fixed 1.0.0 version for 2015
parent
40a11244dd
commit
e5de3ba244
|
@ -168,7 +168,7 @@ unsigned int Model::InitLevelList () {
|
||||||
|
|
||||||
boost::filesystem::path level_dir(level_dir_name);
|
boost::filesystem::path level_dir(level_dir_name);
|
||||||
|
|
||||||
if (!boost::filesystem::exists(level_dir.file_string())) {
|
if (!boost::filesystem::exists(level_dir.string())) {
|
||||||
Engine::LogError ("Could not init level list: %s does not exist!", level_dir.filename().c_str());
|
Engine::LogError ("Could not init level list: %s does not exist!", level_dir.filename().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,10 +182,10 @@ unsigned int Model::InitLevelList () {
|
||||||
++dir_iter) {
|
++dir_iter) {
|
||||||
if (boost::filesystem::is_regular_file (dir_iter->status())) {
|
if (boost::filesystem::is_regular_file (dir_iter->status())) {
|
||||||
std::string level_relative_path (level_dir_name);
|
std::string level_relative_path (level_dir_name);
|
||||||
level_relative_path += dir_iter->path().filename();
|
level_relative_path += dir_iter->path().filename().string();
|
||||||
|
|
||||||
// check whether we found an official level
|
// check whether we found an official level
|
||||||
std::string map_name (dir_iter->filename());
|
std::string map_name (dir_iter->path().filename().string());
|
||||||
|
|
||||||
if (mLevelHashes.find(map_name) == mLevelHashes.end()) {
|
if (mLevelHashes.find(map_name) == mLevelHashes.end()) {
|
||||||
Engine::LogDebug ("Skipping unofficial level %s", std::string(level_relative_path).c_str());
|
Engine::LogDebug ("Skipping unofficial level %s", std::string(level_relative_path).c_str());
|
||||||
|
@ -560,7 +560,7 @@ void Model::SubmitHighscoreEntry (const std::string &name, const unsigned int po
|
||||||
int Model::DoLoadLevel (const char* filename) {
|
int Model::DoLoadLevel (const char* filename) {
|
||||||
// verify the hash of the map
|
// verify the hash of the map
|
||||||
std::string map_name (filename);
|
std::string map_name (filename);
|
||||||
map_name = boost::filesystem::path(map_name).filename();
|
map_name = boost::filesystem::path(map_name).filename().string();
|
||||||
std::string map_hash = sha256_hash_file (filename);
|
std::string map_hash = sha256_hash_file (filename);
|
||||||
if (map_hash != mLevelHashes[map_name]) {
|
if (map_hash != mLevelHashes[map_name]) {
|
||||||
Engine::LogMessage ("Map verification for file %s failed!", map_name.c_str());
|
Engine::LogMessage ("Map verification for file %s failed!", map_name.c_str());
|
||||||
|
|
|
@ -122,8 +122,8 @@ int main (int argc, char* argv[]) {
|
||||||
|
|
||||||
// use the current path as default
|
// use the current path as default
|
||||||
boost::filesystem::path cpath = boost::filesystem::initial_path<boost::filesystem::path>();
|
boost::filesystem::path cpath = boost::filesystem::initial_path<boost::filesystem::path>();
|
||||||
user_path = boost::filesystem::path(cpath.string() + user_path).file_string();
|
user_path = boost::filesystem::path(cpath.string() + user_path).string();
|
||||||
game_data_path = boost::filesystem::path(cpath.string() + game_data_path).file_string();
|
game_data_path = boost::filesystem::path(cpath.string() + game_data_path).string();
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
// on linux et al we check more thoroughly at the possible directories
|
// on linux et al we check more thoroughly at the possible directories
|
||||||
|
@ -135,7 +135,7 @@ int main (int argc, char* argv[]) {
|
||||||
std::string log_file_path = user_path;
|
std::string log_file_path = user_path;
|
||||||
log_file_path += "/game.log";
|
log_file_path += "/game.log";
|
||||||
|
|
||||||
log_file_path = boost::filesystem::path (log_file_path).file_string();
|
log_file_path = boost::filesystem::path (log_file_path).string();
|
||||||
|
|
||||||
cout << "User Data Dir = " << user_path << endl;
|
cout << "User Data Dir = " << user_path << endl;
|
||||||
engine.SetUserDataPath (user_path);
|
engine.SetUserDataPath (user_path);
|
||||||
|
|
|
@ -8,7 +8,7 @@ FIND_PACKAGE (SDL_net REQUIRED)
|
||||||
FIND_PACKAGE (OpenGL REQUIRED)
|
FIND_PACKAGE (OpenGL REQUIRED)
|
||||||
FIND_PACKAGE (PNG REQUIRED)
|
FIND_PACKAGE (PNG REQUIRED)
|
||||||
FIND_PACKAGE (FreeType2 REQUIRED)
|
FIND_PACKAGE (FreeType2 REQUIRED)
|
||||||
FIND_PACKAGE (Boost COMPONENTS filesystem REQUIRED)
|
FIND_PACKAGE (Boost COMPONENTS filesystem system REQUIRED)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY ( libraries )
|
ADD_SUBDIRECTORY ( libraries )
|
||||||
|
|
||||||
|
|
|
@ -117,13 +117,13 @@ class Engine : public Module {
|
||||||
* \brief it
|
* \brief it
|
||||||
*/
|
*/
|
||||||
std::string GetResourceFullPath (const std::string &resource) {
|
std::string GetResourceFullPath (const std::string &resource) {
|
||||||
return boost::filesystem::path(mGameDataPath + resource).file_string();
|
return boost::filesystem::path(mGameDataPath + resource).string();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** \brief Returns the path to a file by prepending the user data path to it
|
/** \brief Returns the path to a file by prepending the user data path to it
|
||||||
*/
|
*/
|
||||||
std::string GetUserDirFullPath (const std::string &path) {
|
std::string GetUserDirFullPath (const std::string &path) {
|
||||||
return boost::filesystem::path(mUserDataPath + path).file_string();
|
return boost::filesystem::path(mUserDataPath + path).string();
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue