aboutsummaryrefslogtreecommitdiff
path: root/engines/neverhood/modules/module3000.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/neverhood/modules/module3000.cpp')
-rw-r--r--engines/neverhood/modules/module3000.cpp49
1 files changed, 24 insertions, 25 deletions
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);
}
}
}