From d70b856da90ece5cc0d1e210a9992212a5da39a6 Mon Sep 17 00:00:00 2001 From: uruk Date: Sun, 15 Sep 2013 16:50:12 +0200 Subject: AVALANCHE: Rename room number constans. Repair Lucerna::enterRoom(). --- engines/avalanche/acci.cpp | 66 ++++++++++++------------- engines/avalanche/animation.cpp | 44 ++++++++--------- engines/avalanche/celer.cpp | 22 ++++----- engines/avalanche/gyro.cpp | 46 ++++++++--------- engines/avalanche/lucerna.cpp | 106 ++++++++++++++++++++-------------------- engines/avalanche/roomnums.h | 86 ++++++++++++++------------------ engines/avalanche/timer.cpp | 6 +-- 7 files changed, 181 insertions(+), 195 deletions(-) (limited to 'engines') diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp index a90e1f0a21..390097a145 100644 --- a/engines/avalanche/acci.cpp +++ b/engines/avalanche/acci.cpp @@ -700,16 +700,16 @@ void Acci::parse() { replace(Common::String("\x4\xE5"), 20); // "take off" = "doff" // Words that could mean more than one _person - if (_vm->_gyro->_room == r__nottspub) + if (_vm->_gyro->_room == kRoomNottsPub) replace(Common::String('\xCC'), 164); // Barman = Port else replace(Common::String('\xCC'), 154); // Barman = Malagauche switch (_vm->_gyro->_room) { - case r__aylesoffice: + case kRoomAylesOffice: replace(Common::String('\xCB'), 163); // Monk = Ayles break; - case r__musicroom: + case kRoomMusicRoom: replace(Common::String('\xCB'), 166); // Monk = Jacques break; default: @@ -880,7 +880,7 @@ bool Acci::isHolding() { } void Acci::openBox(bool isOpening) { - if ((_vm->_gyro->_room == r__yours) && (_thing == 54)) { + if ((_vm->_gyro->_room == kRoomYours) && (_thing == 54)) { _vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_celer->updateBackgroundSprites(); @@ -993,7 +993,7 @@ void Acci::swallow() { // Eat something. } break; default: - if ((_vm->_gyro->_room == r__argentpub) || (_vm->_gyro->_room == r__nottspub)) + if ((_vm->_gyro->_room == kRoomArgentPub) || (_vm->_gyro->_room == kRoomNottsPub)) _vm->_scrolls->displayText("Try BUYing things before you drink them!"); else _vm->_scrolls->displayText("The taste of it makes you retch!"); @@ -1036,27 +1036,27 @@ void Acci::peopleInRoom() { void Acci::lookAround() { _vm->_scrolls->displayText(*_vm->_gyro->_also[0][1]); switch (_vm->_gyro->_room) { - case r__spludwicks: + case kRoomSpludwicks: if (_vm->_gyro->_avariciusTalk > 0) _vm->_scrolls->displayScrollChain('q', 23); else peopleInRoom(); break; - case r__robins: + case kRoomRobins: if (_vm->_gyro->_tiedUp) _vm->_scrolls->displayScrollChain('q', 38); if (_vm->_gyro->_mushroomGrowing) _vm->_scrolls->displayScrollChain('q', 55); break; - case r__insidecardiffcastle: + case kRoomInsideCardiffCastle: if (!_vm->_gyro->_takenPen) _vm->_scrolls->displayScrollChain('q', 49); break; - case r__lustiesroom: + case kRoomLustiesRoom: if (_vm->_gyro->_lustieIsAsleep) _vm->_scrolls->displayScrollChain('q', 65); break; - case r__catacombs: + case kRoomCatacombs: switch (_vm->_gyro->_catacombY * 256 + _vm->_gyro->_catacombX) { case 258 : _vm->_scrolls->displayScrollChain('q', 80); // Inside art gallery. @@ -1077,7 +1077,7 @@ void Acci::lookAround() { void Acci::openDoor() { // Special cases. switch (_vm->_gyro->_room) { - case r__yours: + case kRoomYours: if (_vm->_animation->inField(2)) { // Opening the box. _thing = 54; // The box. @@ -1086,7 +1086,7 @@ void Acci::openDoor() { return; } break; - case r__spludwicks: + case kRoomSpludwicks: if (_thing == 61) { _vm->_scrolls->displayScrollChain('q', 85); return; @@ -1094,7 +1094,7 @@ void Acci::openDoor() { break; } - if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != r__lusties)) + if ((!_vm->_gyro->_userMovesAvvy) && (_vm->_gyro->_room != kRoomLusties)) return; // No doors can open if you can't move Avvy. for (byte i = 0; i < 7; i++) { @@ -1124,7 +1124,7 @@ void Acci::openDoor() { } } - if (_vm->_gyro->_room == r__map) + if (_vm->_gyro->_room == kRoomMap) _vm->_scrolls->displayText("Avvy, you can complete the whole game without ever going " \ "to anywhere other than Argent, Birmingham, Cardiff, Nottingham and Norwich."); else @@ -1169,7 +1169,7 @@ void Acci::putProc() { break; case 54: - if (_vm->_gyro->_room == r__yours) { // Put something into the box. + if (_vm->_gyro->_room == kRoomYours) { // Put something into the box. if (_vm->_gyro->_boxContent != kNothing) _vm->_scrolls->displayText("There's something in the box already, Avvy. Try taking that out first."); else { @@ -1316,7 +1316,7 @@ void Acci::already() { void Acci::standUp() { switch (_vm->_gyro->_room) { - case r__yours: // Avvy isn't asleep. + case kRoomYours: // Avvy isn't asleep. if (_vm->_gyro->_avvyIsAwake && _vm->_gyro->_avvyInBed) { // But he's in bed. if (_vm->_gyro->_teetotal) { _vm->_scrolls->displayScrollChain('d', 12); @@ -1335,11 +1335,11 @@ void Acci::standUp() { already(); break; - case r__insidecardiffcastle: + case kRoomInsideCardiffCastle: cardiffClimbing(); break; - case r__nottspub: + case kRoomNottsPub: if (_vm->_gyro->_sittingInPub) { _vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down. _vm->_animation->_sprites[0]._visible = true; // But standing up. @@ -1356,7 +1356,7 @@ void Acci::standUp() { void Acci::getProc(char thing) { switch (_vm->_gyro->_room) { - case r__yours: + case kRoomYours: if (_vm->_animation->inField(2)) { if (_vm->_gyro->_boxContent == thing) { _vm->_celer->drawBackgroundSprite(-1, -1, 5); @@ -1372,7 +1372,7 @@ void Acci::getProc(char thing) { } else _vm->_scrolls->displayScrollChain('q', 57); break; - case r__insidecardiffcastle: + case kRoomInsideCardiffCastle: switch (thing) { case Gyro::kObjectPen: if (_vm->_animation->inField(2)) { // Standing on the dais. @@ -1399,7 +1399,7 @@ void Acci::getProc(char thing) { _vm->_scrolls->displayScrollChain('q', 57); } break; - case r__robins: + case kRoomRobins: if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(1)) & (_vm->_gyro->_mushroomGrowing)) { _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_scrolls->displayText("Got it!"); @@ -1421,7 +1421,7 @@ void Acci::getProc(char thing) { * @remarks Originally called 'give_Geida_the_lute' */ void Acci::giveGeidaTheLute() { - if (_vm->_gyro->_room != r__lustiesroom) { + if (_vm->_gyro->_room != kRoomLustiesRoom) { Common::String tmpStr = Common::String::format("Not yet. Try later!%c2%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble); _vm->_scrolls->displayText(tmpStr); return; @@ -1779,7 +1779,7 @@ void Acci::doThat() { case kVerbCodePlay: if (_thing == kPardon) { switch (_vm->_gyro->_room) { // They just typed "play"... - case r__argentpub: { // ...in the pub, => play Nim. + case kRoomArgentPub: { // ...in the pub, => play Nim. warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()"); // play_nim(); // The following parts are copied from play_nim(). @@ -1814,7 +1814,7 @@ void Acci::doThat() { + Scrolls::kControlNewLine + Scrolls::kControlNewLine + "Peter (uruk)"); } break; - case r__musicroom: + case kRoomMusicRoom: playHarp(); break; } @@ -1830,13 +1830,13 @@ void Acci::doThat() { _vm->_scrolls->displayScrollChain('U', 15); break; case 52: - if (_vm->_gyro->_room == r__musicroom) + if (_vm->_gyro->_room == kRoomMusicRoom) playHarp(); else _vm->_scrolls->displayText(kWhat); break; case 55: - if (_vm->_gyro->_room == r__argentpub) + if (_vm->_gyro->_room == kRoomArgentPub) // play_nim(); warning("STUB: Acci::doThat() - case kVerbCodeplay - play_nim()"); else @@ -1946,7 +1946,7 @@ void Acci::doThat() { break; case kVerbCodeBuy: // What are they trying to buy? switch (_vm->_gyro->_room) { - case r__argentpub: + case kRoomArgentPub: if (_vm->_animation->inField(6)) { // We're in a pub, and near the bar. switch (_thing) { case 51: @@ -2007,7 +2007,7 @@ void Acci::doThat() { _vm->_scrolls->displayScrollChain('D', 5); // Go to the bar! break; - case r__outsideducks: + case kRoomOutsideDucks: if (_vm->_animation->inField(6)) { if (_thing == Gyro::kObjectOnion) { if (_vm->_gyro->_objects[Gyro::kObjectOnion - 1]) @@ -2034,7 +2034,7 @@ void Acci::doThat() { _vm->_scrolls->displayScrollChain('D', 0); break; - case r__nottspub: + case kRoomNottsPub: _vm->_scrolls->displayScrollChain('n', 15); // Can't sell to southerners. break; default: @@ -2042,7 +2042,7 @@ void Acci::doThat() { } break; case kVerbCodeAttack: - if ((_vm->_gyro->_room == r__brummieroad) && + if ((_vm->_gyro->_room == kRoomBrummieRoad) && ((_person == 157) || (_thing == Gyro::kObjectCrossbow) || (_thing == Gyro::kObjectBolt)) && (_vm->_gyro->_whereIs[7] == _vm->_gyro->_room)) { switch (_vm->_gyro->_objects[Gyro::kObjectBolt - 1] + _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] * 2) { @@ -2077,7 +2077,7 @@ void Acci::doThat() { _vm->_scrolls->displayScrollChain('Q', 10); break; case kVerbCodePasswd: - if (_vm->_gyro->_room != r__bridge) + if (_vm->_gyro->_room != kRoomBridge) _vm->_scrolls->displayScrollChain('Q', 12); else { bool ok = true; @@ -2143,7 +2143,7 @@ void Acci::doThat() { break; case kVerbCodeClimb: - if (_vm->_gyro->_room == r__insidecardiffcastle) + if (_vm->_gyro->_room == kRoomInsideCardiffCastle) cardiffClimbing(); else // In the wrong room! _vm->_scrolls->displayText("Not with your head for heights, Avvy!"); @@ -2187,7 +2187,7 @@ void Acci::doThat() { } break; case kVerbCodeSit: - if (_vm->_gyro->_room == r__nottspub) { + if (_vm->_gyro->_room == kRoomNottsPub) { if (_vm->_gyro->_sittingInPub) _vm->_scrolls->displayText("You're already sitting!"); else { diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 5f89ccb224..ab90c274ef 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -439,20 +439,20 @@ void Animation::catacombMove(byte ped) { switch (xy_uint16) { case 1801: // Exit catacombs - flipRoom(r__lustiesroom, 4); + flipRoom(kRoomLustiesRoom, 4); _vm->_scrolls->displayText("Phew! Nice to be out of there!"); return; case 1033:{ // Oubliette - flipRoom(r__oubliette, 1); + flipRoom(kRoomOubliette, 1); Common::String tmpStr = Common::String::format("Oh, NO!%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble); _vm->_scrolls->displayText(tmpStr); } return; case 4: - flipRoom(r__geidas, 1); + flipRoom(kRoomGeidas, 1); return; case 2307: - flipRoom(r__lusties, 5); + flipRoom(kRoomLusties, 5); _vm->_scrolls->displayText("Oh no... here we go again..."); _vm->_gyro->_userMovesAvvy = false; _sprites[0]._moveY = 1; @@ -849,7 +849,7 @@ void Animation::callSpecial(uint16 which) { _vm->_lucerna->dusk(); _vm->_gyro->_catacombY--; catacombMove(4); - if (_vm->_gyro->_room != r__catacombs) + if (_vm->_gyro->_room != kRoomCatacombs) return; switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1] & 0xf00) >> 8) { case 0x1: @@ -867,7 +867,7 @@ void Animation::callSpecial(uint16 which) { _vm->_lucerna->dusk(); _vm->_gyro->_catacombX++; catacombMove(1); - if (_vm->_gyro->_room != r__catacombs) + if (_vm->_gyro->_room != kRoomCatacombs) return; appearPed(1, 1); dawnDelay(); @@ -876,7 +876,7 @@ void Animation::callSpecial(uint16 which) { _vm->_lucerna->dusk(); _vm->_gyro->_catacombY += 1; catacombMove(2); - if (_vm->_gyro->_room != r__catacombs) + if (_vm->_gyro->_room != kRoomCatacombs) return; appearPed(1, 2); dawnDelay(); @@ -885,7 +885,7 @@ void Animation::callSpecial(uint16 which) { _vm->_lucerna->dusk(); _vm->_gyro->_catacombX--; catacombMove(3); - if (_vm->_gyro->_room != r__catacombs) + if (_vm->_gyro->_room != kRoomCatacombs) return; appearPed(1, 3); dawnDelay(); @@ -902,30 +902,30 @@ void Animation::callSpecial(uint16 which) { */ void Animation::openDoor(byte whither, byte ped, byte magicnum) { switch (_vm->_gyro->_room) { - case r__outsideyours: - case r__outsidenottspub: - case r__outsideducks: + case kRoomOutsideYours: + case kRoomOutsideNottsPub: + case kRoomOutsideDucks: _vm->_sequence->firstShow(1); _vm->_sequence->thenShow(2); _vm->_sequence->thenShow(3); break; - case r__insidecardiffcastle: + case kRoomInsideCardiffCastle: _vm->_sequence->firstShow(1); _vm->_sequence->thenShow(5); break; - case r__avvysgarden: - case r__entrancehall: - case r__insideabbey: - case r__yourhall: + case kRoomAvvysGarden: + case kRoomEntranceHall: + case kRoomInsideAbbey: + case kRoomYourHall: _vm->_sequence->firstShow(1); _vm->_sequence->thenShow(2); break; - case r__musicroom: - case r__outsideargentpub: + case kRoomMusicRoom: + case kRoomOutsideArgentPub: _vm->_sequence->firstShow(5); _vm->_sequence->thenShow(6); break; - case r__lusties: + case kRoomLusties: switch (magicnum) { case 14: if (_vm->_gyro->_avvysInTheCupboard) { @@ -1321,12 +1321,12 @@ void Animation::flipRoom(byte room, byte ped) { return; } - if ((room == 177) && (_vm->_gyro->_room == r__lusties)) { + if ((room == 177) && (_vm->_gyro->_room == kRoomLusties)) { hideInCupboard(); return; } - if ((_vm->_gyro->_jumpStatus > 0) && (_vm->_gyro->_room == r__insidecardiffcastle)) { + if ((_vm->_gyro->_jumpStatus > 0) && (_vm->_gyro->_room == kRoomInsideCardiffCastle)) { // You can't *jump* out of Cardiff Castle! _sprites[0]._moveX = 0; return; @@ -1340,7 +1340,7 @@ void Animation::flipRoom(byte room, byte ped) { _sprites[i].remove(); } // Deallocate sprite - if (_vm->_gyro->_room == r__lustiesroom) + if (_vm->_gyro->_room == kRoomLustiesRoom) _vm->_gyro->_enterCatacombsFromLustiesRoom = true; _vm->_lucerna->enterRoom(room, ped); diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp index f8b2604ee0..6a86bf78c4 100644 --- a/engines/avalanche/celer.cpp +++ b/engines/avalanche/celer.cpp @@ -58,23 +58,23 @@ void Celer::updateBackgroundSprites() { return; // No animation when the menus are up. switch (_vm->_gyro->_room) { - case r__outsideargentpub: + case kRoomOutsideArgentPub: if ((_vm->_gyro->_roomTime % 12) == 0) drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 4); break; - case r__brummieroad: + case kRoomBrummieRoad: if ((_vm->_gyro->_roomTime % 2) == 0) drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 2) % 4); break; - case r__bridge: + case kRoomBridge: if ((_vm->_gyro->_roomTime % 2) == 0) drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->_roomTime / 2) % 4); break; - case r__yours: + case kRoomYours: if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0)) drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 2); break; - case r__argentpub: + case kRoomArgentPub: if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) { // Malagauche cycle. _vm->_gyro->_malagauche += 1; @@ -131,7 +131,7 @@ void Celer::updateBackgroundSprites() { } } break; - case r__westhall: + case kRoomWestHall: if ((_vm->_gyro->_roomTime % 3) == 0) { switch ((_vm->_gyro->_roomTime / int32(3)) % int32(6)) { case 4: @@ -149,7 +149,7 @@ void Celer::updateBackgroundSprites() { } } break; - case r__lustiesroom: + case kRoomLustiesRoom: if (!(_vm->_gyro->_lustieIsAsleep)) { byte direction = 0; uint16 angle = _vm->_lucerna->bearing(2); @@ -169,7 +169,7 @@ void Celer::updateBackgroundSprites() { } } break; - case r__aylesoffice: + case kRoomAylesOffice: if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) { switch ((_vm->_gyro->_roomTime / 14) % 2) { case 0: @@ -181,7 +181,7 @@ void Celer::updateBackgroundSprites() { } } break; - case r__robins: + case kRoomRobins: if (_vm->_gyro->_tiedUp) { switch (_vm->_gyro->_roomTime % 54) { case 20: @@ -193,7 +193,7 @@ void Celer::updateBackgroundSprites() { } } break; - case r__nottspub: { + case kRoomNottsPub: { // Bearing of Avvy from Port. byte direction = 0; uint16 angle = _vm->_lucerna->bearing(5); @@ -222,7 +222,7 @@ void Celer::updateBackgroundSprites() { } break; } - case r__ducks: { + case kRoomDucks: { if ((_vm->_gyro->_roomTime % 3) == 0) // The fire flickers. drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 3) % 3); diff --git a/engines/avalanche/gyro.cpp b/engines/avalanche/gyro.cpp index 1e95c6b725..5cc877d99c 100644 --- a/engines/avalanche/gyro.cpp +++ b/engines/avalanche/gyro.cpp @@ -143,29 +143,29 @@ const TuneType Gyro::kTune = { byte Gyro::_whereIs[29] = { // The Lads - r__yours, // Avvy - r__spludwicks, // Spludwick - r__outsideyours, // Crapulus - r__ducks, // Duck - r__DucksRoom's not defined yet. - r__argentpub, // Malagauche - r__robins, // Friar Tuck. + kRoomYours, // Avvy + kRoomSpludwicks, // Spludwick + kRoomOutsideYours, // Crapulus + kRoomDucks, // Duck - r__DucksRoom's not defined yet. + kRoomArgentPub, // Malagauche + kRoomRobins, // Friar Tuck. 177, // Robin Hood - can't meet him at the start. - r__brummieroad, // Cwytalot - r__lustiesroom, // Baron du Lustie. - r__outsidecardiffcastle, // The Duke of Cardiff. - r__argentpub, // Dogfood - r__outsideducks, // Trader - r__argentpub, // Ibythneth - r__aylesoffice, // Ayles - r__nottspub, // Port - r__nottspub, // Spurge - r__musicroom, // Jacques + kRoomBrummieRoad, // Cwytalot + kRoomLustiesRoom, // Baron du Lustie. + kRoomOutsideCardiffCastle, // The Duke of Cardiff. + kRoomArgentPub, // Dogfood + kRoomOutsideDucks, // Trader + kRoomArgentPub, // Ibythneth + kRoomAylesOffice, // Ayles + kRoomNottsPub, // Port + kRoomNottsPub, // Spurge + kRoomMusicRoom, // Jacques 0, 0, 0, 0, 0, 0, 0, 0, // The Lasses - r__yours, // Arkata - r__geidas, // Geida + kRoomYours, // Arkata + kRoomGeidas, // Geida 177, // nobody allocated here! - r__wisewomans // The Wise Woman. + kRoomWiseWomans // The Wise Woman. }; Gyro::Gyro(AvalancheEngine *vm) : _interrogation(0), _onCanDoPageSwap(true) { @@ -510,25 +510,25 @@ Common::String Gyro::getItem(byte which) { Common::String Gyro::f5Does() { switch (_room) { - case r__yours: + case kRoomYours: if (!_avvyIsAwake) return Common::String::format("%cWWake up", Acci::kVerbCodeWake); else if (_avvyInBed) return Common::String::format("%cGGet up", Acci::kVerbCodeStand); break; - case r__insidecardiffcastle: + case kRoomInsideCardiffCastle: if (_standingOnDais) return Common::String::format("%cCClimb down", Acci::kVerbCodeClimb); else return Common::String::format("%cCClimb up", Acci::kVerbCodeClimb); break; - case r__nottspub: + case kRoomNottsPub: if (_sittingInPub) return Common::String::format("%cSStand up", Acci::kVerbCodeStand); else return Common::String::format("%cSSit down", Acci::kVerbCodeSit); break; - case r__musicroom: + case kRoomMusicRoom: if (_vm->_animation->inField(7)) return Common::String::format("%cPPlay the harp", Acci::kVerbCodePlay); break; diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp index e848442c5c..7d1e35d28e 100644 --- a/engines/avalanche/lucerna.cpp +++ b/engines/avalanche/lucerna.cpp @@ -345,21 +345,21 @@ void Lucerna::exitRoom(byte x) { _vm->_gyro->_seeScroll = true; // This stops the trippancy system working over the length of this procedure. switch (x) { - case r__spludwicks: + case kRoomSpludwicks: _vm->_timer->loseTimer(Timer::kReasonAvariciusTalks); _vm->_gyro->_avariciusTalk = 0; // He doesn't HAVE to be talking for this to work. It just deletes it IF it exists. break; - case r__bridge: + case kRoomBridge: if (_vm->_gyro->_drawbridgeOpen > 0) { _vm->_gyro->_drawbridgeOpen = 4; // Fully open. _vm->_timer->loseTimer(Timer::kReasonDrawbridgeFalls); } break; - case r__outsidecardiffcastle: + case kRoomOutsideCardiffCastle: _vm->_timer->loseTimer(Timer::kReasonCardiffsurvey); break; - case r__robins: + case kRoomRobins: _vm->_timer->loseTimer(Timer::kReasonGettingTiedUp); break; } @@ -369,7 +369,7 @@ void Lucerna::exitRoom(byte x) { _vm->_gyro->_seeScroll = false; // Now it can work again! _vm->_gyro->_lastRoom = _vm->_gyro->_room; - if (_vm->_gyro->_room != r__map) + if (_vm->_gyro->_room != kRoomMap) _vm->_gyro->_lastRoomNotMap = _vm->_gyro->_room; } @@ -383,13 +383,13 @@ void Lucerna::enterNewTown() { _vm->_dropdown->setupMenu(); switch (_vm->_gyro->_room) { - case r__outsidenottspub: // Entry into Nottingham. - if ((_vm->_gyro->_roomCount[r__robins] > 0) && (_vm->_gyro->_beenTiedUp) && (!_vm->_gyro->_takenMushroom)) + case kRoomOutsideNottsPub: // Entry into Nottingham. + if ((_vm->_gyro->_roomCount[kRoomRobins] > 0) && (_vm->_gyro->_beenTiedUp) && (!_vm->_gyro->_takenMushroom)) _vm->_gyro->_mushroomGrowing = true; break; - case r__wisewomans: { // Entry into Argent. + case kRoomWiseWomans: { // Entry into Argent. if (_vm->_gyro->_talkedToCrapulus && (!_vm->_gyro->_lustieIsAsleep)) { - _vm->_gyro->_spludwickAtHome = !((_vm->_gyro->_roomCount[r__wisewomans] % 3) == 1); + _vm->_gyro->_spludwickAtHome = !((_vm->_gyro->_roomCount[kRoomWiseWomans] % 3) == 1); _vm->_gyro->_crapulusWillTell = !_vm->_gyro->_spludwickAtHome; } else { _vm->_gyro->_spludwickAtHome = true; @@ -401,7 +401,7 @@ void Lucerna::enterNewTown() { break; } - if (_vm->_gyro->_room != r__outsideducks) { + if (_vm->_gyro->_room != kRoomOutsideDucks) { if ((_vm->_gyro->_objects[Gyro::kObjectOnion - 1]) && !(_vm->_gyro->_onionInVinegar)) _vm->_gyro->_rottenOnion = true; // You're holding the onion } @@ -441,12 +441,12 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_gyro->_roomTime = 0; - if ((_vm->_gyro->_lastRoom == r__map) && (_vm->_gyro->_lastRoomNotMap != _vm->_gyro->_room)) + if ((_vm->_gyro->_lastRoom == kRoomMap) && (_vm->_gyro->_lastRoomNotMap != _vm->_gyro->_room)) enterNewTown(); switch (room) { - case r__yours: + case kRoomYours: if (_vm->_gyro->_avvyInBed) { _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_graphics->refreshBackground(); @@ -454,14 +454,14 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__outsideyours: + case kRoomOutsideYours: if (ped > 0) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; if (!_vm->_gyro->_talkedToCrapulus) { - _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__outsideyours; + _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomOutsideYours; spr1->init(8, false, _vm->_animation); // load Crapulus - if (_vm->_gyro->_roomCount[r__outsideyours] == 1) { + if (_vm->_gyro->_roomCount[kRoomOutsideYours] == 1) { _vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen. spr1->walkTo(5); // Walks up to greet you. } else { @@ -473,7 +473,7 @@ void Lucerna::enterRoom(byte room, byte ped) { spr1->_eachStepProc = Animation::kProcFaceAvvy; // He always faces Avvy. } else - _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = r__nowhere; + _vm->_gyro->_whereIs[Gyro::kPeopleCrapulus - 150] = kRoomNowhere; if (_vm->_gyro->_crapulusWillTell) { spr1->init(8, false, _vm->_animation); @@ -485,43 +485,43 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__outsidespludwicks: - if ((_vm->_gyro->_roomCount[r__outsidespludwicks] == 1) && (ped == 1)) { + case kRoomOutsideSpludwicks: + if ((_vm->_gyro->_roomCount[kRoomOutsideSpludwicks] == 1) && (ped == 1)) { _vm->_timer->addTimer(20, Timer::kProcBang, Timer::kReasonExplosion); _vm->_gyro->_spludwickAtHome = true; } break; - case r__spludwicks: + case kRoomSpludwicks: if (_vm->_gyro->_spludwickAtHome) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; if (ped > 0) { spr1->init(2, false, _vm->_animation); // load Spludwick _vm->_animation->appearPed(2, 2); - _vm->_gyro->_whereIs[1] = r__spludwicks; + _vm->_gyro->_whereIs[1] = kRoomSpludwicks; } spr1->_callEachStepFl = true; spr1->_eachStepProc = Animation::kProcGeida; } else - _vm->_gyro->_whereIs[1] = r__nowhere; + _vm->_gyro->_whereIs[1] = kRoomNowhere; break; - case r__brummieroad: + case kRoomBrummieRoad: if (_vm->_gyro->_geidaFollows) putGeidaAt(5, ped); if (_vm->_gyro->_cwytalotGone) { _vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing; - _vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere; + _vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomNowhere; } else { if (ped > 0) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; spr1->init(4, false, _vm->_animation); // 4 = Cwytalot spr1->_callEachStepFl = true; spr1->_eachStepProc = Animation::kProcFollowAvvyY; - _vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad; + _vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = kRoomBrummieRoad; - if (_vm->_gyro->_roomCount[r__brummieroad] == 1) { // First time here... + if (_vm->_gyro->_roomCount[kRoomBrummieRoad] == 1) { // First time here... _vm->_animation->appearPed(2, 2); // He appears on the right of the screen... spr1->walkTo(4); // ...and he walks up... } else { @@ -533,8 +533,8 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__argentroad: - if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[r__argentroad] > 3)) { + case kRoomArgentRoad: + if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[kRoomArgentRoad] > 3)) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again _vm->_animation->appearPed(2, 1); @@ -546,7 +546,7 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__bridge: + case kRoomBridge: if (_vm->_gyro->_drawbridgeOpen == 4) { // open _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge _vm->_graphics->refreshBackground(); @@ -556,7 +556,7 @@ void Lucerna::enterRoom(byte room, byte ped) { putGeidaAt(ped + 3, ped); // load Geida break; - case r__robins: + case kRoomRobins: if (ped > 0) { if (!_vm->_gyro->_beenTiedUp) { // A welcome party... or maybe not... @@ -581,7 +581,7 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_graphics->refreshBackground(); break; - case r__outsidecardiffcastle: + case kRoomOutsideCardiffCastle: if (ped > 0) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; switch (_vm->_gyro->_cardiffQuestionNum) { @@ -608,12 +608,12 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_gyro->_interrogation = 0; break; - case r__map: + case kRoomMap: // You're entering the map. dawn(); //setactivepage(cp); if (ped > 0) - zoomOut(_vm->_gyro->_peds[ped - 1]._x, _vm->_gyro->_peds[ped - 1]._y); + zoomOut(_vm->_gyro->_peds[ped]._x, _vm->_gyro->_peds[ped]._y); //setactivepage(1 - cp); if ((_vm->_gyro->_objects[Gyro::kObjectWine - 1]) && (_vm->_gyro->_wineState != 3)) { @@ -625,7 +625,7 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_scrolls->displayScrollChain('q', 69); break; - case r__catacombs: + case kRoomCatacombs: if ((ped == 0) || (ped == 3) || (ped == 5) || (ped == 6)) { switch (ped) { @@ -652,7 +652,7 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__argentpub: + case kRoomArgentPub: if (_vm->_gyro->_wonNim) _vm->_celer->drawBackgroundSprite(-1, -1, 1); // No lute by the settle. _vm->_gyro->_malagauche = 0; // Ready to boot Malagauche @@ -663,7 +663,7 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_graphics->refreshBackground(); break; - case r__lustiesroom: + case kRoomLustiesRoom: _vm->_gyro->_npcFacing = 1; // du Lustie. if (_vm->_animation->_sprites[0]._id == 0) // Avvy in his normal clothes _vm->_timer->addTimer(3, Timer::kProcCallsGuards, Timer::kReasonDuLustieTalks); @@ -680,7 +680,7 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__musicroom: + case kRoomMusicRoom: if (_vm->_gyro->_jacquesState > 0) { _vm->_gyro->_jacquesState = 5; _vm->_celer->drawBackgroundSprite(-1, -1, 2); @@ -699,7 +699,7 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__outsidenottspub: + case kRoomOutsideNottsPub: if (ped == 2) { _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_graphics->refreshBackground(); @@ -711,7 +711,7 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__outsideargentpub: + case kRoomOutsideArgentPub: if (ped == 2) { _vm->_celer->drawBackgroundSprite(-1, -1, 6); _vm->_graphics->refreshBackground(); @@ -722,10 +722,10 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__wisewomans: { + case kRoomWiseWomans: { AnimationType *spr1 = &_vm->_animation->_sprites[1]; spr1->init(11, false, _vm->_animation); - if ((_vm->_gyro->_roomCount[r__wisewomans] == 1) && (ped > 0)) { + if ((_vm->_gyro->_roomCount[kRoomWiseWomans] == 1) && (ped > 0)) { _vm->_animation->appearPed(2, 2); // Start on the right-hand side of the screen. spr1->walkTo(4); // Walks up to greet you. } else { @@ -738,7 +738,7 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__insidecardiffcastle: + case kRoomInsideCardiffCastle: if (ped > 0) { _vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart. _vm->_celer->drawBackgroundSprite(-1, -1, 1); @@ -763,7 +763,7 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__avvysgarden: + case kRoomAvvysGarden: if (ped == 1) { _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_graphics->refreshBackground(); @@ -774,9 +774,9 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__entrancehall: - case r__insideabbey: - case r__yourhall: + case kRoomEntranceHall: + case kRoomInsideAbbey: + case kRoomYourHall: if (ped == 2) { #if 0 // It was the original: @@ -795,34 +795,34 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__aylesoffice: + case kRoomAylesOffice: if (_vm->_gyro->_aylesIsAwake) _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_graphics->refreshBackground(); break; // Ayles awake. - case r__geidas: + case kRoomGeidas: putGeidaAt(2, ped); break; // load Geida - case r__easthall: - case r__westhall: + case kRoomEastHall: + case kRoomWestHall: if (_vm->_gyro->_geidaFollows) putGeidaAt(ped + 2, ped); break; - case r__lusties: + case kRoomLusties: if (_vm->_gyro->_geidaFollows) putGeidaAt(ped + 6, ped); break; - case r__nottspub: + case kRoomNottsPub: if (_vm->_gyro->_sittingInPub) _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_gyro->_npcFacing = 1; // Port. break; - case r__outsideducks: + case kRoomOutsideDucks: if (ped == 2) { // Shut the door _vm->_celer->drawBackgroundSprite(-1, -1, 3); @@ -835,7 +835,7 @@ void Lucerna::enterRoom(byte room, byte ped) { } break; - case r__ducks: + case kRoomDucks: _vm->_gyro->_npcFacing = 1; // Duck. break; } diff --git a/engines/avalanche/roomnums.h b/engines/avalanche/roomnums.h index e623c27a20..c87fc4c2d2 100644 --- a/engines/avalanche/roomnums.h +++ b/engines/avalanche/roomnums.h @@ -32,56 +32,42 @@ namespace Avalanche { -const byte r__nowhere = 0; -const byte r__yours = 1; -const byte r__outsideyours = 2; -const byte r__outsidespludwicks = 3; -const byte r__yourhall = 5; -const byte r__musicroom = 7; -const byte r__outsideargentpub = 9; -const byte r__argentroad = 10; -const byte r__wisewomans = 11; -const byte r__spludwicks = 12; -const byte r__insideabbey = 13; -const byte r__outsideabbey = 14; // assumed -const byte r__avvysgarden = 15; -const byte r__aylesoffice = 16; -const byte r__argentpub = 19; -const byte r__brummieroad = 20; -const byte r__bridge = 21; // ? not sure -const byte r__lusties = 22; -const byte r__lustiesroom = 23; -const byte r__westhall = 25; -const byte r__easthall = 26; -const byte r__oubliette = 27; -const byte r__geidas = 28; -const byte r__catacombs = 29; - -//{ -------------- } - -const byte r__entrancehall = 40; -const byte r__robins = 42; -const byte r__outsidenottspub = 46; -const byte r__nottspub = 47; - -//{ -------------- } - -const byte r__outsideducks = 50; -const byte r__ducks = 51; - -//{ -------------- } - -const byte r__outsidecardiffcastle = 70; -const byte r__insidecardiffcastle = 71; - -//{ -------------- } - -// place80 appears to be bogus - -//{ -------------- } - -const byte r__bosskey = 98; // assumed -const byte r__map = 99; +enum Room { + kRoomNowhere = 0, + kRoomYours = 1, + kRoomOutsideYours = 2, + kRoomOutsideSpludwicks = 3, + kRoomYourHall = 5, + kRoomMusicRoom = 7, + kRoomOutsideArgentPub = 9, + kRoomArgentRoad = 10, + kRoomWiseWomans = 11, + kRoomSpludwicks = 12, + kRoomInsideAbbey = 13, + kRoomOutsideAbbey = 14, + kRoomAvvysGarden = 15, + kRoomAylesOffice = 16, + kRoomArgentPub = 19, + kRoomBrummieRoad = 20, + kRoomBridge = 21, + kRoomLusties = 22, + kRoomLustiesRoom = 23, + kRoomWestHall = 25, + kRoomEastHall = 26, + kRoomOubliette = 27, + kRoomGeidas = 28, + kRoomCatacombs = 29, + kRoomEntranceHall = 40, + kRoomRobins = 42, + kRoomOutsideNottsPub = 46, + kRoomNottsPub = 47, + kRoomOutsideDucks = 50, + kRoomDucks = 51, + kRoomOutsideCardiffCastle = 70, + kRoomInsideCardiffCastle = 71, + kRoomBossKey = 98, // assumed + kRoomMap = 99 +}; } // End of namespace Avalanche diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp index efe5bf30b7..8cc21fd86a 100644 --- a/engines/avalanche/timer.cpp +++ b/engines/avalanche/timer.cpp @@ -327,7 +327,7 @@ void Timer::hangAround() { AnimationType *avvy = &_vm->_animation->_sprites[0]; avvy->init(7, true, _vm->_animation); // Robin Hood - _vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = r__robins; + _vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = kRoomRobins; _vm->_animation->appearPed(1, 2); _vm->_scrolls->displayScrollChain('q', 39); avvy->walkTo(7); @@ -339,7 +339,7 @@ void Timer::hangAround2() { AnimationType *spr = &_vm->_animation->_sprites[1]; spr->_vanishIfStill = false; spr->walkTo(4); - _vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = r__robins; + _vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = kRoomRobins; _vm->_scrolls->displayScrollChain('q', 41); _vm->_animation->_sprites[0].remove(); spr->remove(); // Get rid of Robin Hood and Friar Tuck. @@ -485,7 +485,7 @@ void Timer::jump() { } if ((_vm->_gyro->_jumpStatus == 10) // You're at the highest point of your jump. - && (_vm->_gyro->_room == r__insidecardiffcastle) + && (_vm->_gyro->_room == kRoomInsideCardiffCastle) && (_vm->_gyro->_arrowInTheDoor == true) && (_vm->_animation->inField(3))) { // Beside the wall // Grab the arrow! -- cgit v1.2.3