diff options
author | Blue <bluesansdouze@gmail.com> | 2009-04-26 19:38:59 +0200 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-04-26 11:51:26 -0600 |
commit | c85b7fd4bf6480495c6f28d10031d3b53988e1d6 (patch) | |
tree | 21fd54c5f752426ce61c1da022afa2d0f8d44d04 /src/engine.cpp | |
parent | 1b114e761b528fdcf132db294dbe83d8aafe3621 (diff) | |
download | mana-client-c85b7fd4bf6480495c6f28d10031d3b53988e1d6.tar.gz mana-client-c85b7fd4bf6480495c6f28d10031d3b53988e1d6.tar.bz2 mana-client-c85b7fd4bf6480495c6f28d10031d3b53988e1d6.tar.xz mana-client-c85b7fd4bf6480495c6f28d10031d3b53988e1d6.zip |
Minimap ratio adapt
Now the minimap can adapt every image ratio, not only 0.5 (even images
with differents width and height)
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index a0e475f6..5cceb4cc 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -84,11 +84,8 @@ bool Engine::changeMap(const std::string &mapPath) logger->error("Could not find map file"); // Notify the minimap and beingManager about the map change - Image *mapImage = NULL; if (newMap->hasProperty("minimap")) { - mapImage = resman->getImage(newMap->getProperty("minimap")); - // Set the title for the Minimap if (newMap->hasProperty("mapname")) minimap->setCaption(newMap->getProperty("mapname")); @@ -100,15 +97,7 @@ bool Engine::changeMap(const std::string &mapPath) logger->log("WARNING: Map file '%s' defines a minimap image but " "does not define a 'mapname' property", map_path.c_str()); - } - - // How many pixels equal one tile. .5 (which is the TMW default) is - // 2 tiles to a pixel, while 1 is 1 tile to 1 pixel - if (newMap->hasProperty("minimapproportion")) - minimap->setProportion(atof( - newMap->getProperty("minimapproportion").c_str())); - else - minimap->setProportion(0.5); + } } if (newMap->hasProperty("name")) { @@ -116,7 +105,7 @@ bool Engine::changeMap(const std::string &mapPath) } else { minimap->setCaption("Map"); } - minimap->setMapImage(mapImage); + minimap->setMap(newMap); beingManager->setMap(newMap); particleEngine->setMap(newMap); viewport->setMap(newMap); |