diff options
author | Strangerke | 2013-09-15 17:42:32 +0200 |
---|---|---|
committer | Strangerke | 2013-09-15 17:42:32 +0200 |
commit | 34acc80d7329352ecc55c36091877a2c3e8ec307 (patch) | |
tree | ae65fc4ce9d7b374cd27a18381c8debb24020400 | |
parent | ac49e6d09bb6bdc2ecb46178eef74170121d7851 (diff) | |
download | scummvm-rg350-34acc80d7329352ecc55c36091877a2c3e8ec307.tar.gz scummvm-rg350-34acc80d7329352ecc55c36091877a2c3e8ec307.tar.bz2 scummvm-rg350-34acc80d7329352ecc55c36091877a2c3e8ec307.zip |
AVALANCHE: Get rid of several magic values
-rw-r--r-- | engines/avalanche/acci.cpp | 6 | ||||
-rw-r--r-- | engines/avalanche/animation.cpp | 2 | ||||
-rw-r--r-- | engines/avalanche/avalanche.cpp | 2 | ||||
-rw-r--r-- | engines/avalanche/gyro.cpp | 4 | ||||
-rw-r--r-- | engines/avalanche/lucerna.cpp | 4 | ||||
-rw-r--r-- | engines/avalanche/roomnums.h | 3 | ||||
-rw-r--r-- | engines/avalanche/scrolls.cpp | 2 |
7 files changed, 12 insertions, 11 deletions
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp index 3c3357ed13..dc8ebc212f 100644 --- a/engines/avalanche/acci.cpp +++ b/engines/avalanche/acci.cpp @@ -1893,7 +1893,7 @@ void Acci::doThat() { else { if ((_vm->_gyro->_room == 12) & (_vm->_animation->inField(2))) { // Avaricius appears! _vm->_scrolls->displayScrollChain('q', 17); - if (_vm->_gyro->_whereIs[1] == 12) + if (_vm->_gyro->_whereIs[1] == kRoomSpludwicks) _vm->_scrolls->displayScrollChain('q', 18); else { Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1]; @@ -2044,7 +2044,7 @@ void Acci::doThat() { case kVerbCodeAttack: if ((_vm->_gyro->_room == kRoomBrummieRoad) && ((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt)) - && (_vm->_gyro->_whereIs[7] == _vm->_gyro->_room)) { + && (_vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] == _vm->_gyro->_room)) { switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) { // 0 = neither, 1 = only bolt, 2 = only crossbow, 3 = both. case 0: @@ -2068,7 +2068,7 @@ void Acci::doThat() { _vm->_animation->_sprites[1].walkTo(1); _vm->_animation->_sprites[1]._vanishIfStill = true; _vm->_animation->_sprites[1]._callEachStepFl = false; - _vm->_gyro->_whereIs[7] = 177; + _vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomDummy; break; default: _vm->_scrolls->displayScrollChain('Q', 10); // Please try not to be so violent! diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index eaf74fa124..833aa5cc31 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -797,7 +797,7 @@ void Animation::callSpecial(uint16 which) { _sprites[1].walkTo(2); _sprites[1]._vanishIfStill = true; _sprites[1]._doCheck = true; // One of them must have Check_Me switched on. - _vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = 177; // Not here, then. + _vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = kRoomDummy; // Not here, then. _vm->_timer->addTimer(364, Timer::kProcHangAround, Timer::kReasonHangingAround); } break; diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index c6f74f80f0..24e5f56dd1 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -441,7 +441,7 @@ bool AvalancheEngine::loadGame(const int16 slot) { _celer->forgetBackgroundSprites(); _lucerna->minorRedraw(); _dropdown->setupMenu(); - _gyro->_whereIs[0] = _gyro->_room; + _gyro->_whereIs[Gyro::kPeopleAvalot - 150] = _gyro->_room; _gyro->_alive = true; _lucerna->refreshObjectList(); _animation->updateSpeed(); diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp index 539f1430b3..d6ea248d78 100644 --- a/engines/avalanche/gyro.cpp +++ b/engines/avalanche/gyro.cpp @@ -150,7 +150,7 @@ byte Gyro::_whereIs[29] = { kRoomDucks, // Duck - r__DucksRoom's not defined yet. kRoomArgentPub, // Malagauche kRoomRobins, // Friar Tuck. - 177, // Robin Hood - can't meet him at the start. + kRoomDummy, // Robin Hood - can't meet him at the start. kRoomBrummieRoad, // Cwytalot kRoomLustiesRoom, // Baron du Lustie. kRoomOutsideCardiffCastle, // The Duke of Cardiff. @@ -165,7 +165,7 @@ byte Gyro::_whereIs[29] = { // The Lasses kRoomYours, // Arkata kRoomGeidas, // Geida - 177, // nobody allocated here! + kRoomDummy, // nobody allocated here! kRoomWiseWomans // The Wise Woman. }; diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp index c735346f9d..65e1478e18 100644 --- a/engines/avalanche/lucerna.cpp +++ b/engines/avalanche/lucerna.cpp @@ -496,13 +496,13 @@ void Lucerna::enterRoom(byte room, byte ped) { if (ped > 0) { spr1->init(2, false, _vm->_animation); // load Spludwick _vm->_animation->appearPed(2, 1); - _vm->_gyro->_whereIs[1] = kRoomSpludwicks; + _vm->_gyro->_whereIs[Gyro::kPeopleSpludwick - 150] = kRoomSpludwicks; } spr1->_callEachStepFl = true; spr1->_eachStepProc = Animation::kProcGeida; } else - _vm->_gyro->_whereIs[1] = kRoomNowhere; + _vm->_gyro->_whereIs[Gyro::kPeopleSpludwick - 150] = kRoomNowhere; break; case kRoomBrummieRoad: diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h index c87fc4c2d2..a963468db2 100644 --- a/engines/avalanche/roomnums.h +++ b/engines/avalanche/roomnums.h @@ -66,7 +66,8 @@ enum Room { kRoomOutsideCardiffCastle = 70, kRoomInsideCardiffCastle = 71, kRoomBossKey = 98, // assumed - kRoomMap = 99 + kRoomMap = 99, + kRoomDummy = 177 // Dummy room }; } // End of namespace Avalanche diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp index 3ecec3c83b..87fdb0b768 100644 --- a/engines/avalanche/scrolls.cpp +++ b/engines/avalanche/scrolls.cpp @@ -1051,7 +1051,7 @@ void Scrolls::talkTo(byte whom) { _vm->_lucerna->refreshObjectList(); displayScrollChain('q', 1); // Circular from Cardiff. _vm->_gyro->_talkedToCrapulus = true; - _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = 177; // Crapulus walks off. + _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomDummy; // Crapulus walks off. AnimationType *spr = &_vm->_animation->_sprites[1]; spr->_vanishIfStill = true; |