fixed 1.0.0 version for 2015

main
Martin Felis 2015-06-11 14:01:41 +02:00
parent 40a11244dd
commit e5de3ba244
4 changed files with 10 additions and 10 deletions

View File

@ -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());

View File

@ -122,8 +122,8 @@ int main (int argc, char* argv[]) {
// use the current path as default
boost::filesystem::path cpath = boost::filesystem::initial_path<boost::filesystem::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);

View File

@ -8,7 +8,7 @@ FIND_PACKAGE (SDL_net REQUIRED)
FIND_PACKAGE (OpenGL 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 )

View File

@ -117,13 +117,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: