From 2576f4b0bdff2bcff5f8667780c1254b3f2d84a2 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 29 Dec 2009 23:25:24 +0000 Subject: SCI/newmusic: fixed fading (fixes gk1 demo, park area) svn-id: r46730 --- engines/sci/sfx/music.cpp | 2 ++ engines/sci/sfx/soundcmd.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/sci/sfx/music.cpp b/engines/sci/sfx/music.cpp index 88dcec2b6f..a2f84f6ec6 100644 --- a/engines/sci/sfx/music.cpp +++ b/engines/sci/sfx/music.cpp @@ -378,6 +378,8 @@ void MusicEntry::doFade() { volume = fadeTo; fadeStep = 0; } + SegManager *segMan = ((SciEngine *)g_engine)->getEngineState()->_segMan; // HACK + PUT_SEL32V(segMan, soundObj, vol, volume); pMidiParser->setVolume(volume); } diff --git a/engines/sci/sfx/soundcmd.cpp b/engines/sci/sfx/soundcmd.cpp index 918b744c4e..124a93025f 100644 --- a/engines/sci/sfx/soundcmd.cpp +++ b/engines/sci/sfx/soundcmd.cpp @@ -640,11 +640,14 @@ void SoundCommandParser::cmdFadeHandle(reg_t obj, int16 value) { return; } - int volume = GET_SEL32V(_segMan, obj, vol); + int volume = musicSlot->volume; + PUT_SEL32V(_segMan, musicSlot->soundObj, vol, volume); musicSlot->fadeTo = _argv[2].toUint16(); musicSlot->fadeStep = volume > _argv[2].toUint16() ? -_argv[4].toUint16() : _argv[4].toUint16(); musicSlot->fadeTickerStep = _argv[3].toUint16() * 16667 / _music->soundGetTempo(); musicSlot->fadeTicker = 0; + + debugC(2, kDebugLevelSound, "cmdFadeHandle: to %d, step %d, ticker %d", musicSlot->fadeTo, musicSlot->fadeStep, musicSlot->fadeTickerStep); #endif } -- cgit v1.2.3