diff options
author | johndoe123 | 2014-01-23 13:21:20 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-05-10 09:54:21 +0200 |
commit | 4752703298c568a87b3a7bfb281cd1993d9de3c7 (patch) | |
tree | cd318bb5146ae3543084c36b82d08bfbb015cfcb | |
parent | d5d7d3c802ed676fc8f5db98e1158bec5a2f286e (diff) | |
download | scummvm-rg350-4752703298c568a87b3a7bfb281cd1993d9de3c7.tar.gz scummvm-rg350-4752703298c568a87b3a7bfb281cd1993d9de3c7.tar.bz2 scummvm-rg350-4752703298c568a87b3a7bfb281cd1993d9de3c7.zip |
GNAP: Clean up scene 38
-rw-r--r-- | engines/gnap/gnap.cpp | 2 | ||||
-rw-r--r-- | engines/gnap/gnap.h | 1 | ||||
-rw-r--r-- | engines/gnap/scenes/scene38.cpp | 112 |
3 files changed, 63 insertions, 52 deletions
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp index 86fc38d7c0..677b073207 100644 --- a/engines/gnap/gnap.cpp +++ b/engines/gnap/gnap.cpp @@ -751,7 +751,7 @@ void GnapEngine::mainLoop() { // > DEBUG BEGIN _currentSceneNum = 53; - _newSceneNum = 32; + _newSceneNum = 38; _newCursorValue = 3; // < DEBUG END diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h index cf146e407d..86bce8d935 100644 --- a/engines/gnap/gnap.h +++ b/engines/gnap/gnap.h @@ -816,6 +816,7 @@ public: void scene32_run(); void scene32_updateAnimations(); + // Scene 33 int _s33_currChickenSequenceId, _s33_nextChickenSequenceId; int scene33_init(); void scene33_updateHotspots(); diff --git a/engines/gnap/scenes/scene38.cpp b/engines/gnap/scenes/scene38.cpp index cfbaf9dcaf..53768fe9ca 100644 --- a/engines/gnap/scenes/scene38.cpp +++ b/engines/gnap/scenes/scene38.cpp @@ -42,6 +42,16 @@ enum { kHSWalkArea6 = 12 }; +enum { + kASLeaveScene = 0, + kASExitCave = 1, + kASUseHuntingTrophy = 2, + kASHoldingHuntingTrophy = 3, + kASReleaseHuntingTrophy = 4, + kASUseBeaverWithTrapDoor = 5, + kASBeaverHoldingTrapDoor = 6 +}; + int GnapEngine::scene38_init() { _gameSys->setAnimation(0, 0, 0); _gameSys->setAnimation(0, 0, 1); @@ -62,21 +72,21 @@ void GnapEngine::scene38_updateHotspots() { setHotspot(kHSWalkArea5, 770, 0, 799, 445); setHotspot(kHSWalkArea6, 393, 0, 698, 445, SF_WALKABLE | SF_DISABLED); setDeviceHotspot(kHSDevice, -1, -1, -1, -1); - if (_beaverActionStatus == 6) + if (_beaverActionStatus == kASBeaverHoldingTrapDoor) _hotspots[kHSPlatypus].flags = SF_WALKABLE | SF_DISABLED; - if (_beaverActionStatus == 6) + if (_beaverActionStatus == kASBeaverHoldingTrapDoor) _hotspots[kHSExitCave].flags = SF_EXIT_D_CURSOR; - else if (_gnapActionStatus == 3) + else if (_gnapActionStatus == kASHoldingHuntingTrophy) _hotspots[kHSExitCave].flags = SF_EXIT_D_CURSOR; - if (_beaverActionStatus == 6) + if (_beaverActionStatus == kASBeaverHoldingTrapDoor) _hotspots[kHSTrapDoorLid1].flags = SF_DISABLED; - else if (_gnapActionStatus == 3) + else if (_gnapActionStatus == kASHoldingHuntingTrophy) _hotspots[kHSTrapDoorLid1].flags = SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR; - if (_beaverActionStatus == 6) + if (_beaverActionStatus == kASBeaverHoldingTrapDoor) _hotspots[kHSTrapDoorLid2].flags = SF_DISABLED; - else if (_gnapActionStatus == 3) + else if (_gnapActionStatus == kASHoldingHuntingTrophy) _hotspots[kHSTrapDoorLid2].flags = SF_PLAT_CURSOR | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR; - if (_beaverActionStatus == 6) + if (_beaverActionStatus == kASBeaverHoldingTrapDoor) _hotspots[kHSWalkArea6].flags = 0; _hotspotsCount = 13; } @@ -111,8 +121,8 @@ void GnapEngine::scene38_run() { break; case kHSPlatypus: - if (_gnapActionStatus == 3) { - _gnapActionStatus = 4; + if (_gnapActionStatus == kASHoldingHuntingTrophy) { + _gnapActionStatus = kASReleaseHuntingTrophy; } else if (_grabCursorSpriteIndex >= 0) { playGnapImpossible(_platX, _platY); } else { @@ -135,42 +145,42 @@ void GnapEngine::scene38_run() { break; case kHSExitHouse: - if (_gnapActionStatus == 3) { - _gnapActionStatus = 4; + if (_gnapActionStatus == kASHoldingHuntingTrophy) { + _gnapActionStatus = kASReleaseHuntingTrophy; } else { - _isLeavingScene = 1; + _isLeavingScene = true; gnapWalkTo(-1, -1, 0, 0x107AE, 1); - _gnapActionStatus = 0; + _gnapActionStatus = kASLeaveScene; _newSceneNum = 37; } break; case kHSExitCave: - if (_gnapActionStatus == 3) { - _gnapActionStatus = 4; - if (_beaverActionStatus == 6) - _isLeavingScene = 1; - } else if (_beaverActionStatus == 6) { - _sceneWaiting = 0; - _isLeavingScene = 1; + if (_gnapActionStatus == kASHoldingHuntingTrophy) { + _gnapActionStatus = kASReleaseHuntingTrophy; + if (_beaverActionStatus == kASBeaverHoldingTrapDoor) + _isLeavingScene = true; + } else if (_beaverActionStatus == kASBeaverHoldingTrapDoor) { + _sceneWaiting = false; + _isLeavingScene = true; gnapWalkTo(5, 7, 0, 0x107BB, 1); _newSceneNum = 39; - _gnapActionStatus = 1; + _gnapActionStatus = kASExitCave; } break; case kHSTrapDoorLid1: case kHSTrapDoorLid2: - if (_gnapActionStatus == 3) { - if (_beaverActionStatus == 6 && _verbCursor == PLAT_CURSOR) - _gnapActionStatus = 5; + if (_gnapActionStatus == kASHoldingHuntingTrophy) { + if (_verbCursor == PLAT_CURSOR && _beaverActionStatus != kASBeaverHoldingTrapDoor) + _gnapActionStatus = kASUseBeaverWithTrapDoor; else - _gnapActionStatus = 4; + _gnapActionStatus = kASReleaseHuntingTrophy; } break; case kHSHuntingTrophy: - if (_gnapActionStatus != 3) { + if (_gnapActionStatus != kASHoldingHuntingTrophy) { if (_grabCursorSpriteIndex >= 0) { playGnapShowCurrItem(3, 6, 2, 0); } else { @@ -179,12 +189,12 @@ void GnapEngine::scene38_run() { playGnapScratchingHead(0, 0); break; case GRAB_CURSOR: - if (_beaverActionStatus == 6) + if (_beaverActionStatus == kASBeaverHoldingTrapDoor) playGnapImpossible(0, 0); else { gnapWalkTo(3, 6, 0, 0x107BB, 1); platypusWalkTo(4, 8, -1, -1, 1); - _gnapActionStatus = 2; + _gnapActionStatus = kASUseHuntingTrophy; } break; case TALK_CURSOR: @@ -207,16 +217,16 @@ void GnapEngine::scene38_run() { case kHSWalkArea4: case kHSWalkArea5: case kHSWalkArea6: - if (_gnapActionStatus == 3) - _gnapActionStatus = 4; + if (_gnapActionStatus == kASHoldingHuntingTrophy) + _gnapActionStatus = kASReleaseHuntingTrophy; else if (_gnapActionStatus < 0) gnapWalkTo(-1, -1, -1, -1, 1); break; default: if (_mouseClickState.left) { - if (_gnapActionStatus == 3) - _gnapActionStatus = 4; + if (_gnapActionStatus == kASHoldingHuntingTrophy) + _gnapActionStatus = kASReleaseHuntingTrophy; else if (_gnapActionStatus < 0) gnapWalkTo(-1, -1, -1, -1, 1); _mouseClickState.left = false; @@ -251,29 +261,29 @@ void GnapEngine::scene38_updateAnimations() { if (_gameSys->getAnimationStatus(0) == 2) { _gameSys->setAnimation(0, 0, 0); switch (_gnapActionStatus) { - case 0: + case kASLeaveScene: _sceneDone = true; break; - case 1: + case kASExitCave: _gameSys->removeSequence(_beaverSequenceId | (_beaverSequenceDatNum << 16), _beaverId, 1); _gameSys->insertSequence(0xA3, _gnapId, makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId, kSeqSyncWait, 0, 0, 0); _gnapSequenceId = 0xA3; _gnapSequenceDatNum = 0; _gameSys->setAnimation(0xA3, _gnapId, 0); - _gnapActionStatus = 0; + _gnapActionStatus = kASLeaveScene; break; - case 2: + case kASUseHuntingTrophy: _gameSys->removeSequence(0x9B, 0, 1); _gameSys->insertSequence(0x9C, _gnapId, makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId, kSeqSyncWait, 0, 0, 0); _gnapSequenceId = 0x9C; _gnapSequenceDatNum = 0; _gameSys->setAnimation(0x9C, _gnapId, 0); - _gnapActionStatus = 3; + _gnapActionStatus = kASHoldingHuntingTrophy; scene38_updateHotspots(); break; - case 3: - if (_beaverActionStatus != 6) - _sceneWaiting = 1; + case kASHoldingHuntingTrophy: + if (_beaverActionStatus != kASBeaverHoldingTrapDoor) + _sceneWaiting = true; if (_gnapSequenceId == 0xA4) { _gameSys->insertSequence(0x9D, _gnapId, makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId, kSeqSyncWait, 0, 0, 0); _gnapSequenceId = 0x9D; @@ -284,11 +294,11 @@ void GnapEngine::scene38_updateAnimations() { _gnapSequenceDatNum = 0; _gameSys->setAnimation(_gnapSequenceId, _gnapId, 0); break; - case 4: + case kASReleaseHuntingTrophy: if (_gnapSequenceId == 0x9E) { _gameSys->insertSequence(0x9B, 0, 0, 0, kSeqNone, 0, 0, 0); _gnapActionStatus = -1; - } else if (_beaverActionStatus == 6) { + } else if (_beaverActionStatus == kASBeaverHoldingTrapDoor) { _gameSys->insertSequence(0xA0, _gnapId, makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId, kSeqSyncWait, 0, 0, 0); _gnapSequenceId = 0xA0; _gnapSequenceDatNum = 0; @@ -296,10 +306,10 @@ void GnapEngine::scene38_updateAnimations() { _gnapY = 6; _gnapIdleFacing = 1; if (_isLeavingScene) { - _sceneWaiting = 0; + _sceneWaiting = false; gnapWalkTo(5, 7, 0, 0x107BB, 1); _newSceneNum = 39; - _gnapActionStatus = 1; + _gnapActionStatus = kASExitCave; } else { _gnapActionStatus = -1; } @@ -311,17 +321,17 @@ void GnapEngine::scene38_updateAnimations() { _gnapY = 6; _gnapIdleFacing = 1; _gameSys->setAnimation(0x9E, _gnapId, 0); - _sceneWaiting = 0; + _sceneWaiting = false; scene38_updateHotspots(); } break; - case 5: - _sceneWaiting = 0; + case kASUseBeaverWithTrapDoor: + _sceneWaiting = false; _gameSys->insertSequence(0x9F, _gnapId, makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId, kSeqSyncWait, 0, 0, 0); _gnapSequenceId = 0x9F; _gnapSequenceDatNum = 0; _gameSys->setAnimation(0x9F, _gnapId, 0); - _gnapActionStatus = 3; + _gnapActionStatus = kASHoldingHuntingTrophy; if (_beaverFacing) playBeaverSequence(0x107D5); else @@ -332,7 +342,7 @@ void GnapEngine::scene38_updateAnimations() { _beaverSequenceDatNum = 0; _beaverId = _gnapId + 1; _gameSys->setAnimation(0xA1, _gnapId + 1, 1); - _beaverActionStatus = 6; + _beaverActionStatus = kASBeaverHoldingTrapDoor; scene38_updateHotspots(); break; } @@ -340,7 +350,7 @@ void GnapEngine::scene38_updateAnimations() { if (_gameSys->getAnimationStatus(1) == 2) { _gameSys->setAnimation(0, 0, 1); - if (_beaverActionStatus == 6) { + if (_beaverActionStatus == kASBeaverHoldingTrapDoor) { _gameSys->insertSequence(0xA2, _beaverId, _beaverSequenceId | (_beaverSequenceDatNum << 16), _beaverId, kSeqSyncWait, 0, 0, 0); _beaverSequenceId = 0xA2; _beaverSequenceDatNum = 0; |