[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.106,1.107 simon.h,1.29,1.30 items.cpp,1.26,1.27

Oliver Kiehl olki at users.sourceforge.net
Sun Dec 1 08:03:23 CET 2002


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv14664

Modified Files:
	simon.cpp simon.h items.cpp 
Log Message:
new randimizer for simon


Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- simon.cpp	1 Dec 2002 08:56:04 -0000	1.106
+++ simon.cpp	1 Dec 2002 15:36:36 -0000	1.107
@@ -4512,6 +4512,8 @@
 	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;

Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- simon.h	1 Dec 2002 08:56:04 -0000	1.29
+++ simon.h	1 Dec 2002 15:36:36 -0000	1.30
@@ -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 @@
 	void show_it(void *buf);
 
 	char *gen_savename(int slot);
+
+	RandomSource _rnd;
 };
 
 

Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- items.cpp	1 Dec 2002 08:56:04 -0000	1.26
+++ items.cpp	1 Dec 2002 15:36:36 -0000	1.27
@@ -277,7 +277,7 @@
 
 				for (;;) {
 					uint value_2 = value;
-					rand_value = rand() & 0x7FFF;
+					rand_value = _rnd.getRandomNumber(0xffff) & 0x7FFF;
 
 					if (value == 0)
 						error("Invalid random range");





More information about the Scummvm-git-logs mailing list