a few fixes that I had lying around here, select walk animation in worldmap when...
[supertux.git] / src / tile_manager.cpp
index e6a3a15..c9db17f 100644 (file)
@@ -24,6 +24,7 @@
 #include <sstream>
 #include <iostream>
 #include <assert.h>
+#include <SDL.h>
 #include "video/drawing_context.hpp"
 #include "lisp/lisp.hpp"
 #include "lisp/parser.hpp"
 
 TileManager::TileManager(const std::string& filename)
 {
+#ifdef DEBUG
+  Uint32 ticks = SDL_GetTicks();
+#endif
   load_tileset(filename);
+#ifdef DEBUG
+  printf("Tiles loaded in %f seconds\n", (SDL_GetTicks() - ticks) / 1000.0);
+#endif
 }
 
 TileManager::~TileManager()
@@ -72,6 +79,9 @@ void TileManager::load_tileset(std::string filename)
       while(tile->id >= tiles.size()) {
         tiles.push_back(0);
       }
+      if(tiles[tile->id] != 0) {
+        std::cout << "Warning: Tile with ID " << tile->id << " redefined\n";
+      }
       tiles[tile->id] = tile;
     } else if(iter.item() == "tilegroup") {
       TileGroup tilegroup;