X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fworld.cpp;h=df762ad3e8cec2de2668583c841268ee24bf1515;hb=c75799590ba936c673bea467b65518c3c2c2e284;hp=d8beb4a5c13e1bad01a797ddbd267686d03a2de0;hpb=99cf62c2d44b4555e9761f1c8f1b10cf880c33fb;p=supertux.git diff --git a/src/world.cpp b/src/world.cpp index d8beb4a5c..df762ad3e 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -20,8 +20,7 @@ #include #include -//#include -#include +#include #include #include "world.hpp" @@ -62,21 +61,19 @@ World::~World() void World::set_savegame_filename(const std::string& filename) { - Unison::VFS::FileSystem &fs = Unison::VFS::FileSystem::get(); this->savegame_filename = filename; // make sure the savegame directory exists std::string dirname = FileSystem::dirname(filename); - if(!fs.exists(dirname)) { - fs.mkdir(dirname); - /*if(PHYSFS_mkdir(dirname.c_str())) { + if(!PHYSFS_exists(dirname.c_str())) { + if(PHYSFS_mkdir(dirname.c_str())) { std::ostringstream msg; msg << "Couldn't create directory for savegames '" << dirname << "': " < files = Unison::VFS::FileSystem::get().ls(path); - for(std::vector::iterator iter = files.begin();iter != files.end();++iter) - { - if(has_suffix(iter->c_str(), ".stl")) { - levels.push_back(path + *iter); - } - } - /*char** files = PHYSFS_enumerateFiles(path.c_str()); + char** files = PHYSFS_enumerateFiles(path.c_str()); if(!files) { log_warning << "Couldn't read subset dir '" << path << "'" << std::endl; return; @@ -128,7 +118,7 @@ World::load(const std::string& filename) levels.push_back(path + *filename); } } - PHYSFS_freeList(files);*/ + PHYSFS_freeList(files); } void @@ -138,7 +128,7 @@ World::run() current_ = this; - // create new squirrel table for persisten game state + // create new squirrel table for persistent game state HSQUIRRELVM vm = Scripting::global_vm; sq_pushroottable(vm);