From 06111415b117fc47b5b8bf6396d855616778f3b0 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 14 Jul 2005 00:41:48 +0000 Subject: Committed resource manager cleanup patch by Doener, and properly implemented the custom mouse cursor option, which is now also dynamically changeable through the setup window. --- src/engine.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/engine.cpp') diff --git a/src/engine.cpp b/src/engine.cpp index 11e653b7..2ee6406f 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -282,11 +282,14 @@ Map *Engine::getCurrentMap() void Engine::setCurrentMap(Map *newMap) { std::string oldMusic = ""; + if (mCurrentMap) { oldMusic = mCurrentMap->getProperty("music"); } + std::string newMusic = newMap->getProperty("music"); - if(newMusic!=oldMusic) { + + if (newMusic != oldMusic) { newMusic = std::string(TMW_DATADIR) + "data/music/" + newMusic; sound.playMusic(newMusic.c_str(), -1); } @@ -542,8 +545,6 @@ void Engine::draw() statusWindow->update(); } - gui->draw(); - std::stringstream debugStream; debugStream << "[" << fps << " fps] " << mouseTileX << ", " << mouseTileY; @@ -556,4 +557,6 @@ void Engine::draw() debugInfo->setCaption(debugStream.str()); debugInfo->adjustSize(); + + gui->draw(); } -- cgit v1.2.3-70-g09d2