From cb399b63d5cc24e6adb0289a1ff0dfd32ff29b1e Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sat, 4 Sep 2004 09:27:17 +0000 Subject: Added support for compressed music. I'm sure there are some glitches still to fix, but it should work well enough for now. In this rewrite of the music code, I removed the "save/restore music state" function, since it just complicated things for a very small gain. It wasn't in the original engine, and I added it just for the credits, so that the previously playing music could be resumed afterwards. I might re-add it later, but probably not. svn-id: r14887 --- sword2/function.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'sword2/function.cpp') diff --git a/sword2/function.cpp b/sword2/function.cpp index 4f95b89852..6c275f9747 100644 --- a/sword2/function.cpp +++ b/sword2/function.cpp @@ -369,6 +369,8 @@ struct CreditsLine { #define CREDITS_LINE_SPACING 20 int32 Logic::fnPlayCredits(int32 *params) { + uint32 loopingMusicId = _vm->_loopingMusicId; + // This function just quits the game if this is the playable demo, ie. // credits are NOT played in the demo any more! @@ -383,11 +385,8 @@ int32 Logic::fnPlayCredits(int32 *params) { _vm->setMouse(0); - _vm->_sound->saveMusicState(); - _vm->_sound->muteFx(true); _vm->_sound->muteSpeech(true); - _vm->_sound->stopMusic(); _vm->_graphics->waitForFade(); _vm->_graphics->fadeDown(); @@ -703,10 +702,16 @@ int32 Logic::fnPlayCredits(int32 *params) { if (_vm->_quit) return IR_CONT; - _vm->_sound->restoreMusicState(); _vm->_sound->muteFx(false); _vm->_sound->muteSpeech(false); + if (loopingMusicId) { + pars[0] = loopingMusicId; + pars[1] = FX_LOOP; + fnPlayMusic(pars); + } else + fnStopMusic(NULL); + _vm->_thisScreen.new_palette = 99; if (!_vm->_mouseStatus || _choosing) -- cgit v1.2.3