From 6097828f546fd6f135bc907d6cd0586bb473d9b5 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Mon, 20 Jul 2009 17:34:19 +0000 Subject: Made 'show walking map overlay' setting persist when changing rooms. svn-id: r42628 --- engines/draci/animation.h | 2 +- engines/draci/draci.cpp | 20 ++++++++++++-------- engines/draci/game.cpp | 2 +- 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); } -- cgit v1.2.3