NEVERHOOD: Add sound lists to all modules which have them

This commit is contained in:
johndoe123 2012-09-24 11:08:24 +00:00 committed by Willem Jan Palenstijn
parent f5a8c9d90d
commit a2bc192912
11 changed files with 134 additions and 47 deletions

View File

@ -26,6 +26,18 @@
namespace Neverhood {
static const uint32 kModule1100SoundList[] = {
0x90805C50,
0xB288D450,
0x98C05840,
0x98A01500,
0xB4005E50,
0x92025040,
0x90035066,
0x74E01054,
0
};
Module1100::Module1100(NeverhoodEngine *vm, Module *parentModule, int which)
: Module(vm, parentModule) {
@ -37,8 +49,8 @@ Module1100::Module1100(NeverhoodEngine *vm, Module *parentModule, int which)
createScene(9, 3);
}
// TODO SoundMan_addSoundList(0x0002C818, dword_4B85B0, true);
// TODO SoundMan_setSoundListParams(dword_4B85B0, true, 50, 600, 20, 250);
_vm->_soundMan->addSoundList(0x0002C818, kModule1100SoundList);
_vm->_soundMan->setSoundListParams(kModule1100SoundList, true, 50, 600, 20, 250);
_vm->_soundMan->setSoundParams(0x74E01054, false, 100, 200, 10, 20);
_vm->_soundMan->setSoundVolume(0x74E01054, 60);
_vm->_soundMan->playTwoSounds(0x0002C818, 0x41861371, 0x43A2507F, 0);

View File

@ -32,12 +32,22 @@
namespace Neverhood {
static const uint32 kModule1300SoundList[] = {
0x16805648,
0x16805C48,
0xB4964448,
0x96A05481,
0xD0E14441,
0x90815450,
0
};
Module1300::Module1300(NeverhoodEngine *vm, Module *parentModule, int which)
: Module(vm, parentModule) {
_vm->_soundMan->addMusic(0x61C090, 0x203197);
// TODO SoundMan_addSoundList(0x61C090, dword_4B2868, true);
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 50, 600, 20, 150);
_vm->_soundMan->addSoundList(0x61C090, kModule1300SoundList);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 50, 600, 20, 150);
_vm->_soundMan->playTwoSounds(0x61C090, 0x48498E46, 0x50399F64, 0);
_vm->_soundMan->setSoundVolume(0x48498E46, 70);
_vm->_soundMan->setSoundVolume(0x50399F64, 70);
@ -102,82 +112,82 @@ void Module1300::createScene(int sceneNum, int which) {
_vm->gameState().sceneNum = sceneNum;
switch (_vm->gameState().sceneNum) {
case 1:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->startMusic(0x203197, 0, 2);
_childObject = new Scene1302(_vm, this, which);
break;
case 2:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
_childObject = new Scene1303(_vm, this, which);
break;
case 3:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
_childObject = new Scene1304(_vm, this, which);
break;
case 4:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->startMusic(0x203197, 0, 2);
_childObject = new Scene1305(_vm, this, which);
break;
case 5:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->startMusic(0x203197, 0, 2);
_childObject = new Scene1306(_vm, this, which);
break;
case 6:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->startMusic(0x203197, 0, 2);
_childObject = new Scene1307(_vm, this, which);
break;
case 7:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->startMusic(0x203197, 0, 2);
_childObject = new Scene1308(_vm, this, which);
break;
case 8:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
_childObject = new DiskplayerScene(_vm, this, 1);
break;
case 9:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
createSmackerScene(0x20082818, true, true, false);
break;
case 10:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
createSmackerScene(0x20082828, true, true, false);
break;
case 11:
// TODO SoundMan_setSoundListParams(0xdword_4B2868, true, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, true, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
createNavigationScene(0x004B27A8, which);
break;
case 12:
// TODO SoundMan_setSoundListParams(0xdword_4B2868, true, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, true, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
createNavigationScene(0x004B2718, which);
break;
case 13:
// TODO SoundMan_setSoundListParams(0xdword_4B2868, true, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, true, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
createNavigationScene(0x004B27D8, which);
break;
case 14:
// TODO SoundMan_setSoundListParams(0xdword_4B2868, true, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, true, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
createNavigationScene(0x004B2808, which);
break;
case 15:
// TODO SoundMan_setSoundListParams(0xdword_4B2868, true, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, true, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
createNavigationScene(0x004B2838, which);
break;
case 16:
// TODO SoundMan_setSoundListParams(dword_4B2868, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1300SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->stopMusic(0x203197, 0, 2);
_childObject = new Scene1317(_vm, this, which);
break;

View File

@ -27,6 +27,15 @@
namespace Neverhood {
static const uint32 kModule1600SoundList[] = {
0x90805C50,
0x90804450,
0xB4005E60,
0x91835066,
0x90E14440,
0
};
Module1600::Module1600(NeverhoodEngine *vm, Module *parentModule, int which)
: Module(vm, parentModule) {
@ -44,8 +53,8 @@ Module1600::Module1600(NeverhoodEngine *vm, Module *parentModule, int which)
createScene(0, 0);
}
// TODO SoundMan_addSoundList(0x1A008D8, dword_4B3BB0, true);
// TODO SoundMan_setSoundListParams(dword_4B3BB0, true, 50, 600, 5, 150);
_vm->_soundMan->addSoundList(0x1A008D8, kModule1600SoundList);
_vm->_soundMan->setSoundListParams(kModule1600SoundList, true, 50, 600, 5, 150);
_vm->_soundMan->playTwoSounds(0x1A008D8, 0x41861371, 0x43A2507F, 0);
}

View File

@ -24,12 +24,21 @@
namespace Neverhood {
static const uint32 kModule1700SoundList[] = {
0xB288D450,
0x90804450,
0x99801500,
0xB288D455,
0x93825040,
0
};
Module1700::Module1700(NeverhoodEngine *vm, Module *parentModule, int which)
: Module(vm, parentModule), _soundResource(vm) {
_vm->_soundMan->addMusic(0x04212331, 0x31114225);
// TODO SoundMan_addSoundList(0x04212331, dword_4AE930, true);
// TODO SoundMan_setSoundListParams(dword_4AE930, true, 50, 600, 5, 150);
_vm->_soundMan->addSoundList(0x04212331, kModule1700SoundList);
_vm->_soundMan->setSoundListParams(kModule1700SoundList, true, 50, 600, 5, 150);
_vm->_soundMan->playTwoSounds(0x04212331, 0x41861371, 0x43A2507F, 0);
if (which < 0) {
@ -53,7 +62,7 @@ void Module1700::createScene(int sceneNum, int which) {
_vm->gameState().sceneNum = sceneNum;
switch (_vm->gameState().sceneNum) {
case 0:
// TODO SoundMan_setSoundListParams(dword_4AE930, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1700SoundList, false, 0, 0, 0, 0);
createSmackerScene(0x3028A005, true, true, false);
break;
case 1:
@ -63,11 +72,11 @@ void Module1700::createScene(int sceneNum, int which) {
createNavigationScene(0x004AE8E8, which);
break;
case 3:
// TODO SoundMan_setSoundListParams(dword_4AE930, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1700SoundList, false, 0, 0, 0, 0);
createSmackerScene(0x01190041, true, true, false);
break;
case 4:
// TODO SoundMan_setSoundListParams(dword_4AE930, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1700SoundList, false, 0, 0, 0, 0);
_vm->_soundMan->startMusic(0x31114225, 0, 2);
_childObject = new Scene1705(_vm, this, which);
break;
@ -80,7 +89,7 @@ void Module1700::updateScene() {
if (!updateChild()) {
switch (_vm->gameState().sceneNum) {
case 0:
// TODO SoundMan_setSoundListParams(dword_4AE930, false, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1700SoundList, true, 0, 0, 0, 0);
createScene(1, 0);
break;
case 1:

View File

@ -25,11 +25,21 @@
namespace Neverhood {
static const uint32 kModule1800SoundList[] = {
0x16805548,
0x16805048,
0xD0E14441,
0x90E090C2,
0x90E1D0C2,
0x90E2D0C2,
0
};
Module1800::Module1800(NeverhoodEngine *vm, Module *parentModule, int which)
: Module(vm, parentModule) {
// TODO SoundMan_addSoundList(0x04A14718, dword_4AFE70);
// TODO SoundMan_setSoundListParams(dword_4AFE70, true, 50, 600, 10, 150);
_vm->_soundMan->addSoundList(0x04A14718, kModule1800SoundList);
_vm->_soundMan->setSoundListParams(kModule1800SoundList, true, 50, 600, 10, 150);
_vm->_soundMan->playTwoSounds(0x04A14718, 0x8A382B55, 0x0C242F1D, 0);
if (which < 0) {
@ -77,7 +87,7 @@ void Module1800::createScene(int sceneNum, int which) {
createSmackerScene(0x08D84010, true, true, false);
break;
case 7:
// TODO SoundMan_setSoundListParams(dword_4AFE70, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule1800SoundList, false, 0, 0, 0, 0);
createSmackerScene(0x0168B121, true, true, false);
break;
case 8:

View File

@ -25,6 +25,13 @@
namespace Neverhood {
static const uint32 kModule1900SoundList[] = {
0xB4005E60,
0x91835066,
0x90E14440,
0
};
Module1900::Module1900(NeverhoodEngine *vm, Module *parentModule, int which)
: Module(vm, parentModule) {
@ -36,8 +43,8 @@ Module1900::Module1900(NeverhoodEngine *vm, Module *parentModule, int which)
createScene(0, 0);
}
// TODO SoundMan_addSoundList(0x04E1C09C, dword_4B8800, true);
// TODO SoundMan_setSoundListParams(dword_4B8800, true, 50, 600, 5, 150);
_vm->_soundMan->addSoundList(0x04E1C09C, kModule1900SoundList);
_vm->_soundMan->setSoundListParams(kModule1900SoundList, true, 50, 600, 5, 150);
}

View File

@ -24,11 +24,21 @@
namespace Neverhood {
static const uint32 kModule2300SoundList[] = {
0x90805C50,
0x90804450,
0xB4005E60,
0x91835066,
0x90E14440,
0x90F0D1C3,
0
};
Module2300::Module2300(NeverhoodEngine *vm, Module *parentModule, int which)
: Module(vm, parentModule), _volume(0) {
// TODO SoundMan_addSoundList(0x1A214010, dword_4B6938, true);
// TODO SoundMan_setSoundListParams(dword_4B6938, true, 50, 600, 10, 10, 150);
_vm->_soundMan->addSoundList(0x1A214010, kModule2300SoundList);
_vm->_soundMan->setSoundListParams(kModule2300SoundList, true, 50, 600, 10, 150);
_flag = getGlobalVar(0x10938830) == 0;

View File

@ -24,6 +24,15 @@
namespace Neverhood {
static const uint32 kModule2600SoundList[] = {
0xB288D450,
0x90804450,
0x99801500,
0xB288D455,
0x93825040,
0
};
Module2600::Module2600(NeverhoodEngine *vm, Module *parentModule, int which)
: Module(vm, parentModule) {
@ -35,8 +44,8 @@ Module2600::Module2600(NeverhoodEngine *vm, Module *parentModule, int which)
createScene(0, 1);
}
// TODO SoundMan_addSoundList(0x40271018, dword_4B87E8, true);
// TODO SoundMan_setSoundListParams(dword_4B87E8, true, 50, 600, 5, 150);
_vm->_soundMan->addSoundList(0x40271018, kModule2600SoundList);
_vm->_soundMan->setSoundListParams(kModule2600SoundList, true, 50, 600, 5, 150);
_vm->_soundMan->playTwoSounds(0x40271018, 0x41861371, 0x43A2507F, 0);
}

View File

@ -26,11 +26,22 @@
namespace Neverhood {
static const uint32 kModule3000SoundList[] = {
0x92025040,
0x90035066,
0x90815450,
0x99801500,
0x90E14440,
0x16805048,
0x90F0D1C3,
0
};
Module3000::Module3000(NeverhoodEngine *vm, Module *parentModule, int which)
: Module(vm, parentModule), _soundVolume(0) {
// TODO SoundMan_addSoundList(0x81293110, dword_4B7FC8, true);
// TODO SoundMan_setSoundListParams(dword_4B7FC8, true, 50, 600, 5, 150);
_vm->_soundMan->addSoundList(0x81293110, kModule3000SoundList);
_vm->_soundMan->setSoundListParams(kModule3000SoundList, true, 50, 600, 5, 150);
_vm->_soundMan->setSoundParams(0x90F0D1C3, false, 20000, 30000, 20000, 30000);
_vm->_soundMan->playTwoSounds(0x81293110, 0x48498E46, 0x50399F64, 0);
_vm->_soundMan->playTwoSounds(0x81293110, 0x40030A51, 0xC862CA15, 0);
@ -109,7 +120,7 @@ void Module3000::createScene(int sceneNum, int which) {
createNavigationScene(0x004B7FB0, which, kNavigationTypes06);
break;
case 7:
// TODO SoundMan_setSoundListParams(dword_4B7FC8, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule3000SoundList, false, 0, 0, 0, 0);
if (!getSubVar(0x40050052, 0x089809C2)) {
setSubVar(0x40050052, 0x089809C2, 1);
createSmackerScene(0x90022001, true, true, false);
@ -126,7 +137,7 @@ void Module3000::createScene(int sceneNum, int which) {
_childObject = new Scene3011(_vm, this, 0);
break;
case 11:
// TODO SoundMan_setSoundListParams(dword_4B7FC8, false, 0, 0, 0, 0);
_vm->_soundMan->setSoundListParams(kModule3000SoundList, false, 0, 0, 0, 0);
if (!getSubVar(0x40050052, 0x10130993)) {
setSubVar(0x40050052, 0x10130993, 1);
createSmackerScene(0x31093019, true, true, false);
@ -229,12 +240,12 @@ void Module3000::updateScene() {
case 8:
_flag = getGlobalVar(0x10938830); // CHECKME
if (_moduleResult != 1) {
// TODO: SoundMan_setSoundListParams(dword_4B7FC8, true, 0, 0, 0, 0):
// TODO: SoundMan_setSoundListParams(kModule3000SoundList, true, 0, 0, 0, 0):
createScene(4, 1);
} else if (getGlobalVar(0xF0402B0A)) {
createScene(1008, -1);
} else {
// TODO: SoundMan_setSoundListParams(dword_4B7FC8, true, 0, 0, 0, 0);
// TODO: SoundMan_setSoundListParams(kModule3000SoundList, true, 0, 0, 0, 0);
createScene(4, 1);
}
break;

View File

@ -206,7 +206,7 @@ void SoundMan::addSound(uint32 nameHash, uint32 soundFileHash) {
_soundItems.push_back(soundItem);
}
void SoundMan::addSoundList(uint32 nameHash, uint32 *soundFileHashList) {
void SoundMan::addSoundList(uint32 nameHash, const uint32 *soundFileHashList) {
while (*soundFileHashList)
addSound(nameHash, *soundFileHashList++);
}
@ -242,7 +242,7 @@ void SoundMan::setSoundParams(uint32 soundFileHash, bool playOnceAfterRandomCoun
}
}
void SoundMan::setSoundListParams(uint32 *soundFileHashList, bool playOnceAfterRandomCountdown,
void SoundMan::setSoundListParams(const uint32 *soundFileHashList, bool playOnceAfterRandomCountdown,
int16 minCountdown, int16 maxCountdown, int16 firstMinCountdown, int16 firstMaxCountdown) {
while (*soundFileHashList)

View File

@ -113,11 +113,11 @@ public:
// Sound
void addSound(uint32 nameHash, uint32 soundFileHash);
void addSoundList(uint32 nameHash, uint32 *soundFileHashList);
void addSoundList(uint32 nameHash, const uint32 *soundFileHashList);
void deleteSound(uint32 soundFileHash);
void setSoundParams(uint32 soundFileHash, bool playOnceAfterRandomCountdown,
int16 minCountdown, int16 maxCountdown, int16 firstMinCountdown, int16 firstMaxCountdown);
void setSoundListParams(uint32 *soundFileHashList, bool playOnceAfterRandomCountdown,
void setSoundListParams(const uint32 *soundFileHashList, bool playOnceAfterRandomCountdown,
int16 minCountdown, int16 maxCountdown, int16 firstMinCountdown, int16 firstMaxCountdown);
void playSoundLooping(uint32 soundFileHash);
void stopSound(uint32 soundFileHash);