aboutsummaryrefslogtreecommitdiff
path: root/engines/neverhood/modules
diff options
context:
space:
mode:
authorjohndoe1232014-04-17 23:02:25 +0200
committerjohndoe1232014-04-17 23:02:25 +0200
commitc0d83b0b298f1116cb69948107ba867fc73f16df (patch)
tree15c6c92b3952f957dd63c2eb54994e5c32e0b1dc /engines/neverhood/modules
parent4904554bb6ddd250de6bcb356b5660c9c57b5a2b (diff)
downloadscummvm-rg350-c0d83b0b298f1116cb69948107ba867fc73f16df.tar.gz
scummvm-rg350-c0d83b0b298f1116cb69948107ba867fc73f16df.tar.bz2
scummvm-rg350-c0d83b0b298f1116cb69948107ba867fc73f16df.zip
NEVERHOOD: Fix bug #6520: 'NEVERHOOD: buggy sound of the waterfall'
Diffstat (limited to 'engines/neverhood/modules')
-rw-r--r--engines/neverhood/modules/module2300.cpp28
-rw-r--r--engines/neverhood/modules/module2300.h2
-rw-r--r--engines/neverhood/modules/module3000.cpp49
-rw-r--r--engines/neverhood/modules/module3000.h4
4 files changed, 41 insertions, 42 deletions
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..b5758b0c86 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;
+ bool _isWaterfallRunning;
void createScene(int sceneNum, int which);
void updateScene();
};
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();
};