diff --git a/asteroids/Model.cc b/asteroids/Model.cc index 152475e..87bd59a 100644 --- a/asteroids/Model.cc +++ b/asteroids/Model.cc @@ -168,7 +168,7 @@ unsigned int Model::InitLevelList () { 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()); } @@ -182,10 +182,10 @@ unsigned int Model::InitLevelList () { ++dir_iter) { if (boost::filesystem::is_regular_file (dir_iter->status())) { 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 - std::string map_name (dir_iter->filename()); + std::string map_name (dir_iter->path().filename().string()); if (mLevelHashes.find(map_name) == mLevelHashes.end()) { 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) { // verify the hash of the map 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); if (map_hash != mLevelHashes[map_name]) { Engine::LogMessage ("Map verification for file %s failed!", map_name.c_str()); diff --git a/asteroids/main.cc b/asteroids/main.cc index e29ca4e..66ff561 100644 --- a/asteroids/main.cc +++ b/asteroids/main.cc @@ -122,8 +122,8 @@ int main (int argc, char* argv[]) { // use the current path as default boost::filesystem::path cpath = boost::filesystem::initial_path(); - user_path = boost::filesystem::path(cpath.string() + user_path).file_string(); - game_data_path = boost::filesystem::path(cpath.string() + game_data_path).file_string(); + user_path = boost::filesystem::path(cpath.string() + user_path).string(); + game_data_path = boost::filesystem::path(cpath.string() + game_data_path).string(); #ifndef WIN32 // 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; 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; engine.SetUserDataPath (user_path); diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index 6b8e242..a952fd9 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -9,7 +9,7 @@ FIND_PACKAGE (OpenGL REQUIRED) FIND_PACKAGE (GLEW REQUIRED) FIND_PACKAGE (PNG REQUIRED) FIND_PACKAGE (FreeType2 REQUIRED) -FIND_PACKAGE (Boost COMPONENTS filesystem REQUIRED) +FIND_PACKAGE (Boost COMPONENTS filesystem system REQUIRED) ADD_SUBDIRECTORY ( libraries ) diff --git a/engine/Engine.h b/engine/Engine.h index 97eb656..3d3631c 100644 --- a/engine/Engine.h +++ b/engine/Engine.h @@ -121,13 +121,13 @@ class Engine : public Module { * \brief it */ 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 */ std::string GetUserDirFullPath (const std::string &path) { - return boost::filesystem::path(mUserDataPath + path).file_string(); + return boost::filesystem::path(mUserDataPath + path).string(); }; private: