diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/acci.cpp | 30 | ||||
-rw-r--r-- | engines/avalanche/animation.cpp | 110 | ||||
-rw-r--r-- | engines/avalanche/celer.cpp | 71 | ||||
-rw-r--r-- | engines/avalanche/celer.h | 2 | ||||
-rw-r--r-- | engines/avalanche/lucerna.cpp | 44 | ||||
-rw-r--r-- | engines/avalanche/sequence.cpp | 2 | ||||
-rw-r--r-- | engines/avalanche/timer.cpp | 26 |
7 files changed, 141 insertions, 144 deletions
diff --git a/engines/avalanche/acci.cpp b/engines/avalanche/acci.cpp index ba8dbbdef9..3b46053e56 100644 --- a/engines/avalanche/acci.cpp +++ b/engines/avalanche/acci.cpp @@ -871,7 +871,7 @@ bool Acci::isHolding() { void Acci::openBox(bool isOpening) { if ((_vm->_gyro->_room == kRoomYours) && (_thing == 54)) { - _vm->_celer->drawBackgroundSprite(-1, -1, 5); + _vm->_celer->drawBackgroundSprite(-1, -1, 4); _vm->_celer->updateBackgroundSprites(); _vm->_animation->animLink(); @@ -880,7 +880,7 @@ void Acci::openBox(bool isOpening) { _vm->_system->delayMillis(55); if (!isOpening) { - _vm->_celer->drawBackgroundSprite(-1, -1, 6); + _vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_celer->updateBackgroundSprites(); _vm->_animation->animLink(); _vm->_graphics->refreshScreen(); @@ -1315,7 +1315,7 @@ void Acci::standUp() { _vm->_gyro->_userMovesAvvy = true; _vm->_animation->appearPed(0, 1); _vm->_animation->_direction = Animation::kDirLeft; - _vm->_celer->drawBackgroundSprite(-1, -1, 4); // Picture of empty pillow. + _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of empty pillow. _vm->_lucerna->incScore(1); _vm->_gyro->_avvyInBed = false; _vm->_timer->loseTimer(Timer::kReasonArkataShouts); @@ -1329,7 +1329,7 @@ void Acci::standUp() { case kRoomNottsPub: if (_vm->_gyro->_sittingInPub) { - _vm->_celer->drawBackgroundSprite(-1, -1, 4); // Not sitting down. + _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Not sitting down. _vm->_animation->_sprites[0]._visible = true; // But standing up. _vm->_animation->appearPed(0, 3); // And walking away. _vm->_gyro->_sittingInPub = false; // Really not sitting down. @@ -1347,12 +1347,12 @@ void Acci::getProc(char thing) { case kRoomYours: if (_vm->_animation->inField(1)) { if (_vm->_gyro->_boxContent == thing) { - _vm->_celer->drawBackgroundSprite(-1, -1, 5); + _vm->_celer->drawBackgroundSprite(-1, -1, 4); _vm->_scrolls->displayText("OK, I've got it."); _vm->_gyro->_objects[thing - 1] = true; _vm->_lucerna->refreshObjectList(); _vm->_gyro->_boxContent = kNothing; - _vm->_celer->drawBackgroundSprite(-1, -1, 6); + _vm->_celer->drawBackgroundSprite(-1, -1, 5); } else { Common::String tmpStr = Common::String::format("I can't see %s in the box.", _vm->_gyro->getItem(thing).c_str()); _vm->_scrolls->displayText(tmpStr); @@ -1368,7 +1368,7 @@ void Acci::getProc(char thing) { _vm->_scrolls->displayText("It's not there, Avvy."); else { // OK: we're taking the pen, and it's there. - _vm->_celer->drawBackgroundSprite(-1, -1, 4); // No pen there now. + _vm->_celer->drawBackgroundSprite(-1, -1, 3); // No pen there now. _vm->_animation->callSpecial(3); // Zap! _vm->_gyro->_takenPen = true; _vm->_gyro->_objects[Gyro::kObjectPen - 1] = true; @@ -1389,7 +1389,7 @@ void Acci::getProc(char thing) { break; case kRoomRobins: if ((thing == Gyro::kObjectMushroom) & (_vm->_animation->inField(0)) & (_vm->_gyro->_mushroomGrowing)) { - _vm->_celer->drawBackgroundSprite(-1, -1, 3); + _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_scrolls->displayText("Got it!"); _vm->_gyro->_mushroomGrowing = false; _vm->_gyro->_takenMushroom = true; @@ -1608,8 +1608,8 @@ void Acci::doThat() { _vm->_gyro->_objects[Gyro::kObjectBadge - 1] = false; _vm->_gyro->_objects[Gyro::kObjectHabit - 1] = true; _vm->_gyro->_givenBadgeToIby = true; + _vm->_celer->drawBackgroundSprite(-1, -1, 7); _vm->_celer->drawBackgroundSprite(-1, -1, 8); - _vm->_celer->drawBackgroundSprite(-1, -1, 9); } else heyThanks(); break; @@ -1791,7 +1791,7 @@ void Acci::doThat() { _vm->_gyro->_objects[Gyro::kObjectLute - 1] = true; _vm->_lucerna->refreshObjectList(); _vm->_gyro->_wonNim = true; - _vm->_celer->drawBackgroundSprite(-1, -1, 1); // Show the settle with no lute on it. + _vm->_celer->drawBackgroundSprite(-1, -1, 0); // Show the settle with no lute on it. _vm->_lucerna->incScore(7); // 7 points for winning! if (_vm->_gyro->_playedNim == 1) @@ -1953,11 +1953,11 @@ void Acci::doThat() { if (_vm->_gyro->_alcoholLevel == 0) _vm->_lucerna->incScore(3); - _vm->_celer->drawBackgroundSprite(-1, -1, 12); + _vm->_celer->drawBackgroundSprite(-1, -1, 11); _vm->_scrolls->displayText(booze[_thing - 51] + ", please." + Scrolls::kControlRegister + '1' + Scrolls::kControlSpeechBubble); _vm->_gyro->_drinking = _thing; - _vm->_celer->drawBackgroundSprite(-1, -1, 10); + _vm->_celer->drawBackgroundSprite(-1, -1, 9); _vm->_gyro->_malagauche = 177; _vm->_timer->addTimer(27, Timer::kProcBuyDrinks, Timer::kReasonDrinks); break; @@ -1978,12 +1978,12 @@ void Acci::doThat() { return; } - _vm->_celer->drawBackgroundSprite(-1, -1, 12); + _vm->_celer->drawBackgroundSprite(-1, -1, 11); Common::String tmpStr = Common::String::format("Wine, please.%c1%c", Scrolls::kControlRegister, Scrolls::kControlSpeechBubble); _vm->_scrolls->displayText(tmpStr); if (_vm->_gyro->_alcoholLevel == 0) _vm->_lucerna->incScore(3); - _vm->_celer->drawBackgroundSprite(-1, -1, 10); + _vm->_celer->drawBackgroundSprite(-1, -1, 9); _vm->_gyro->_malagauche = 177; _vm->_timer->addTimer(27, Timer::kProcBuyWine, Timer::kReasonDrinks); @@ -2153,7 +2153,7 @@ void Acci::doThat() { _vm->_gyro->_avvyIsAwake = true; _vm->_lucerna->incScore(1); _vm->_gyro->_avvyInBed = true; - _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Picture of Avvy, awake in bed. + _vm->_celer->drawBackgroundSprite(-1, -1, 2); // Picture of Avvy, awake in bed. if (_vm->_gyro->_teetotal) _vm->_scrolls->displayScrollChain('d', 13); } else diff --git a/engines/avalanche/animation.cpp b/engines/avalanche/animation.cpp index f3076da63a..3bd3bde1a3 100644 --- a/engines/avalanche/animation.cpp +++ b/engines/avalanche/animation.cpp @@ -464,59 +464,59 @@ void Animation::catacombMove(byte ped) { _vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 28); + _vm->_celer->drawBackgroundSprite(-1, -1, 27); break; case 0x1: // no connection (wall + shield), _vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield. + _vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 28); // ...shield. break; case 0x2: // wall with door _vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door. + _vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door. break; case 0x3: // wall with door and shield _vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and... - _vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...shield. + _vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door, and... + _vm->_celer->drawBackgroundSprite(-1, -1, 28); // ...shield. break; case 0x4: // no connection (wall + window), _vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 5); // ...window. + _vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 4); // ...window. break; case 0x5: // wall with door and window _vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and... - _vm->_celer->drawBackgroundSprite(-1, -1, 5); // ...window. + _vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door, and... + _vm->_celer->drawBackgroundSprite(-1, -1, 4); // ...window. break; case 0x6: // no connection (wall + torches), _vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[4]._operation = Gyro::kMagicNothing; // No door. - _vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches. + _vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 6); // ...torches. break; case 0x7: // wall with door and torches _vm->_gyro->_magics[1]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[2]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[4]._operation = Gyro::kMagicSpecial; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 28); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 30); // ...door, and... - _vm->_celer->drawBackgroundSprite(-1, -1, 7); // ...torches. + _vm->_celer->drawBackgroundSprite(-1, -1, 27); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 29); // ...door, and... + _vm->_celer->drawBackgroundSprite(-1, -1, 6); // ...torches. break; case 0xf: // straight-through corridor. _vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // Sloping wall. @@ -531,44 +531,44 @@ void Animation::catacombMove(byte ped) { _vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 19); + _vm->_celer->drawBackgroundSprite(-1, -1, 18); break; case 0x1: // no connection (wall + window), _vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window. + _vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 19); // ...window. break; case 0x2: // wall with door _vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door. + _vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door. break; case 0x3: // wall with door and window _vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and... - _vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...window. + _vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 19); // ...door, and... + _vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...window. break; case 0x6: // no connection (wall + torches), _vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[6]._operation = Gyro::kMagicNothing; // No door. - _vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches. + _vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 17); // ...torches. break; case 0x7: // wall with door and torches _vm->_gyro->_magics[4]._operation = Gyro::kMagicBounce; // Sloping wall. _vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // Straight wall. _vm->_gyro->_portals[6]._operation = Gyro::kMagicSpecial; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 19); // Wall, plus... - _vm->_celer->drawBackgroundSprite(-1, -1, 21); // ...door, and... - _vm->_celer->drawBackgroundSprite(-1, -1, 18); // ...torches. + _vm->_celer->drawBackgroundSprite(-1, -1, 18); // Wall, plus... + _vm->_celer->drawBackgroundSprite(-1, -1, 20); // ...door, and... + _vm->_celer->drawBackgroundSprite(-1, -1, 17); // ...torches. break; case 0xf: // straight-through corridor. _vm->_gyro->_magics[4]._operation = Gyro::kMagicNothing; // Sloping wall. @@ -586,7 +586,7 @@ void Animation::catacombMove(byte ped) { _vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce; break; case 0x1: - _vm->_celer->drawBackgroundSprite(-1, -1, 22); + _vm->_celer->drawBackgroundSprite(-1, -1, 21); if ((xy_uint16 == 2051) && (_vm->_gyro->_geidaFollows)) _vm->_gyro->_magics[12]._operation = Gyro::kMagicExclaim; @@ -597,13 +597,13 @@ void Animation::catacombMove(byte ped) { _vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce; break; case 0x2: - _vm->_celer->drawBackgroundSprite(-1, -1, 23); + _vm->_celer->drawBackgroundSprite(-1, -1, 22); _vm->_gyro->_magics[6]._operation = Gyro::kMagicSpecial; // Middle exit south. _vm->_gyro->_magics[11]._operation = Gyro::kMagicBounce; _vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce; break; case 0x3: - _vm->_celer->drawBackgroundSprite(-1, -1, 24); + _vm->_celer->drawBackgroundSprite(-1, -1, 23); _vm->_gyro->_magics[11]._operation = Gyro::kMagicSpecial; // Left exit south. _vm->_gyro->_magics[6]._operation = Gyro::kMagicBounce; _vm->_gyro->_magics[12]._operation = Gyro::kMagicBounce; @@ -624,7 +624,7 @@ void Animation::catacombMove(byte ped) { break; #endif case 0x2: - _vm->_celer->drawBackgroundSprite(-1, -1, 4); + _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; // Middle exit north. _vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door. break; @@ -642,7 +642,7 @@ void Animation::catacombMove(byte ped) { break; #endif case 0x5: - _vm->_celer->drawBackgroundSprite(-1, -1, 3); + _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; // Middle exit north. _vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door. break; @@ -657,12 +657,12 @@ void Animation::catacombMove(byte ped) { case 0x7: case 0x8: case 0x9: - _vm->_celer->drawBackgroundSprite(-1, -1, 6); + _vm->_celer->drawBackgroundSprite(-1, -1, 5); if (((here & 0xf000) >> 12) > 0x7) - _vm->_celer->drawBackgroundSprite(-1, -1, 31); + _vm->_celer->drawBackgroundSprite(-1, -1, 30); if (((here & 0xf000) >> 12) == 0x9) - _vm->_celer->drawBackgroundSprite(-1, -1, 32); + _vm->_celer->drawBackgroundSprite(-1, -1, 31); _vm->_gyro->_magics[0]._operation = Gyro::kMagicSpecial; // Middle arch north. _vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door. @@ -671,50 +671,50 @@ void Animation::catacombMove(byte ped) { case 0xd: // No connection + WINDOW _vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; _vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 14); + _vm->_celer->drawBackgroundSprite(-1, -1, 13); break; case 0xe: // No connection + TORCH _vm->_gyro->_magics[0]._operation = Gyro::kMagicBounce; _vm->_gyro->_portals[3]._operation = Gyro::kMagicNothing; // Door. - _vm->_celer->drawBackgroundSprite(-1, -1, 8); + _vm->_celer->drawBackgroundSprite(-1, -1, 7); break; // Recessed door: case 0xf: _vm->_gyro->_magics[0]._operation = Gyro::kMagicNothing; // Door to Geida's room. - _vm->_celer->drawBackgroundSprite(-1, -1, 1); + _vm->_celer->drawBackgroundSprite(-1, -1, 0); _vm->_gyro->_portals[3]._operation = Gyro::kMagicSpecial; // Door. break; } switch (xy_uint16) { case 514: - _vm->_celer->drawBackgroundSprite(-1, -1, 17); + _vm->_celer->drawBackgroundSprite(-1, -1, 16); break; // [2,2] : "Art Gallery" sign over door. case 264: - _vm->_celer->drawBackgroundSprite(-1, -1, 9); + _vm->_celer->drawBackgroundSprite(-1, -1, 8); break; // [8,1] : "The Wrong Way!" sign. case 1797: - _vm->_celer->drawBackgroundSprite(-1, -1, 2); + _vm->_celer->drawBackgroundSprite(-1, -1, 1); break; // [5,7] : "Ite Mingite" sign. case 258: for (int i = 0; i <= 2; i++) { // [2,1] : Art gallery - pictures - _vm->_celer->drawBackgroundSprite(130 + i * 120, 70, 15); - _vm->_celer->drawBackgroundSprite(184 + i * 120, 78, 16); + _vm->_celer->drawBackgroundSprite(130 + i * 120, 70, 14); + _vm->_celer->drawBackgroundSprite(184 + i * 120, 78, 15); } break; case 1287: for (int i = 10; i <= 13; i++) - _vm->_celer->drawBackgroundSprite(-1, -1, i); + _vm->_celer->drawBackgroundSprite(-1, -1, i - 1); break; // [7,5] : 4 candles. case 776: - _vm->_celer->drawBackgroundSprite(-1, -1, 10); + _vm->_celer->drawBackgroundSprite(-1, -1, 9); break; // [8,3] : 1 candle. case 2049: - _vm->_celer->drawBackgroundSprite(-1, -1, 11); + _vm->_celer->drawBackgroundSprite(-1, -1, 10); break; // [1,8] : another candle. case 257: + _vm->_celer->drawBackgroundSprite(-1, -1, 11); _vm->_celer->drawBackgroundSprite(-1, -1, 12); - _vm->_celer->drawBackgroundSprite(-1, -1, 13); break; // [1,1] : the other two. } @@ -735,7 +735,7 @@ void Animation::dawnDelay() { void Animation::callSpecial(uint16 which) { switch (which) { case 1: // _vm->_gyro->special 1: Room 22: top of stairs. - _vm->_celer->drawBackgroundSprite(-1, -1, 1); + _vm->_celer->drawBackgroundSprite(-1, -1, 0); _vm->_gyro->_brummieStairs = 1; _vm->_gyro->_magics[9]._operation = Gyro::kMagicNothing; _vm->_timer->addTimer(10, Timer::kProcStairs, Timer::kReasonBrummieStairs); @@ -782,7 +782,7 @@ void Animation::callSpecial(uint16 which) { _vm->_scrolls->displayScrollChain('q', 35); _sprites[0].remove(); //tr[1].vanishifstill:=true; - _vm->_celer->drawBackgroundSprite(-1, -1, 2); + _vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_scrolls->displayScrollChain('q', 36); _vm->_gyro->_tiedUp = true; _vm->_gyro->_friarWillTieYouUp = false; @@ -1075,7 +1075,7 @@ void Animation::arrowProcs(byte tripnum) { } } else { // Arrow has hit the wall! _sprites[tripnum].remove(); // Deallocate the arrow. - _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Show pic of arrow stuck into the door. + _vm->_celer->drawBackgroundSprite(-1, -1, 2); // Show pic of arrow stuck into the door. _vm->_gyro->_arrowInTheDoor = true; // So that we can pick it up. } @@ -1301,7 +1301,7 @@ void Animation::hideInCupboard() { "but dusty, cupboard. Hmmmm... you leave the door slightly open to avoid suffocation.", Scrolls::kControlParagraph); _vm->_scrolls->displayText(tmpStr); _vm->_gyro->_avvysInTheCupboard = true; - _vm->_celer->drawBackgroundSprite(-1, -1, 8); + _vm->_celer->drawBackgroundSprite(-1, -1, 7); } } diff --git a/engines/avalanche/celer.cpp b/engines/avalanche/celer.cpp index 3efcdc48c0..f6e3773ae3 100644 --- a/engines/avalanche/celer.cpp +++ b/engines/avalanche/celer.cpp @@ -60,19 +60,19 @@ void Celer::updateBackgroundSprites() { switch (_vm->_gyro->_room) { case kRoomOutsideArgentPub: if ((_vm->_gyro->_roomTime % 12) == 0) - drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 4); + drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 12) % 4); break; case kRoomBrummieRoad: if ((_vm->_gyro->_roomTime % 2) == 0) - drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 2) % 4); + drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 2) % 4); break; case kRoomBridge: if ((_vm->_gyro->_roomTime % 2) == 0) - drawBackgroundSprite(-1, -1, 4 + (_vm->_gyro->_roomTime / 2) % 4); + drawBackgroundSprite(-1, -1, 3 + (_vm->_gyro->_roomTime / 2) % 4); break; case kRoomYours: if ((!_vm->_gyro->_avvyIsAwake) && ((_vm->_gyro->_roomTime % 4) == 0)) - drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 12) % 2); + drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 12) % 2); break; case kRoomArgentPub: if (((_vm->_gyro->_roomTime % 7) == 1) && (_vm->_gyro->_malagauche != 177)) { @@ -82,16 +82,16 @@ void Celer::updateBackgroundSprites() { case 1: case 11: case 21: - drawBackgroundSprite(-1, -1, 12); // Looks forwards. + drawBackgroundSprite(-1, -1, 11); // Looks forwards. break; case 8: case 18: case 28: case 32: - drawBackgroundSprite(-1, -1, 11); // Looks at you. + drawBackgroundSprite(-1, -1, 10); // Looks at you. break; case 30: - drawBackgroundSprite(-1, -1, 13); // Winks. + drawBackgroundSprite(-1, -1, 12); // Winks. break; case 33: _vm->_gyro->_malagauche = 0; @@ -102,14 +102,14 @@ void Celer::updateBackgroundSprites() { switch (_vm->_gyro->_roomTime % 200) { case 179: case 197: - drawBackgroundSprite(-1, -1, 5); // Dogfood's drinking cycle. + drawBackgroundSprite(-1, -1, 4); // Dogfood's drinking cycle. break; case 182: case 194: - drawBackgroundSprite(-1, -1, 6); + drawBackgroundSprite(-1, -1, 5); break; case 185: - drawBackgroundSprite(-1, -1, 7); + drawBackgroundSprite(-1, -1, 6); break; case 199: _vm->_gyro->_npcFacing = 177; // Impossible value for this. @@ -127,7 +127,7 @@ void Celer::updateBackgroundSprites() { direction = 4; if (direction != _vm->_gyro->_npcFacing) { // Dogfood. - drawBackgroundSprite(-1, -1, direction); + drawBackgroundSprite(-1, -1, direction - 1); _vm->_gyro->_npcFacing = direction; } } @@ -136,16 +136,16 @@ void Celer::updateBackgroundSprites() { if ((_vm->_gyro->_roomTime % 3) == 0) { switch ((_vm->_gyro->_roomTime / int32(3)) % int32(6)) { case 4: - drawBackgroundSprite(-1, -1, 1); + drawBackgroundSprite(-1, -1, 0); break; case 1: case 3: case 5: - drawBackgroundSprite(-1, -1, 2); + drawBackgroundSprite(-1, -1, 1); break; case 0: case 2: - drawBackgroundSprite(-1, -1, 3); + drawBackgroundSprite(-1, -1, 2); break; } } @@ -165,7 +165,7 @@ void Celer::updateBackgroundSprites() { direction = 3; // Right. if (direction != _vm->_gyro->_npcFacing) { // du Lustie. - drawBackgroundSprite(-1, -1, direction); + drawBackgroundSprite(-1, -1, direction - 1); _vm->_gyro->_npcFacing = direction; } } @@ -174,10 +174,10 @@ void Celer::updateBackgroundSprites() { if ((!_vm->_gyro->_aylesIsAwake) && (_vm->_gyro->_roomTime % 14 == 0)) { switch ((_vm->_gyro->_roomTime / 14) % 2) { case 0: - drawBackgroundSprite(-1, -1, 1); // Frame 2: EGA. + drawBackgroundSprite(-1, -1, 0); // Frame 2: EGA. break; case 1: - drawBackgroundSprite(-1, -1, 3); // Frame 1: Natural. + drawBackgroundSprite(-1, -1, 2); // Frame 1: Natural. break; } } @@ -186,10 +186,10 @@ void Celer::updateBackgroundSprites() { if (_vm->_gyro->_tiedUp) { switch (_vm->_gyro->_roomTime % 54) { case 20: - drawBackgroundSprite(-1, -1, 4); // Frame 4: Avalot blinks. + drawBackgroundSprite(-1, -1, 3); // Frame 4: Avalot blinks. break; case 23: - drawBackgroundSprite(-1, -1, 2); // Frame 1: Back to normal. + drawBackgroundSprite(-1, -1, 1); // Frame 1: Back to normal. break; } } @@ -209,23 +209,23 @@ void Celer::updateBackgroundSprites() { direction--; // Blinks. if (direction != _vm->_gyro->_npcFacing) { // Port. - drawBackgroundSprite(-1, -1, direction); + drawBackgroundSprite(-1, -1, direction - 1); _vm->_gyro->_npcFacing = direction; } switch (_vm->_gyro->_roomTime % 50) { case 45 : - drawBackgroundSprite(-1, -1, 9); // Spurge blinks. + drawBackgroundSprite(-1, -1, 8); // Spurge blinks. break; case 49 : - drawBackgroundSprite(-1, -1, 10); + drawBackgroundSprite(-1, -1, 9); break; } break; } case kRoomDucks: { if ((_vm->_gyro->_roomTime % 3) == 0) // The fire flickers. - drawBackgroundSprite(-1, -1, 1 + (_vm->_gyro->_roomTime / 3) % 3); + drawBackgroundSprite(-1, -1, (_vm->_gyro->_roomTime / 3) % 3); // Bearing of Avvy from Duck. byte direction = 0; @@ -241,7 +241,7 @@ void Celer::updateBackgroundSprites() { direction++; // Duck blinks. if (direction != _vm->_gyro->_npcFacing) { // Duck. - drawBackgroundSprite(-1, -1, direction); + drawBackgroundSprite(-1, -1, direction - 1); _vm->_gyro->_npcFacing = direction; } break; @@ -321,23 +321,23 @@ void Celer::forgetBackgroundSprites() { } } -void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) { - which--; // For the difference between the Pascal and C array indexes. - //setactivepage(3); - warning("STUB: Celer::show_one()"); - - if (_sprites[which]._x > kOnDisk) { +/** + * Draw background animation + * @remarks Originally called 'show_one' + */ +void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte sprId) { + if (_sprites[sprId]._x > kOnDisk) { if (destX < 0) { - destX = _sprites[which]._x * 8; - destY = _sprites[which]._y; + destX = _sprites[sprId]._x * 8; + destY = _sprites[sprId]._y; } - drawSprite(destX, destY, _sprites[which]); + drawSprite(destX, destY, _sprites[sprId]); } else { Common::File f; if (!f.open(_filename)) // Filename was set in loadBackgroundSprites(). return; // We skip because some rooms don't have sprites in the background. - f.seek(_offsets[which]); + f.seek(_offsets[sprId]); SpriteType sprite; sprite._type = PictureType(f.readByte()); @@ -358,9 +358,6 @@ void Celer::drawBackgroundSprite(int16 destX, int16 destY, byte which) { sprite._picture.free(); f.close(); } - - //setactivepage(1 - cp); - warning("STUB: Celer::show_one()"); } diff --git a/engines/avalanche/celer.h b/engines/avalanche/celer.h index 47a11bfad4..538a765956 100644 --- a/engines/avalanche/celer.h +++ b/engines/avalanche/celer.h @@ -51,7 +51,7 @@ public: // Setting the destination to negative coordinates means the picture should be drawn to it's original position. // If you give it positive values, the picture will be plotted to the desired coordinates on the screen. // By that we get rid of show_one_at(), which would be almost identical and cause a lot of code duplication. - void drawBackgroundSprite(int16 destX, int16 destY, byte which); + void drawBackgroundSprite(int16 destX, int16 destY, byte sprId); private: enum PictureType {kEga, kBgi, kNaturalImage}; diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp index 275375c8ad..3fdca0c561 100644 --- a/engines/avalanche/lucerna.cpp +++ b/engines/avalanche/lucerna.cpp @@ -445,7 +445,7 @@ void Lucerna::enterRoom(byte room, byte ped) { switch (room) { case kRoomYours: if (_vm->_gyro->_avvyInBed) { - _vm->_celer->drawBackgroundSprite(-1, -1, 3); + _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_graphics->refreshBackground(); _vm->_timer->addTimer(100, Timer::kProcArkataShouts, Timer::kReasonArkataShouts); } @@ -545,7 +545,7 @@ void Lucerna::enterRoom(byte room, byte ped) { case kRoomBridge: if (_vm->_gyro->_drawbridgeOpen == 4) { // open - _vm->_celer->drawBackgroundSprite(-1, -1, 3); // Position of drawbridge + _vm->_celer->drawBackgroundSprite(-1, -1, 2); // Position of drawbridge _vm->_graphics->refreshBackground(); _vm->_gyro->_magics[kColorGreen - 1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge. } @@ -571,10 +571,10 @@ void Lucerna::enterRoom(byte room, byte ped) { } if (_vm->_gyro->_tiedUp) - _vm->_celer->drawBackgroundSprite(-1, -1, 2); + _vm->_celer->drawBackgroundSprite(-1, -1, 1); if (!_vm->_gyro->_mushroomGrowing) - _vm->_celer->drawBackgroundSprite(-1, -1, 3); + _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_graphics->refreshBackground(); break; @@ -648,11 +648,11 @@ void Lucerna::enterRoom(byte room, byte ped) { case kRoomArgentPub: if (_vm->_gyro->_wonNim) - _vm->_celer->drawBackgroundSprite(-1, -1, 1); // No lute by the settle. + _vm->_celer->drawBackgroundSprite(-1, -1, 0); // No lute by the settle. _vm->_gyro->_malagauche = 0; // Ready to boot Malagauche if (_vm->_gyro->_givenBadgeToIby) { + _vm->_celer->drawBackgroundSprite(-1, -1, 7); _vm->_celer->drawBackgroundSprite(-1, -1, 8); - _vm->_celer->drawBackgroundSprite(-1, -1, 9); } _vm->_graphics->refreshBackground(); break; @@ -668,7 +668,7 @@ void Lucerna::enterRoom(byte room, byte ped) { if (_vm->_gyro->_geidaFollows) { putGeidaAt(4, ped); if (_vm->_gyro->_lustieIsAsleep) { - _vm->_celer->drawBackgroundSprite(-1, -1, 5); + _vm->_celer->drawBackgroundSprite(-1, -1, 4); _vm->_graphics->refreshBackground(); } } @@ -677,14 +677,14 @@ void Lucerna::enterRoom(byte room, byte ped) { case kRoomMusicRoom: if (_vm->_gyro->_jacquesState > 0) { _vm->_gyro->_jacquesState = 5; - _vm->_celer->drawBackgroundSprite(-1, -1, 2); + _vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_graphics->refreshBackground(); - _vm->_celer->drawBackgroundSprite(-1, -1, 4); + _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_gyro->_magics[kColorBrown - 1]._operation = Gyro::kMagicNothing; _vm->_gyro->_whereIs[Gyro::kPeopleJacques - 150] = 0; } if (ped != 0) { - _vm->_celer->drawBackgroundSprite(-1, -1, 6); + _vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_graphics->refreshBackground(); _vm->_sequence->firstShow(6); _vm->_sequence->thenShow(5); @@ -695,7 +695,7 @@ void Lucerna::enterRoom(byte room, byte ped) { case kRoomOutsideNottsPub: if (ped == 2) { - _vm->_celer->drawBackgroundSprite(-1, -1, 3); + _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_graphics->refreshBackground(); _vm->_sequence->firstShow(3); _vm->_sequence->thenShow(2); @@ -707,7 +707,7 @@ void Lucerna::enterRoom(byte room, byte ped) { case kRoomOutsideArgentPub: if (ped == 2) { - _vm->_celer->drawBackgroundSprite(-1, -1, 6); + _vm->_celer->drawBackgroundSprite(-1, -1, 5); _vm->_graphics->refreshBackground(); _vm->_sequence->firstShow(6); _vm->_sequence->thenShow(5); @@ -735,7 +735,7 @@ void Lucerna::enterRoom(byte room, byte ped) { case kRoomInsideCardiffCastle: if (ped > 0) { _vm->_animation->_sprites[1].init(10, false, _vm->_animation); // Define the dart. - _vm->_celer->drawBackgroundSprite(-1, -1, 1); + _vm->_celer->drawBackgroundSprite(-1, -1, 0); _vm->_graphics->refreshBackground(); _vm->_sequence->firstShow(1); if (_vm->_gyro->_arrowInTheDoor) @@ -744,22 +744,22 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_sequence->thenShow(2); if (_vm->_gyro->_takenPen) - _vm->_celer->drawBackgroundSprite(-1, -1, 4); + _vm->_celer->drawBackgroundSprite(-1, -1, 3); _vm->_sequence->startToClose(); } else { - _vm->_celer->drawBackgroundSprite(-1, -1, 1); + _vm->_celer->drawBackgroundSprite(-1, -1, 0); if (_vm->_gyro->_arrowInTheDoor) - _vm->_celer->drawBackgroundSprite(-1, -1, 3); - else _vm->_celer->drawBackgroundSprite(-1, -1, 2); + else + _vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_graphics->refreshBackground(); } break; case kRoomAvvysGarden: if (ped == 1) { - _vm->_celer->drawBackgroundSprite(-1, -1, 2); + _vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_graphics->refreshBackground(); _vm->_sequence->firstShow(2); _vm->_sequence->thenShow(1); @@ -780,7 +780,7 @@ void Lucerna::enterRoom(byte room, byte ped) { _vm->_sequence->start_to_close(); #endif - _vm->_celer->drawBackgroundSprite(-1, -1, 2); + _vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_graphics->refreshBackground(); _vm->_sequence->firstShow(2); _vm->_sequence->thenShow(1); @@ -791,7 +791,7 @@ void Lucerna::enterRoom(byte room, byte ped) { case kRoomAylesOffice: if (_vm->_gyro->_aylesIsAwake) - _vm->_celer->drawBackgroundSprite(-1, -1, 2); + _vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_graphics->refreshBackground(); break; // Ayles awake. @@ -812,14 +812,14 @@ void Lucerna::enterRoom(byte room, byte ped) { case kRoomNottsPub: if (_vm->_gyro->_sittingInPub) - _vm->_celer->drawBackgroundSprite(-1, -1, 3); + _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_gyro->_npcFacing = 1; // Port. break; case kRoomOutsideDucks: if (ped == 2) { // Shut the door - _vm->_celer->drawBackgroundSprite(-1, -1, 3); + _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_graphics->refreshBackground(); _vm->_sequence->firstShow(3); _vm->_sequence->firstShow(2); diff --git a/engines/avalanche/sequence.cpp b/engines/avalanche/sequence.cpp index 0e6d72acdd..1b55e88589 100644 --- a/engines/avalanche/sequence.cpp +++ b/engines/avalanche/sequence.cpp @@ -98,7 +98,7 @@ void Sequence::callSequencer() { if ((_seq[0] >= 1) && (_seq[0] <= 176)) { // Show a frame. - _vm->_celer->drawBackgroundSprite(-1, -1, _seq[0]); + _vm->_celer->drawBackgroundSprite(-1, -1, _seq[0] - 1); shoveLeft(); } diff --git a/engines/avalanche/timer.cpp b/engines/avalanche/timer.cpp index 892dde08bd..8c169c5a9f 100644 --- a/engines/avalanche/timer.cpp +++ b/engines/avalanche/timer.cpp @@ -232,7 +232,7 @@ void Timer::loseTimer(byte which) { void Timer::openDrawbridge() { _vm->_gyro->_drawbridgeOpen++; - _vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_drawbridgeOpen - 1); + _vm->_celer->drawBackgroundSprite(-1, -1, _vm->_gyro->_drawbridgeOpen - 2); if (_vm->_gyro->_drawbridgeOpen == 4) _vm->_gyro->_magics[1]._operation = Gyro::kMagicNothing; // You may enter the drawbridge. @@ -274,7 +274,7 @@ void Timer::bang2() { void Timer::stairs() { _vm->_gyro->blip(); _vm->_animation->_sprites[0].walkTo(3); - _vm->_celer->drawBackgroundSprite(-1, -1, 2); + _vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_gyro->_brummieStairs = 2; _vm->_gyro->_magics[10]._operation = Gyro::kMagicSpecial; _vm->_gyro->_magics[10]._data = 2; // Reached the bottom of the stairs. @@ -393,17 +393,17 @@ void Timer::jacquesWakesUp() { switch (_vm->_gyro->_jacquesState) { // Additional pictures. case 1 : - _vm->_celer->drawBackgroundSprite(-1, -1, 1); // Eyes open. + _vm->_celer->drawBackgroundSprite(-1, -1, 0); // Eyes open. _vm->_scrolls->displayScrollChain('Q', 45); break; case 2 : // Going through the door. - _vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor. - _vm->_celer->drawBackgroundSprite(-1, -1, 3); // But going through the door. + _vm->_celer->drawBackgroundSprite(-1, -1, 1); // Not on the floor. + _vm->_celer->drawBackgroundSprite(-1, -1, 2); // But going through the door. _vm->_gyro->_magics[5]._operation = Gyro::kMagicNothing; // You can't wake him up now. break; case 3 : // Gone through the door. - _vm->_celer->drawBackgroundSprite(-1, -1, 2); // Not on the floor, either. - _vm->_celer->drawBackgroundSprite(-1, -1, 4); // He's gone... so the door's open. + _vm->_celer->drawBackgroundSprite(-1, -1, 1); // Not on the floor, either. + _vm->_celer->drawBackgroundSprite(-1, -1, 3); // He's gone... so the door's open. _vm->_gyro->_whereIs[Gyro::kPeopleJacques - 150] = 0; // Gone! break; } @@ -433,7 +433,7 @@ void Timer::naughtyDuke() { // This is when the Duke comes in and takes your mon spr->walkTo(2); // He walks over to you. // Let's get the door opening. - _vm->_celer->drawBackgroundSprite(-1, -1, 1); + _vm->_celer->drawBackgroundSprite(-1, -1, 0); _vm->_sequence->firstShow(2); _vm->_sequence->startToClose(); @@ -449,7 +449,7 @@ void Timer::naughtyDuke2() { } void Timer::naughtyDuke3() { - _vm->_celer->drawBackgroundSprite(-1, -1, 1); + _vm->_celer->drawBackgroundSprite(-1, -1, 0); _vm->_sequence->firstShow(2); _vm->_sequence->startToClose(); } @@ -492,7 +492,7 @@ void Timer::jump() { if (_vm->_gyro->_carryNum >= kCarryLimit) _vm->_scrolls->displayText("You fail to grab it, because your hands are full."); else { - _vm->_celer->drawBackgroundSprite(-1, -1, 2); + _vm->_celer->drawBackgroundSprite(-1, -1, 1); _vm->_gyro->_arrowInTheDoor = false; // You've got it. _vm->_gyro->_objects[Gyro::kObjectBolt - 1] = true; _vm->_lucerna->refreshObjectList(); @@ -508,7 +508,7 @@ void Timer::crapulusSaysSpludOut() { } void Timer::buyDrinks() { - _vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again. + _vm->_celer->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again. _vm->_gyro->_malagauche = 0; _vm->_scrolls->displayScrollChain('D', _vm->_gyro->_drinking); // Display message about it. @@ -520,7 +520,7 @@ void Timer::buyDrinks() { } void Timer::buyWine() { - _vm->_celer->drawBackgroundSprite(-1, -1, 11); // Malagauche gets up again. + _vm->_celer->drawBackgroundSprite(-1, -1, 10); // Malagauche gets up again. _vm->_gyro->_malagauche = 0; _vm->_scrolls->displayScrollChain('D', 50); // You buy the wine. @@ -630,7 +630,7 @@ void Timer::avvySitDown() { if (avvy->_homing) // Still walking. addTimer(1, kProcAvvySitDown, kReasonSittingDown); else { - _vm->_celer->drawBackgroundSprite(-1, -1, 3); + _vm->_celer->drawBackgroundSprite(-1, -1, 2); _vm->_gyro->_sittingInPub = true; _vm->_gyro->_userMovesAvvy = false; avvy->_visible = false; |