aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/draci.cpp
diff options
context:
space:
mode:
authorRobert Špalek2009-11-10 05:16:34 +0000
committerRobert Špalek2009-11-10 05:16:34 +0000
commite2ca397e63861b256d50ba5ea9550db3ac4421e5 (patch)
tree59886600416d6f6f680ccf4c6e4f65b4259c556d /engines/draci/draci.cpp
parent501dfa24895b15f3be8b50406e62fe557f3d0fb1 (diff)
downloadscummvm-rg350-e2ca397e63861b256d50ba5ea9550db3ac4421e5.tar.gz
scummvm-rg350-e2ca397e63861b256d50ba5ea9550db3ac4421e5.tar.bz2
scummvm-rg350-e2ca397e63861b256d50ba5ea9550db3ac4421e5.zip
Huge refactoring of data structures.
Replaced IDs of objects by pointers, which saves many lookups, each of which is horribly ineffective. Moved a lot of code into methods of structs now turned into objects. Tested the new code a lot and seems to work as well as the old code. svn-id: r45799
Diffstat (limited to 'engines/draci/draci.cpp')
-rw-r--r--engines/draci/draci.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index d9720b77fd..f759cad4a3 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -242,7 +242,7 @@ void DraciEngine::handleEvents() {
? _game->getEscRoom() : _game->getPreviousRoomNum();
// Check if there is an escape room defined for the current room
- if (escRoom != kNoEscRoom) {
+ if (escRoom >= 0) {
// Schedule room change
// TODO: gate 0 is not always the best one for returning from the map
@@ -266,15 +266,7 @@ void DraciEngine::handleEvents() {
case Common::KEYCODE_w:
// Show walking map toggle
_showWalkingMap = !_showWalkingMap;
- if (_showWalkingMap) {
- _anims->play(kWalkingMapOverlay);
- _anims->play(kWalkingShortestPathOverlay);
- _anims->play(kWalkingObliquePathOverlay);
- } else {
- _anims->stop(kWalkingMapOverlay);
- _anims->stop(kWalkingShortestPathOverlay);
- _anims->stop(kWalkingObliquePathOverlay);
- }
+ _game->switchWalkingAnimations(_showWalkingMap);
break;
case Common::KEYCODE_q:
_game->setWantQuickHero(!_game->getWantQuickHero());