X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Flevel.cpp;h=6c87b816e32e4c5e96a0103e96aa6be824fe346b;hb=c3f9468882de1fd44f41ccfa7dae6d776bf306a7;hp=d6cd3c75331220ebf4d5c50ab468ce78e8279423;hpb=7ae3aef67ad305cb9c6ed584cdac6117da9eba88;p=supertux.git diff --git a/src/level.cpp b/src/level.cpp index d6cd3c753..6c87b816e 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -29,29 +29,29 @@ #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; Level::Level() - : name("noname"), author("Mr. X") + : name("noname"), author("Mr. X"), extro_music("leveldone.ogg"), extro_length(7.0) { } @@ -85,6 +85,17 @@ Level::load(const std::string& filepath) iter.value()->get(name); } else if(token == "author") { iter.value()->get(author); + } else if(token == "extro") { + const lisp::Lisp* ext = iter.lisp(); + lisp::ListIterator ext_iter(ext); + while(ext_iter.next()) { + const std::string& ext_token = ext_iter.item(); + if(ext_token == "music") { + ext_iter.value()->get(extro_music); + } else if(ext_token == "length") { + ext_iter.value()->get(extro_length); + } + } } else if(token == "sector") { Sector* sector = new Sector; sector->parse(*(iter.lisp()));