[Scummvm-cvs-logs] CVS: scummvm/common util.h,1.25,1.26 util.cpp,1.20,1.21
Max Horn
fingolfin at users.sourceforge.net
Tue Oct 14 03:25:04 CEST 2003
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv5762/common
Modified Files:
util.h util.cpp
Log Message:
init RNG for everybody using time()
Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- util.h 4 Oct 2003 11:50:20 -0000 1.25
+++ util.h 14 Oct 2003 10:24:27 -0000 1.26
@@ -55,7 +55,7 @@
uint32 _randSeed;
public:
- RandomSource(uint32 seed = 0xA943DE33);
+ RandomSource();
void setSeed(uint32 seed);
/**
Index: util.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- util.cpp 4 Oct 2003 11:50:20 -0000 1.20
+++ util.cpp 14 Oct 2003 10:24:27 -0000 1.21
@@ -75,8 +75,10 @@
printf("|\n");
}
-RandomSource::RandomSource(uint32 seed) {
- _randSeed = seed;
+RandomSource::RandomSource() {
+ // Use system time as RNG seed. Normally not a good idea, if you are using
+ // a RNG for security purposes, but good enough for our purposes.
+ setSeed(time(0));
}
void RandomSource::setSeed(uint32 seed) {
More information about the Scummvm-git-logs
mailing list