aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Kasak2009-07-20 17:34:19 +0000
committerDenis Kasak2009-07-20 17:34:19 +0000
commit6097828f546fd6f135bc907d6cd0586bb473d9b5 (patch)
tree612287aa0f9b8c730891951df64fa2280deb7e8c
parenta2a71cb8fbdbf1426d73c6f09f315abf04cfcbb9 (diff)
downloadscummvm-rg350-6097828f546fd6f135bc907d6cd0586bb473d9b5.tar.gz
scummvm-rg350-6097828f546fd6f135bc907d6cd0586bb473d9b5.tar.bz2
scummvm-rg350-6097828f546fd6f135bc907d6cd0586bb473d9b5.zip
Made 'show walking map overlay' setting persist when changing rooms.
svn-id: r42628
-rw-r--r--engines/draci/animation.h2
-rw-r--r--engines/draci/draci.cpp20
-rw-r--r--engines/draci/game.cpp2
3 files changed, 14 insertions, 10 deletions
diff --git a/engines/draci/animation.h b/engines/draci/animation.h
index 0aab82f5e7..b54b72947d 100644
--- a/engines/draci/animation.h
+++ b/engines/draci/animation.h
@@ -30,7 +30,7 @@
namespace Draci {
-enum { kOverlayImage = -1, kUnused = -2 };
+enum { kOverlayImage = -1, kWalkingMapOverlay = -2, kUnused = -3 };
enum { kCurrentFrame = -1 };
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index 1e7b292229..7e892a7e1e 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -181,23 +181,27 @@ int DraciEngine::go() {
case Common::EVENT_KEYDOWN:
if (event.kbd.keycode == Common::KEYCODE_RIGHT)
_game->changeRoom(_game->nextRoomNum());
+
else if (event.kbd.keycode == Common::KEYCODE_LEFT)
_game->changeRoom(_game->prevRoomNum());
- else if (event.kbd.keycode == Common::KEYCODE_w) { // Show walking map toggle
- // Toggle
- showWalkingMap = !showWalkingMap;
- if (showWalkingMap) {
- _anims->play(-2);
- } else {
- _anims->stop(-2);
- }
+ // Show walking map toggle
+ else if (event.kbd.keycode == Common::KEYCODE_w) {
+ showWalkingMap = !showWalkingMap;
}
break;
default:
_mouse->handleEvent(event);
}
}
+
+ // Show walking map overlay
+ if (showWalkingMap) {
+ _anims->play(kWalkingMapOverlay);
+ } else {
+ _anims->stop(kWalkingMapOverlay);
+ }
+
_game->loop();
_anims->drawScene(_screen->getSurface());
_screen->copyToScreen();
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 46de4825fc..318246cc16 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -345,7 +345,7 @@ void Game::loadRoom(int roomNum) {
Sprite *ov = new Sprite(wlk, kScreenWidth, kScreenHeight, 0, 0, false);
- Animation *map = _vm->_anims->addAnimation(-2, 255, false);
+ Animation *map = _vm->_anims->addAnimation(kWalkingMapOverlay, 255, false);
map->addFrame(ov);
}