init RNG for everybody using time()

svn-id: r10796
This commit is contained in:
Max Horn 2003-10-14 10:24:27 +00:00
parent e9dacde3c5
commit 0aa58f53c8
3 changed files with 5 additions and 6 deletions

View File

@ -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) {

View File

@ -55,7 +55,7 @@ private:
uint32 _randSeed;
public:
RandomSource(uint32 seed = 0xA943DE33);
RandomSource();
void setSeed(uint32 seed);
/**

View File

@ -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;