From b9d66c41246fef56e41f600b5523a5ff1a29a1c8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 9 Apr 2011 18:49:05 +0300 Subject: Improve map loading speed. --- src/resources/image.h | 3 ++- src/resources/mapreader.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/resources') diff --git a/src/resources/image.h b/src/resources/image.h index 585b3d62b..beaba7b0e 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -209,6 +209,8 @@ class Image : public Resource static int getTextureType() { return mTextureType; } + + static int mTextureType; #endif protected: @@ -268,7 +270,6 @@ class Image : public Resource int mTexWidth, mTexHeight; static int mUseOpenGL; - static int mTextureType; static int mTextureSize; #endif }; diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 25e9750de..d2bcde06d 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -370,7 +370,7 @@ Map *MapReader::readMap(xmlNodePtr node, const std::string &path) } map->initializeAmbientLayers(); - + map->clearIndexedTilesets(); return map; } @@ -424,6 +424,8 @@ void MapReader::readLayer(xmlNodePtr node, Map *map) const bool isFringeLayer = (name.substr(0, 6) == "fringe"); const bool isCollisionLayer = (name.substr(0, 9) == "collision"); + map->indexTilesets(); + MapLayer *layer = 0; if (!isCollisionLayer) -- cgit v1.2.3-70-g09d2