[Scummvm-cvs-logs] CVS: scummvm/sound rate.cpp,1.34,1.35

Max Horn fingolfin at users.sourceforge.net
Mon Dec 27 15:59:02 CET 2004


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1715/sound

Modified Files:
	rate.cpp 
Log Message:
Use SoundMixer::kMaxMixerVolume

Index: rate.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/rate.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- rate.cpp	6 Jan 2004 12:45:33 -0000	1.34
+++ rate.cpp	27 Dec 2004 23:58:04 -0000	1.35
@@ -28,8 +28,9 @@
  */
 
 #include "stdafx.h"
-#include "sound/rate.h"
 #include "sound/audiostream.h"
+#include "sound/rate.h"
+#include "sound/mixer.h"
 
 /**
  * The precision of the fractional computations used by the rate converter.
@@ -166,10 +167,10 @@
 			}
 
 			// output left channel
-			clampedAdd(*obuf++, (out[0] * (int)vol_l) >> 8);
+			clampedAdd(*obuf++, (out[0] * (int)vol_l) / SoundMixer::kMaxMixerVolume);
 
 			// output right channel
-			clampedAdd(*obuf++, (out[1] * (int)vol_r) >> 8);
+			clampedAdd(*obuf++, (out[1] * (int)vol_r) / SoundMixer::kMaxMixerVolume);
 
 			// Increment output position
 			unsigned long tmp = opos_frac + opos_inc_frac;
@@ -236,10 +237,10 @@
 			}
 
 			// output left channel
-			clampedAdd(*obuf++, (tmp0 * (int)vol_l) >> 8);
+			clampedAdd(*obuf++, (tmp0 * (int)vol_l) / SoundMixer::kMaxMixerVolume);
 	
 			// output right channel
-			clampedAdd(*obuf++, (tmp1 * (int)vol_r) >> 8);
+			clampedAdd(*obuf++, (tmp1 * (int)vol_r) / SoundMixer::kMaxMixerVolume);
 		}
 		return (ST_SUCCESS);
 	}





More information about the Scummvm-git-logs mailing list