- Introduce seeding of the random number generator at startup
- Replaced all engine-side occurances of rand() with random()
This commit is contained in:
parent
7aed7e8861
commit
b40f1507ea
5 changed files with 28 additions and 17 deletions
|
@ -44,12 +44,10 @@ void R_NoiseInit( void )
|
|||
{
|
||||
int i;
|
||||
|
||||
srand( 1001 );
|
||||
|
||||
for ( i = 0; i < NOISE_SIZE; i++ )
|
||||
{
|
||||
s_noise_table[i] = ( float ) ( ( ( rand() / ( float ) RAND_MAX ) * 2.0 - 1.0 ) );
|
||||
s_noise_perm[i] = ( unsigned char ) ( rand() / ( float ) RAND_MAX * 255 );
|
||||
s_noise_table[i] = ( float ) ( ( ( random() / ( float ) RAND_MAX ) * 2.0 - 1.0 ) );
|
||||
s_noise_perm[i] = ( unsigned char ) ( random() / ( float ) RAND_MAX * 255 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue