From: Matthias Braun Date: Sun, 3 Apr 2005 21:07:14 +0000 (+0000) Subject: make sure all tiles are loaded X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=37e3ad0ee2ec05d6bfebf611d45046b49fa33387;p=supertux.git make sure all tiles are loaded SVN-Revision: 2322 --- diff --git a/src/object/tilemap.cpp b/src/object/tilemap.cpp index 59557d162..578bb51c9 100644 --- a/src/object/tilemap.cpp +++ b/src/object/tilemap.cpp @@ -83,6 +83,10 @@ TileMap::TileMap(const lisp::Lisp& reader) if(int(tiles.size()) != width*height) { throw std::runtime_error("wrong number of tiles in tilemap."); } + + // make sure all tiles are loaded + for(Tiles::iterator i = tiles.begin(); i != tiles.end(); ++i) + tilemanager->get(*i); } TileMap::TileMap(int layer_, bool solid_, size_t width_, size_t height_) @@ -200,6 +204,10 @@ TileMap::set(int newwidth, int newheight, const std::vector&newt, solid = newsolid; if(solid) flags |= FLAG_SOLID; + + // make sure all tiles are loaded + for(Tiles::iterator i = tiles.begin(); i != tiles.end(); ++i) + tilemanager->get(*i); } void