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. svn-id: r17863
This commit is contained in:
parent
9bd7d78199
commit
5a2d871a2b
3 changed files with 2 additions and 3 deletions
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
void shutdown();
|
||||
|
||||
|
||||
Common::RandomSource _rnd;
|
||||
};
|
||||
|
||||
extern GobEngine *_vm;
|
||||
|
|
|
@ -68,7 +68,6 @@ void init_soundVideo(int32 smallHeap, int16 flag) {
|
|||
videoMode);
|
||||
|
||||
pFileHandler = 0;
|
||||
srand(0);
|
||||
|
||||
//if ((flag & 4) == 0)
|
||||
// vid_findVideo();
|
||||
|
|
|
@ -126,7 +126,7 @@ int16 util_checkKey(void) {
|
|||
}
|
||||
|
||||
int16 util_getRandom(int16 max) {
|
||||
return ((int32)rand() * max) / (RAND_MAX + 1);
|
||||
return _vm->_rnd.getRandomNumber(max - 1);
|
||||
}
|
||||
|
||||
void util_processInput() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue