[Scummvm-cvs-logs] SF.net SVN: scummvm:[46887] scummvm/trunk/engines/sci/sfx
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Jan 2 16:54:08 CET 2010
Revision: 46887
http://scummvm.svn.sourceforge.net/scummvm/?rev=46887&view=rev
Author: thebluegr
Date: 2010-01-02 15:54:08 +0000 (Sat, 02 Jan 2010)
Log Message:
-----------
SCI/new music code: don't stop a music track if the fading effect has just finished. Fixes the music in GK1 (demo and full)
Modified Paths:
--------------
scummvm/trunk/engines/sci/sfx/music.cpp
scummvm/trunk/engines/sci/sfx/music.h
scummvm/trunk/engines/sci/sfx/soundcmd.cpp
Modified: scummvm/trunk/engines/sci/sfx/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.cpp 2010-01-02 15:37:17 UTC (rev 46886)
+++ scummvm/trunk/engines/sci/sfx/music.cpp 2010-01-02 15:54:08 UTC (rev 46887)
@@ -534,7 +534,7 @@
fadeStep = 0;
fadeTicker = 0;
fadeTickerStep = 0;
- fadeVolumeSet = false;
+ fadeSetVolume = false;
status = kSoundStopped;
@@ -579,8 +579,7 @@
// Only process MIDI streams in this thread, not digital sound effects
if (pMidiParser)
pMidiParser->setVolume(volume);
- if (pStreamAud)
- fadeVolumeSet = true; // set flag so that SoundCommandParser::cmdUpdateCues will set the volume of the stream
+ fadeSetVolume = true; // set flag so that SoundCommandParser::cmdUpdateCues will set the volume of the stream
}
}
Modified: scummvm/trunk/engines/sci/sfx/music.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.h 2010-01-02 15:37:17 UTC (rev 46886)
+++ scummvm/trunk/engines/sci/sfx/music.h 2010-01-02 15:54:08 UTC (rev 46887)
@@ -93,7 +93,7 @@
short fadeStep;
uint32 fadeTicker;
uint32 fadeTickerStep;
- bool fadeVolumeSet;
+ bool fadeSetVolume;
SoundStatus status;
Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2010-01-02 15:37:17 UTC (rev 46886)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2010-01-02 15:54:08 UTC (rev 46887)
@@ -790,9 +790,9 @@
musicSlot->ticker = (uint16)(mixer->getSoundElapsedTime(musicSlot->hCurrentAud) * 0.06);
}
// We get a flag from MusicEntry::doFade() here to set volume for the stream
- if (musicSlot->fadeVolumeSet) {
+ if (musicSlot->fadeSetVolume) {
mixer->setChannelVolume(musicSlot->hCurrentAud, musicSlot->volume);
- musicSlot->fadeVolumeSet = false;
+ musicSlot->fadeSetVolume = false;
}
} else {
switch (musicSlot->signal) {
@@ -803,7 +803,13 @@
}
break;
case SIGNAL_OFFSET:
- cmdStopSound(obj, 0);
+ // Check if this signal is the end of the track or the end of fading effect.
+ // If this came from a fading effect, don't stop the track here, it'll be stopped
+ // by the engine scripts
+ if (musicSlot->fadeSetVolume)
+ musicSlot->fadeSetVolume = false;
+ else
+ cmdStopSound(obj, 0);
break;
default:
// Sync the signal of the sound object
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list