aboutsummaryrefslogtreecommitdiff
path: root/sword2/function.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-09-04 09:27:17 +0000
committerTorbjörn Andersson2004-09-04 09:27:17 +0000
commitcb399b63d5cc24e6adb0289a1ff0dfd32ff29b1e (patch)
tree09bfe31f5df556b93b04dff14f449b352a70fdfe /sword2/function.cpp
parentae4105de50ef26265a469cde6fa3003a7bd6c000 (diff)
downloadscummvm-rg350-cb399b63d5cc24e6adb0289a1ff0dfd32ff29b1e.tar.gz
scummvm-rg350-cb399b63d5cc24e6adb0289a1ff0dfd32ff29b1e.tar.bz2
scummvm-rg350-cb399b63d5cc24e6adb0289a1ff0dfd32ff29b1e.zip
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
Diffstat (limited to 'sword2/function.cpp')
-rw-r--r--sword2/function.cpp13
1 files changed, 9 insertions, 4 deletions
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)