diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gnap/datarchive.cpp | 4 | ||||
-rw-r--r-- | engines/gnap/gnap.cpp | 1 | ||||
-rw-r--r-- | engines/gnap/scenes/scene18.cpp | 3 | ||||
-rw-r--r-- | engines/gnap/scenes/scene42.cpp | 42 |
4 files changed, 19 insertions, 31 deletions
diff --git a/engines/gnap/datarchive.cpp b/engines/gnap/datarchive.cpp index 0f6faee6df..a2de0b38e0 100644 --- a/engines/gnap/datarchive.cpp +++ b/engines/gnap/datarchive.cpp @@ -72,7 +72,7 @@ byte *DatArchive::load(int index) { DatManager::DatManager() { for (int i = 0; i < kMaxDatArchives; ++i) - _datArchives[i] = 0; + _datArchives[i] = nullptr; } DatManager::~DatManager() { @@ -87,7 +87,7 @@ void DatManager::open(int index, const char *filename) { void DatManager::close(int index) { delete _datArchives[index]; - _datArchives[index] = 0; + _datArchives[index] = nullptr; } byte *DatManager::loadResource(int resourceId) { diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp index b9519110ac..79cab3dc08 100644 --- a/engines/gnap/gnap.cpp +++ b/engines/gnap/gnap.cpp @@ -959,7 +959,6 @@ void GnapEngine::startSoundTimerC(int timerIndex) { } int GnapEngine::playSoundC() { - static const int kSoundIdsC[] = { 0x918, 0x91F, 0x920, 0x922, 0x923, 0x924, 0x926 diff --git a/engines/gnap/scenes/scene18.cpp b/engines/gnap/scenes/scene18.cpp index 4bd75f59a4..a13432d8fa 100644 --- a/engines/gnap/scenes/scene18.cpp +++ b/engines/gnap/scenes/scene18.cpp @@ -770,11 +770,9 @@ void GnapEngine::scene18_run() { if (isFlag(kGFGnapControlsToyUFO)) deleteSurface(&_s18_cowboyHatSurface); - } void GnapEngine::scene18_updateAnimations() { - if (_gameSys->getAnimationStatus(0) == 2) { _gameSys->setAnimation(0, 0, 0); switch (_gnapActionStatus) { @@ -1016,7 +1014,6 @@ void GnapEngine::scene18_updateAnimations() { scene18_platEndPhoning(true); } } - } } // End of namespace Gnap diff --git a/engines/gnap/scenes/scene42.cpp b/engines/gnap/scenes/scene42.cpp index 906d84f040..5685f5cda6 100644 --- a/engines/gnap/scenes/scene42.cpp +++ b/engines/gnap/scenes/scene42.cpp @@ -145,22 +145,19 @@ void GnapEngine::scene42_run() { } while (!_sceneDone) { - if (!isSoundPlaying(0x1094B)) playSound(0x1094B, true); - + updateMouseCursor(); updateCursorByHotspot(); - + testWalk(0, 0, -1, -1, -1, -1); - + _sceneClickedHotspot = getClickedHotspotId(); updateGrabCursorSprite(0, 0); - - if (isFlag(kGFGnapControlsToyUFO)) { + if (isFlag(kGFGnapControlsToyUFO)) { switch (_sceneClickedHotspot) { - case kHSUfoExitLeft: if (_toyUfoActionStatus < 0) { _isLeavingScene = true; @@ -194,7 +191,6 @@ void GnapEngine::scene42_run() { runMenu(); scene42_updateHotspots(); break; - } } else { switch (_sceneClickedHotspot) { @@ -203,7 +199,7 @@ void GnapEngine::scene42_run() { scene42_updateHotspots(); _timers[4] = getRandom(20) + 30; break; - + case kHSPlatypus: if (_gnapActionStatus < 0) { if (_grabCursorSpriteIndex >= 0) { @@ -277,7 +273,7 @@ void GnapEngine::scene42_run() { } } break; - + case kHSChickenLeg: if (_grabCursorSpriteIndex >= 0) { playGnapShowCurrItem(_hotspotsWalkPos[kHSChickenLeg].x, _hotspotsWalkPos[kHSChickenLeg].y, _hotspotsWalkPos[kHSChickenLeg].x - 1, 0); @@ -297,17 +293,16 @@ void GnapEngine::scene42_run() { } } break; - + case kHSWalkArea1: case kHSWalkArea2: if (_gnapActionStatus < 0) gnapWalkTo(-1, -1, -1, -1, 1); break; - + } - } - + if (_mouseClickState._left && _gnapActionStatus < 0) { _mouseClickState._left = false; if (isFlag(kGFGnapControlsToyUFO)) { @@ -317,11 +312,11 @@ void GnapEngine::scene42_run() { gnapWalkTo(-1, -1, -1, -1, 1); } } - + scene42_updateAnimations(); - + toyUfoCheckTimer(); - + if (!_isLeavingScene) { if (_beaverActionStatus < 0 && !isFlag(kGFGnapControlsToyUFO)) updateBeaverIdleSequence(); @@ -353,20 +348,18 @@ void GnapEngine::scene42_run() { } } } - + checkGameKeys(); - + if (isKeyStatus1(8)) { clearKeyStatus1(8); runMenu(); scene42_updateHotspots(); _timers[4] = getRandom(20) + 30; } - + gameUpdateTick(); - } - } void GnapEngine::scene42_updateAnimations() { @@ -447,7 +440,7 @@ void GnapEngine::scene42_updateAnimations() { break; } } - + if (_gameSys->getAnimationStatus(2) == 2 && _s42_nextBBQVendorSequenceId != -1) { _gameSys->insertSequence(_s42_nextBBQVendorSequenceId, 1, _s42_currBBQVendorSequenceId, 1, kSeqSyncWait, 0, 0, 0); _gameSys->setAnimation(_s42_nextBBQVendorSequenceId, 1, 2); @@ -455,7 +448,7 @@ void GnapEngine::scene42_updateAnimations() { _s42_nextBBQVendorSequenceId = -1; _timers[4] = getRandom(20) + 30; } - + if (_gameSys->getAnimationStatus(3) == 2) { switch (_toyUfoActionStatus) { case kASToyUfoLeaveScene: @@ -494,7 +487,6 @@ void GnapEngine::scene42_updateAnimations() { } _toyUfoActionStatus = -1; } - } } // End of namespace Gnap |