summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-27 21:37:15 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-08-27 21:37:15 +0000
commit1cfedcb3046f4169698256c65b09307d79f363d8 (patch)
treee7baa03ef62ac19329873f32edb944eadeafa1d2 /src/engine.cpp
parent11a539a2945f2eabb8e9c179829e0b0dd3c966ff (diff)
downloadmana-1cfedcb3046f4169698256c65b09307d79f363d8.tar.gz
mana-1cfedcb3046f4169698256c65b09307d79f363d8.tar.bz2
mana-1cfedcb3046f4169698256c65b09307d79f363d8.tar.xz
mana-1cfedcb3046f4169698256c65b09307d79f363d8.zip
Ported patch from 0.0, in order to support missing extensions and uncompressed maps.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 3b5fb403..6db89089 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -67,7 +67,12 @@ void Engine::changeMap(const std::string &mapPath)
particleEngine->clear();
// Store full map path in global var
- map_path = "maps/" + mapPath;
+ map_path = "maps/" + mapPath + ".tmx";
+ ResourceManager *resman = ResourceManager::getInstance();
+ if (!resman->exists(map_path))
+ {
+ map_path += ".gz";
+ }
// Attempt to load the new map
Map *newMap = MapReader::readMap(map_path);
@@ -80,7 +85,6 @@ void Engine::changeMap(const std::string &mapPath)
Image *mapImage = NULL;
if (newMap->hasProperty("minimap"))
{
- ResourceManager *resman = ResourceManager::getInstance();
mapImage = resman->getImage(newMap->getProperty("minimap"));
}
minimap->setMapImage(mapImage);