mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +00:00
init RNG for everybody using time()
svn-id: r10796
This commit is contained in:
parent
e9dacde3c5
commit
0aa58f53c8
@ -75,8 +75,10 @@ void hexdump(const byte * data, int len, int bytesPerLine) {
|
||||
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) {
|
||||
|
@ -55,7 +55,7 @@ private:
|
||||
uint32 _randSeed;
|
||||
|
||||
public:
|
||||
RandomSource(uint32 seed = 0xA943DE33);
|
||||
RandomSource();
|
||||
void setSeed(uint32 seed);
|
||||
|
||||
/**
|
||||
|
@ -585,9 +585,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst)
|
||||
VAR_VERB_ALLOWED = 0xFF;
|
||||
VAR_CLICK_AREA = 0xFF;
|
||||
|
||||
// Set the RNG seed
|
||||
_rnd.setSeed(_system->get_msecs());
|
||||
|
||||
// Use g_scumm from error() ONLY
|
||||
g_scumm = this;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user