aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Kiehl2002-12-01 15:36:36 +0000
committerOliver Kiehl2002-12-01 15:36:36 +0000
commit7e77138a3f58225857f1f3b75bb7fb0d0281e71b (patch)
tree7819bf5a69b0d4b5eb0a1752b2fbf7ff57ecd130
parent5819f1e6ee61cb4d652749008e40dea5ab33146f (diff)
downloadscummvm-rg350-7e77138a3f58225857f1f3b75bb7fb0d0281e71b.tar.gz
scummvm-rg350-7e77138a3f58225857f1f3b75bb7fb0d0281e71b.tar.bz2
scummvm-rg350-7e77138a3f58225857f1f3b75bb7fb0d0281e71b.zip
new randimizer for simon
svn-id: r5784
-rw-r--r--simon/items.cpp2
-rw-r--r--simon/simon.cpp2
-rw-r--r--simon/simon.h3
3 files changed, 6 insertions, 1 deletions
diff --git a/simon/items.cpp b/simon/items.cpp
index d9eb7b8c26..68cb5e9cb9 100644
--- a/simon/items.cpp
+++ b/simon/items.cpp
@@ -277,7 +277,7 @@ int SimonState::runScript()
for (;;) {
uint value_2 = value;
- rand_value = rand() & 0x7FFF;
+ rand_value = _rnd.getRandomNumber(0xffff) & 0x7FFF;
if (value == 0)
error("Invalid random range");
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 20bc397ad8..14937caaef 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -4512,6 +4512,8 @@ void SimonState::delay(uint amount)
uint32 cur = start;
const uint vga_period = _fast_mode ? 10 : 50;
+ _rnd.getRandomNumber(2);
+
do {
while (!_in_callback && cur >= _last_vga_tick + vga_period) {
_last_vga_tick += vga_period;
diff --git a/simon/simon.h b/simon/simon.h
index c73f7e78f1..8942786d35 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -24,6 +24,7 @@
#include <stdio.h>
#include "common/engine.h"
+#include "common/util.h"
#include "simon/midi.h"
#include "sound/mixer.h"
#include "simon/sound.h"
@@ -779,6 +780,8 @@ public:
void show_it(void *buf);
char *gen_savename(int slot);
+
+ RandomSource _rnd;
};