aboutsummaryrefslogtreecommitdiff
path: root/engines/made/scriptfuncs.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2009-01-13 10:11:52 +0000
committerFilippos Karapetis2009-01-13 10:11:52 +0000
commitc2db2b91a53386960f3351d5ab3681bd913386e0 (patch)
tree55aa0c065b4e5292a4981821e74e046517e49663 /engines/made/scriptfuncs.cpp
parentcfdb824535a204a6ee1853dd801cad9a2eac92aa (diff)
downloadscummvm-rg350-c2db2b91a53386960f3351d5ab3681bd913386e0.tar.gz
scummvm-rg350-c2db2b91a53386960f3351d5ab3681bd913386e0.tar.bz2
scummvm-rg350-c2db2b91a53386960f3351d5ab3681bd913386e0.zip
- Music now works in LGoP2
- Changed the default music volume to 127, down from 255 - Added an explanation/FIXME for the out of sync mouth animations in RTZ - Added some TODOs and removed some obsolete ones svn-id: r35843
Diffstat (limited to 'engines/made/scriptfuncs.cpp')
-rw-r--r--engines/made/scriptfuncs.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp
index df56f9c20e..deb1b700ca 100644
--- a/engines/made/scriptfuncs.cpp
+++ b/engines/made/scriptfuncs.cpp
@@ -244,15 +244,30 @@ int16 ScriptFunctions::sfPlaySound(int16 argc, int16 *argv) {
}
int16 ScriptFunctions::sfPlayMusic(int16 argc, int16 *argv) {
- // TODO: Music in LGOP2 and Manhole isn't supported yet
+ int16 musicNum = argv[0];
+
if (_vm->getGameID() == GID_RTZ) {
- int16 musicNum = argv[0];
if (musicNum > 0) {
_musicRes = _vm->_res->getXmidi(musicNum);
if (_musicRes)
_vm->_music->playXMIDI(_musicRes);
}
+ } else {
+ // HACK: music number 2 in LGOP2 is file MT32SET.TON, which
+ // is used to set the MT32 instruments. This is not loaded
+ // correctly and the game freezes, and since we don't support
+ // MT32 music yet, we ignore it here
+ // FIXME: Remove this hack and handle this file properly
+ if (_vm->getGameID() == GID_LGOP2 && musicNum == 2)
+ return 0;
+
+ if (musicNum > 0) {
+ _musicRes = _vm->_res->getMidi(musicNum);
+ if (_musicRes)
+ _vm->_music->playSMF(_musicRes);
+ }
}
+
return 0;
}
@@ -321,6 +336,7 @@ int16 ScriptFunctions::sfShowMouseCursor(int16 argc, int16 *argv) {
}
int16 ScriptFunctions::sfGetMusicBeat(int16 argc, int16 *argv) {
+ // TODO
// This is called loads of times in the intro of the floppy version
// of RtZ. Not sure what it does. Commented out to reduce spam
//warning("Unimplemented opcode: sfGetMusicBeat");
@@ -599,6 +615,16 @@ int16 ScriptFunctions::sfClearMono(int16 argc, int16 *argv) {
int16 ScriptFunctions::sfGetSoundEnergy(int16 argc, int16 *argv) {
// This is called while in-game voices are played to animate
// mouths when NPCs are talking
+
+ // FIXME: the mouth animations are out of sync. This occurs
+ // because the original unpacked sounds on the fly, whereas
+ // in ScummVM we unpack them when they're loaded. In ScummVM,
+ // the "sound energy" values are stored in an array (used as
+ // a stack), which means that sfGetSoundEnergy can empty that
+ // array prematurely. A proper fix would be to figure out
+ // when a value should be popped from the sound energy stack,
+ // or to unpack sounds on the fly like the original does
+
int result = 0;
if (soundEnergy.size() > 0) {
result = *soundEnergy.begin();
@@ -909,6 +935,9 @@ int16 ScriptFunctions::sfGetSynthType(int16 argc, int16 *argv) {
// 2 = SBFM/ADLIB
// 3 = ADLIBG
// 4 = MT32MPU
+
+ // TODO
+
warning("Unimplemented opcode: sfGetSynthType");
return 0;
}