X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flevel.cpp;h=33c7c2523a5584084c3e15de0f9a74159af6a114;hb=13c84268f16872f9b442251c4175a3a1a7a7899a;hp=b5ef146f506462a98bcf0500404ecf9ff79b0752;hpb=0d4be1a5fadf30244c41188f114f83c818ece9bc;p=supertux.git diff --git a/src/level.cpp b/src/level.cpp index b5ef146f5..33c7c2523 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -19,6 +19,8 @@ // 02111-1307, USA. #include +#include "level.hpp" + #include #include #include @@ -34,19 +36,12 @@ #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 "tile_set.hpp" #include "tile_manager.hpp" -#include "resources.hpp" -#include "file_system.hpp" -#include "object/gameobjs.hpp" -#include "object/camera.hpp" -#include "object/tilemap.hpp" #include "object/coin.hpp" #include "object/block.hpp" +#include "trigger/secretarea_trigger.hpp" using namespace std; @@ -67,6 +62,7 @@ void Level::load(const std::string& filepath) { try { + filename = filepath; lisp::Parser parser; const lisp::Lisp* root = parser.parse(filepath); @@ -77,6 +73,8 @@ Level::load(const std::string& filepath) int version = 1; level->get("version", version); if(version == 1) { + log_info << "level uses old format: version 1" << std::endl; + tileset = tile_manager->get_tileset("images/tiles.strf"); load_old_format(*level); return; } @@ -263,3 +261,12 @@ Level::get_total_badguys() total_badguys += (*i)->get_total_badguys(); return total_badguys; } + +int +Level::get_total_secrets() +{ + int total_secrets = 0; + for(Sectors::iterator i = sectors.begin(); i != sectors.end(); ++i) + total_secrets += (*i)->get_total_count(); + return total_secrets; +}