[Scummvm-cvs-logs] CVS: scummvm/sound fmopl.cpp,1.21,1.22 fmopl.h,1.12,1.13

Max Horn fingolfin at users.sourceforge.net
Sat Mar 13 10:53:02 CET 2004


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

Modified Files:
	fmopl.cpp fmopl.h 
Log Message:
Patch #902111: Change remaining random function calls to use RandomSource

Index: fmopl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/fmopl.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- fmopl.cpp	24 Feb 2004 22:39:41 -0000	1.21
+++ fmopl.cpp	13 Mar 2004 18:44:09 -0000	1.22
@@ -471,7 +471,8 @@
 #define WHITE_NOISE_db 6.0
 inline void OPL_CALC_RH(OPL_CH *CH) {
 	uint env_tam, env_sd, env_top, env_hh;
-	int whitenoise = int((rand()&1) * (WHITE_NOISE_db / EG_STEP));
+	int whitenoise = int(oplRnd.getRandomNumber(1) * (WHITE_NOISE_db / EG_STEP));
+
 	int tone8;
 
 	OPL_SLOT *SLOT;

Index: fmopl.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/fmopl.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- fmopl.h	24 Feb 2004 22:39:41 -0000	1.12
+++ fmopl.h	13 Mar 2004 18:44:10 -0000	1.13
@@ -27,6 +27,7 @@
 #define FMOPL_H_
 
 #include "common/scummsys.h"
+#include "common/util.h"
 
 enum {
 	FMOPL_ENV_BITS_HQ = 16,
@@ -158,6 +159,9 @@
 int OPLTimerOver(FM_OPL *OPL, int c);
 void OPLWriteReg(FM_OPL *OPL, int r, int v);
 void YM3812UpdateOne(FM_OPL *OPL, int16 *buffer, int length);
+
+static Common::RandomSource oplRnd;			/* OPL random number generator */
+
 #endif
 
 // Factory method





More information about the Scummvm-git-logs mailing list