X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flevel.cpp;h=8f1885bfb0da9f7ebcf86da0317a41bbd3b2ea46;hb=d3e1e0c7e35a4f9bc662312f3b3f2a515d418239;hp=e9f8ccd537f3669a31c4c05fdc1e9038e5c98312;hpb=aeec9baba33ec63d2d0fdd97d961a53ec5c1541d;p=supertux.git diff --git a/src/level.cpp b/src/level.cpp index e9f8ccd53..8f1885bfb 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -29,24 +29,24 @@ #include #include -#include "video/screen.h" -#include "lisp/parser.h" -#include "lisp/lisp.h" -#include "lisp/list_iterator.h" -#include "lisp/writer.h" -#include "level.h" -#include "physic.h" -#include "sector.h" -#include "tile.h" -#include "resources.h" -#include "file_system.h" -#include "object/gameobjs.h" -#include "object/camera.h" -#include "object/tilemap.h" -#include "object/coin.h" +#include "video/screen.hpp" +#include "lisp/parser.hpp" +#include "lisp/lisp.hpp" +#include "lisp/list_iterator.hpp" +#include "lisp/writer.hpp" +#include "level.hpp" +#include "physic.hpp" +#include "sector.hpp" +#include "tile.hpp" +#include "resources.hpp" +#include "file_system.hpp" +#include "object/gameobjs.hpp" +#include "object/camera.hpp" +#include "object/tilemap.hpp" +#include "object/coin.hpp" // test -#include "flip_level_transformer.h" +#include "flip_level_transformer.hpp" using namespace std; @@ -70,13 +70,6 @@ Level::load(const std::string& filepath) level->get("version", version); if(version == 1) { load_old_format(*level); - -#if 0 - // test for now - FlipLevelTransformer* transformer = new FlipLevelTransformer(); - transformer->transform(this); -#endif - return; } @@ -123,12 +116,7 @@ Level::load_old_format(const lisp::Lisp& reader) void Level::save(const std::string& filename) { - std::string filepath = "levels/" + filename; - int last_slash = filepath.find_last_of('/'); - FileSystem::fcreatedir(filepath.substr(0,last_slash).c_str()); - filepath = user_dir + "/" + filepath; - ofstream file(filepath.c_str(), ios::out); - lisp::Writer* writer = new lisp::Writer(file); + lisp::Writer* writer = new lisp::Writer(filename); writer->write_comment("Level made using SuperTux's built-in Level Editor"); @@ -150,7 +138,6 @@ Level::save(const std::string& filename) writer->end_list("supertux-level"); delete writer; - file.close(); } Level::~Level()