aboutsummaryrefslogtreecommitdiff
path: root/engines/neverhood/modules
diff options
context:
space:
mode:
Diffstat (limited to 'engines/neverhood/modules')
-rw-r--r--engines/neverhood/modules/module1000.cpp12
-rw-r--r--engines/neverhood/modules/module1300.cpp4
-rw-r--r--engines/neverhood/modules/module2200.cpp2
-rw-r--r--engines/neverhood/modules/module2300.cpp28
-rw-r--r--engines/neverhood/modules/module2300.h4
-rw-r--r--engines/neverhood/modules/module2700.cpp2
-rw-r--r--engines/neverhood/modules/module2900.cpp3
-rw-r--r--engines/neverhood/modules/module3000.cpp49
-rw-r--r--engines/neverhood/modules/module3000.h4
9 files changed, 52 insertions, 56 deletions
diff --git a/engines/neverhood/modules/module1000.cpp b/engines/neverhood/modules/module1000.cpp
index a3b5bc67b5..5e4d67d2bc 100644
--- a/engines/neverhood/modules/module1000.cpp
+++ b/engines/neverhood/modules/module1000.cpp
@@ -228,7 +228,7 @@ uint32 Scene1001::handleMessage(int messageNum, const MessageParam &param, Entit
}
Scene1002::Scene1002(NeverhoodEngine *vm, Module *parentModule, int which)
- : Scene(vm, parentModule), _isKlaymenFloor(false), _isClimbingLadder(false) {
+ : Scene(vm, parentModule), _isKlaymenFloor(false), _isClimbingLadder(false), _asKlaymenPeekHand(nullptr) {
NRect tempClipRect;
Sprite *tempSprite;
@@ -693,22 +693,18 @@ uint32 Scene1005::getTextIndex1() {
uint32 Scene1005::getKloggsTextIndex() {
uint32 textIndex = getGlobalVar(V_TEXT_COUNTING_INDEX1);
if (textIndex + 1 > 10) {
- setGlobalVar(V_TEXT_COUNTING_INDEX1, 0);
textIndex = 0;
- } else {
- setGlobalVar(V_TEXT_COUNTING_INDEX1, textIndex + 1);
}
+ setGlobalVar(V_TEXT_COUNTING_INDEX1, textIndex + 1);
return textIndex + 40;
}
uint32 Scene1005::getTextIndex3() {
uint32 textIndex = getGlobalVar(V_TEXT_COUNTING_INDEX2);
- if (textIndex + 1 >= 10) {
- setGlobalVar(V_TEXT_COUNTING_INDEX2, 0);
+ if (textIndex + 1 > 10) {
textIndex = 0;
- } else {
- setGlobalVar(V_TEXT_COUNTING_INDEX2, textIndex + 1);
}
+ setGlobalVar(V_TEXT_COUNTING_INDEX2, textIndex + 1);
return textIndex + 30;
}
diff --git a/engines/neverhood/modules/module1300.cpp b/engines/neverhood/modules/module1300.cpp
index d806019e6c..60ff0411a6 100644
--- a/engines/neverhood/modules/module1300.cpp
+++ b/engines/neverhood/modules/module1300.cpp
@@ -603,7 +603,7 @@ uint32 Scene1305::handleMessage(int messageNum, const MessageParam &param, Entit
}
Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which)
- : Scene(vm, parentModule) {
+ : Scene(vm, parentModule), _asKey(nullptr) {
if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0)
setGlobalVar(V_KEY3_LOCATION, 4);
@@ -683,7 +683,6 @@ Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which)
clearRectList();
sendMessage(_asElevator, NM_KLAYMEN_OPEN_DOOR, 0);
}
-
}
Scene1306::~Scene1306() {
@@ -942,6 +941,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which)
_sprite2 = insertStaticSprite(0x40043120, 995);
_sprite3 = insertStaticSprite(0x43003100, 995);
_sprite4 = NULL;
+ _sprite5 = nullptr;
if (which < 0) {
// Restoring game
diff --git a/engines/neverhood/modules/module2200.cpp b/engines/neverhood/modules/module2200.cpp
index f9033a9dbe..6618cb3ab0 100644
--- a/engines/neverhood/modules/module2200.cpp
+++ b/engines/neverhood/modules/module2200.cpp
@@ -885,7 +885,7 @@ void Scene2205::update() {
} else if (_isLightOn && !getGlobalVar(V_LIGHTS_ON)) {
_palette->addPalette(0xD00A028D, 0, 256, 0);
changeBackground(0xD00A028D);
- _ssLightSwitch->setFileHashes(0x2D339030, 0xDAC86E84);
+ _ssLightSwitch->setFileHashes(0xD6C86E84, 0xDAC86E84);
sendMessage(_ssDoorFrame, 0x2000, 0);
changeMouseCursor(0xA0289D08);
_isKlaymenInLight = true;
diff --git a/engines/neverhood/modules/module2300.cpp b/engines/neverhood/modules/module2300.cpp
index c0edc95873..68ae07f2bb 100644
--- a/engines/neverhood/modules/module2300.cpp
+++ b/engines/neverhood/modules/module2300.cpp
@@ -31,14 +31,14 @@ static const uint32 kModule2300SoundList[] = {
};
Module2300::Module2300(NeverhoodEngine *vm, Module *parentModule, int which)
- : Module(vm, parentModule), _soundVolume(0) {
+ : Module(vm, parentModule), _waterfallSoundVolume(0) {
_vm->_soundMan->addSoundList(0x1A214010, kModule2300SoundList);
_vm->_soundMan->setSoundListParams(kModule2300SoundList, true, 50, 600, 10, 150);
- _isWallBroken = getGlobalVar(V_WALL_BROKEN) != 0;
+ _isWaterfallRunning = getGlobalVar(V_WALL_BROKEN) != 1;
- if (_isWallBroken) {
+ if (_isWaterfallRunning) {
_vm->_soundMan->setSoundVolume(0x90F0D1C3, 0);
_vm->_soundMan->playSoundLooping(0x90F0D1C3);
} else {
@@ -78,8 +78,8 @@ void Module2300::createScene(int sceneNum, int which) {
case 1:
_vm->gameState().sceneNum = 1;
createNavigationScene(0x004B67E8, which);
- if (_isWallBroken) {
- _soundVolume = 15;
+ if (_isWaterfallRunning) {
+ _waterfallSoundVolume = 15;
_vm->_soundMan->setSoundVolume(0x90F0D1C3, 15);
}
break;
@@ -92,10 +92,10 @@ void Module2300::createScene(int sceneNum, int which) {
if (getGlobalVar(V_WALL_BROKEN))
createNavigationScene(0x004B68F0, which);
else {
- _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume);
+ _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume);
createNavigationScene(0x004B68A8, which);
- if (_isWallBroken) {
- _soundVolume = 87;
+ if (_isWaterfallRunning) {
+ _waterfallSoundVolume = 87;
_vm->_soundMan->setSoundVolume(0x90F0D1C3, 87);
}
}
@@ -161,10 +161,10 @@ void Module2300::updateScene() {
} else {
switch (_sceneNum) {
case 1:
- if (_isWallBroken && navigationScene()->isWalkingForward() && navigationScene()->getNavigationIndex() == 4 &&
+ if (_isWaterfallRunning && navigationScene()->isWalkingForward() && navigationScene()->getNavigationIndex() == 4 &&
navigationScene()->getFrameNumber() % 2) {
- _soundVolume++;
- _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume);
+ _waterfallSoundVolume++;
+ _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume);
}
if (navigationScene()->isWalkingForward() && navigationScene()->getNavigationIndex() == 0 &&
navigationScene()->getFrameNumber() == 50) {
@@ -174,9 +174,9 @@ void Module2300::updateScene() {
}
break;
case 3:
- if (_isWallBroken && navigationScene()->isWalkingForward() && navigationScene()->getFrameNumber() % 2) {
- _soundVolume--;
- _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume);
+ if (_isWaterfallRunning && navigationScene()->isWalkingForward() && navigationScene()->getFrameNumber() % 2) {
+ _waterfallSoundVolume--;
+ _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume);
}
break;
}
diff --git a/engines/neverhood/modules/module2300.h b/engines/neverhood/modules/module2300.h
index 57235986d9..58bffb710c 100644
--- a/engines/neverhood/modules/module2300.h
+++ b/engines/neverhood/modules/module2300.h
@@ -37,8 +37,8 @@ public:
virtual ~Module2300();
protected:
int _sceneNum;
- bool _isWallBroken;
- int _soundVolume;
+ int _waterfallSoundVolume;
+ bool _isWaterfallRunning;
void createScene(int sceneNum, int which);
void updateScene();
};
diff --git a/engines/neverhood/modules/module2700.cpp b/engines/neverhood/modules/module2700.cpp
index 9399981cfd..2a112435fc 100644
--- a/engines/neverhood/modules/module2700.cpp
+++ b/engines/neverhood/modules/module2700.cpp
@@ -84,7 +84,7 @@ static const uint32 kScene2725StaticSprites[] = {
};
Module2700::Module2700(NeverhoodEngine *vm, Module *parentModule, int which)
- : Module(vm, parentModule), _soundIndex(0), _radioMusicInitialized(false) {
+ : Module(vm, parentModule), _soundIndex(0), _radioMusicInitialized(false), _musicFileHash(0) {
_vm->_soundMan->addMusic(0x42212411, 0x04020210);
_vm->_soundMan->startMusic(0x04020210, 24, 2);
diff --git a/engines/neverhood/modules/module2900.cpp b/engines/neverhood/modules/module2900.cpp
index 3bf98eca35..69186514a2 100644
--- a/engines/neverhood/modules/module2900.cpp
+++ b/engines/neverhood/modules/module2900.cpp
@@ -34,11 +34,12 @@ namespace Neverhood {
Module2900::Module2900(NeverhoodEngine *vm, Module *parentModule, int which)
: Module(vm, parentModule) {
+ _teleporterModuleResult = -1;
+
if (which >= 0)
setGlobalVar(V_TELEPORTER_WHICH, which);
createScene(0, 0);
-
}
void Module2900::createScene(int sceneNum, int which) {
diff --git a/engines/neverhood/modules/module3000.cpp b/engines/neverhood/modules/module3000.cpp
index 59b2df260e..d4809611ad 100644
--- a/engines/neverhood/modules/module3000.cpp
+++ b/engines/neverhood/modules/module3000.cpp
@@ -39,7 +39,7 @@ static const uint32 kModule3000SoundList[] = {
};
Module3000::Module3000(NeverhoodEngine *vm, Module *parentModule, int which)
- : Module(vm, parentModule), _soundVolume(0) {
+ : Module(vm, parentModule), _waterfallSoundVolume(0) {
_vm->_soundMan->addSoundList(0x81293110, kModule3000SoundList);
_vm->_soundMan->setSoundListParams(kModule3000SoundList, true, 50, 600, 5, 150);
@@ -48,9 +48,9 @@ Module3000::Module3000(NeverhoodEngine *vm, Module *parentModule, int which)
_vm->_soundMan->playTwoSounds(0x81293110, 0x40030A51, 0xC862CA15, 0);
_vm->_soundMan->playTwoSounds(0x81293110, 0x41861371, 0x43A2507F, 0);
- _isWallBroken = getGlobalVar(V_WALL_BROKEN) != 0;
+ _isWaterfallRunning = getGlobalVar(V_WALL_BROKEN) != 1;
- if (!_isWallBroken) {
+ if (_isWaterfallRunning) {
_vm->_soundMan->setSoundVolume(0x90F0D1C3, 0);
_vm->_soundMan->playSoundLooping(0x90F0D1C3);
}
@@ -78,12 +78,11 @@ void Module3000::createScene(int sceneNum, int which) {
static const byte kNavigationTypes06[] = {5};
debug(1, "Module3000::createScene(%d, %d)", sceneNum, which);
_vm->gameState().sceneNum = sceneNum;
- _isWallBroken = getGlobalVar(V_WALL_BROKEN) != 0;
switch (_vm->gameState().sceneNum) {
case 1:
if (!getGlobalVar(V_BOLT_DOOR_OPEN)) {
createNavigationScene(0x004B7C80, which);
- } else if (_isWallBroken) {
+ } else if (getGlobalVar(V_WALL_BROKEN)) {
createNavigationScene(0x004B7CE0, which);
} else {
createNavigationScene(0x004B7CB0, which);
@@ -91,11 +90,11 @@ void Module3000::createScene(int sceneNum, int which) {
break;
case 2:
_vm->_soundMan->playTwoSounds(0x81293110, 0x40030A51, 0xC862CA15, 0);
- if (!_isWallBroken) {
- _soundVolume = 90;
+ if (_isWaterfallRunning) {
+ _waterfallSoundVolume = 90;
_vm->_soundMan->setSoundVolume(0x90F0D1C3, 90);
}
- if (_isWallBroken) {
+ if (getGlobalVar(V_WALL_BROKEN)) {
createNavigationScene(0x004B7D58, which);
} else {
createNavigationScene(0x004B7D10, which);
@@ -104,7 +103,7 @@ void Module3000::createScene(int sceneNum, int which) {
case 3:
if (getGlobalVar(V_STAIRS_DOWN))
createNavigationScene(0x004B7E60, which);
- else if (_isWallBroken)
+ else if (getGlobalVar(V_WALL_BROKEN))
createNavigationScene(0x004B7DA0, which);
else
createNavigationScene(0x004B7E00, which);
@@ -152,12 +151,12 @@ void Module3000::createScene(int sceneNum, int which) {
// NOTE: Newly introduced sceneNums
case 1001:
if (!getGlobalVar(V_BOLT_DOOR_OPEN))
- if (_isWallBroken)
+ if (getGlobalVar(V_WALL_BROKEN))
createSmackerScene(0x00940021, true, true, false);
else
createSmackerScene(0x01140021, true, true, false);
else
- if (_isWallBroken)
+ if (getGlobalVar(V_WALL_BROKEN))
createSmackerScene(0x001011B1, true, true, false);
else
createSmackerScene(0x001021B1, true, true, false);
@@ -195,8 +194,8 @@ void Module3000::updateScene() {
break;
case 2:
_vm->_soundMan->playTwoSounds(0x81293110, 0x41861371, 0x43A2507F, 0);
- if (_isWallBroken) {
- _soundVolume = 0;
+ if (_isWaterfallRunning) {
+ _waterfallSoundVolume = 0;
_vm->_soundMan->setSoundVolume(0x90F0D1C3, 0);
}
if (_moduleResult == 0) {
@@ -240,7 +239,7 @@ void Module3000::updateScene() {
createScene(8, -1);
break;
case 8:
- _isWallBroken = getGlobalVar(V_WALL_BROKEN) != 0;
+ _isWaterfallRunning = getGlobalVar(V_WALL_BROKEN) != 1;
if (_moduleResult != 1) {
_vm->_soundMan->setSoundListParams(kModule3000SoundList, true, 0, 0, 0, 0);
createScene(4, 1);
@@ -301,12 +300,12 @@ void Module3000::updateScene() {
} else if (frameNumber == 10) {
_vm->_soundMan->playTwoSounds(0x81293110, 0x40030A51, 0xC862CA15, 0);
}
- if (!_isWallBroken && _soundVolume < 90 && frameNumber % 2) {
+ if (_isWaterfallRunning && _waterfallSoundVolume < 90 && frameNumber % 2) {
if (frameNumber == 0)
- _soundVolume = 40;
+ _waterfallSoundVolume = 40;
else
- _soundVolume++;
- _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume);
+ _waterfallSoundVolume++;
+ _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume);
}
}
}
@@ -315,9 +314,9 @@ void Module3000::updateScene() {
if (navigationScene()->isWalkingForward()) {
uint32 frameNumber = navigationScene()->getFrameNumber();
int navigationIndex = navigationScene()->getNavigationIndex();
- if (!_isWallBroken && _soundVolume > 1 && frameNumber % 2) {
- _soundVolume--;
- _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume);
+ if (_isWaterfallRunning && _waterfallSoundVolume > 1 && frameNumber % 2) {
+ _waterfallSoundVolume--;
+ _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume);
}
if (navigationIndex == 0) {
if (frameNumber == 35) {
@@ -340,12 +339,12 @@ void Module3000::updateScene() {
if (frameNumber == 40) {
_vm->_soundMan->playTwoSounds(0x81293110, 0x40030A51, 0xC862CA15, 0);
}
- if (!_isWallBroken && _soundVolume < 90 && frameNumber % 2) {
+ if (_isWaterfallRunning && _waterfallSoundVolume < 90 && frameNumber % 2) {
if (frameNumber == 0)
- _soundVolume = 40;
+ _waterfallSoundVolume = 40;
else
- _soundVolume++;
- _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume);
+ _waterfallSoundVolume++;
+ _vm->_soundMan->setSoundVolume(0x90F0D1C3, _waterfallSoundVolume);
}
}
}
diff --git a/engines/neverhood/modules/module3000.h b/engines/neverhood/modules/module3000.h
index e5c251f828..3d895b8d8a 100644
--- a/engines/neverhood/modules/module3000.h
+++ b/engines/neverhood/modules/module3000.h
@@ -34,8 +34,8 @@ public:
Module3000(NeverhoodEngine *vm, Module *parentModule, int which);
virtual ~Module3000();
protected:
- int _soundVolume;
- bool _isWallBroken;
+ int _waterfallSoundVolume;
+ bool _isWaterfallRunning;
void createScene(int sceneNum, int which);
void updateScene();
};