aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohndoe1232014-01-23 13:53:06 +0100
committerEugene Sandulenko2016-05-10 09:54:21 +0200
commit9bac81c802e12b64cde335af30d748a98815658c (patch)
tree4517df8c29c9eef369c1adba029896de2793635c
parent4752703298c568a87b3a7bfb281cd1993d9de3c7 (diff)
downloadscummvm-rg350-9bac81c802e12b64cde335af30d748a98815658c.tar.gz
scummvm-rg350-9bac81c802e12b64cde335af30d748a98815658c.tar.bz2
scummvm-rg350-9bac81c802e12b64cde335af30d748a98815658c.zip
GNAP: Clean up scene 39
-rw-r--r--engines/gnap/gnap.cpp6
-rw-r--r--engines/gnap/gnap.h3
-rw-r--r--engines/gnap/scenes/scene39.cpp40
3 files changed, 27 insertions, 22 deletions
diff --git a/engines/gnap/gnap.cpp b/engines/gnap/gnap.cpp
index 677b073207..598fd8c7c8 100644
--- a/engines/gnap/gnap.cpp
+++ b/engines/gnap/gnap.cpp
@@ -158,14 +158,14 @@ Common::Error GnapEngine::run() {
//testBack->fillRect(Common::Rect(0, 0, 800, 600), 0xFFFFFFFF);
testBack->fillRect(Common::Rect(0, 0, 800, 600), 0xFF000000);
- _currentSceneNum = 31;
+ _currentSceneNum = 39;
Common::String datFilename = Common::String::format("%s_n.dat", kSceneNames[_currentSceneNum]);
_dat->open(0, datFilename.c_str());
_gameSys->setBackgroundSurface(testBack, 0, 500, 1, 1000);
- _gameSys->insertSequence(0xfe, 100, -1, -1, 0, 0, 0, 0);
+ _gameSys->insertSequence(0x33, 100, -1, -1, 0, 0, 0, 0);
CursorMan.showMouse(true);
@@ -751,7 +751,7 @@ void GnapEngine::mainLoop() {
// > DEBUG BEGIN
_currentSceneNum = 53;
- _newSceneNum = 38;
+ _newSceneNum = 39;
_newCursorValue = 3;
// < DEBUG END
diff --git a/engines/gnap/gnap.h b/engines/gnap/gnap.h
index 86bce8d935..02c1aeb031 100644
--- a/engines/gnap/gnap.h
+++ b/engines/gnap/gnap.h
@@ -830,8 +830,7 @@ public:
void scene38_updateAnimations();
// Scene 39
- int _s39_dword_47EAF8;
- int _s39_dword_47EAFC;
+ int _s39_currGuySequenceId, _s39_nextGuySequenceId;
int scene39_init();
void scene39_updateHotspots();
void scene39_run();
diff --git a/engines/gnap/scenes/scene39.cpp b/engines/gnap/scenes/scene39.cpp
index 7bf04de240..4ba8e16b05 100644
--- a/engines/gnap/scenes/scene39.cpp
+++ b/engines/gnap/scenes/scene39.cpp
@@ -36,6 +36,10 @@ enum {
kHSWalkArea2 = 6
};
+enum {
+ kASLeaveScene = 0
+};
+
int GnapEngine::scene39_init() {
_gameSys->setAnimation(0, 0, 0);
_gameSys->setAnimation(0, 0, 1);
@@ -54,15 +58,17 @@ void GnapEngine::scene39_updateHotspots() {
}
void GnapEngine::scene39_run() {
+
+ _timers[5] = 0; // Bug in the original? Timer was never intiailized.
queueInsertDeviceIcon();
- _s39_dword_47EAF8 = 0x33;
+ _s39_currGuySequenceId = 0x33;
_gameSys->setAnimation(0x33, 21, 3);
- _gameSys->insertSequence(_s39_dword_47EAF8, 21, 0, 0, kSeqNone, 0, 0, 0);
+ _gameSys->insertSequence(_s39_currGuySequenceId, 21, 0, 0, kSeqNone, 0, 0, 0);
_gameSys->insertSequence(0x34, 21, 0, 0, kSeqLoop, 0, 0, 0);
- _s39_dword_47EAFC = -1;
+ _s39_nextGuySequenceId = -1;
if (_prevSceneNum == 38) {
initGnapPos(3, 7, 7);
initBeaverPos(2, 7, 5);
@@ -79,7 +85,7 @@ void GnapEngine::scene39_run() {
playSound(0x1094B, 1);
setSoundVolume(0x1094B, 60);
}
-
+
updateMouseCursor();
updateCursorByHotspot();
@@ -122,10 +128,10 @@ void GnapEngine::scene39_run() {
case kHSExitUfoParty:
if (_gnapActionStatus < 0) {
- _isLeavingScene = 1;
+ _isLeavingScene = true;
_sceneDone = true;
gnapWalkTo(_gnapX, _gnapY, 0, 0x107AB, 1);
- _gnapActionStatus = 0;
+ _gnapActionStatus = kASLeaveScene;
_newSceneNum = 40;
}
break;
@@ -154,7 +160,7 @@ void GnapEngine::scene39_run() {
case kHSExitInsideHouse:
if (_gnapActionStatus < 0) {
_sceneDone = true;
- _isLeavingScene = 1;
+ _isLeavingScene = true;
_newSceneNum = 38;
}
break;
@@ -185,16 +191,16 @@ void GnapEngine::scene39_run() {
_timers[5] = getRandom(20) + 50;
switch (getRandom(4)) {
case 0:
- _s39_dword_47EAFC = 0x30;
+ _s39_nextGuySequenceId = 0x30;
break;
case 1:
- _s39_dword_47EAFC = 0x31;
+ _s39_nextGuySequenceId = 0x31;
break;
case 2:
- _s39_dword_47EAFC = 0x32;
+ _s39_nextGuySequenceId = 0x32;
break;
case 3:
- _s39_dword_47EAFC = 0x33;
+ _s39_nextGuySequenceId = 0x33;
break;
}
}
@@ -219,17 +225,17 @@ void GnapEngine::scene39_updateAnimations() {
if (_gameSys->getAnimationStatus(0) == 2) {
_gameSys->setAnimation(0, 0, 0);
- if (_gnapActionStatus == 0)
+ if (_gnapActionStatus == kASLeaveScene)
_sceneDone = true;
else
_gnapActionStatus = -1;
}
- if (_gameSys->getAnimationStatus(3) == 2 && _s39_dword_47EAFC != -1) {
- _gameSys->setAnimation(_s39_dword_47EAFC, 21, 3);
- _gameSys->insertSequence(_s39_dword_47EAFC, 21, _s39_dword_47EAF8, 21, kSeqSyncWait, 0, 0, 0);
- _s39_dword_47EAF8 = _s39_dword_47EAFC;
- _s39_dword_47EAFC = -1;
+ if (_gameSys->getAnimationStatus(3) == 2 && _s39_nextGuySequenceId != -1) {
+ _gameSys->setAnimation(_s39_nextGuySequenceId, 21, 3);
+ _gameSys->insertSequence(_s39_nextGuySequenceId, 21, _s39_currGuySequenceId, 21, kSeqSyncWait, 0, 0, 0);
+ _s39_currGuySequenceId = _s39_nextGuySequenceId;
+ _s39_nextGuySequenceId = -1;
}
}