X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftile_manager.cpp;h=df1f90d7aadfb337847d296c75d937ae6c48757f;hb=5bd825749c3dc21471f35abc23e7a12bc4348b67;hp=cbdb6b541169a497f7dbcb09441aa587d2bd891b;hpb=0dc0172a1e92bac0d08baac2308d2fb68253e2e6;p=supertux.git diff --git a/src/tile_manager.cpp b/src/tile_manager.cpp index cbdb6b541..df1f90d7a 100644 --- a/src/tile_manager.cpp +++ b/src/tile_manager.cpp @@ -69,7 +69,7 @@ void TileManager::load_tileset(std::string filename) } lisp::Parser parser; - std::auto_ptr root (parser.parse(filename)); + const lisp::Lisp* root = parser.parse(filename); const lisp::Lisp* tiles_lisp = root->get_lisp("supertux-tiles"); if(!tiles_lisp) @@ -152,4 +152,22 @@ void TileManager::load_tileset(std::string filename) log_warning << "Unknown symbol '" << iter.item() << "' tile defintion file" << std::endl; } } + + if (0) + { // enable this if you want to see a list of free tiles + log_info << "Last Tile ID is " << tiles.size()-1 << std::endl; + int last = -1; + for(int i = 0; i < int(tiles.size()); ++i) + { + if (tiles[i] == 0 && last == -1) + { + last = i; + } + else if (tiles[i] && last != -1) + { + log_info << "Free Tile IDs (" << i - last << "): " << last << " - " << i-1 << std::endl; + last = -1; + } + } + } }