aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2016-04-23 19:34:42 +0200
committerEugene Sandulenko2016-05-10 09:54:21 +0200
commit093c58a397c3b97fd4175b33428849c9716cb7af (patch)
tree163ccd69525fb3159fac850d232f716c2dbf88f9
parent2e37c2b9e67b5196cf014aaa57e785289ec09348 (diff)
downloadscummvm-rg350-093c58a397c3b97fd4175b33428849c9716cb7af.tar.gz
scummvm-rg350-093c58a397c3b97fd4175b33428849c9716cb7af.tar.bz2
scummvm-rg350-093c58a397c3b97fd4175b33428849c9716cb7af.zip
GNAP: Refactor scene 29
-rw-r--r--engines/gnap/gnap.h10
-rw-r--r--engines/gnap/scenes/scene29.cpp316
-rw-r--r--engines/gnap/scenes/scene29.h52
-rw-r--r--engines/gnap/scenes/scenecore.cpp9
4 files changed, 218 insertions, 169 deletions
diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h
index aa0b3097b4..37099b770b 100644
--- a/engines/gnap/gnap.h
+++ b/engines/gnap/gnap.h
@@ -603,17 +603,9 @@ public:
void sceneXX_playRandomSound(int timerIndex);
void playSequences(int fullScreenSpriteId, int sequenceId1, int sequenceId2, int sequenceId3);
- // Scene 18
+ // Shared by scenes 17 & 18
int _s18_garbageCanPos;
- // Scene 29
- int _s28_currMonkeySequenceId, _s28_nextMonkeySequenceId;
- int _s28_currManSequenceId, _s28_nextManSequenceId;
- int scene29_init();
- void scene29_updateHotspots();
- void scene29_run();
- void scene29_updateAnimations();
-
// Scene 30
int _s30_kidSequenceId;
int scene30_init();
diff --git a/engines/gnap/scenes/scene29.cpp b/engines/gnap/scenes/scene29.cpp
index 3528141de4..0f64304272 100644
--- a/engines/gnap/scenes/scene29.cpp
+++ b/engines/gnap/scenes/scene29.cpp
@@ -23,6 +23,7 @@
#include "gnap/gnap.h"
#include "gnap/gamesys.h"
#include "gnap/resource.h"
+#include "gnap/scenes/scene29.h"
namespace Gnap {
@@ -41,100 +42,104 @@ enum {
kASLeaveScene = 2
};
-int GnapEngine::scene29_init() {
+Scene29::Scene29(GnapEngine *vm) : Scene(vm) {
+ _s28_currMonkeySequenceId = -1;
+ _s28_nextMonkeySequenceId = -1;
+ _s28_currManSequenceId = -1;
+ _s28_nextManSequenceId = -1;
+}
+
+int Scene29::init() {
return 0xF6;
}
-void GnapEngine::scene29_updateHotspots() {
- setHotspot(kHSPlatypus, 0, 0, 0, 0, SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR);
- setHotspot(kHSMonkey, 410, 374, 518, 516, SF_WALKABLE | SF_DISABLED, 3, 7);
- setHotspot(kHSExitCircus, 150, 585, 650, 600, SF_EXIT_D_CURSOR | SF_WALKABLE, 5, 9);
- setHotspot(kHSExitOutsideClown, 785, 0, 800, 600, SF_EXIT_R_CURSOR | SF_WALKABLE, 11, 9);
- setHotspot(kHSAracde, 88, 293, 155, 384, SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 3, 8);
- setHotspot(kHSWalkArea1, 0, 0, 800, 478);
- setDeviceHotspot(kHSDevice, -1, -1, -1, -1);
- if (invHas(kItemHorn))
- _hotspots[kHSMonkey]._flags = SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR;
- _hotspotsCount = 7;
+void Scene29::updateHotspots() {
+ _vm->setHotspot(kHSPlatypus, 0, 0, 0, 0, SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR);
+ _vm->setHotspot(kHSMonkey, 410, 374, 518, 516, SF_WALKABLE | SF_DISABLED, 3, 7);
+ _vm->setHotspot(kHSExitCircus, 150, 585, 650, 600, SF_EXIT_D_CURSOR | SF_WALKABLE, 5, 9);
+ _vm->setHotspot(kHSExitOutsideClown, 785, 0, 800, 600, SF_EXIT_R_CURSOR | SF_WALKABLE, 11, 9);
+ _vm->setHotspot(kHSAracde, 88, 293, 155, 384, SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR, 3, 8);
+ _vm->setHotspot(kHSWalkArea1, 0, 0, 800, 478);
+ _vm->setDeviceHotspot(kHSDevice, -1, -1, -1, -1);
+ if (_vm->invHas(kItemHorn))
+ _vm->_hotspots[kHSMonkey]._flags = SF_WALKABLE | SF_TALK_CURSOR | SF_GRAB_CURSOR | SF_LOOK_CURSOR;
+ _vm->_hotspotsCount = 7;
}
-void GnapEngine::scene29_run() {
-
- playSound(0x1093B, true);
- startSoundTimerB(6);
- queueInsertDeviceIcon();
+void Scene29::run() {
+ _vm->playSound(0x1093B, true);
+ _vm->startSoundTimerB(6);
+ _vm->queueInsertDeviceIcon();
- if (invHas(kItemHorn)) {
+ if (_vm->invHas(kItemHorn)) {
_s28_currMonkeySequenceId = 0xE8;
_s28_nextMonkeySequenceId = -1;
- _gameSys->setAnimation(0xE8, 159, 4);
- _gameSys->insertSequence(_s28_currMonkeySequenceId, 159, 0, 0, kSeqNone, 0, 0, 0);
- _gameSys->insertSequence(0xED, 39, 0, 0, kSeqNone, 0, 0, 0);
+ _vm->_gameSys->setAnimation(0xE8, 159, 4);
+ _vm->_gameSys->insertSequence(_s28_currMonkeySequenceId, 159, 0, 0, kSeqNone, 0, 0, 0);
+ _vm->_gameSys->insertSequence(0xED, 39, 0, 0, kSeqNone, 0, 0, 0);
_s28_currManSequenceId = 0xED;
_s28_nextManSequenceId = -1;
- _gameSys->setAnimation(0xED, 39, 3);
- _timers[4] = getRandom(20) + 60;
+ _vm->_gameSys->setAnimation(0xED, 39, 3);
+ _vm->_timers[4] = _vm->getRandom(20) + 60;
} else {
- _gameSys->insertSequence(0xF4, 19, 0, 0, kSeqNone, 0, 0, 0);
- _gameSys->setAnimation(0, 0, 4);
- _gameSys->insertSequence(0xED, 39, 0, 0, kSeqNone, 0, 0, 0);
- _gameSys->setAnimation(0, 0, 3);
+ _vm->_gameSys->insertSequence(0xF4, 19, 0, 0, kSeqNone, 0, 0, 0);
+ _vm->_gameSys->setAnimation(0, 0, 4);
+ _vm->_gameSys->insertSequence(0xED, 39, 0, 0, kSeqNone, 0, 0, 0);
+ _vm->_gameSys->setAnimation(0, 0, 3);
}
- _gameSys->insertSequence(0xF3, 39, 0, 0, kSeqLoop, 0, 0, 0);
- _gameSys->insertSequence(0xF5, 38, 0, 0, kSeqLoop, 0, 0, 0);
+ _vm->_gameSys->insertSequence(0xF3, 39, 0, 0, kSeqLoop, 0, 0, 0);
+ _vm->_gameSys->insertSequence(0xF5, 38, 0, 0, kSeqLoop, 0, 0, 0);
- if (_prevSceneNum == 27) {
- initGnapPos(12, 7, kDirBottomRight);
- initPlatypusPos(12, 8, kDirNone);
- endSceneInit();
- gnapWalkTo(8, 7, -1, 0x107B9, 1);
- platypusWalkTo(8, 8, -1, 0x107C2, 1);
+ if (_vm->_prevSceneNum == 27) {
+ _vm->initGnapPos(12, 7, kDirBottomRight);
+ _vm->initPlatypusPos(12, 8, kDirNone);
+ _vm->endSceneInit();
+ _vm->gnapWalkTo(8, 7, -1, 0x107B9, 1);
+ _vm->platypusWalkTo(8, 8, -1, 0x107C2, 1);
} else {
- initGnapPos(-1, 7, kDirBottomRight);
- initPlatypusPos(-2, 7, kDirNone);
- endSceneInit();
- gnapWalkTo(2, 7, -1, 0x107B9, 1);
- platypusWalkTo(1, 7, -1, 0x107C2, 1);
+ _vm->initGnapPos(-1, 7, kDirBottomRight);
+ _vm->initPlatypusPos(-2, 7, kDirNone);
+ _vm->endSceneInit();
+ _vm->gnapWalkTo(2, 7, -1, 0x107B9, 1);
+ _vm->platypusWalkTo(1, 7, -1, 0x107C2, 1);
}
- while (!_sceneDone) {
-
- updateMouseCursor();
- updateCursorByHotspot();
+ while (!_vm->_sceneDone) {
+ _vm->updateMouseCursor();
+ _vm->updateCursorByHotspot();
- _sceneClickedHotspot = getClickedHotspotId();
- updateGrabCursorSprite(0, 0);
+ _vm->_sceneClickedHotspot = _vm->getClickedHotspotId();
+ _vm->updateGrabCursorSprite(0, 0);
- switch (_sceneClickedHotspot) {
-
+ switch (_vm->_sceneClickedHotspot) {
case kHSDevice:
- if (_gnapActionStatus < 0) {
- runMenu();
- scene29_updateHotspots();
+ if (_vm->_gnapActionStatus < 0) {
+ _vm->runMenu();
+ updateHotspots();
}
break;
case kHSPlatypus:
- if (_gnapActionStatus < 0) {
- if (_grabCursorSpriteIndex == kItemJoint) {
- gnapUseJointOnPlatypus();
- } else if (_grabCursorSpriteIndex >= 0) {
- playGnapImpossible(0, 0);
+ if (_vm->_gnapActionStatus < 0) {
+ if (_vm->_grabCursorSpriteIndex == kItemJoint) {
+ _vm->gnapUseJointOnPlatypus();
+ } else if (_vm->_grabCursorSpriteIndex >= 0) {
+ _vm->playGnapImpossible(0, 0);
} else {
- switch (_verbCursor) {
+ switch (_vm->_verbCursor) {
case LOOK_CURSOR:
- playGnapMoan1(_platX, _platY);
+ _vm->playGnapMoan1(_vm->_platX, _vm->_platY);
break;
case GRAB_CURSOR:
- gnapKissPlatypus(0);
+ _vm->gnapKissPlatypus(0);
break;
case TALK_CURSOR:
- playGnapBrainPulsating(_platX, _platY);
- playPlatypusSequence(getPlatypusSequenceId());
+ _vm->playGnapBrainPulsating(_vm->_platX, _vm->_platY);
+ _vm->playPlatypusSequence(_vm->getPlatypusSequenceId());
break;
case PLAT_CURSOR:
- playGnapImpossible(0, 0);
+ _vm->playGnapImpossible(0, 0);
break;
}
}
@@ -142,27 +147,27 @@ void GnapEngine::scene29_run() {
break;
case kHSMonkey:
- if (_gnapActionStatus < 0) {
- if (_grabCursorSpriteIndex == kItemBanana) {
- _gnapIdleFacing = kDirBottomRight;
- gnapWalkTo(_hotspotsWalkPos[kHSMonkey].x, _hotspotsWalkPos[kHSMonkey].y, 0, getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
- _gnapActionStatus = kASUseBananaWithMonkey;
- _newSceneNum = 51;
- _isLeavingScene = true;
- setGrabCursorSprite(-1);
- } else if (_grabCursorSpriteIndex >= 0) {
- playGnapShowCurrItem(_hotspotsWalkPos[kHSMonkey].x, _hotspotsWalkPos[kHSMonkey].y, 5, 6);
+ if (_vm->_gnapActionStatus < 0) {
+ if (_vm->_grabCursorSpriteIndex == kItemBanana) {
+ _vm->_gnapIdleFacing = kDirBottomRight;
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHSMonkey].x, _vm->_hotspotsWalkPos[kHSMonkey].y, 0, _vm->getGnapSequenceId(gskIdle, 0, 0) | 0x10000, 1);
+ _vm->_gnapActionStatus = kASUseBananaWithMonkey;
+ _vm->_newSceneNum = 51;
+ _vm->_isLeavingScene = true;
+ _vm->setGrabCursorSprite(-1);
+ } else if (_vm->_grabCursorSpriteIndex >= 0) {
+ _vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[kHSMonkey].x, _vm->_hotspotsWalkPos[kHSMonkey].y, 5, 6);
} else {
- switch (_verbCursor) {
+ switch (_vm->_verbCursor) {
case LOOK_CURSOR:
- playGnapScratchingHead(5, 6);
+ _vm->playGnapScratchingHead(5, 6);
break;
case TALK_CURSOR:
- playGnapBrainPulsating(_hotspotsWalkPos[kHSMonkey].x, _hotspotsWalkPos[kHSMonkey].y);
+ _vm->playGnapBrainPulsating(_vm->_hotspotsWalkPos[kHSMonkey].x, _vm->_hotspotsWalkPos[kHSMonkey].y);
break;
case GRAB_CURSOR:
case PLAT_CURSOR:
- playGnapImpossible(0, 0);
+ _vm->playGnapImpossible(0, 0);
break;
}
}
@@ -170,45 +175,45 @@ void GnapEngine::scene29_run() {
break;
case kHSExitCircus:
- if (_gnapActionStatus < 0) {
- _isLeavingScene = true;
- _newSceneNum = 26;
- gnapWalkTo(_hotspotsWalkPos[kHSExitCircus].x, _hotspotsWalkPos[kHSExitCircus].y, 0, 0x107AE, 1);
- _gnapActionStatus = kASLeaveScene;
- platypusWalkTo(_hotspotsWalkPos[kHSExitCircus].x + 1, _hotspotsWalkPos[kHSExitCircus].y, -1, -1, 1);
+ if (_vm->_gnapActionStatus < 0) {
+ _vm->_isLeavingScene = true;
+ _vm->_newSceneNum = 26;
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHSExitCircus].x, _vm->_hotspotsWalkPos[kHSExitCircus].y, 0, 0x107AE, 1);
+ _vm->_gnapActionStatus = kASLeaveScene;
+ _vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHSExitCircus].x + 1, _vm->_hotspotsWalkPos[kHSExitCircus].y, -1, -1, 1);
}
break;
case kHSExitOutsideClown:
- if (_gnapActionStatus < 0) {
- _isLeavingScene = true;
- _newSceneNum = 27;
- gnapWalkTo(_hotspotsWalkPos[kHSExitOutsideClown].x, _hotspotsWalkPos[kHSExitOutsideClown].y, 0, 0x107AB, 1);
- _gnapActionStatus = kASLeaveScene;
- platypusWalkTo(_hotspotsWalkPos[kHSExitOutsideClown].x, _hotspotsWalkPos[kHSExitOutsideClown].y - 1, -1, 0x107CD, 1);
+ if (_vm->_gnapActionStatus < 0) {
+ _vm->_isLeavingScene = true;
+ _vm->_newSceneNum = 27;
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHSExitOutsideClown].x, _vm->_hotspotsWalkPos[kHSExitOutsideClown].y, 0, 0x107AB, 1);
+ _vm->_gnapActionStatus = kASLeaveScene;
+ _vm->platypusWalkTo(_vm->_hotspotsWalkPos[kHSExitOutsideClown].x, _vm->_hotspotsWalkPos[kHSExitOutsideClown].y - 1, -1, 0x107CD, 1);
}
break;
case kHSAracde:
- if (_gnapActionStatus < 0) {
- if (_grabCursorSpriteIndex == kItemDiceQuarterHole) {
- setGrabCursorSprite(-1);
- _isLeavingScene = true;
- _newSceneNum = 52;
- gnapWalkTo(_hotspotsWalkPos[kHSAracde].x, _hotspotsWalkPos[kHSAracde].y, 0, -1, 1);
- playGnapIdle(_hotspotsWalkPos[kHSAracde].x, _hotspotsWalkPos[kHSAracde].y);
- _gnapActionStatus = kASLeaveScene;
- } else if (_grabCursorSpriteIndex >= 0) {
- playGnapShowCurrItem(_hotspotsWalkPos[kHSAracde].x, _hotspotsWalkPos[kHSAracde].y, 2, 3);
+ if (_vm->_gnapActionStatus < 0) {
+ if (_vm->_grabCursorSpriteIndex == kItemDiceQuarterHole) {
+ _vm->setGrabCursorSprite(-1);
+ _vm->_isLeavingScene = true;
+ _vm->_newSceneNum = 52;
+ _vm->gnapWalkTo(_vm->_hotspotsWalkPos[kHSAracde].x, _vm->_hotspotsWalkPos[kHSAracde].y, 0, -1, 1);
+ _vm->playGnapIdle(_vm->_hotspotsWalkPos[kHSAracde].x, _vm->_hotspotsWalkPos[kHSAracde].y);
+ _vm->_gnapActionStatus = kASLeaveScene;
+ } else if (_vm->_grabCursorSpriteIndex >= 0) {
+ _vm->playGnapShowCurrItem(_vm->_hotspotsWalkPos[kHSAracde].x, _vm->_hotspotsWalkPos[kHSAracde].y, 2, 3);
} else {
- switch (_verbCursor) {
+ switch (_vm->_verbCursor) {
case LOOK_CURSOR:
- playGnapMoan2(0, 0);
+ _vm->playGnapMoan2(0, 0);
break;
case GRAB_CURSOR:
case TALK_CURSOR:
case PLAT_CURSOR:
- playGnapImpossible(0, 0);
+ _vm->playGnapImpossible(0, 0);
break;
}
}
@@ -216,33 +221,33 @@ void GnapEngine::scene29_run() {
break;
case kHSWalkArea1:
- if (_gnapActionStatus < 0)
- gnapWalkTo(-1, -1, -1, -1, 1);
+ if (_vm->_gnapActionStatus < 0)
+ _vm->gnapWalkTo(-1, -1, -1, -1, 1);
break;
default:
- if (_mouseClickState._left) {
- gnapWalkTo(-1, -1, -1, -1, 1);
- _mouseClickState._left = false;
+ if (_vm->_mouseClickState._left) {
+ _vm->gnapWalkTo(-1, -1, -1, -1, 1);
+ _vm->_mouseClickState._left = false;
}
break;
}
- scene29_updateAnimations();
+ updateAnimations();
- if (!isSoundPlaying(0x1093B))
- playSound(0x1093B, true);
+ if (!_vm->isSoundPlaying(0x1093B))
+ _vm->playSound(0x1093B, true);
- if (!_isLeavingScene) {
- if (_gnapActionStatus < 0) {
- updateGnapIdleSequence();
- updatePlatypusIdleSequence();
+ if (!_vm->_isLeavingScene) {
+ if (_vm->_gnapActionStatus < 0) {
+ _vm->updateGnapIdleSequence();
+ _vm->updatePlatypusIdleSequence();
}
- if (!_timers[4]) {
- if (invHas(kItemHorn)) {
- _timers[4] = getRandom(20) + 60;
- if (_gnapActionStatus < 0) {
- switch (getRandom(5)) {
+ if (!_vm->_timers[4]) {
+ if (_vm->invHas(kItemHorn)) {
+ _vm->_timers[4] = _vm->getRandom(20) + 60;
+ if (_vm->_gnapActionStatus < 0) {
+ switch (_vm->getRandom(5)) {
case 0:
_s28_nextManSequenceId = 0xED;
break;
@@ -262,64 +267,61 @@ void GnapEngine::scene29_run() {
}
}
}
- playSoundB();
+ _vm->playSoundB();
}
- checkGameKeys();
+ _vm->checkGameKeys();
- if (isKeyStatus1(8)) {
- clearKeyStatus1(8);
- runMenu();
- scene29_updateHotspots();
+ if (_vm->isKeyStatus1(8)) {
+ _vm->clearKeyStatus1(8);
+ _vm->runMenu();
+ updateHotspots();
}
- gameUpdateTick();
-
- }
-
+ _vm->gameUpdateTick();
+ }
}
-void GnapEngine::scene29_updateAnimations() {
-
- if (_gameSys->getAnimationStatus(0) == 2) {
- _gameSys->setAnimation(0, 0, 0);
- switch (_gnapActionStatus) {
+void Scene29::updateAnimations() {
+ if (_vm->_gameSys->getAnimationStatus(0) == 2) {
+ _vm->_gameSys->setAnimation(0, 0, 0);
+ switch (_vm->_gnapActionStatus) {
case kASUseBananaWithMonkey:
_s28_nextMonkeySequenceId = 0xE5;
break;
case kASLeaveScene:
- _sceneDone = true;
+ _vm->_sceneDone = true;
break;
}
}
- if (_gameSys->getAnimationStatus(3) == 2 && _s28_nextManSequenceId != -1) {
- _gameSys->insertSequence(_s28_nextManSequenceId, 39, _s28_currManSequenceId, 39, kSeqSyncWait, 0, 0, 0);
- _gameSys->setAnimation(_s28_nextManSequenceId, 39, 3);
+ if (_vm->_gameSys->getAnimationStatus(3) == 2 && _s28_nextManSequenceId != -1) {
+ _vm->_gameSys->insertSequence(_s28_nextManSequenceId, 39, _s28_currManSequenceId, 39, kSeqSyncWait, 0, 0, 0);
+ _vm->_gameSys->setAnimation(_s28_nextManSequenceId, 39, 3);
_s28_currManSequenceId = _s28_nextManSequenceId;
_s28_nextManSequenceId = -1;
}
- if (_gameSys->getAnimationStatus(4) == 2) {
+ if (_vm->_gameSys->getAnimationStatus(4) == 2) {
if (_s28_nextMonkeySequenceId == 0xE5) {
- _gameSys->insertSequence(0xF2, _gnapId, makeRid(_gnapSequenceDatNum, _gnapSequenceId), _gnapId, kSeqSyncWait, 0, 0, 0);
- _gnapSequenceDatNum = 0;
- _gnapSequenceId = 0xF2;
- _gameSys->setAnimation(0xE6, 159, 0);
- _gameSys->setAnimation(0, 159, 4);
- _gameSys->insertSequence(_s28_nextMonkeySequenceId, 159, _s28_currMonkeySequenceId, 159, kSeqSyncWait, 0, 0, 0);
- _gameSys->insertSequence(0xE6, 159, _s28_nextMonkeySequenceId, 159, kSeqSyncWait, 0, 0, 0);
- _gnapActionStatus = kASLeaveScene;
+ _vm->_gameSys->insertSequence(0xF2, _vm->_gnapId, makeRid(_vm->_gnapSequenceDatNum, _vm->_gnapSequenceId), _vm->_gnapId, kSeqSyncWait, 0, 0, 0);
+ _vm->_gnapSequenceDatNum = 0;
+ _vm->_gnapSequenceId = 0xF2;
+ _vm->_gameSys->setAnimation(0xE6, 159, 0);
+ _vm->_gameSys->setAnimation(0, 159, 4);
+ _vm->_gameSys->insertSequence(_s28_nextMonkeySequenceId, 159, _s28_currMonkeySequenceId, 159, kSeqSyncWait, 0, 0, 0);
+ _vm->_gameSys->insertSequence(0xE6, 159, _s28_nextMonkeySequenceId, 159, kSeqSyncWait, 0, 0, 0);
+ _vm->_gnapActionStatus = kASLeaveScene;
_s28_currMonkeySequenceId = 0xE6;
_s28_nextMonkeySequenceId = -1;
- _timers[5] = 30;
- while (_timers[5])
- gameUpdateTick();
- platypusWalkTo(0, 8, 1, 0x107CF, 1);
- while (_gameSys->getAnimationStatus(1) != 2)
- gameUpdateTick();
+ _vm->_timers[5] = 30;
+ while (_vm->_timers[5])
+ _vm->gameUpdateTick();
+ _vm->platypusWalkTo(0, 8, 1, 0x107CF, 1);
+ while (_vm->_gameSys->getAnimationStatus(1) != 2)
+ _vm->gameUpdateTick();
} else if (_s28_nextMonkeySequenceId == -1) {
- switch (getRandom(6)) {
+ switch (_vm->getRandom(6)) {
case 0:
_s28_nextMonkeySequenceId = 0xE8;
break;
@@ -339,13 +341,13 @@ void GnapEngine::scene29_updateAnimations() {
_s28_nextMonkeySequenceId = 0xE7;
break;
}
- _gameSys->insertSequence(_s28_nextMonkeySequenceId, 159, _s28_currMonkeySequenceId, 159, kSeqSyncWait, 0, 0, 0);
- _gameSys->setAnimation(_s28_nextMonkeySequenceId, 159, 4);
+ _vm->_gameSys->insertSequence(_s28_nextMonkeySequenceId, 159, _s28_currMonkeySequenceId, 159, kSeqSyncWait, 0, 0, 0);
+ _vm->_gameSys->setAnimation(_s28_nextMonkeySequenceId, 159, 4);
_s28_currMonkeySequenceId = _s28_nextMonkeySequenceId;
_s28_nextMonkeySequenceId = -1;
} else {
- _gameSys->insertSequence(_s28_nextMonkeySequenceId, 159, _s28_currMonkeySequenceId, 159, kSeqSyncWait, 0, 0, 0);
- _gameSys->setAnimation(_s28_nextMonkeySequenceId, 159, 4);
+ _vm->_gameSys->insertSequence(_s28_nextMonkeySequenceId, 159, _s28_currMonkeySequenceId, 159, kSeqSyncWait, 0, 0, 0);
+ _vm->_gameSys->setAnimation(_s28_nextMonkeySequenceId, 159, 4);
_s28_currMonkeySequenceId = _s28_nextMonkeySequenceId;
_s28_nextMonkeySequenceId = -1;
}
diff --git a/engines/gnap/scenes/scene29.h b/engines/gnap/scenes/scene29.h
new file mode 100644
index 0000000000..1b9e2c3408
--- /dev/null
+++ b/engines/gnap/scenes/scene29.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef GNAP_SCENE29_H
+#define GNAP_SCENE29_H
+
+#include "gnap/debugger.h"
+#include "gnap/scenes/scenecore.h"
+
+namespace Gnap {
+
+class GnapEngine;
+
+class Scene29: public Scene {
+public:
+ Scene29(GnapEngine *vm);
+ ~Scene29() {}
+
+ virtual int init();
+ virtual void updateHotspots();
+ virtual void run();
+ virtual void updateAnimations();
+ virtual void updateAnimationsCb() {};
+
+private:
+ int _s28_currMonkeySequenceId;
+ int _s28_nextMonkeySequenceId;
+ int _s28_currManSequenceId;
+ int _s28_nextManSequenceId;
+};
+
+} // End of namespace Gnap
+#endif // GNAP_SCENE29_H
diff --git a/engines/gnap/scenes/scenecore.cpp b/engines/gnap/scenes/scenecore.cpp
index 25a2f7df50..e4790a2de6 100644
--- a/engines/gnap/scenes/scenecore.cpp
+++ b/engines/gnap/scenes/scenecore.cpp
@@ -54,6 +54,7 @@
#include "gnap/scenes/scene26.h"
#include "gnap/scenes/scene27.h"
#include "gnap/scenes/scene28.h"
+#include "gnap/scenes/scene29.h"
#include "gnap/scenes/scene47.h"
#include "gnap/scenes/scene48.h"
#include "gnap/scenes/scene54.h"
@@ -264,8 +265,9 @@ int GnapEngine::initSceneLogic() {
initSceneGrid(21, 146, 11, 10);
break;
case 29:
- backgroundId = scene29_init();
- scene29_updateHotspots();
+ _scene = new Scene29(this);
+ backgroundId = _scene->init();
+ _scene->updateHotspots();
_gameSys->setScaleValues(0, 500, 1, 1000);
initSceneGrid(21, 146, 11, 10);
break;
@@ -586,7 +588,8 @@ void GnapEngine::runSceneLogic() {
_newSceneNum = 20;
break;
case 29:
- scene29_run();
+ _scene->run();
+ delete _scene;
if (_newSceneNum == 55)
_newSceneNum = 20;
break;