[Scummvm-cvs-logs] CVS: scummvm/bs2/driver d_sound.cpp,1.34,1.35

Pawel Kolodziejski aquadran at users.sourceforge.net
Tue Sep 2 23:05:02 CEST 2003


Update of /cvsroot/scummvm/scummvm/bs2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv2211

Modified Files:
	d_sound.cpp 
Log Message:
fixed music fading out. it's "goto" hack. 
originaly dsound has 3 seconds buffer fillled with data enought for fading
this hack continue play music for time while fading is going

Index: d_sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/driver/d_sound.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- d_sound.cpp	3 Sep 2003 05:04:55 -0000	1.34
+++ d_sound.cpp	3 Sep 2003 06:03:29 -0000	1.35
@@ -1156,20 +1156,24 @@
 						if (v0 > v1) {
 							volume = musicVolTable[v0];
 							pan = (musicVolTable[v1 * 16 / v0] / 2) - 127;
+						}
+						if (v1 > v0) {
+							volume = musicVolTable[v1];
+							pan = (musicVolTable[v0 * 16 / v1] / 2) + 127;
 						} else {
-							if (v1 > v0) {
-								volume = musicVolTable[v1];
-								pan = (musicVolTable[v0 * 16 / v1] / 2) + 127;
-							} else {
-								volume = musicVolTable[v1];
-								pan = 0;
-							}
-							g_engine->_mixer->setChannelVolume(soundHandleMusic[i], volume);
-							g_engine->_mixer->setChannelPan(soundHandleMusic[i], pan);
+							volume = musicVolTable[v1];
+							pan = 0;
 						}
+						g_engine->_mixer->setChannelVolume(soundHandleMusic[i], volume);
+						g_engine->_mixer->setChannelPan(soundHandleMusic[i], pan);
+						// FIXME: hack. this need cleanup. 
+						// originaly it has 3 second buffer ahead enought for fading
+						// that why it's need play music for time while fading is going
+						goto label1;
 					}
 				}
 			} else {
+label1:
 				len = bufferSizeMusic;
 
 				// Reduce length if it requires reading past the end of the music
@@ -1232,7 +1236,7 @@
 					// be necessary.
 					if (len & 1)
 						len--;
-					
+
 					g_engine->_mixer->appendStream(soundHandleMusic[i], data16, len);
 					
 					free(data16);





More information about the Scummvm-git-logs mailing list