From c2db2b91a53386960f3351d5ab3681bd913386e0 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 13 Jan 2009 10:11:52 +0000 Subject: - 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 --- engines/made/music.cpp | 6 +++--- engines/made/screenfx.cpp | 1 - engines/made/scriptfuncs.cpp | 33 +++++++++++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/engines/made/music.cpp b/engines/made/music.cpp index 0b58a11774..bb45367805 100644 --- a/engines/made/music.cpp +++ b/engines/made/music.cpp @@ -164,7 +164,7 @@ void MusicPlayer::playXMIDI(GenericResource *midiResource, MusicFlags flags) { _parser = parser; - setVolume(255); + setVolume(127); _looping = flags & MUSIC_LOOP; _isPlaying = true; @@ -190,7 +190,7 @@ void MusicPlayer::playSMF(GenericResource *midiResource, MusicFlags flags) { _parser = parser; - setVolume(255); + setVolume(127); _looping = flags & MUSIC_LOOP; _isPlaying = true; @@ -213,7 +213,7 @@ void MusicPlayer::pause() { } void MusicPlayer::resume() { - setVolume(255); + setVolume(127); _isPlaying = true; } diff --git a/engines/made/screenfx.cpp b/engines/made/screenfx.cpp index b73c83c663..ba5d8b9476 100644 --- a/engines/made/screenfx.cpp +++ b/engines/made/screenfx.cpp @@ -56,7 +56,6 @@ ScreenEffects::ScreenEffects(Screen *screen) : _screen(screen) { void ScreenEffects::run(int16 effectNum, Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { // TODO: Put effect functions into an array - // TODO: Implement more visual effects switch (effectNum) { 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; } -- cgit v1.2.3