diff options
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 2edc6550..74e11336 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -19,13 +19,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "engine.h" - #include <list> #include "being.h" #include "beingmanager.h" #include "configuration.h" +#include "engine.h" #include "flooritemmanager.h" #include "game.h" #include "graphics.h" @@ -93,6 +92,27 @@ void Engine::changeMap(const std::string &mapPath) 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")); + } + else + { + minimap->setCaption("Unknown"); + 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")) { |