summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-14 15:46:52 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-14 15:46:52 +0000
commitebdd5b00db488c878fa4d57069e94eb19d3326db (patch)
tree9f8866df8edeedc25baee561d883d90ea46c4b87 /src/engine.cpp
parenteb753d99914a0941ad7e2cfa4c8a364723340fc9 (diff)
downloadmana-ebdd5b00db488c878fa4d57069e94eb19d3326db.tar.gz
mana-ebdd5b00db488c878fa4d57069e94eb19d3326db.tar.bz2
mana-ebdd5b00db488c878fa4d57069e94eb19d3326db.tar.xz
mana-ebdd5b00db488c878fa4d57069e94eb19d3326db.zip
Moved Map manangement code into engine.cpp.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 956fbfa6..6c28d1c2 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -48,6 +48,7 @@
#include "resources/image.h"
#include "resources/iteminfo.h"
#include "resources/itemmanager.h"
+#include "resources/mapreader.h"
#include "resources/resourcemanager.h"
extern Being *autoTarget;
@@ -191,12 +192,19 @@ Map *Engine::getCurrentMap()
return mCurrentMap;
}
-void Engine::setCurrentMap(Map *newMap)
+void Engine::changeMap(const std::string &mapPath)
{
+ Map *newMap = MapReader::readMap(mapPath);
+
+ if (!newMap) {
+ logger->error("Could not find map file");
+ }
+
std::string oldMusic = "";
if (mCurrentMap) {
oldMusic = mCurrentMap->getProperty("music");
+ delete mCurrentMap;
}
std::string newMusic = newMap->getProperty("music");