Replace random generator
This commit is contained in:
parent
8ee0f478ad
commit
8dd8d1c312
|
@ -3,6 +3,8 @@
|
|||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <random>
|
||||
|
||||
#include "debug.h"
|
||||
#include "platform_compat.h"
|
||||
#include "scripts.h"
|
||||
|
@ -37,7 +39,7 @@ static int _idum;
|
|||
void randomInit()
|
||||
{
|
||||
unsigned int randomSeed = randomGetSeed();
|
||||
srand(randomSeed);
|
||||
std::srand(randomSeed);
|
||||
|
||||
int pseudorandomSeed = randomInt32();
|
||||
randomSeedPrerandomInternal(pseudorandomSeed);
|
||||
|
@ -183,10 +185,7 @@ void randomSeedPrerandom(int seed)
|
|||
// 0x4A31C4
|
||||
static int randomInt32()
|
||||
{
|
||||
int high = rand() << 16;
|
||||
int low = rand();
|
||||
|
||||
return (high + low) & INT_MAX;
|
||||
return std::rand();
|
||||
}
|
||||
|
||||
// 0x4A31E0
|
||||
|
|
Loading…
Reference in New Issue