summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-10 00:33:27 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-10 00:33:27 +0300
commita0c7a0e2d34a13f2c3e86f662e352977ebe2ae73 (patch)
tree15996308da765b18751048c6bdaeb81926959328 /src/game.cpp
parentc5ff42706d5ff540b5f557fa1a2b1924a6cdf07b (diff)
downloadmv-a0c7a0e2d34a13f2c3e86f662e352977ebe2ae73.tar.gz
mv-a0c7a0e2d34a13f2c3e86f662e352977ebe2ae73.tar.bz2
mv-a0c7a0e2d34a13f2c3e86f662e352977ebe2ae73.tar.xz
mv-a0c7a0e2d34a13f2c3e86f662e352977ebe2ae73.zip
Add option to left all per map sprites in memory if once was loaded.
This can prevent random lags and also can use more memory.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 465911767..105be45cf 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1008,6 +1008,9 @@ void Game::changeMap(const std::string &mapPath)
{
resetAdjustLevel();
+ ResourceManager *const resman = ResourceManager::getInstance();
+ resman->cleanProtected();
+
if (viewport)
viewport->clearPopup();
@@ -1038,7 +1041,6 @@ void Game::changeMap(const std::string &mapPath)
std::string realFullMap = paths.getValue("maps", "maps/").append(
MapDB::getMapName(mMapName)).append(".tmx");
- const ResourceManager *const resman = ResourceManager::getInstance();
if (!resman->exists(realFullMap))
realFullMap.append(".gz");