projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Russian translation update from Constantin Baranov... from December.
[supertux.git]
/
src
/
level.cpp
diff --git
a/src/level.cpp
b/src/level.cpp
index
b5ef146
..
33c7c25
100644
(file)
--- a/
src/level.cpp
+++ b/
src/level.cpp
@@
-19,6
+19,8
@@
// 02111-1307, USA.
#include <config.h>
// 02111-1307, USA.
#include <config.h>
+#include "level.hpp"
+
#include <map>
#include <stdlib.h>
#include <stdio.h>
#include <map>
#include <stdlib.h>
#include <stdio.h>
@@
-34,19
+36,12
@@
#include "lisp/lisp.hpp"
#include "lisp/list_iterator.hpp"
#include "lisp/writer.hpp"
#include "lisp/lisp.hpp"
#include "lisp/list_iterator.hpp"
#include "lisp/writer.hpp"
-#include "level.hpp"
-#include "physic.hpp"
#include "sector.hpp"
#include "sector.hpp"
-#include "tile.hpp"
#include "tile_set.hpp"
#include "tile_manager.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 "object/coin.hpp"
#include "object/block.hpp"
+#include "trigger/secretarea_trigger.hpp"
using namespace std;
using namespace std;
@@
-67,6
+62,7
@@
void
Level::load(const std::string& filepath)
{
try {
Level::load(const std::string& filepath)
{
try {
+ filename = filepath;
lisp::Parser parser;
const lisp::Lisp* root = parser.parse(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) {
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;
}
load_old_format(*level);
return;
}
@@
-263,3
+261,12
@@
Level::get_total_badguys()
total_badguys += (*i)->get_total_badguys();
return 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<SecretAreaTrigger>();
+ return total_secrets;
+}