[Scummvm-cvs-logs] SF.net SVN: scummvm:[46891] scummvm/trunk/engines/sci/sfx

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sat Jan 2 18:17:00 CET 2010


Revision: 46891
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46891&view=rev
Author:   m_kiewitz
Date:     2010-01-02 17:16:59 +0000 (Sat, 02 Jan 2010)

Log Message:
-----------
SCI/newmusic: fading signal handling changed... fixes lsl1demo and gk1demo

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 17:03:58 UTC (rev 46890)
+++ scummvm/trunk/engines/sci/sfx/music.cpp	2010-01-02 17:16:59 UTC (rev 46891)
@@ -535,6 +535,7 @@
 	fadeTicker = 0;
 	fadeTickerStep = 0;
 	fadeSetVolume = false;
+	fadeCompleted = false;
 
 	status = kSoundStopped;
 
@@ -572,7 +573,7 @@
 		if (((fadeStep > 0) && (fadeVolume >= fadeTo)) || ((fadeStep < 0) && (fadeVolume <= fadeTo))) {
 			fadeVolume = fadeTo;
 			fadeStep = 0;
-			signal = SIGNAL_OFFSET;
+			fadeCompleted = true;
 		}
 		volume = fadeVolume;
 

Modified: scummvm/trunk/engines/sci/sfx/music.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.h	2010-01-02 17:03:58 UTC (rev 46890)
+++ scummvm/trunk/engines/sci/sfx/music.h	2010-01-02 17:16:59 UTC (rev 46891)
@@ -94,6 +94,7 @@
 	uint32 fadeTicker;
 	uint32 fadeTickerStep;
 	bool fadeSetVolume;
+	bool fadeCompleted;
 
 	SoundStatus status;
 

Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2010-01-02 17:03:58 UTC (rev 46890)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2010-01-02 17:16:59 UTC (rev 46891)
@@ -803,16 +803,7 @@
 				}
 				break;
 			case SIGNAL_OFFSET:
-				// 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;
-					// Notify the game scripts that music fading is done
-					PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
-				} else {
-					cmdStopSound(obj, 0);
-				}
+				cmdStopSound(obj, 0);
 				break;
 			default:
 				// Sync the signal of the sound object
@@ -821,6 +812,11 @@
 		}
 	}
 
+	if (musicSlot->fadeCompleted) {
+		musicSlot->fadeCompleted = false;
+		PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
+	}
+
 	// Sync loop selector for SCI0
 	if (_soundVersion <= SCI_VERSION_0_LATE)
 		PUT_SEL32V(_segMan, obj, loop, musicSlot->loop);


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