From fc3c62f2d68851b89b345a7aa7852d4a22f848dc Mon Sep 17 00:00:00 2001 From: Blue Sans Douze Date: Sat, 23 Jan 2010 18:56:21 +0100 Subject: Chaning the method name Map::getMapId() to map::getFilename() --- src/gui/minimap.cpp | 8 +++++--- src/map.cpp | 2 +- src/map.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index 539bfbaa..ef86dfd4 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -97,15 +97,17 @@ void Minimap::setMap(Map *map) if (map) { - std::string tempname = "graphics/minimaps/"+(*map->getMapId())+".png"; - + std::string tempname = + "graphics/minimaps/"+(*map->getFilename())+".png"; ResourceManager *resman = ResourceManager::getInstance(); + minimapName = map->getProperty("minimap"); + if (minimapName.empty() && resman->exists(tempname)) { minimapName = tempname; } - std::cout << "Minimap name : " << minimapName << std::endl; + mMapImage = resman->getImage(minimapName); } diff --git a/src/map.cpp b/src/map.cpp index 5f411c47..0c6aee8f 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -583,7 +583,7 @@ const std::string &Map::getName() const return getProperty("mapname"); } -const std::string *Map::getMapId() const +const std::string *Map::getFilename() const { std::string fileName = getProperty("_filename"); int lastSlash = fileName.rfind("/") + 1; diff --git a/src/map.h b/src/map.h index 82b9e842..b7349400 100644 --- a/src/map.h +++ b/src/map.h @@ -269,7 +269,7 @@ class Map : public Properties /** * Gives the map id based on filepath (ex: 009-1) */ - const std::string *getMapId() const; + const std::string *getFilename() const; /** * Find a path from one location to the next. -- cgit v1.2.3-60-g2f50