[Scummvm-cvs-logs] SF.net SVN: scummvm:[36174] scummvm/branches/branch-0-13-0/engines/groovie/ music.cpp

spookypeanut at users.sourceforge.net spookypeanut at users.sourceforge.net
Sun Feb 1 13:33:11 CET 2009


Revision: 36174
          http://scummvm.svn.sourceforge.net/scummvm/?rev=36174&view=rev
Author:   spookypeanut
Date:     2009-02-01 12:33:11 +0000 (Sun, 01 Feb 2009)

Log Message:
-----------
Backport of r36173: T7G: Fix for 2474078

Modified Paths:
--------------
    scummvm/branches/branch-0-13-0/engines/groovie/music.cpp

Modified: scummvm/branches/branch-0-13-0/engines/groovie/music.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/engines/groovie/music.cpp	2009-02-01 11:56:12 UTC (rev 36173)
+++ scummvm/branches/branch-0-13-0/engines/groovie/music.cpp	2009-02-01 12:33:11 UTC (rev 36174)
@@ -188,13 +188,6 @@
 	// Calculate the passed time
 	uint32 time = _vm->_system->getMillis() - _fadingStartTime;
 	if (time >= _fadingDuration) {
-		// If we were fading to 0, stop the playback and restore the volume
-		if (_fadingEndVolume == 0) {
-			debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Faded to zero: end of song");
-			unload();
-			_fadingEndVolume = 100;
-		}
-
 		// Set the end volume
 		_gameVolume = _fadingEndVolume;
 	} else {
@@ -203,6 +196,15 @@
 			_fadingEndVolume * time) / _fadingDuration;
 	}
 
+	if (_gameVolume == _fadingEndVolume) {
+		// If we were fading to 0, stop the playback and restore the volume
+		if (_fadingEndVolume == 0) {
+			debugC(1, kGroovieDebugMIDI | kGroovieDebugAll, "Groovie::Music: Faded to zero: end of song");
+			unload();
+			_fadingEndVolume = 100;
+		}
+	}
+
 	// Apply the new volume to all the channels
 	for (int i = 0; i < 0x10; i++) {
 		updateChanVolume(i);


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