diff options
author | Strangerke | 2015-09-21 21:18:19 +0200 |
---|---|---|
committer | Strangerke | 2015-09-21 21:18:19 +0200 |
commit | 63ad675abf7cc8585da30ef97bebe0c6cd502a58 (patch) | |
tree | 663472524cefbe9ba81d4c4f6812d6aeca52f38f | |
parent | 2356501d349098b9e408662155da490b176764d6 (diff) | |
download | scummvm-rg350-63ad675abf7cc8585da30ef97bebe0c6cd502a58.tar.gz scummvm-rg350-63ad675abf7cc8585da30ef97bebe0c6cd502a58.tar.bz2 scummvm-rg350-63ad675abf7cc8585da30ef97bebe0c6cd502a58.zip |
MADS: Allow multiple animations for Phantom and later games
-rw-r--r-- | engines/mads/game.cpp | 6 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes1.cpp | 26 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes2.cpp | 84 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes3.cpp | 76 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes4.cpp | 72 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes5.cpp | 46 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes6.cpp | 118 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes7.cpp | 84 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes8.cpp | 36 | ||||
-rw-r--r-- | engines/mads/scene.cpp | 78 | ||||
-rw-r--r-- | engines/mads/scene.h | 4 |
11 files changed, 322 insertions, 308 deletions
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp index 91f6cd5630..332ac43505 100644 --- a/engines/mads/game.cpp +++ b/engines/mads/game.cpp @@ -297,8 +297,10 @@ void Game::sectionLoop() { _vm->_events->waitCursor(); _kernelMode = KERNEL_ROOM_PRELOAD; - delete _scene._activeAnimation; - _scene._activeAnimation = nullptr; + for (int i = 0; i < 10; i++) { + delete _scene._animation[i]; + _scene._animation[i] = nullptr; + } _scene._reloadSceneFlag = false; diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index fd97f71727..d5e1fc08f7 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -258,32 +258,32 @@ void Scene101::step() { break; } - if (_scene->_activeAnimation != nullptr) { - if ((_scene->_activeAnimation->getCurrentFrame() >= 6) && (_messageNum == 0)) { + if (_scene->_animation[0] != nullptr) { + if ((_scene->_animation[0]->getCurrentFrame() >= 6) && (_messageNum == 0)) { _messageNum++; _scene->_kernelMessages.add(Common::Point(63, _posY), 0x1110, 0, 0, 240, _game.getQuote(49)); _posY += 14; } - if ((_scene->_activeAnimation->getCurrentFrame() >= 7) && (_messageNum == 1)) { + if ((_scene->_animation[0]->getCurrentFrame() >= 7) && (_messageNum == 1)) { _messageNum++; _scene->_kernelMessages.add(Common::Point(63, _posY), 0x1110, 0, 0, 240, _game.getQuote(54)); _posY += 14; } - if ((_scene->_activeAnimation->getCurrentFrame() >= 10) && (_messageNum == 2)) { + if ((_scene->_animation[0]->getCurrentFrame() >= 10) && (_messageNum == 2)) { _messageNum++; _scene->_kernelMessages.add(Common::Point(63, _posY), 0x1110, 0, 0, 240, _game.getQuote(55)); _posY += 14; } - if ((_scene->_activeAnimation->getCurrentFrame() >= 17) && (_messageNum == 3)) { + if ((_scene->_animation[0]->getCurrentFrame() >= 17) && (_messageNum == 3)) { _messageNum++; _scene->_kernelMessages.add(Common::Point(63, _posY), 0x1110, 0, 0, 240, _game.getQuote(56)); _posY += 14; } - if ((_scene->_activeAnimation->getCurrentFrame() >= 20) && (_messageNum == 4)) { + if ((_scene->_animation[0]->getCurrentFrame() >= 20) && (_messageNum == 4)) { _messageNum++; _scene->_kernelMessages.add(Common::Point(63, _posY), 0x1110, 0, 0, 240, _game.getQuote(50)); _posY += 14; @@ -1782,7 +1782,7 @@ void Scene104::step() { if ((_game._player._special > 0) && _game._player._stepEnabled) _game._player._stepEnabled = false; - if (_kargShootingFl && (_scene->_activeAnimation->getCurrentFrame() >= 19)) { + if (_kargShootingFl && (_scene->_animation[0]->getCurrentFrame() >= 19)) { _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 120, _game.getQuote(52)); _kargShootingFl = false; } @@ -2079,7 +2079,7 @@ void Scene106::step() { } } - if (_firstEmergingFl && (_scene->_activeAnimation->getCurrentFrame() >= 19)) { + if (_firstEmergingFl && (_scene->_animation[0]->getCurrentFrame() >= 19)) { _firstEmergingFl = false; _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 120, _game.getQuote(52)); } @@ -2263,7 +2263,7 @@ void Scene107::enter() { } void Scene107::step() { - if (_shootingFl && (_scene->_activeAnimation->getCurrentFrame() >= 19)) { + if (_shootingFl && (_scene->_animation[0]->getCurrentFrame() >= 19)) { _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 120, _game.getQuote(52)); _shootingFl = false; } @@ -2919,7 +2919,7 @@ void Scene110::actions() { switch (_game._trigger) { case 0: _scene->loadAnimation(Resources::formatName(110, 'T', 0, EXT_AA, ""), 1); - _scene->_activeAnimation->setNextFrameTimer(_game._player._ticksAmount + _game._player._priorTimer); + _scene->_animation[0]->setNextFrameTimer(_game._player._ticksAmount + _game._player._priorTimer); _game._player._stepEnabled = false; _game._player._visible = false; break; @@ -3066,7 +3066,7 @@ void Scene111::step() { if (_game._trigger == 73) _vm->_sound->command(37); - if (_rexDivingFl && (_scene->_activeAnimation->getCurrentFrame() >= 9)) { + if (_rexDivingFl && (_scene->_animation[0]->getCurrentFrame() >= 9)) { _vm->_sound->command(36); _rexDivingFl = false; } @@ -3138,8 +3138,8 @@ void Scene112::enter() { } void Scene112::step() { - if ((_scene->_activeAnimation != nullptr) && (_game._storyMode == STORYMODE_NICE)) { - if (_scene->_activeAnimation->getCurrentFrame() >= 54) { + if ((_scene->_animation[0] != nullptr) && (_game._storyMode == STORYMODE_NICE)) { + if (_scene->_animation[0]->getCurrentFrame() >= 54) { _scene->freeAnimation(); _game._trigger = 70; } diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 1cbd6f56ef..ad15f83707 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -484,7 +484,7 @@ void Scene202::enter() { } _scene->loadAnimation(formAnimName('M', -1), 71); - _scene->_activeAnimation->setCurrentFrame(200); + _scene->_animation[0]->setCurrentFrame(200); } else { if (_ladderTopFl) { _game._player._visible = false; @@ -596,7 +596,7 @@ void Scene202::step() { break; } - if (!_scene->_activeAnimation && (_globals[kMeteorologistStatus] != METEOROLOGIST_GONE) && (_meteoClock2 <= _scene->_frameStartTime) && (_meteoClock1 <= _scene->_frameStartTime)) { + if (!_scene->_animation[0] && (_globals[kMeteorologistStatus] != METEOROLOGIST_GONE) && (_meteoClock2 <= _scene->_frameStartTime) && (_meteoClock1 <= _scene->_frameStartTime)) { int randVal = _vm->getRandomNumber(1, 500); int threshold = 1; if (_ladderTopFl) @@ -615,11 +615,11 @@ void Scene202::step() { } } - if (!_scene->_activeAnimation) + if (!_scene->_animation[0]) return; if (_waitingMeteoFl) { - if (_scene->_activeAnimation->getCurrentFrame() >= 200) { + if (_scene->_animation[0]->getCurrentFrame() >= 200) { if ((_globals[kMeteorologistWatch] == METEOROLOGIST_TOWER) || _globals[kLadderBroken]) { _scene->_nextSceneId = 213; } else { @@ -628,7 +628,7 @@ void Scene202::step() { } } - if ((_scene->_activeAnimation->getCurrentFrame() == 160) && (_meteoFrame != _scene->_activeAnimation->getCurrentFrame())) { + if ((_scene->_animation[0]->getCurrentFrame() == 160) && (_meteoFrame != _scene->_animation[0]->getCurrentFrame())) { Common::Point msgPos; int msgFlag; if (!_ladderTopFl) { @@ -647,15 +647,15 @@ void Scene202::step() { _toTeleportFl = true; } - if (_scene->_activeAnimation->getCurrentFrame() == _meteoFrame) { + if (_scene->_animation[0]->getCurrentFrame() == _meteoFrame) { return; } - _meteoFrame = _scene->_activeAnimation->getCurrentFrame(); + _meteoFrame = _scene->_animation[0]->getCurrentFrame(); int randVal = _vm->getRandomNumber(1, 1000); int frameStep = -1; - switch (_scene->_activeAnimation->getCurrentFrame()) { + switch (_scene->_animation[0]->getCurrentFrame()) { case 42: case 77: case 96: @@ -693,8 +693,8 @@ void Scene202::step() { break; } - if (frameStep >= 0 && frameStep != _scene->_activeAnimation->getCurrentFrame() + 1) { - _scene->_activeAnimation->setCurrentFrame(frameStep); + if (frameStep >= 0 && frameStep != _scene->_animation[0]->getCurrentFrame() + 1) { + _scene->_animation[0]->setCurrentFrame(frameStep); _meteoFrame = frameStep; } } @@ -797,7 +797,7 @@ void Scene202::actions() { _scene->_nextSceneId = 203; } else if (_action.isAction(VERB_WALK_TOWARDS, NOUN_FIELD_TO_NORTH)) { if (_globals[kMeteorologistStatus] != METEOROLOGIST_GONE) { - if (_scene->_activeAnimation) + if (_scene->_animation[0]) _globals[kMeteorologistStatus] = METEOROLOGIST_PRESENT; else _globals[kMeteorologistStatus] = METEOROLOGIST_ABSENT; @@ -890,7 +890,7 @@ void Scene202::actions() { _globals._sequenceIndexes[10] = _scene->_sequences.startCycle(_globals._spriteIndexes[9], false, 6); _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 1); _scene->_sequences.setPosition(_globals._sequenceIndexes[10], Common::Point(172, 123)); - if (_scene->_activeAnimation) { + if (_scene->_animation[0]) { _waitingMeteoFl = true; _globals[kMeteorologistWatch] = METEOROLOGIST_GROUND; } else { @@ -898,7 +898,7 @@ void Scene202::actions() { } break; case 2: - if (!_scene->_activeAnimation && !_meteorologistSpecial) { + if (!_scene->_animation[0] && !_meteorologistSpecial) { _vm->_dialogs->show(20222); } _scene->_sequences.remove(_globals._sequenceIndexes[10]); @@ -932,13 +932,13 @@ void Scene202::actions() { _globals._sequenceIndexes[10] = _scene->_sequences.startCycle(_globals._spriteIndexes[9], true, -2); _scene->_sequences.setPosition(_globals._sequenceIndexes[10], Common::Point(247, 82)); _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 1); - if (_scene->_activeAnimation) { - if (_scene->_activeAnimation->getCurrentFrame() > 200) { + if (_scene->_animation[0]) { + if (_scene->_animation[0]->getCurrentFrame() > 200) { _scene->_sequences.addTimer(120, 2); } else { _waitingMeteoFl = true; _globals[kMeteorologistWatch] = METEOROLOGIST_GONE; - if ((_scene->_activeAnimation->getCurrentFrame() >= 44) && (_scene->_activeAnimation->getCurrentFrame() <= 75)) { + if ((_scene->_animation[0]->getCurrentFrame() >= 44) && (_scene->_animation[0]->getCurrentFrame() <= 75)) { _scene->_kernelMessages.reset(); int msgIndex = _scene->_kernelMessages.add(Common::Point(248, 15), 0x1110, 32, 0, 60, _game.getQuote(100)); _scene->_kernelMessages.setQuoted(msgIndex, 4, false); @@ -952,7 +952,7 @@ void Scene202::actions() { } break; case 2: - if (!_scene->_activeAnimation) + if (!_scene->_animation[0]) _vm->_dialogs->show(20222); _meteorologistSpecial = false; _scene->_sequences.remove(_globals._sequenceIndexes[10]); @@ -1227,7 +1227,7 @@ void Scene205::enter() { if (_globals[kSexOfRex] != SEX_MALE) { _scene->loadAnimation(formAnimName('a', -1)); - _scene->_activeAnimation->_resetFlag = true; + _scene->_animation[0]->_resetFlag = true; } else { _beingKicked = true; _globals._sequenceIndexes[8] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[8], false, 8, 1, 0, 0); @@ -1379,8 +1379,8 @@ void Scene205::actions() { _scene->_sequences.updateTimeout(_globals._sequenceIndexes[9], -1); _vm->_sound->command(27); } else if (_game._trigger == 1) { - if (_scene->_activeAnimation != nullptr) - _scene->_activeAnimation->resetSpriteSetsCount(); + if (_scene->_animation[0] != nullptr) + _scene->_animation[0]->resetSpriteSetsCount(); _vm->_dialogs->show(20516); _scene->_reloadSceneFlag = true; @@ -1746,9 +1746,9 @@ void Scene208::enter() { } void Scene208::step() { - if (_boundingFl && _scene->_activeAnimation && - (_rhotundaTime <= _scene->_activeAnimation->getCurrentFrame())) { - _rhotundaTime = _scene->_activeAnimation->getCurrentFrame(); + if (_boundingFl && _scene->_animation[0] && + (_rhotundaTime <= _scene->_animation[0]->getCurrentFrame())) { + _rhotundaTime = _scene->_animation[0]->getCurrentFrame(); if (_rhotundaTime == 125) _scene->_sequences.remove(_globals._sequenceIndexes[4]); @@ -4064,7 +4064,7 @@ void Scene210::setDialogNode(int node) { _vm->_palette->lock(); _scene->_kernelMessages.reset(); _scene->freeAnimation(); - _scene->_activeAnimation = nullptr; + _scene->_animation[0] = nullptr; _scene->resetScene(); _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', -1)); @@ -4263,8 +4263,8 @@ void Scene210::enter() { } restoreDialogNode(_curDialogNode, quote, number); - if (_scene->_activeAnimation) - _scene->_activeAnimation->setCurrentFrame(131); + if (_scene->_animation[0]) + _scene->_animation[0]->setCurrentFrame(131); } _vm->_palette->setEntry(252, 63, 63, 10); @@ -4274,9 +4274,9 @@ void Scene210::enter() { } void Scene210::step() { - if ((_twinkleAnimationType == 1) && _scene->_activeAnimation) { - if (_twinklesCurrentFrame != _scene->_activeAnimation->getCurrentFrame()) { - _twinklesCurrentFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_twinkleAnimationType == 1) && _scene->_animation[0]) { + if (_twinklesCurrentFrame != _scene->_animation[0]->getCurrentFrame()) { + _twinklesCurrentFrame = _scene->_animation[0]->getCurrentFrame(); int reset_frame = -1; int random = _vm->getRandomNumber(1, 1000); @@ -4396,8 +4396,8 @@ void Scene210::step() { } if (reset_frame >= 0) { - if (reset_frame != _scene->_activeAnimation->getCurrentFrame()) { - _scene->_activeAnimation->setCurrentFrame(reset_frame); + if (reset_frame != _scene->_animation[0]->getCurrentFrame()) { + _scene->_animation[0]->setCurrentFrame(reset_frame); _twinklesCurrentFrame = reset_frame; } @@ -4411,9 +4411,9 @@ void Scene210::step() { } } - if ((_twinkleAnimationType == 2) && _scene->_activeAnimation) { - if (_twinklesCurrentFrame != _scene->_activeAnimation->getCurrentFrame()) { - _twinklesCurrentFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_twinkleAnimationType == 2) && _scene->_animation[0]) { + if (_twinklesCurrentFrame != _scene->_animation[0]->getCurrentFrame()) { + _twinklesCurrentFrame = _scene->_animation[0]->getCurrentFrame(); int reset_frame = -1; if (_twinklesCurrentFrame == 53) { @@ -4422,8 +4422,8 @@ void Scene210::step() { } else if ((_twinklesCurrentFrame == 75) && _shouldTalk) reset_frame = 60; - if ((reset_frame >= 0) && (reset_frame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(reset_frame); + if ((reset_frame >= 0) && (reset_frame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(reset_frame); _twinklesCurrentFrame = reset_frame; } } @@ -4646,7 +4646,7 @@ void Scene211::enter() { _game._player._stepEnabled = false; _game._player._visible = false; _scene->loadAnimation(formAnimName('A', -1), 100); - _scene->_activeAnimation->setCurrentFrame(169); + _scene->_animation[0]->setCurrentFrame(169); } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._playerPos = Common::Point(310, 31); _game._player._facing = FACING_SOUTHWEST; @@ -4725,8 +4725,8 @@ void Scene211::step() { } } - if (_ambushFl && (_scene->_activeAnimation->getCurrentFrame() > _monkeyFrame)) { - _monkeyFrame = _scene->_activeAnimation->getCurrentFrame(); + if (_ambushFl && (_scene->_animation[0]->getCurrentFrame() > _monkeyFrame)) { + _monkeyFrame = _scene->_animation[0]->getCurrentFrame(); switch (_monkeyFrame) { case 2: { int msgIndex = _scene->_kernelMessages.add(Common::Point(12, 4), 0xFDFC, 0, 0, 60, _game.getQuote(157)); @@ -4798,9 +4798,9 @@ void Scene211::step() { _wakeFl = false; } - if (_scene->_activeAnimation->getCurrentFrame() > _monkeyFrame) { - _monkeyFrame = _scene->_activeAnimation->getCurrentFrame(); - switch (_scene->_activeAnimation->getCurrentFrame()) { + if (_scene->_animation[0]->getCurrentFrame() > _monkeyFrame) { + _monkeyFrame = _scene->_animation[0]->getCurrentFrame(); + switch (_scene->_animation[0]->getCurrentFrame()) { case 177: { int msgIndex = _scene->_kernelMessages.add(Common::Point(63, _scrollY), 0x1110, 0, 0, 180, _game.getQuote(165)); _scene->_kernelMessages.setQuoted(msgIndex, 4, true); diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp index 5a6edbf995..717dd85de7 100644 --- a/engines/mads/nebular/nebular_scenes3.cpp +++ b/engines/mads/nebular/nebular_scenes3.cpp @@ -293,8 +293,8 @@ void Scene302::step() { if (_game._trigger == 71) _scene->_nextSceneId = 303; - if ((_scene->_activeAnimation != nullptr) && (_scene->_activeAnimation->getCurrentFrame() != _oldFrame)) { - _oldFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_scene->_animation[0] != nullptr) && (_scene->_animation[0]->getCurrentFrame() != _oldFrame)) { + _oldFrame = _scene->_animation[0]->getCurrentFrame(); if (_oldFrame == 147) { _game._objects.setRoom(OBJ_POISON_DARTS, 1); _game._objects.setRoom(OBJ_BLOWGUN, 1); @@ -828,23 +828,23 @@ void Scene307::enter() { void Scene307::step() { handleForceField(&_forceField, &_globals._spriteIndexes[0]); - if ((_animationMode == 1) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() == 126) { + if ((_animationMode == 1) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() == 126) { _forceField._flag = false; _vm->_sound->command(5); } - if (_scene->_activeAnimation->getCurrentFrame() == 194) { + if (_scene->_animation[0]->getCurrentFrame() == 194) { _forceField._flag = true; _vm->_sound->command(24); } } - if ((_animationMode == 2) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() == 54) + if ((_animationMode == 2) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() == 54) _forceField._flag = false; - if (_scene->_activeAnimation->getCurrentFrame() == 150) { + if (_scene->_animation[0]->getCurrentFrame() == 150) { _game._player._visible = false; _game._player._priorTimer = _scene->_frameStartTime - _game._player._ticksAmount; } @@ -869,7 +869,7 @@ void Scene307::step() { } _lastFrameTime = _scene->_frameStartTime; - if ((_guardTime > 3000) && !_duringPeeingFl && (_scene->_activeAnimation == nullptr) + if ((_guardTime > 3000) && !_duringPeeingFl && (_scene->_animation[0] == nullptr) && (_game._screenObjects._inputMode != kInputConversation) && _globals[kMetBuddyBeast] && !_activePrisonerFl) { if (!_game._objects.isInInventory(OBJ_SCALPEL) && !_grateOpenedFl) { _game._player._stepEnabled = false; @@ -879,7 +879,7 @@ void Scene307::step() { _scene->loadAnimation(formAnimName('b', -1), 70); } _guardTime = 0; - } else if ((_prisonerTimer > 300) && (_game._screenObjects._inputMode != kInputConversation) && (_scene->_activeAnimation == nullptr) && !_activePrisonerFl) { + } else if ((_prisonerTimer > 300) && (_game._screenObjects._inputMode != kInputConversation) && (_scene->_animation[0] == nullptr) && !_activePrisonerFl) { if (!_globals[kMetBuddyBeast]) { int idx = _scene->_kernelMessages.add(Common::Point(5, 51), 0xFDFC, 0, 81, 120, _game.getQuote(_prisonerMessageId)); _scene->_kernelMessages.setQuoted(idx, 4, true); @@ -1380,9 +1380,9 @@ void Scene309::enter() { _game._player._stepEnabled = false; _scene->loadAnimation(formAnimName('a', -1), 60); - _characterSpriteIndexes[0] = _scene->_activeAnimation->_spriteListIndexes[2]; - _characterSpriteIndexes[1] = _scene->_activeAnimation->_spriteListIndexes[2]; - _characterSpriteIndexes[2] = _scene->_activeAnimation->_spriteListIndexes[1]; + _characterSpriteIndexes[0] = _scene->_animation[0]->_spriteListIndexes[2]; + _characterSpriteIndexes[1] = _scene->_animation[0]->_spriteListIndexes[2]; + _characterSpriteIndexes[2] = _scene->_animation[0]->_spriteListIndexes[1]; _messagesIndexes[0] = -1; _messagesIndexes[1] = -1; @@ -1404,9 +1404,9 @@ void Scene309::step() { if (_game._trigger == 62) _messagesIndexes[2] = -1; - if (_scene->_activeAnimation != nullptr) { - if (_lastFrame != _scene->_activeAnimation->getCurrentFrame()) { - _lastFrame = _scene->_activeAnimation->getCurrentFrame(); + if (_scene->_animation[0] != nullptr) { + if (_lastFrame != _scene->_animation[0]->getCurrentFrame()) { + _lastFrame = _scene->_animation[0]->getCurrentFrame(); if (_lastFrame == 39) { _messagesIndexes[0] = _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 32, 61, 210, _game.getQuote(348)); _messagesIndexes[1] = _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 32, 0, 210, _game.getQuote(349)); @@ -1419,15 +1419,15 @@ void Scene309::step() { if (_messagesIndexes[charIdx] >= 0) { bool match = false; int j = -1; - for (j = _scene->_activeAnimation->_oldFrameEntry; j < _scene->_activeAnimation->_header._frameEntriesCount; j++) { - if (_scene->_activeAnimation->_frameEntries[j]._spriteSlot._spritesIndex == _characterSpriteIndexes[charIdx]) { + for (j = _scene->_animation[0]->_oldFrameEntry; j < _scene->_animation[0]->_header._frameEntriesCount; j++) { + if (_scene->_animation[0]->_frameEntries[j]._spriteSlot._spritesIndex == _characterSpriteIndexes[charIdx]) { match = true; break; } } if (match) { - SpriteSlotSubset *curSpriteSlot = &_scene->_activeAnimation->_frameEntries[j]._spriteSlot; + SpriteSlotSubset *curSpriteSlot = &_scene->_animation[0]->_frameEntries[j]._spriteSlot; _scene->_kernelMessages._entries[_messagesIndexes[charIdx]]._position.x = curSpriteSlot->_position.x; _scene->_kernelMessages._entries[_messagesIndexes[charIdx]]._position.y = curSpriteSlot->_position.y - (50 + (14 * ((charIdx == 0) ? 2 : 1))); } @@ -2602,7 +2602,7 @@ void Scene318::enter() { if (_globals[kAfterHavoc]) { _scene->loadAnimation(formAnimName('f', -1)); - _scene->_activeAnimation->_resetFlag = true; + _scene->_animation[0]->_resetFlag = true; } else if (!_globals[kHasSeenProfPyro]) { _scene->_hotspots.activate(NOUN_PROFESSORS_GURNEY, false); _scene->_hotspots.activate(NOUN_PROFESSOR, false); @@ -2705,9 +2705,9 @@ void Scene318::enter() { } void Scene318::step() { - if ((_scene->_activeAnimation != nullptr) && (_animMode == 2)) { - if (_lastFrame != _scene->_activeAnimation->getCurrentFrame()) { - _lastFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_scene->_animation[0] != nullptr) && (_animMode == 2)) { + if (_lastFrame != _scene->_animation[0]->getCurrentFrame()) { + _lastFrame = _scene->_animation[0]->getCurrentFrame(); int nextFrame = -1; switch (_lastFrame) { @@ -2759,8 +2759,8 @@ void Scene318::step() { break; } - if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextFrame); + if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextFrame); _lastFrame = nextFrame; } } @@ -3185,11 +3185,11 @@ void Scene319::enter() { } void Scene319::step() { - if (_scene->_activeAnimation == nullptr) + if (_scene->_animation[0] == nullptr) return; - if (_animFrame != _scene->_activeAnimation->getCurrentFrame()) { - _animFrame = _scene->_activeAnimation->getCurrentFrame(); + if (_animFrame != _scene->_animation[0]->getCurrentFrame()) { + _animFrame = _scene->_animation[0]->getCurrentFrame(); int nextFrame = -1; if (_animMode == 1) { switch (_animFrame) { @@ -3305,8 +3305,8 @@ void Scene319::step() { if ((_animMode == 4) && (_animFrame == 16)) _vm->_screen._shakeCountdown = 80; - if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextFrame); + if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextFrame); _animFrame = nextFrame; } } @@ -3320,11 +3320,11 @@ void Scene319::step() { _scene->freeAnimation(); _scene->loadAnimation(formAnimName('b', 0)); if (_nextAction1 == 3) - _scene->_activeAnimation->setCurrentFrame(85); + _scene->_animation[0]->setCurrentFrame(85); else if (_nextAction1 == 1) - _scene->_activeAnimation->setCurrentFrame(40); + _scene->_animation[0]->setCurrentFrame(40); - _animFrame = _scene->_activeAnimation->getCurrentFrame(); + _animFrame = _scene->_animation[0]->getCurrentFrame(); _slacheTalkingFl = true; _vm->_screen._shakeCountdown = 1; @@ -3710,9 +3710,9 @@ void Scene320::enter() { } void Scene320::step() { - if (_scene->_activeAnimation != nullptr) { - if (_lastFrame != _scene->_activeAnimation->getCurrentFrame()) { - _lastFrame = _scene->_activeAnimation->getCurrentFrame(); + if (_scene->_animation[0] != nullptr) { + if (_lastFrame != _scene->_animation[0]->getCurrentFrame()) { + _lastFrame = _scene->_animation[0]->getCurrentFrame(); switch (_lastFrame) { case 95: _blinkFl = true; @@ -3892,8 +3892,8 @@ void Scene321::enter() { } void Scene321::step() { - if (_scene->_activeAnimation != nullptr) { - if ((_scene->_activeAnimation->getCurrentFrame() >= 260) && (_globals[kSexOfRex] == REX_MALE) && (_game._storyMode >= STORYMODE_NICE)) + if (_scene->_animation[0] != nullptr) { + if ((_scene->_animation[0]->getCurrentFrame() >= 260) && (_globals[kSexOfRex] == REX_MALE) && (_game._storyMode >= STORYMODE_NICE)) _scene->_nextSceneId = 316; } diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp index c981f6a6e4..19e1fc792e 100644 --- a/engines/mads/nebular/nebular_scenes4.cpp +++ b/engines/mads/nebular/nebular_scenes4.cpp @@ -876,7 +876,7 @@ void Scene402::enter() { _refuseAlienLiquor = false; _scene->loadAnimation(Resources::formatName(402, 'd', 1, EXT_AA, "")); - _scene->_activeAnimation->_resetFlag = true; + _scene->_animation[0]->_resetFlag = true; _globals._sequenceIndexes[5] = _scene->_sequences.startCycle(_globals._spriteIndexes[5], false, 1); _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1); @@ -1536,43 +1536,43 @@ void Scene402::step() { if (_game._trigger == 32) _rightWomanMoving = false; - if (_scene->_activeAnimation->getCurrentFrame() == 1) { + if (_scene->_animation[0]->getCurrentFrame() == 1) { switch (_vm->getRandomNumber(1, 50)) { case 1: - _scene->_activeAnimation->setCurrentFrame(2); + _scene->_animation[0]->setCurrentFrame(2); break; case 2: - _scene->_activeAnimation->setCurrentFrame(7); + _scene->_animation[0]->setCurrentFrame(7); break; case 3: - _scene->_activeAnimation->setCurrentFrame(11); + _scene->_animation[0]->setCurrentFrame(11); break; default: - _scene->_activeAnimation->setCurrentFrame(0); + _scene->_animation[0]->setCurrentFrame(0); break; } } - if ((_scene->_activeAnimation->getCurrentFrame() == 4) && (_drinkTimer < 10)) { + if ((_scene->_animation[0]->getCurrentFrame() == 4) && (_drinkTimer < 10)) { ++ _drinkTimer; - _scene->_activeAnimation->setCurrentFrame(3); + _scene->_animation[0]->setCurrentFrame(3); } if (_drinkTimer == 10) { _drinkTimer = 0; - _scene->_activeAnimation->setCurrentFrame(4); - _scene->_activeAnimation->_currentFrame = 5; + _scene->_animation[0]->setCurrentFrame(4); + _scene->_animation[0]->_currentFrame = 5; } - switch (_scene->_activeAnimation->getCurrentFrame()) { + switch (_scene->_animation[0]->getCurrentFrame()) { case 6: case 10: case 14: - _scene->_activeAnimation->setCurrentFrame(0); + _scene->_animation[0]->setCurrentFrame(0); break; default: @@ -3126,36 +3126,36 @@ void Scene410::enter() { sceneEntrySound(); _scene->loadAnimation(Resources::formatName(410, 'r', -1, EXT_AA, "")); - _scene->_activeAnimation->_resetFlag = true; + _scene->_animation[0]->_resetFlag = true; } void Scene410::step() { - if (_scene->_activeAnimation->getCurrentFrame() == 1) { + if (_scene->_animation[0]->getCurrentFrame() == 1) { if (_vm->getRandomNumber(1, 30) == 1) - _scene->_activeAnimation->setCurrentFrame(2); + _scene->_animation[0]->setCurrentFrame(2); else - _scene->_activeAnimation->setCurrentFrame(0); + _scene->_animation[0]->setCurrentFrame(0); } - if (_scene->_activeAnimation->getCurrentFrame() == 9) { + if (_scene->_animation[0]->getCurrentFrame() == 9) { if (_vm->getRandomNumber(1, 30) == 1) - _scene->_activeAnimation->setCurrentFrame(10); + _scene->_animation[0]->setCurrentFrame(10); else - _scene->_activeAnimation->setCurrentFrame(8); + _scene->_animation[0]->setCurrentFrame(8); } - if (_scene->_activeAnimation->getCurrentFrame() == 5) { + if (_scene->_animation[0]->getCurrentFrame() == 5) { if (_vm->getRandomNumber(1, 30) == 1) - _scene->_activeAnimation->setCurrentFrame(6); + _scene->_animation[0]->setCurrentFrame(6); else - _scene->_activeAnimation->setCurrentFrame(4); + _scene->_animation[0]->setCurrentFrame(4); } - if (_scene->_activeAnimation->getCurrentFrame() == 3) { + if (_scene->_animation[0]->getCurrentFrame() == 3) { if (_vm->getRandomNumber(1, 2) == 1) - _scene->_activeAnimation->setCurrentFrame(4); + _scene->_animation[0]->setCurrentFrame(4); else // == 2 - _scene->_activeAnimation->setCurrentFrame(8); + _scene->_animation[0]->setCurrentFrame(8); } } @@ -3491,7 +3491,7 @@ void Scene411::handleDialog() { _game._player._priorTimer = _scene->_frameStartTime + _game._player._ticksAmount; _game._player._visible = false; _game._player._stepEnabled = false; - _scene->_activeAnimation->setCurrentFrame(_resetFrame); + _scene->_animation[0]->setCurrentFrame(_resetFrame); } _scene->_kernelMessages.reset(); _newQuantity = computeQuoteAndQuantity(); @@ -3661,16 +3661,16 @@ void Scene411::enter() { } _scene->loadAnimation(formAnimName('a', -1)); - _scene->_activeAnimation->setCurrentFrame(128); + _scene->_animation[0]->setCurrentFrame(128); _makeMushroomCloud = false; _killRox = false; } void Scene411::step() { - if (_scene->_activeAnimation != nullptr) { - if (_curAnimationFrame != _scene->_activeAnimation->getCurrentFrame()) { - _curAnimationFrame = _scene->_activeAnimation->getCurrentFrame(); + if (_scene->_animation[0] != nullptr) { + if (_curAnimationFrame != _scene->_animation[0]->getCurrentFrame()) { + _curAnimationFrame = _scene->_animation[0]->getCurrentFrame(); _resetFrame = -1; switch (_curAnimationFrame) { @@ -3738,14 +3738,14 @@ void Scene411::step() { break; } - if ((_resetFrame >= 0) && (_resetFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(_resetFrame); + if ((_resetFrame >= 0) && (_resetFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(_resetFrame); _curAnimationFrame = _resetFrame; } } } - if (_scene->_activeAnimation->getCurrentFrame() == 86) + if (_scene->_animation[0]->getCurrentFrame() == 86) _vm->_sound->command(59); } @@ -4113,10 +4113,10 @@ void Scene413::enter() { } void Scene413::step() { - if (_scene->_activeAnimation && _scene->_activeAnimation->getCurrentFrame() == 38) - _scene->_activeAnimation->setCurrentFrame(37); + if (_scene->_animation[0] && _scene->_animation[0]->getCurrentFrame() == 38) + _scene->_animation[0]->setCurrentFrame(37); - if (_scene->_activeAnimation && _scene->_activeAnimation->getCurrentFrame() == 21 && _canMove) { + if (_scene->_animation[0] && _scene->_animation[0]->getCurrentFrame() == 21 && _canMove) { _vm->_sound->command(27); _canMove = false; } diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp index 95eb429193..092ddeb3f7 100644 --- a/engines/mads/nebular/nebular_scenes5.cpp +++ b/engines/mads/nebular/nebular_scenes5.cpp @@ -722,9 +722,9 @@ void Scene504::enter() { } void Scene504::step() { - if ((_carAnimationMode == 1) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) { - _carFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_carAnimationMode == 1) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _carFrame) { + _carFrame = _scene->_animation[0]->getCurrentFrame(); int nextFrame; if (_carFrame == 1) @@ -732,8 +732,8 @@ void Scene504::step() { else nextFrame = -1; - if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextFrame); + if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextFrame); _carFrame = nextFrame; } } @@ -943,15 +943,15 @@ void Scene505::enter() { _game._player._stepEnabled = false; _frame = -1; _scene->loadAnimation(formAnimName('a', -1)); - _scene->_activeAnimation->setCurrentFrame(86); + _scene->_animation[0]->setCurrentFrame(86); sceneEntrySound(); _vm->_sound->command(16); } void Scene505::step() { - if (_frame != _scene->_activeAnimation->getCurrentFrame()) { - _frame = _scene->_activeAnimation->getCurrentFrame(); + if (_frame != _scene->_animation[0]->getCurrentFrame()) { + _frame = _scene->_animation[0]->getCurrentFrame(); int resetFrame = -1; switch (_frame) { @@ -1088,8 +1088,8 @@ void Scene505::step() { break; } - if ((resetFrame >= 0) && (resetFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(resetFrame); + if ((resetFrame >= 0) && (resetFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(resetFrame); _frame = resetFrame; } } @@ -1254,7 +1254,7 @@ void Scene506::step() { switch (_game._trigger) { case 70: _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _scene->_sequences.addTimer(6, 71); break; @@ -1943,9 +1943,9 @@ void Scene511::enter() { } void Scene511::step() { - if ((_lineAnimationMode == 1) && _scene->_activeAnimation) { - if (_lineFrame != _scene->_activeAnimation->getCurrentFrame()) { - _lineFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_lineAnimationMode == 1) && _scene->_animation[0]) { + if (_lineFrame != _scene->_animation[0]->getCurrentFrame()) { + _lineFrame = _scene->_animation[0]->getCurrentFrame(); int resetFrame = -1; if ((_lineAnimationPosition == 2) && (_lineFrame == 14)) @@ -1961,8 +1961,8 @@ void Scene511::step() { resetFrame = 2; } - if ((resetFrame >= 0) && (resetFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(resetFrame); + if ((resetFrame >= 0) && (resetFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(resetFrame); _lineFrame = resetFrame; } } @@ -1971,7 +1971,7 @@ void Scene511::step() { switch (_game._trigger) { case 70: _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _scene->_sequences.addTimer(6, 71); break; @@ -2009,7 +2009,7 @@ void Scene511::preActions() { _scene->loadAnimation(formAnimName('R',2), 1); } else if (_game._trigger == 1) { _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _game._objects.setRoom(OBJ_FISHING_LINE, 1); _handingLine = false; _game._player._stepEnabled = true; @@ -2118,8 +2118,8 @@ void Scene511::actions() { _globals[kLineStatus] = 3; _game._player._stepEnabled = true; - if (_scene->_activeAnimation) - _scene->_activeAnimation->eraseSprites(); + if (_scene->_animation[0]) + _scene->_animation[0]->eraseSprites(); _game._player.update(); } } @@ -2434,8 +2434,8 @@ void Scene512::actions() { _vm->_dialogs->show(51225); else if (_action.isAction(VERB_LOOK, NOUN_PADLOCK_KEY) && _game._objects.isInRoom(OBJ_PADLOCK_KEY)) _vm->_dialogs->show(51215); - else if (_action.isAction(VERB_LOOK, NOUN_FISHING_ROD) && (!_scene->_activeAnimation || - _scene->_activeAnimation->getCurrentFrame() == 4)) + else if (_action.isAction(VERB_LOOK, NOUN_FISHING_ROD) && (!_scene->_animation[0] || + _scene->_animation[0]->getCurrentFrame() == 4)) _vm->_dialogs->show(51216); else if (_action.isAction(VERB_LOOK, NOUN_SHIPS_WHEEL)) _vm->_dialogs->show(51218); @@ -2570,7 +2570,7 @@ void Scene513::step() { switch (_game._trigger) { case 70: _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _scene->_sequences.addTimer(6, 71); break; diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp index d97e37ea0b..5b7dae4489 100644 --- a/engines/mads/nebular/nebular_scenes6.cpp +++ b/engines/mads/nebular/nebular_scenes6.cpp @@ -124,7 +124,7 @@ void Scene601::step() { switch (_game._trigger) { case 70: _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _scene->_sequences.addTimer(30, 71); break; @@ -431,7 +431,7 @@ void Scene602::actions() { case 1: { _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _lastSpriteIdx = _globals._spriteIndexes[3]; _lastSequenceIdx = _scene->_sequences.startCycle(_lastSpriteIdx, false, -1); _scene->_sequences.setDepth(_lastSequenceIdx, 14); @@ -775,7 +775,7 @@ void Scene604::step() { switch (_game._trigger) { case 70: _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _scene->_sequences.addTimer(30, 71); break; @@ -797,9 +797,9 @@ void Scene604::step() { break; } - if (_monsterActive && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _monsterFrame) { - _monsterFrame = _scene->_activeAnimation->getCurrentFrame(); + if (_monsterActive && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _monsterFrame) { + _monsterFrame = _scene->_animation[0]->getCurrentFrame(); int nextMonsterFrame = -1; switch (_monsterFrame) { @@ -837,7 +837,7 @@ void Scene604::step() { } if ((nextMonsterFrame >= 0) && (nextMonsterFrame != _monsterFrame)) { - _scene->_activeAnimation->setCurrentFrame(nextMonsterFrame); + _scene->_animation[0]->setCurrentFrame(nextMonsterFrame); _monsterFrame = nextMonsterFrame; } } @@ -1297,7 +1297,7 @@ void Scene607::step() { switch (_game._trigger) { case 80: _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _scene->_sequences.addTimer(6, 81); break; @@ -1331,7 +1331,7 @@ void Scene607::handleThrowingBone() { case 1: _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; if (_animationMode != 1) _scene->_hotspots.activate(NOUN_OBNOXIOUS_DOG, false); @@ -1605,7 +1605,7 @@ void Scene608::restoreAnimations() { _scene->_sequences.remove(_globals._sequenceIndexes[6]); _scene->_sequences.remove(_globals._sequenceIndexes[7]); _scene->loadAnimation(formAnimName('A', -1)); - _scene->_activeAnimation->setCurrentFrame(6); + _scene->_animation[0]->setCurrentFrame(6); } } @@ -1757,7 +1757,7 @@ void Scene608::enter() { int idx = _scene->_dynamicHotspots.add(NOUN_CAR, VERB_WALKTO, -1, Common::Rect(100, 100, 100 + 82, 100 + 25)); _carHotspotId = _scene->_dynamicHotspots.setPosition(idx, Common::Point(96, 132), FACING_NORTHEAST); _scene->loadAnimation(formAnimName('A', -1)); - _scene->_activeAnimation->setCurrentFrame(6); + _scene->_animation[0]->setCurrentFrame(6); } else if (_globals[kCarStatus] == CAR_SQUASHES_DOG) { _carMode = 2; _dogDeathMode = 0; @@ -1927,13 +1927,13 @@ void Scene608::step() { _animationMode = 0; } - if ((_carMode == 4) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) { - _carFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_carMode == 4) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _carFrame) { + _carFrame = _scene->_animation[0]->getCurrentFrame(); if (_carFrame == 10) { _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; } else if (_carFrame == 56) { resetDogVariables(); _animationMode = 0; @@ -1942,12 +1942,12 @@ void Scene608::step() { } } - if ((_carMode == 5) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) { - _carFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_carMode == 5) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _carFrame) { + _carFrame = _scene->_animation[0]->getCurrentFrame(); if (_carFrame == 10) { _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; } else if (_carFrame == 52) { resetDogVariables(); _animationMode = 0; @@ -1956,13 +1956,13 @@ void Scene608::step() { } } - if ((_carMode == 6) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) { - _carFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_carMode == 6) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _carFrame) { + _carFrame = _scene->_animation[0]->getCurrentFrame(); if (_carFrame == 11) { _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; } else if (_carFrame == 41) { _globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], false, 9, 0, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], 10, 11); @@ -2000,9 +2000,9 @@ void Scene608::step() { if (_game._trigger == 112) _dogYelping = false; - if ((_carMode == 0) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) { - _carFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_carMode == 0) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _carFrame) { + _carFrame = _scene->_animation[0]->getCurrentFrame(); int nextFrame = -1; if ((_globals[kCarStatus] == CAR_UP) || (_globals[kCarStatus] == CAR_DOWN)) { @@ -2015,7 +2015,7 @@ void Scene608::step() { break; case 1: - if (_scene->_activeAnimation->getCurrentFrame() >= 12) { + if (_scene->_animation[0]->getCurrentFrame() >= 12) { nextFrame = 0; _carMoveMode = 0; _globals[kCarStatus] = CAR_UP; @@ -2023,7 +2023,7 @@ void Scene608::step() { break; case 2: - if (_scene->_activeAnimation->getCurrentFrame() >= 6) { + if (_scene->_animation[0]->getCurrentFrame() >= 6) { nextFrame = 6; _carMoveMode = 0; _globals[kCarStatus] = CAR_DOWN; @@ -2035,35 +2035,35 @@ void Scene608::step() { } } - if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextFrame); + if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextFrame); _carFrame = nextFrame; } } } - if ((_carMode == 2) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) { - _carFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_carMode == 2) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _carFrame) { + _carFrame = _scene->_animation[0]->getCurrentFrame(); int nextFrame = -1; if (_carMoveMode == 0) nextFrame = 28; - else if (_scene->_activeAnimation->getCurrentFrame() >= 28) { + else if (_scene->_animation[0]->getCurrentFrame() >= 28) { nextFrame = 28; _carMoveMode = 0; } - if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextFrame); + if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextFrame); _carFrame = nextFrame; } } } - if ((_carMode == 3) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) { - _carFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_carMode == 3) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _carFrame) { + _carFrame = _scene->_animation[0]->getCurrentFrame(); int nextFrame = -1; if (_resetPositionsFl) { @@ -2071,22 +2071,22 @@ void Scene608::step() { _carMoveMode = 0; } else if (_carMoveMode == 0) nextFrame = 6; - else if (_scene->_activeAnimation->getCurrentFrame() >= 6) { + else if (_scene->_animation[0]->getCurrentFrame() >= 6) { nextFrame = 6; _carMoveMode = 0; } - if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextFrame); + if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextFrame); _carFrame = nextFrame; } } } - if ((_carMode == 1) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) { - _carFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_carMode == 1) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _carFrame) { + _carFrame = _scene->_animation[0]->getCurrentFrame(); int nextFrame = -1; if (_resetPositionsFl) { @@ -2094,13 +2094,13 @@ void Scene608::step() { _carMoveMode = 0; } else if (_carMoveMode == 0) nextFrame = 6; - else if (_scene->_activeAnimation->getCurrentFrame() >= 6) { + else if (_scene->_animation[0]->getCurrentFrame() >= 6) { nextFrame = 6; _carMoveMode = 0; } - if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextFrame); + if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextFrame); _carFrame = nextFrame; } } @@ -2605,7 +2605,7 @@ void Scene609::step() { switch (_game._trigger) { case 70: _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _scene->_sequences.addTimer(6, 71); break; @@ -4145,13 +4145,13 @@ void Scene611::step() { _hermitMovingFl = true; } - if (_stickFingerFl && (_scene->_activeAnimation->getCurrentFrame() == 47)) { + if (_stickFingerFl && (_scene->_animation[0]->getCurrentFrame() == 47)) { _stickFingerFl = false; _hermitMovingFl = true; _hermitMode = 1; } - if (_scene->_activeAnimation != nullptr && (_scene->_activeAnimation->getCurrentFrame() == 240) && _check1Fl) { + if (_scene->_animation[0] != nullptr && (_scene->_animation[0]->getCurrentFrame() == 240) && _check1Fl) { _check1Fl = false; _scene->_kernelMessages.add(Common::Point(33, 88), 0xFDFC, 0, 0, 90, _game.getQuote(0x27E)); _scene->_sequences.addTimer(120, 120); @@ -4240,7 +4240,7 @@ void Scene611::step() { } } - if (_scene->_activeAnimation != nullptr && _scene->_activeAnimation->getCurrentFrame() == 254) + if (_scene->_animation[0] != nullptr && _scene->_animation[0]->getCurrentFrame() == 254) _game._player._stepEnabled = true; if (_game._trigger == 110) { @@ -4266,7 +4266,7 @@ void Scene611::step() { } if (_hermitMode == 6) { - if ((_scene->_activeAnimation->getCurrentFrame() == 9) && _check1Fl) { + if ((_scene->_animation[0]->getCurrentFrame() == 9) && _check1Fl) { _scene->_sequences.remove(_globals._sequenceIndexes[3]); _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 1, 0, 0); _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 2); @@ -4275,7 +4275,7 @@ void Scene611::step() { _check1Fl = false; } - if ((_scene->_activeAnimation->getCurrentFrame() == 17) && !_check1Fl) { + if ((_scene->_animation[0]->getCurrentFrame() == 17) && !_check1Fl) { _nextFrame = 26; _hermitMode = 4; _check1Fl = true; @@ -4283,13 +4283,13 @@ void Scene611::step() { } if (_hermitMode == 4) { - if ((_scene->_activeAnimation->getCurrentFrame() == 33) && _check1Fl) { + if ((_scene->_animation[0]->getCurrentFrame() == 33) && _check1Fl) { displayHermitQuestions(_hermitDisplayedQuestion); _nextFrame = 1; _check1Fl = false; } - if ((_scene->_activeAnimation->getCurrentFrame() == 9) && !_check1Fl) { + if ((_scene->_animation[0]->getCurrentFrame() == 9) && !_check1Fl) { _nextFrame = 8; _scene->_sequences.addTimer(1, 113); _check1Fl = true; @@ -4315,8 +4315,8 @@ void Scene611::step() { _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 115); } - if ((_nextFrame >= 0) && (_nextFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(_nextFrame); + if ((_nextFrame >= 0) && (_nextFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(_nextFrame); _nextFrame = -1; } @@ -4588,7 +4588,7 @@ void Scene612::step() { switch (_game._trigger) { case 70: _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _scene->_sequences.addTimer(6, 71); break; diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp index c2a249e5f8..58280a73f4 100644 --- a/engines/mads/nebular/nebular_scenes7.cpp +++ b/engines/mads/nebular/nebular_scenes7.cpp @@ -361,7 +361,7 @@ void Scene701::actions() { case 1: { _game._player._visible = true; - _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount; + _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount; _globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, -1); _scene->_sequences.setDepth (_globals._sequenceIndexes[2], 9); int idx = _scene->_dynamicHotspots.add(NOUN_BOAT, VERB_CLIMB_INTO, _globals._sequenceIndexes[2], Common::Rect(0, 0, 0, 0)); @@ -694,7 +694,7 @@ void Scene703::enter() { _boatDir = 2; _monsterMode = 0; _scene->loadAnimation(formAnimName('A', -1)); - _scene->_activeAnimation->setCurrentFrame(34); + _scene->_animation[0]->setCurrentFrame(34); } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._stepEnabled = false; _boatDir = 1; @@ -712,17 +712,17 @@ void Scene703::enter() { _boatDir = 1; _monsterMode = 1; _scene->loadAnimation(formAnimName('B', -1)); - _scene->_activeAnimation->setCurrentFrame(39); + _scene->_animation[0]->setCurrentFrame(39); } else if (_boatDir == 1) { _curSequence = 0; _monsterMode = 0; _scene->loadAnimation(formAnimName('A', -1)); - _scene->_activeAnimation->setCurrentFrame(9); + _scene->_animation[0]->setCurrentFrame(9); } else if (_boatDir == 2) { _curSequence = 0; _monsterMode = 0; _scene->loadAnimation(formAnimName('A', -1)); - _scene->_activeAnimation->setCurrentFrame(56); + _scene->_animation[0]->setCurrentFrame(56); } if (_scene->_roomChanged) { @@ -764,9 +764,9 @@ void Scene703::step() { if (_game._trigger == 70) _scene->_reloadSceneFlag = true; - if ((_monsterMode == 3) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _boatFrame) { - _boatFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_monsterMode == 3) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _boatFrame) { + _boatFrame = _scene->_animation[0]->getCurrentFrame(); int nextBoatFrame = -1; if (_boatFrame == 62) { @@ -777,8 +777,8 @@ void Scene703::step() { } } - if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextBoatFrame); + if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextBoatFrame); _boatFrame = nextBoatFrame; } } @@ -787,9 +787,9 @@ void Scene703::step() { if (_game._trigger == 70) _scene->_reloadSceneFlag = true; - if ((_monsterMode == 0) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _boatFrame) { - _boatFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_monsterMode == 0) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _boatFrame) { + _boatFrame = _scene->_animation[0]->getCurrentFrame(); int nextBoatFrame = -1; switch (_boatFrame) { @@ -860,8 +860,8 @@ void Scene703::step() { break; } - if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextBoatFrame); + if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextBoatFrame); _boatFrame = nextBoatFrame; } } @@ -895,9 +895,9 @@ void Scene703::step() { } - if ((_monsterMode == 1) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _boatFrame) { - _boatFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_monsterMode == 1) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _boatFrame) { + _boatFrame = _scene->_animation[0]->getCurrentFrame(); int nextBoatFrame = -1; switch (_boatFrame) { @@ -934,16 +934,16 @@ void Scene703::step() { break; } - if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextBoatFrame); + if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextBoatFrame); _boatFrame = nextBoatFrame; } } } - if ((_monsterMode == 2) && (_scene->_activeAnimation != nullptr)) { - if (_scene->_activeAnimation->getCurrentFrame() != _boatFrame) { - _boatFrame = _scene->_activeAnimation->getCurrentFrame(); + if ((_monsterMode == 2) && (_scene->_animation[0] != nullptr)) { + if (_scene->_animation[0]->getCurrentFrame() != _boatFrame) { + _boatFrame = _scene->_animation[0]->getCurrentFrame(); int nextBoatFrame = -1; switch (_boatFrame) { @@ -983,7 +983,7 @@ void Scene703::step() { _scene->freeAnimation(); _monsterMode = 1; _scene->loadAnimation(formAnimName('B', -1)); - _scene->_activeAnimation->setCurrentFrame(39); + _scene->_animation[0]->setCurrentFrame(39); _game._player._stepEnabled = true; break; @@ -992,7 +992,7 @@ void Scene703::step() { _scene->freeAnimation(); _monsterMode = 1; _scene->loadAnimation(formAnimName('B', -1)); - _scene->_activeAnimation->setCurrentFrame(39); + _scene->_animation[0]->setCurrentFrame(39); _game._player._stepEnabled = true; } else _game._objects.setRoom(OBJ_CHICKEN_BOMB, 1); @@ -1005,7 +1005,7 @@ void Scene703::step() { _scene->freeAnimation(); _monsterMode = 0; _scene->loadAnimation(formAnimName('A', -1)); - _scene->_activeAnimation->setCurrentFrame(9); + _scene->_animation[0]->setCurrentFrame(9); _game._player._stepEnabled = true; if (_game._storyMode == STORYMODE_NAUGHTY) _vm->_dialogs->show(70321); @@ -1018,8 +1018,8 @@ void Scene703::step() { break; } - if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextBoatFrame); + if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextBoatFrame); _boatFrame = nextBoatFrame; } } @@ -1055,7 +1055,7 @@ void Scene703::actions() { _scene->freeAnimation(); _monsterMode = 2; _scene->loadAnimation(formAnimName('C', -1)); - _scene->_activeAnimation->setCurrentFrame(19); + _scene->_animation[0]->setCurrentFrame(19); } else if (_action.isAction(VERB_THROW, NOUN_CHICKEN, NOUN_SEA_MONSTER)) { _game._player._stepEnabled = false; _scene->freeAnimation(); @@ -1066,13 +1066,13 @@ void Scene703::actions() { _scene->freeAnimation(); _monsterMode = 2; _scene->loadAnimation(formAnimName('C', -1)); - _scene->_activeAnimation->setCurrentFrame(39); + _scene->_animation[0]->setCurrentFrame(39); } else if (_action.isAction(VERB_THROW, NOUN_BOMB, NOUN_SEA_MONSTER)) { _game._player._stepEnabled = false; _scene->freeAnimation(); _monsterMode = 2; _scene->loadAnimation(formAnimName('C', -1)); - _scene->_activeAnimation->setCurrentFrame(59); + _scene->_animation[0]->setCurrentFrame(59); } else if (_action.isAction(VERB_THROW, NOUN_CHICKEN_BOMB, NOUN_SEA_MONSTER)) { _useBomb = true; _game._player._stepEnabled = false; @@ -1241,21 +1241,21 @@ void Scene704::enter() { _animationMode = 2; _boatDirection = 2; _scene->loadAnimation(formAnimName('A', -1)); - _scene->_activeAnimation->setCurrentFrame(36); + _scene->_animation[0]->setCurrentFrame(36); } else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) { _game._player._stepEnabled = false; _boatDirection = 1; _scene->loadAnimation(formAnimName('A', -1)); } else if (_boatDirection == 1) { _scene->loadAnimation(formAnimName('A', -1)); - _scene->_activeAnimation->setCurrentFrame(8); + _scene->_animation[0]->setCurrentFrame(8); } else if (_boatDirection == 2) { if (_game._objects[OBJ_BOTTLE]._roomNumber == _scene->_currentSceneId) { _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(123, 125)); _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1); } _scene->loadAnimation(formAnimName('A', -1)); - _scene->_activeAnimation->setCurrentFrame(57); + _scene->_animation[0]->setCurrentFrame(57); } if (_scene->_roomChanged) @@ -1269,9 +1269,9 @@ void Scene704::enter() { } void Scene704::step() { - if (_scene->_activeAnimation != nullptr) { - if (_scene->_activeAnimation->getCurrentFrame() != _boatCurrentFrame) { - _boatCurrentFrame = _scene->_activeAnimation->getCurrentFrame(); + if (_scene->_animation[0] != nullptr) { + if (_scene->_animation[0]->getCurrentFrame() != _boatCurrentFrame) { + _boatCurrentFrame = _scene->_animation[0]->getCurrentFrame(); int nextFrame = -1; switch (_boatCurrentFrame) { @@ -1377,8 +1377,8 @@ void Scene704::step() { break; } - if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) { - _scene->_activeAnimation->setCurrentFrame(nextFrame); + if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) { + _scene->_animation[0]->setCurrentFrame(nextFrame); _boatCurrentFrame = nextFrame; } } @@ -1906,9 +1906,9 @@ void Scene706::step() { _scene->_reloadSceneFlag = true; } - if (_scene->_activeAnimation != nullptr) { - if ((_animationMode != 0) && (_scene->_activeAnimation->getCurrentFrame() != _animationFrame)) { - _animationFrame = _scene->_activeAnimation->getCurrentFrame(); + if (_scene->_animation[0] != nullptr) { + if ((_animationMode != 0) && (_scene->_animation[0]->getCurrentFrame() != _animationFrame)) { + _animationFrame = _scene->_animation[0]->getCurrentFrame(); if (_animationFrame == 6) { _scene->_sequences.remove(_globals._sequenceIndexes[1]); diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index a904569624..3c5cfe37a4 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -930,7 +930,7 @@ void Scene804::enter() { void Scene804::step() { if (!_messWithThrottle) { - if ((_throttleGone) && (_movingThrottle) && (_scene->_activeAnimation->getCurrentFrame() == 39)) { + if ((_throttleGone) && (_movingThrottle) && (_scene->_animation[0]->getCurrentFrame() == 39)) { _globals._sequenceIndexes[1] = _scene->_sequences.startCycle (_globals._spriteIndexes[1], false, 1); _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(133, 139)); @@ -938,7 +938,7 @@ void Scene804::step() { _throttleGone = false; } - if ((_movingThrottle) && (_scene->_activeAnimation->getCurrentFrame() == 42)) { + if ((_movingThrottle) && (_scene->_animation[0]->getCurrentFrame() == 42)) { _resetFrame = 0; _movingThrottle = false; } @@ -947,12 +947,12 @@ void Scene804::step() { _resetFrame = 42; } - if (_scene->_activeAnimation->getCurrentFrame() == 65) + if (_scene->_animation[0]->getCurrentFrame() == 65) _scene->_sequences.remove(_globals._sequenceIndexes[7]); switch (_game._storyMode) { case STORYMODE_NAUGHTY: - if (_scene->_activeAnimation->getCurrentFrame() == 81) { + if (_scene->_animation[0]->getCurrentFrame() == 81) { _resetFrame = 80; _globals[kInSpace] = false; _globals[kBeamIsUp] = true; @@ -964,7 +964,7 @@ void Scene804::step() { break; case STORYMODE_NICE: - if (_scene->_activeAnimation->getCurrentFrame() == 68) { + if (_scene->_animation[0]->getCurrentFrame() == 68) { _resetFrame = 66; _globals[kInSpace] = false; _globals[kBeamIsUp] = true; @@ -975,12 +975,12 @@ void Scene804::step() { } } - if (_scene->_activeAnimation->getCurrentFrame() == 34) { + if (_scene->_animation[0]->getCurrentFrame() == 34) { _resetFrame = 36; _scene->_sequences.remove(_globals._sequenceIndexes[1]); } - if (_scene->_activeAnimation->getCurrentFrame() == 37) { + if (_scene->_animation[0]->getCurrentFrame() == 37) { _resetFrame = 36; if (!_dontPullThrottleAgain) { _dontPullThrottleAgain = true; @@ -992,20 +992,20 @@ void Scene804::step() { _scene->_nextSceneId = 803; } - if ((_scene->_activeAnimation->getCurrentFrame() == 7) && (!_globals[kWindowFixed])) { + if ((_scene->_animation[0]->getCurrentFrame() == 7) && (!_globals[kWindowFixed])) { _globals._sequenceIndexes[4] = _scene->_sequences.startCycle(_globals._spriteIndexes[4], false, 1); _scene->_sequences.addTimer(20, 110); _globals[kWindowFixed] = true; } - if (_scene->_activeAnimation->getCurrentFrame() == 10) { + if (_scene->_animation[0]->getCurrentFrame() == 10) { _resetFrame = 0; _game._player._stepEnabled = true; _game._objects.setRoom(OBJ_POLYCEMENT, NOWHERE); } // FIXME: Original doesn't have resetFrame check. Check why this has been needed - if (_resetFrame == -1 && _scene->_activeAnimation->getCurrentFrame() == 1) { + if (_resetFrame == -1 && _scene->_animation[0]->getCurrentFrame() == 1) { int randomVal = _vm->getRandomNumber(29) + 1; switch (randomVal) { case 1: @@ -1023,7 +1023,7 @@ void Scene804::step() { } } - switch (_scene->_activeAnimation->getCurrentFrame()) { + switch (_scene->_animation[0]->getCurrentFrame()) { case 26: case 28: case 31: @@ -1031,12 +1031,12 @@ void Scene804::step() { break; } } else { - if ((_scene->_activeAnimation->getCurrentFrame() == 36) && (!_throttleGone)) { + if ((_scene->_animation[0]->getCurrentFrame() == 36) && (!_throttleGone)) { _scene->_sequences.remove(_globals._sequenceIndexes[1]); _throttleGone = true; } - if (_scene->_activeAnimation->getCurrentFrame() == 39) { + if (_scene->_animation[0]->getCurrentFrame() == 39) { _movingThrottle = false; switch (_throttleCounter) { case 1: @@ -1074,8 +1074,8 @@ void Scene804::step() { } if (_resetFrame >= 0) { - if (_resetFrame != _scene->_activeAnimation->getCurrentFrame()) { - _scene->_activeAnimation->setCurrentFrame(_resetFrame); + if (_resetFrame != _scene->_animation[0]->getCurrentFrame()) { + _scene->_animation[0]->setCurrentFrame(_resetFrame); _resetFrame = -1; } } @@ -1084,12 +1084,12 @@ void Scene804::step() { _scene->_nextSceneId = 803; } - if ((_scene->_activeAnimation->getCurrentFrame() == 72) && !_alreadyPop) { + if ((_scene->_animation[0]->getCurrentFrame() == 72) && !_alreadyPop) { _vm->_sound->command(21); _alreadyPop = true; } - if ((_scene->_activeAnimation->getCurrentFrame() == 80) && !_alreadyOrgan) { + if ((_scene->_animation[0]->getCurrentFrame() == 80) && !_alreadyOrgan) { _vm->_sound->command(22); _alreadyOrgan = true; } @@ -1606,7 +1606,7 @@ void Scene810::enter() { } void Scene810::step() { - if (_scene->_activeAnimation && (_scene->_activeAnimation->getCurrentFrame() == 200) + if (_scene->_animation[0] && (_scene->_animation[0]->getCurrentFrame() == 200) && _moveAllowed) { _scene->_sequences.addTimer(100, 70); _moveAllowed = false; diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index ee5f1a5440..9eb6a1aa86 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -49,7 +49,8 @@ Scene::Scene(MADSEngine *vm) _reloadSceneFlag = false; _freeAnimationFlag = false; _animationData = nullptr; - _activeAnimation = nullptr; + for (int i = 0; i < 10; i++) + _animation[i] = nullptr; _textSpacing = -1; _frameStartTime = 0; _mode = SCREENMODE_VGA; @@ -430,8 +431,10 @@ void Scene::doFrame() { _sequences.tick(); // Handle any active animation - if (_activeAnimation) - _activeAnimation->update(); + for (int i = 0; i < 10; i++) { + if (_animation[i]) + _animation[i]->update(); + } } // If the debugget flag is set, show the mouse position @@ -480,8 +483,10 @@ void Scene::doFrame() { _vm->_game->_fx = kTransitionNone; // Handle freeing animation if necessary - if (_activeAnimation && _activeAnimation->freeFlag()) - _freeAnimationFlag = true; + for (int i = 0; i < 10; i++) { + if (_animation[i] && _animation[i]->freeFlag()) + _freeAnimationFlag = true; + } if (_freeAnimationFlag) freeAnimation(); } @@ -605,19 +610,19 @@ void Scene::checkKeyboard() { } } -void Scene::loadAnimation(const Common::String &resName, int trigger) { +void Scene::loadAnimation(const Common::String &resName, int trigger, int id) { // WORKAROUND: If there's already a previous active animation used by the // scene, then free it before we create the new one - if (_activeAnimation) + if ((_vm->getGameID() == GType_RexNebular) && _animation[id]) freeAnimation(); DepthSurface depthSurface; UserInterface interfaceSurface(_vm); - _activeAnimation = Animation::init(_vm, this); - _activeAnimation->load(interfaceSurface, depthSurface, resName, + _animation[id] = Animation::init(_vm, this); + _animation[id]->load(interfaceSurface, depthSurface, resName, _vm->_dithering ? ANIMFLAG_DITHER : 0, nullptr, nullptr); - _activeAnimation->startAnimation(trigger); + _animation[id]->startAnimation(trigger); } void Scene::updateCursor() { @@ -658,9 +663,12 @@ void Scene::freeCurrentScene() { delete _animationData; _animationData = nullptr; } - if (_activeAnimation) { - delete _activeAnimation; - _activeAnimation = nullptr; + + for (int i = 0; i < 10; i++) { + if (_animation[i]) { + delete _animation[i]; + _animation[i] = nullptr; + } } _vm->_palette->_paletteUsage.load(nullptr); @@ -692,30 +700,34 @@ void Scene::resetScene() { } void Scene::freeAnimation() { - if (_activeAnimation) { - Player &player = _vm->_game->_player; + for (int j = 0; j < 10; j++) { + if (_animation[j]) { + if (j == 0) { + Player &player = _vm->_game->_player; + + if (!_freeAnimationFlag) { + _spriteSlots.fullRefresh(true); + _sequences.scan(); + } - if (!_freeAnimationFlag) { - _spriteSlots.fullRefresh(true); - _sequences.scan(); - } + // Refresh the player + if (player._visible) { + player._forceRefresh = true; + player.update(); + } + } - // Refresh the player - if (player._visible) { - player._forceRefresh = true; - player.update(); - } + // Remove any kernel messages in use by the animation + for (uint i = 0; i < _animation[j]->_messages.size(); ++i) { + int msgIndex = _animation[j]->_messages[i]._kernelMsgIndex; + if (msgIndex >= 0) + _kernelMessages.remove(msgIndex); + } - // Remove any kernel messages in use by the animation - for (uint i = 0; i < _activeAnimation->_messages.size(); ++i) { - int msgIndex = _activeAnimation->_messages[i]._kernelMsgIndex; - if (msgIndex >= 0) - _kernelMessages.remove(msgIndex); + // Delete the animation + delete _animation[j]; + _animation[j] = nullptr; } - - // Delete the animation - delete _activeAnimation; - _activeAnimation = nullptr; } _freeAnimationFlag = false; diff --git a/engines/mads/scene.h b/engines/mads/scene.h index c0784c3812..a29f8a0ded 100644 --- a/engines/mads/scene.h +++ b/engines/mads/scene.h @@ -111,7 +111,7 @@ public: Common::Array<PaletteCycle> _paletteCycles; Common::StringArray _vocabStrings; Animation *_animationData; - Animation *_activeAnimation; + Animation *_animation[10]; bool _freeAnimationFlag; int _depthStyle; int _bandsRange; @@ -214,7 +214,7 @@ public: /** * Load an animation */ - void loadAnimation(const Common::String &resName, int trigger = 0); + void loadAnimation(const Common::String &resName, int trigger = 0, int id = 0); /** * Returns a vocab entry |