aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2004-03-13 18:44:10 +0000
committerMax Horn2004-03-13 18:44:10 +0000
commit1b537be8d43c7b7a41f6eee31fb1db5175405175 (patch)
treedb387c534a4c3bdb49e64cc04f680244d26202b1 /sound
parent47cfcda3c6a63a765f14b62e6ebbc3b6caadb75a (diff)
downloadscummvm-rg350-1b537be8d43c7b7a41f6eee31fb1db5175405175.tar.gz
scummvm-rg350-1b537be8d43c7b7a41f6eee31fb1db5175405175.tar.bz2
scummvm-rg350-1b537be8d43c7b7a41f6eee31fb1db5175405175.zip
Patch #902111: Change remaining random function calls to use RandomSource
svn-id: r13262
Diffstat (limited to 'sound')
-rw-r--r--sound/fmopl.cpp3
-rw-r--r--sound/fmopl.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/sound/fmopl.cpp b/sound/fmopl.cpp
index 60dacbfc33..0b3c1664a9 100644
--- a/sound/fmopl.cpp
+++ b/sound/fmopl.cpp
@@ -471,7 +471,8 @@ inline void OPL_CALC_CH(OPL_CH *CH) {
#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;
diff --git a/sound/fmopl.h b/sound/fmopl.h
index 509f0abc80..96db6196c1 100644
--- a/sound/fmopl.h
+++ b/sound/fmopl.h
@@ -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 @@ unsigned char OPLRead(FM_OPL *OPL, int a);
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