X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftile_manager.cpp;h=0c87f4e3fb02054fba26e486ab6281bd5b1076e4;hb=546364c9567ef212ea9276201facf73f5ada696a;hp=fe28d495eb0e51d8ac0815b06f13cf728ea55d74;hpb=9f43687076203b3769cd2b9a499d1fb57cd8c40f;p=supertux.git diff --git a/src/tile_manager.cpp b/src/tile_manager.cpp index fe28d495e..0c87f4e3f 100644 --- a/src/tile_manager.cpp +++ b/src/tile_manager.cpp @@ -74,19 +74,13 @@ void TileManager::load_tileset(std::string filename) Tile* tile = new Tile; int tile_id = tile->read(reader); - if(tile_id < 0) { +/* if(tile_id < 0) { std::cerr << "Warning: parse error when reading a tile (id < 0), skipping.\n"; continue; - } + }*/ - tiles.insert(std::make_pair(tile_id, tile)); - -/* tile_id += tileset_id; - - if(tile_id >= int(tiles.size())) - tiles.resize(tile_id+1); - tiles[tile_id] = tile;*/ + tiles[tile_id] = tile; } else if (strcmp(lisp_symbol(lisp_car(element)), "tileset") == 0) { @@ -158,30 +152,9 @@ Tile* TileManager::get(unsigned int id) { Tiles::iterator i = tiles.find(id); - if(i == tiles.end()) - { - std::cerr << "Warning: Asked for a non-existing tile id. Ignoring.\n"; - // Never return 0, but return the first tile instead so that - // user code doesn't have to check for NULL pointers all over - // the place - i = tiles.begin(); - return i->second; - } + return 0; return i->second; - -/* - if(id < tiles.size()) - { - return *tiles[id]; - } - else - { - // Never return 0, but return the 0th tile instead so that - // user code doesn't have to check for NULL pointers all over - // the place - return *tiles[0]; - }*/ } /* EOF */