X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftile_manager.cpp;h=bbc3cffe73d1fd28c20835192a57f531e6f5eedc;hb=24f60c653f1fe1eb87c1d13968a0d51cee8d0879;hp=474b8f271799073c8e1192333c23368c1e427f4d;hpb=0f0e6a3689e5d810ec55b68ff455210b1081a021;p=supertux.git diff --git a/src/tile_manager.cpp b/src/tile_manager.cpp index 474b8f271..bbc3cffe7 100644 --- a/src/tile_manager.cpp +++ b/src/tile_manager.cpp @@ -1,7 +1,8 @@ // $Id$ -// +// // SuperTux // Copyright (C) 2004 Tobias Glaesser +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -12,7 +13,7 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -26,7 +27,7 @@ #include #include #include "video/drawing_context.hpp" -#include "msg.hpp" +#include "log.hpp" #include "lisp/lisp.hpp" #include "lisp/parser.hpp" #include "lisp/list_iterator.hpp" @@ -34,6 +35,8 @@ #include "tile_manager.hpp" #include "resources.hpp" +TileManager* tile_manager = NULL; + TileManager::TileManager(const std::string& filename) { #ifdef DEBUG @@ -41,7 +44,7 @@ TileManager::TileManager(const std::string& filename) #endif load_tileset(filename); #ifdef DEBUG - msg_debug("Tiles loaded in " << (SDL_GetTicks() - ticks) / 1000.0 << "seconds"); + log_debug << "Tiles loaded in " << (SDL_GetTicks() - ticks) / 1000.0 << " seconds" << std::endl; #endif } @@ -64,7 +67,7 @@ void TileManager::load_tileset(std::string filename) } else { tiles_path = filename.substr(0, t+1); } - + lisp::Parser parser; std::auto_ptr root (parser.parse(filename)); @@ -81,7 +84,7 @@ void TileManager::load_tileset(std::string filename) tiles.push_back(0); } if(tiles[tile->id] != 0) { - msg_warning("Tile with ID " << tile->id << " redefined"); + log_warning << "Tile with ID " << tile->id << " redefined" << std::endl; } tiles[tile->id] = tile; } else if(iter.item() == "tilegroup") { @@ -98,7 +101,7 @@ void TileManager::load_tileset(std::string filename) std::string image; // width and height of the image in tile units, this is used for two - // purposes: + // purposes: // a) so we don't have to load the image here to know its dimensions // b) so that the resulting 'tiles' entry is more robust, // ie. enlarging the image won't break the tile id mapping @@ -134,12 +137,11 @@ void TileManager::load_tileset(std::string filename) tiles[ids[i]] = tile; } } - + } else if(iter.item() == "properties") { // deprecated } else { - msg_warning("Unknown symbol '" << iter.item() << "' tile defintion file"); + log_warning << "Unknown symbol '" << iter.item() << "' tile defintion file" << std::endl; } } } -