[Scummvm-cvs-logs] CVS: scummvm/gob gob.h,1.5,1.6 init.cpp,1.8,1.9 util.cpp,1.12,1.13
Torbjörn Andersson
eriktorbjorn at users.sourceforge.net
Fri Apr 29 08:04:22 CEST 2005
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/gob gob.cpp,1.8,1.9 gob.h,1.4,1.5 sound.cpp,1.5,1.6 sound.h,1.4,1.5
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm scumm.h,1.611,1.612
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/gob
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25327
Modified Files:
gob.h init.cpp util.cpp
Log Message:
Replaced rand()/srand() with RandomSource. Of course, util_getRandom() is a
pretty unnecessary function - we could call RandomSource directly - but
let's take this one thing at a time.
Index: gob.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/gob.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gob.h 29 Apr 2005 10:07:00 -0000 1.5
+++ gob.h 29 Apr 2005 15:01:02 -0000 1.6
@@ -51,7 +51,7 @@
void shutdown();
-
+ Common::RandomSource _rnd;
};
extern GobEngine *_vm;
Index: init.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/init.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- init.cpp 26 Apr 2005 06:29:53 -0000 1.8
+++ init.cpp 29 Apr 2005 15:01:03 -0000 1.9
@@ -68,7 +68,6 @@
videoMode);
pFileHandler = 0;
- srand(0);
//if ((flag & 4) == 0)
// vid_findVideo();
Index: util.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/util.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- util.cpp 19 Apr 2005 07:45:55 -0000 1.12
+++ util.cpp 29 Apr 2005 15:01:03 -0000 1.13
@@ -126,7 +126,7 @@
}
int16 util_getRandom(int16 max) {
- return ((int32)rand() * max) / (RAND_MAX + 1);
+ return _vm->_rnd.getRandomNumber(max - 1);
}
void util_processInput() {
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/gob gob.cpp,1.8,1.9 gob.h,1.4,1.5 sound.cpp,1.5,1.6 sound.h,1.4,1.5
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm scumm.h,1.611,1.612
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list