From cccc126d156f4f64445eb0eef43affe3a99a5080 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 15 Sep 2013 15:17:37 +0200 Subject: AVALANCHE: Convert index use from Pascal to C in Bearing() --- engines/avalanche/celer.cpp | 13 +++++++------ engines/avalanche/lucerna.cpp | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp index f8b2604ee0..94ef574199 100644 --- a/engines/avalanche/celer.cpp +++ b/engines/avalanche/celer.cpp @@ -118,11 +118,12 @@ void Celer::updateBackgroundSprites() { if ((_vm->_gyro->_roomTime % 200 >= 0) && (_vm->_gyro->_roomTime % 200 <= 178)) { // Normally. byte direction = 0; - if (((_vm->_lucerna->bearing(2) >= 1) && (_vm->_lucerna->bearing(2) <= 90)) || ((_vm->_lucerna->bearing(2) >= 358) && (_vm->_lucerna->bearing(2) <= 360))) + uint16 angle = _vm->_lucerna->bearing(1); + if (((angle >= 1) && (angle <= 90)) || ((angle >= 358) && (angle <= 360))) direction = 3; - else if ((_vm->_lucerna->bearing(2) >= 293) && (_vm->_lucerna->bearing(2) <= 357)) + else if ((angle >= 293) && (angle <= 357)) direction = 2; - else if ((_vm->_lucerna->bearing(2) >= 271) && (_vm->_lucerna->bearing(2) <= 292)) + else if ((angle >= 271) && (angle <= 292)) direction = 4; if (direction != _vm->_gyro->_npcFacing) { // Dogfood. @@ -152,7 +153,7 @@ void Celer::updateBackgroundSprites() { case r__lustiesroom: if (!(_vm->_gyro->_lustieIsAsleep)) { byte direction = 0; - uint16 angle = _vm->_lucerna->bearing(2); + uint16 angle = _vm->_lucerna->bearing(1); if ((_vm->_gyro->_roomTime % 45) > 42) direction = 4; // du Lustie blinks. // Bearing of Avvy from du Lustie. @@ -196,7 +197,7 @@ void Celer::updateBackgroundSprites() { case r__nottspub: { // Bearing of Avvy from Port. byte direction = 0; - uint16 angle = _vm->_lucerna->bearing(5); + uint16 angle = _vm->_lucerna->bearing(4); if ((angle <= 45) || ((angle >= 315) && (angle <= 360))) direction = 2; // Middle. else if ((angle >= 45) && (angle <= 180)) @@ -228,7 +229,7 @@ void Celer::updateBackgroundSprites() { // Bearing of Avvy from Duck. byte direction = 0; - uint16 angle = _vm->_lucerna->bearing(2); + uint16 angle = _vm->_lucerna->bearing(1); if ((angle <= 45) || ((angle >= 315) && (angle <= 360))) direction = 4; // Middle. else if ((angle >= 45) && (angle <= 180)) diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp index e848442c5c..ac27ea6cfc 100644 --- a/engines/avalanche/lucerna.cpp +++ b/engines/avalanche/lucerna.cpp @@ -1217,7 +1217,7 @@ void Lucerna::majorRedraw() { uint16 Lucerna::bearing(byte whichPed) { static const double rad2deg = 180 / 3.14; // Pi AnimationType *avvy = &_vm->_animation->_sprites[0]; - PedType *curPed = &_vm->_gyro->_peds[whichPed - 1]; // Different array indexes in Pascal and C. + PedType *curPed = &_vm->_gyro->_peds[whichPed]; if (avvy->_x == curPed->_x) return 0; -- cgit v1.2.3 From ecbd87353e74712a86b1dfe171629c01c729670a Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 15 Sep 2013 15:50:05 +0200 Subject: AVALANCHE: Convert index use from Pascal to C in walkTo() --- engines/avalanche/acci.cpp | 10 +++++----- engines/avalanche/animation.cpp | 12 ++++++------ engines/avalanche/lucerna.cpp | 14 +++++++------- engines/avalanche/scrolls.cpp | 2 +- engines/avalanche/timer.cpp | 20 ++++++++++---------- 5 files changed, 29 insertions(+), 29 deletions(-) (limited to 'engines') diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp index a90e1f0a21..59aaa90da2 100644 --- a/engines/avalanche/acci.cpp +++ b/engines/avalanche/acci.cpp @@ -575,7 +575,7 @@ void Acci::storeInterrogation(byte interrogation) { _vm->_gyro->_spareEvening.clear(); _vm->_gyro->_spareEvening = _vm->_parser->_inputText; _vm->_scrolls->displayScrollChain('z', 5); // His closing statement... - _vm->_animation->_sprites[1].walkTo(4); // The end of the drawbridge + _vm->_animation->_sprites[1].walkTo(3); // The end of the drawbridge _vm->_animation->_sprites[1]._vanishIfStill = true; // Then go away! _vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; _vm->_gyro->_cardiffQuestionNum = 5; @@ -1229,7 +1229,7 @@ void Acci::notInOrder() { void Acci::goToCauldron() { _vm->_animation->_sprites[1]._callEachStepFl = false; // Stops Geida_Procs. _vm->_timer->addTimer(1, Timer::kProcSpludwickGoesToCauldron, Timer::kReasonSpludwickWalk); - _vm->_animation->_sprites[1].walkTo(2); + _vm->_animation->_sprites[1].walkTo(1); } /** @@ -1899,7 +1899,7 @@ void Acci::doThat() { Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1]; spr->init(1, false, _vm->_animation); // Avaricius _vm->_animation->appearPed(2, 4); - spr->walkTo(5); + spr->walkTo(4); spr->_callEachStepFl = true; spr->_eachStepProc = Animation::kProcBackAndForth; _vm->_gyro->_avariciusTalk = 14; @@ -2065,7 +2065,7 @@ void Acci::doThat() { _vm->_lucerna->refreshObjectList(); _vm->_gyro->_magics[11]._operation = Gyro::kMagicNothing; _vm->_lucerna->incScore(7); - _vm->_animation->_sprites[1].walkTo(2); + _vm->_animation->_sprites[1].walkTo(1); _vm->_animation->_sprites[1]._vanishIfStill = true; _vm->_animation->_sprites[1]._callEachStepFl = false; _vm->_gyro->_whereIs[7] = 177; @@ -2191,7 +2191,7 @@ void Acci::doThat() { if (_vm->_gyro->_sittingInPub) _vm->_scrolls->displayText("You're already sitting!"); else { - _vm->_animation->_sprites[0].walkTo(4); // Move Avvy to the place, and sit him down. + _vm->_animation->_sprites[0].walkTo(3); // Move Avvy to the place, and sit him down. _vm->_timer->addTimer(1, Timer::kProcAvvySitDown, Timer::kReasonSittingDown); } } else { // Default doodah. diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 5f89ccb224..8ece6b1f40 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -268,7 +268,7 @@ int8 AnimationType::getSign(int16 val) { } void AnimationType::walkTo(byte pedNum) { - PedType *curPed = &_anim->_vm->_gyro->_peds[pedNum - 1]; // Pascal -> C conversion: different array indexes. + PedType *curPed = &_anim->_vm->_gyro->_peds[pedNum]; setSpeed(getSign(curPed->_x - _x) * 4, getSign(curPed->_y - _y)); _homingX = curPed->_x - _info._xLength / 2; @@ -766,7 +766,7 @@ void Animation::callSpecial(uint16 which) { if (!_vm->_gyro->_arrowTriggered) { _vm->_gyro->_arrowTriggered = true; appearPed(2, 4); // The dart starts at ped 4, and... - _sprites[1].walkTo(5); // flies to ped 5. + _sprites[1].walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion). _sprites[1]._facingDir = kDirUp; // Only face. // Should call some kind of Eachstep procedure which will deallocate // the sprite when it hits the wall, and replace it with the chunk @@ -794,7 +794,7 @@ void Animation::callSpecial(uint16 which) { _vm->_scrolls->displayScrollChain('q', 36); _vm->_gyro->_tiedUp = true; _vm->_gyro->_friarWillTieYouUp = false; - _sprites[1].walkTo(3); + _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. @@ -831,7 +831,7 @@ void Animation::callSpecial(uint16 which) { if (!_vm->_gyro->_geidaFollows) return; // DOESN'T COUNT: no Geida. _sprites[1]._callEachStepFl = false; // She no longer follows Avvy around. - _sprites[1].walkTo(4); // She walks to somewhere... + _sprites[1].walkTo(3); // She walks to somewhere... _sprites[0].remove(); // Lose Avvy. _vm->_gyro->_userMovesAvvy = false; _vm->_timer->addTimer(40, Timer::kProcRobinHoodAndGeida, Timer::kReasonRobinHoodAndGeida); @@ -1035,9 +1035,9 @@ void Animation::followAvalotY(byte tripnum) { void Animation::backAndForth(byte tripnum) { if (!_sprites[tripnum]._homing) { if (_sprites[tripnum]._facingDir == kDirRight) - _sprites[tripnum].walkTo(4); + _sprites[tripnum].walkTo(3); else - _sprites[tripnum].walkTo(5); + _sprites[tripnum].walkTo(4); } } diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp index ac27ea6cfc..cb9e0c9886 100644 --- a/engines/avalanche/lucerna.cpp +++ b/engines/avalanche/lucerna.cpp @@ -463,7 +463,7 @@ void Lucerna::enterRoom(byte room, byte ped) { if (_vm->_gyro->_roomCount[r__outsideyours] == 1) { _vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen. - spr1->walkTo(5); // Walks up to greet you. + spr1->walkTo(4); // Walks up to greet you. } else { _vm->_animation->appearPed(2, 5); // Starts where he was before. spr1->_facingDir = Animation::kDirLeft; @@ -478,7 +478,7 @@ void Lucerna::enterRoom(byte room, byte ped) { if (_vm->_gyro->_crapulusWillTell) { spr1->init(8, false, _vm->_animation); _vm->_animation->appearPed(2, 2); - spr1->walkTo(4); + spr1->walkTo(3); _vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut); _vm->_gyro->_crapulusWillTell = false; } @@ -523,7 +523,7 @@ void Lucerna::enterRoom(byte room, byte ped) { if (_vm->_gyro->_roomCount[r__brummieroad] == 1) { // First time here... _vm->_animation->appearPed(2, 2); // He appears on the right of the screen... - spr1->walkTo(4); // ...and he walks up... + spr1->walkTo(3); // ...and he walks up... } else { // You've been here before. _vm->_animation->appearPed(2, 4); // He's standing in your way straight away... @@ -538,7 +538,7 @@ void Lucerna::enterRoom(byte room, byte ped) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again _vm->_animation->appearPed(2, 1); - spr1->walkTo(2); + spr1->walkTo(1); spr1->_vanishIfStill = true; _vm->_gyro->_passedCwytalotInHerts = true; // _vm->_gyro->whereis[#157] = r__Nowhere; // can we fit this in? @@ -563,7 +563,7 @@ void Lucerna::enterRoom(byte room, byte ped) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; spr1->init(6, false, _vm->_animation); _vm->_animation->appearPed(2, 2); - spr1->walkTo(3); + spr1->walkTo(2); _vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp); } } @@ -588,7 +588,7 @@ void Lucerna::enterRoom(byte room, byte ped) { case 0 : // You've answered NONE of his questions. spr1->init(9, false, _vm->_animation); _vm->_animation->appearPed(2, 2); - spr1->walkTo(3); + spr1->walkTo(2); _vm->_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey); break; case 5 : @@ -727,7 +727,7 @@ void Lucerna::enterRoom(byte room, byte ped) { spr1->init(11, false, _vm->_animation); if ((_vm->_gyro->_roomCount[r__wisewomans] == 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. + spr1->walkTo(3); // Walks up to greet you. } else { _vm->_animation->appearPed(2, 4); // Starts where she was before. spr1->_facingDir = Animation::kDirLeft; diff --git a/engines/avalanche/scrolls.cpp b/engines/avalanche/scrolls.cpp index 6e1bb0b492..0390ecaa98 100644 --- a/engines/avalanche/scrolls.cpp +++ b/engines/avalanche/scrolls.cpp @@ -1055,7 +1055,7 @@ void Scrolls::talkTo(byte whom) { AnimationType *spr = &_vm->_animation->_sprites[1]; spr->_vanishIfStill = true; - spr->walkTo(3); // Walks away. + spr->walkTo(2); // Walks away. _vm->_lucerna->incScore(2); } diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp index efe5bf30b7..2380eb5ba4 100644 --- a/engines/avalanche/timer.cpp +++ b/engines/avalanche/timer.cpp @@ -273,7 +273,7 @@ void Timer::bang2() { void Timer::stairs() { _vm->_gyro->blip(); - _vm->_animation->_sprites[0].walkTo(4); + _vm->_animation->_sprites[0].walkTo(3); _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_gyro->_brummieStairs = 2; _vm->_gyro->_magics[10]._operation = Gyro::kMagicSpecial; @@ -316,8 +316,8 @@ void Timer::getTiedUp() { } void Timer::getTiedUp2() { - _vm->_animation->_sprites[0].walkTo(4); - _vm->_animation->_sprites[1].walkTo(5); + _vm->_animation->_sprites[0].walkTo(3); + _vm->_animation->_sprites[1].walkTo(4); _vm->_gyro->_magics[3]._operation = Gyro::kMagicNothing; // No effect when you touch the boundaries. _vm->_gyro->_friarWillTieYouUp = true; } @@ -330,7 +330,7 @@ void Timer::hangAround() { _vm->_gyro->_whereIs[Gyro::kPeopleRobinHood - 150] = r__robins; _vm->_animation->appearPed(1, 2); _vm->_scrolls->displayScrollChain('q', 39); - avvy->walkTo(7); + avvy->walkTo(6); addTimer(55, kProcHangAround2, kReasonHangingAround); } @@ -338,7 +338,7 @@ void Timer::hangAround2() { _vm->_scrolls->displayScrollChain('q', 40); AnimationType *spr = &_vm->_animation->_sprites[1]; spr->_vanishIfStill = false; - spr->walkTo(4); + spr->walkTo(3); _vm->_gyro->_whereIs[Gyro::kPeopleFriarTuck - 150] = r__robins; _vm->_scrolls->displayScrollChain('q', 41); _vm->_animation->_sprites[0].remove(); @@ -430,7 +430,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon AnimationType *spr = &_vm->_animation->_sprites[1]; spr->init(9, false, _vm->_animation); // Here comes the Duke. _vm->_animation->appearPed(2, 1); // He starts at the door... - spr->walkTo(3); // He walks over to you. + spr->walkTo(2); // He walks over to you. // Let's get the door opening. _vm->_celer->drawBackgroundSprite(-1, -1, 1); @@ -443,7 +443,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon void Timer::naughtyDuke2() { AnimationType *spr = &_vm->_animation->_sprites[1]; _vm->_scrolls->displayScrollChain('q', 48); // "Ha ha, it worked again!" - spr->walkTo(1); // Walk to the door. + spr->walkTo(0); // Walk to the door. spr->_vanishIfStill = true; // Then go away! addTimer(32, kProcNaughtyDuke3, kReasonNaughtyDuke); } @@ -587,7 +587,7 @@ void Timer::robinHoodAndGeida() { AnimationType *avvy = &_vm->_animation->_sprites[0]; avvy->init(7, true, _vm->_animation); _vm->_animation->appearPed(1, 7); - avvy->walkTo(6); + avvy->walkTo(5); AnimationType *spr = &_vm->_animation->_sprites[1]; spr->stopWalk(); @@ -601,8 +601,8 @@ void Timer::robinHoodAndGeidaTalk() { AnimationType *avvy = &_vm->_animation->_sprites[0]; AnimationType *spr = &_vm->_animation->_sprites[1]; - avvy->walkTo(2); - spr->walkTo(2); + avvy->walkTo(1); + spr->walkTo(1); avvy->_vanishIfStill = true; spr->_vanishIfStill = true; -- cgit v1.2.3 From ddd7a95737c3222a786298f868234a613413b5ec Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 15 Sep 2013 16:01:05 +0200 Subject: AVALANCHE: Convert index use from Pascal to C in appearPed() --- engines/avalanche/acci.cpp | 10 +++++----- engines/avalanche/animation.cpp | 24 ++++++++++++------------ engines/avalanche/lucerna.cpp | 26 +++++++++++++------------- engines/avalanche/timer.cpp | 10 +++++----- 4 files changed, 35 insertions(+), 35 deletions(-) (limited to 'engines') diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp index 59aaa90da2..d15e6d0397 100644 --- a/engines/avalanche/acci.cpp +++ b/engines/avalanche/acci.cpp @@ -1299,12 +1299,12 @@ void Acci::cardiffClimbing() { if (_vm->_gyro->_standingOnDais) { // Clamber up. _vm->_scrolls->displayText("You climb down, back onto the floor."); _vm->_gyro->_standingOnDais = false; - _vm->_animation->appearPed(1, 3); + _vm->_animation->appearPed(1, 2); } else { // Clamber down. if (_vm->_animation->inField(1)) { _vm->_scrolls->displayText("You clamber up onto the dais."); _vm->_gyro->_standingOnDais = true; - _vm->_animation->appearPed(1, 2); + _vm->_animation->appearPed(1, 1); } else _vm->_scrolls->displayText("Get a bit closer, Avvy."); } @@ -1325,7 +1325,7 @@ void Acci::standUp() { } _vm->_animation->_sprites[0]._visible = true; _vm->_gyro->_userMovesAvvy = true; - _vm->_animation->appearPed(1, 2); + _vm->_animation->appearPed(1, 1); _vm->_animation->_direction = Animation::kDirLeft; _vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow. _vm->_lucerna->incScore(1); @@ -1343,7 +1343,7 @@ void Acci::standUp() { if (_vm->_gyro->_sittingInPub) { _vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down. _vm->_animation->_sprites[0]._visible = true; // But standing up. - _vm->_animation->appearPed(1, 4); // And walking away. + _vm->_animation->appearPed(1, 3); // And walking away. _vm->_gyro->_sittingInPub = false; // Really not sitting down. _vm->_gyro->_userMovesAvvy = true; // And ambulant. } else @@ -1898,7 +1898,7 @@ void Acci::doThat() { else { Avalanche::AnimationType *spr = &_vm->_animation->_sprites[1]; spr->init(1, false, _vm->_animation); // Avaricius - _vm->_animation->appearPed(2, 4); + _vm->_animation->appearPed(2, 3); spr->walkTo(4); spr->_callEachStepFl = true; spr->_eachStepProc = Animation::kProcBackAndForth; diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index 8ece6b1f40..024718205a 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -727,7 +727,7 @@ void Animation::catacombMove(byte ped) { if ((_vm->_gyro->_geidaFollows) && (ped > 0)) { if (!_sprites[1]._quick) // If we don't already have her... _sprites[1].init(5, true, this); // ...Load Geida. - appearPed(2, geidaPed(ped)); + appearPed(2, geidaPed(ped) - 1); _sprites[1]._callEachStepFl = true; _sprites[1]._eachStepProc = kProcGeida; } @@ -765,7 +765,7 @@ void Animation::callSpecial(uint16 which) { if (!_vm->_gyro->_arrowTriggered) { _vm->_gyro->_arrowTriggered = true; - appearPed(2, 4); // The dart starts at ped 4, and... + appearPed(2, 3); // The dart starts at ped 4, and... _sprites[1].walkTo(4); // flies to ped 5 (- 1 for pascal to C conversion). _sprites[1]._facingDir = kDirUp; // Only face. // Should call some kind of Eachstep procedure which will deallocate @@ -853,13 +853,13 @@ void Animation::callSpecial(uint16 which) { return; switch ((_vm->_gyro->kCatacombMap[_vm->_gyro->_catacombY - 1][_vm->_gyro->_catacombX - 1] & 0xf00) >> 8) { case 0x1: - appearPed(1, 12); + appearPed(1, 11); break; case 0x3: - appearPed(1, 11); + appearPed(1, 10); break; default: - appearPed(1, 4); + appearPed(1, 3); } dawnDelay(); break; @@ -869,7 +869,7 @@ void Animation::callSpecial(uint16 which) { catacombMove(1); if (_vm->_gyro->_room != r__catacombs) return; - appearPed(1, 1); + appearPed(1, 0); dawnDelay(); break; case 12: // _vm->_gyro->special 12: transfer south in catacombs. @@ -878,7 +878,7 @@ void Animation::callSpecial(uint16 which) { catacombMove(2); if (_vm->_gyro->_room != r__catacombs) return; - appearPed(1, 2); + appearPed(1, 1); dawnDelay(); break; case 13: // _vm->_gyro->special 13: transfer west in catacombs. @@ -887,7 +887,7 @@ void Animation::callSpecial(uint16 which) { catacombMove(3); if (_vm->_gyro->_room != r__catacombs) return; - appearPed(1, 3); + appearPed(1, 2); dawnDelay(); break; } @@ -935,7 +935,7 @@ void Animation::openDoor(byte whither, byte ped, byte magicnum) { _vm->_sequence->startToClose(); return; } else { - appearPed(1, 6); + appearPed(1, 5); _sprites[0]._facingDir = kDirRight; // added by TT 12/3/1995 _vm->_sequence->firstShow(8); _vm->_sequence->thenShow(9); @@ -1005,7 +1005,7 @@ void Animation::changeDirection(byte t, byte dir) { void Animation::appearPed(byte sprNum, byte pedNum) { AnimationType *curSpr = &_sprites[sprNum - 1]; - PedType *curPed = &_vm->_gyro->_peds[pedNum - 1]; + PedType *curPed = &_vm->_gyro->_peds[pedNum]; curSpr->appear(curPed->_x - curSpr->_info._xLength / 2, curPed->_y - curSpr->_info._yLength, curPed->_direction); changeDirection(sprNum - 1, curPed->_direction); } @@ -1294,7 +1294,7 @@ void Animation::hideInCupboard() { } else { _sprites[0]._visible = true; _vm->_gyro->_userMovesAvvy = true; - appearPed(1, 3); // Walk out of the cupboard. + appearPed(1, 2); // Walk out of the cupboard. _vm->_scrolls->displayText("You leave the cupboard. Nice to be out of there!"); _vm->_gyro->_avvysInTheCupboard = false; _vm->_sequence->firstShow(8); @@ -1344,7 +1344,7 @@ void Animation::flipRoom(byte room, byte ped) { _vm->_gyro->_enterCatacombsFromLustiesRoom = true; _vm->_lucerna->enterRoom(room, ped); - appearPed(1, ped); + appearPed(1, ped - 1); _vm->_gyro->_enterCatacombsFromLustiesRoom = false; _oldDirection = _direction; _direction = _sprites[0]._facingDir; diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp index cb9e0c9886..dd0a647c44 100644 --- a/engines/avalanche/lucerna.cpp +++ b/engines/avalanche/lucerna.cpp @@ -415,7 +415,7 @@ void Lucerna::putGeidaAt(byte whichPed, byte &ped) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; spr1->init(5, false, _vm->_animation); // load Geida - _vm->_animation->appearPed(2, whichPed); + _vm->_animation->appearPed(2, whichPed - 1); spr1->_callEachStepFl = true; spr1->_eachStepProc = Animation::kProcGeida; } @@ -462,10 +462,10 @@ void Lucerna::enterRoom(byte room, byte ped) { spr1->init(8, false, _vm->_animation); // load Crapulus if (_vm->_gyro->_roomCount[r__outsideyours] == 1) { - _vm->_animation->appearPed(2, 4); // Start on the right-hand side of the screen. + _vm->_animation->appearPed(2, 3); // Start on the right-hand side of the screen. spr1->walkTo(4); // Walks up to greet you. } else { - _vm->_animation->appearPed(2, 5); // Starts where he was before. + _vm->_animation->appearPed(2, 4); // Starts where he was before. spr1->_facingDir = Animation::kDirLeft; } @@ -477,7 +477,7 @@ void Lucerna::enterRoom(byte room, byte ped) { if (_vm->_gyro->_crapulusWillTell) { spr1->init(8, false, _vm->_animation); - _vm->_animation->appearPed(2, 2); + _vm->_animation->appearPed(2, 1); spr1->walkTo(3); _vm->_timer->addTimer(20, Timer::kProcCrapulusSpludOut, Timer::kReasonCrapulusSaysSpludwickOut); _vm->_gyro->_crapulusWillTell = false; @@ -497,7 +497,7 @@ void Lucerna::enterRoom(byte room, byte ped) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; if (ped > 0) { spr1->init(2, false, _vm->_animation); // load Spludwick - _vm->_animation->appearPed(2, 2); + _vm->_animation->appearPed(2, 1); _vm->_gyro->_whereIs[1] = r__spludwicks; } @@ -522,11 +522,11 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__brummieroad; if (_vm->_gyro->_roomCount[r__brummieroad] == 1) { // First time here... - _vm->_animation->appearPed(2, 2); // He appears on the right of the screen... + _vm->_animation->appearPed(2, 1); // He appears on the right of the screen... spr1->walkTo(3); // ...and he walks up... } else { // You've been here before. - _vm->_animation->appearPed(2, 4); // He's standing in your way straight away... + _vm->_animation->appearPed(2, 3); // He's standing in your way straight away... spr1->_facingDir = Animation::kDirLeft; } } @@ -537,7 +537,7 @@ void Lucerna::enterRoom(byte room, byte ped) { if ((_vm->_gyro->_cwytalotGone) && (!_vm->_gyro->_passedCwytalotInHerts) && (ped == 2) && (_vm->_gyro->_roomCount[r__argentroad] > 3)) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; spr1->init(4, false, _vm->_animation); // 4 = Cwytalot again - _vm->_animation->appearPed(2, 1); + _vm->_animation->appearPed(2, 0); spr1->walkTo(1); spr1->_vanishIfStill = true; _vm->_gyro->_passedCwytalotInHerts = true; @@ -562,7 +562,7 @@ void Lucerna::enterRoom(byte room, byte ped) { // A welcome party... or maybe not... AnimationType *spr1 = &_vm->_animation->_sprites[1]; spr1->init(6, false, _vm->_animation); - _vm->_animation->appearPed(2, 2); + _vm->_animation->appearPed(2, 1); spr1->walkTo(2); _vm->_timer->addTimer(36, Timer::kProcGetTiedUp, Timer::kReasonGettingTiedUp); } @@ -587,7 +587,7 @@ void Lucerna::enterRoom(byte room, byte ped) { switch (_vm->_gyro->_cardiffQuestionNum) { case 0 : // You've answered NONE of his questions. spr1->init(9, false, _vm->_animation); - _vm->_animation->appearPed(2, 2); + _vm->_animation->appearPed(2, 1); spr1->walkTo(2); _vm->_timer->addTimer(47, Timer::kProcCardiffSurvey, Timer::kReasonCardiffsurvey); break; @@ -596,7 +596,7 @@ void Lucerna::enterRoom(byte room, byte ped) { break; // You've answered ALL his questions. => nothing happens. default: // You've answered SOME of his questions. spr1->init(9, false, _vm->_animation); - _vm->_animation->appearPed(2, 3); + _vm->_animation->appearPed(2, 2); spr1->_facingDir = Animation::kDirRight; _vm->_timer->addTimer(3, Timer::kProcCardiffReturn, Timer::kReasonCardiffsurvey); } @@ -726,10 +726,10 @@ void Lucerna::enterRoom(byte room, byte ped) { AnimationType *spr1 = &_vm->_animation->_sprites[1]; spr1->init(11, false, _vm->_animation); if ((_vm->_gyro->_roomCount[r__wisewomans] == 1) && (ped > 0)) { - _vm->_animation->appearPed(2, 2); // Start on the right-hand side of the screen. + _vm->_animation->appearPed(2, 1); // Start on the right-hand side of the screen. spr1->walkTo(3); // Walks up to greet you. } else { - _vm->_animation->appearPed(2, 4); // Starts where she was before. + _vm->_animation->appearPed(2, 3); // Starts where she was before. spr1->_facingDir = Animation::kDirLeft; } diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp index 2380eb5ba4..faab01c742 100644 --- a/engines/avalanche/timer.cpp +++ b/engines/avalanche/timer.cpp @@ -328,7 +328,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->_animation->appearPed(1, 2); + _vm->_animation->appearPed(1, 1); _vm->_scrolls->displayScrollChain('q', 39); avvy->walkTo(6); addTimer(55, kProcHangAround2, kReasonHangingAround); @@ -358,7 +358,7 @@ void Timer::afterTheShootemup() { // Only placed this here to replace the minigame. TODO: Remove it when the shoot em' up is implemented! _vm->_animation->_sprites[0].init(0, true, _vm->_animation); // Avalot. - _vm->_animation->appearPed(1, 2); + _vm->_animation->appearPed(1, 1); _vm->_gyro->_userMovesAvvy = true; _vm->_gyro->_objects[Gyro::kObjectCrossbow - 1] = true; _vm->_lucerna->refreshObjectList(); @@ -429,7 +429,7 @@ void Timer::jacquesWakesUp() { void Timer::naughtyDuke() { // This is when the Duke comes in and takes your money. AnimationType *spr = &_vm->_animation->_sprites[1]; spr->init(9, false, _vm->_animation); // Here comes the Duke. - _vm->_animation->appearPed(2, 1); // He starts at the door... + _vm->_animation->appearPed(2, 0); // He starts at the door... spr->walkTo(2); // He walks over to you. // Let's get the door opening. @@ -586,7 +586,7 @@ void Timer::riseUpOubliette() { void Timer::robinHoodAndGeida() { AnimationType *avvy = &_vm->_animation->_sprites[0]; avvy->init(7, true, _vm->_animation); - _vm->_animation->appearPed(1, 7); + _vm->_animation->appearPed(1, 6); avvy->walkTo(5); AnimationType *spr = &_vm->_animation->_sprites[1]; @@ -615,7 +615,7 @@ void Timer::avalotReturns() { avvy->remove(); spr->remove(); avvy->init(0, true, _vm->_animation); - _vm->_animation->appearPed(1, 1); + _vm->_animation->appearPed(1, 0); _vm->_scrolls->displayScrollChain('q', 67); _vm->_gyro->_userMovesAvvy = true; } -- cgit v1.2.3 From 83ee99a3814a33d1a9e174cf3b6379d741a516ef Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sun, 15 Sep 2013 16:26:25 +0200 Subject: AVALANCHE: Convert index use from Pascal to C in putGeidaAt() --- engines/avalanche/lucerna.cpp | 18 ++++++++---------- engines/avalanche/lucerna.h | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'engines') diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp index dd0a647c44..097b5da466 100644 --- a/engines/avalanche/lucerna.cpp +++ b/engines/avalanche/lucerna.cpp @@ -407,15 +407,13 @@ void Lucerna::enterNewTown() { } } - - -void Lucerna::putGeidaAt(byte whichPed, byte &ped) { +void Lucerna::putGeidaAt(byte whichPed, byte ped) { if (ped == 0) return; AnimationType *spr1 = &_vm->_animation->_sprites[1]; spr1->init(5, false, _vm->_animation); // load Geida - _vm->_animation->appearPed(2, whichPed - 1); + _vm->_animation->appearPed(2, whichPed); spr1->_callEachStepFl = true; spr1->_eachStepProc = Animation::kProcGeida; } @@ -509,7 +507,7 @@ void Lucerna::enterRoom(byte room, byte ped) { case r__brummieroad: if (_vm->_gyro->_geidaFollows) - putGeidaAt(5, ped); + putGeidaAt(4, ped); if (_vm->_gyro->_cwytalotGone) { _vm->_gyro->_magics[kColorLightred - 1]._operation = Gyro::kMagicNothing; _vm->_gyro->_whereIs[Gyro::kPeopleCwytalot - 150] = r__nowhere; @@ -553,7 +551,7 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge. } if (_vm->_gyro->_geidaFollows) - putGeidaAt(ped + 3, ped); // load Geida + putGeidaAt(ped + 2, ped); // load Geida break; case r__robins: @@ -672,7 +670,7 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_timer->addTimer(3, Timer::kProcGreetsMonk, Timer::kReasonDuLustieTalks); if (_vm->_gyro->_geidaFollows) { - putGeidaAt(5, ped); + putGeidaAt(4, ped); if (_vm->_gyro->_lustieIsAsleep) { _vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_graphics->refreshBackground(); @@ -802,18 +800,18 @@ void Lucerna::enterRoom(byte room, byte ped) { break; // Ayles awake. case r__geidas: - putGeidaAt(2, ped); + putGeidaAt(1, ped); break; // load Geida case r__easthall: case r__westhall: if (_vm->_gyro->_geidaFollows) - putGeidaAt(ped + 2, ped); + putGeidaAt(ped + 1, ped); break; case r__lusties: if (_vm->_gyro->_geidaFollows) - putGeidaAt(ped + 6, ped); + putGeidaAt(ped + 5, ped); break; case r__nottspub: diff --git a/engines/avalanche/lucerna.h b/engines/avalanche/lucerna.h index 9c1cc6ce44..87b1931e25 100644 --- a/engines/avalanche/lucerna.h +++ b/engines/avalanche/lucerna.h @@ -107,7 +107,7 @@ private: void zoomOut(int16 x, int16 y); // Only used when entering the map. void enterNewTown(); void findPeople(byte room); - void putGeidaAt(byte whichPed, byte &ped); + void putGeidaAt(byte whichPed, byte ped); void guideAvvy(Common::Point cursorPos); // Will be used in dusk() and dawn(). -- cgit v1.2.3