Made 'show walking map overlay' setting persist when changing rooms.

svn-id: r42628
This commit is contained in:
Denis Kasak 2009-07-20 17:34:19 +00:00
parent a2a71cb8fb
commit 6097828f54
3 changed files with 14 additions and 10 deletions

View File

@ -30,7 +30,7 @@
namespace Draci {
enum { kOverlayImage = -1, kUnused = -2 };
enum { kOverlayImage = -1, kWalkingMapOverlay = -2, kUnused = -3 };
enum { kCurrentFrame = -1 };

View File

@ -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();

View File

@ -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);
}