diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/kyra_hof.h | 2 | ||||
-rw-r--r-- | engines/kyra/script_hof.cpp | 19 |
2 files changed, 16 insertions, 5 deletions
diff --git a/engines/kyra/kyra_hof.h b/engines/kyra/kyra_hof.h index f34c0d6d3a..93e1246b7d 100644 --- a/engines/kyra/kyra_hof.h +++ b/engines/kyra/kyra_hof.h @@ -786,7 +786,7 @@ protected: int o2_updateTwoSceneAnims(EMCState *script); int o2_getRainbowRoomData(EMCState *script); int o2_drawSceneShapeEx(EMCState *script); - int o2_getBoolFromStack(EMCState *script); + int o2_midiSoundFadeout(EMCState *script); int o2_getSfxDriver(EMCState *script); int o2_getVocSupport(EMCState *script); int o2_getMusicDriver(EMCState *script); diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp index 14f8faad5f..4525d71548 100644 --- a/engines/kyra/script_hof.cpp +++ b/engines/kyra/script_hof.cpp @@ -1335,9 +1335,20 @@ int KyraEngine_HoF::o2_drawSceneShapeEx(EMCState *script) { return 0; } -int KyraEngine_HoF::o2_getBoolFromStack(EMCState *script) { - debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_getBoolFromStack(%p) ()", (const void *)script); - return stackPos(0) ? 1 : 0; +int KyraEngine_HoF::o2_midiSoundFadeout(EMCState *script) { + debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_midiSoundFadeout(%p) ()", (const void *)script); + if (!stackPos(0)) { + if ((_sound->getMusicType() == Sound::kMidiMT32 || _sound->getMusicType() == Sound::kMidiGM) && + (_sound->getSfxType() == Sound::kMidiMT32 || _sound->getSfxType() == Sound::kMidiGM)) { + _sound->beginFadeOut(); + delay(2000, true); + _lastMusicCommand = -1; + } else { + return 0; + } + } + + return 1; } int KyraEngine_HoF::o2_getSfxDriver(EMCState *script) { @@ -1704,7 +1715,7 @@ void KyraEngine_HoF::setupOpcodeTable() { Opcode(o2_updateTwoSceneAnims); Opcode(o2_getRainbowRoomData); Opcode(o2_drawSceneShapeEx); - Opcode(o2_getBoolFromStack); + Opcode(o2_midiSoundFadeout); // 0xa4 Opcode(o2_getSfxDriver); Opcode(o2_getVocSupport); |