[quake3-commits] r1563 - in trunk/code: client qcommon renderer server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun May 31 16:30:37 EDT 2009


Author: thilo
Date: 2009-05-31 16:30:37 -0400 (Sun, 31 May 2009)
New Revision: 1563

Modified:
   trunk/code/client/cl_main.c
   trunk/code/qcommon/common.c
   trunk/code/renderer/tr_noise.c
   trunk/code/server/sv_init.c
Log:
I'll retain the new way seeding the random number generator.. these calls are therefore redundant


Modified: trunk/code/client/cl_main.c
===================================================================
--- trunk/code/client/cl_main.c	2009-05-31 20:24:10 UTC (rev 1562)
+++ trunk/code/client/cl_main.c	2009-05-31 20:30:37 UTC (rev 1563)
@@ -1306,11 +1306,7 @@
 		BigShort( cls.updateServer.port ) );
 	
 	info[0] = 0;
-  // NOTE TTimo xoring against Com_Milliseconds, otherwise we may not have a true randomization
-  // only srand I could catch before here is tr_noise.c l:26 srand(1001)
-  // https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=382
-  // NOTE: the Com_Milliseconds xoring only affects the lower 16-bit word,
-  //   but I decided it was enough randomization
+
 	Com_sprintf( cls.updateChallenge, sizeof( cls.updateChallenge ), "%i", ((rand() << 16) ^ rand()) ^ Com_Milliseconds());
 
 	Info_SetValueForKey( info, "challenge", cls.updateChallenge );

Modified: trunk/code/qcommon/common.c
===================================================================
--- trunk/code/qcommon/common.c	2009-05-31 20:24:10 UTC (rev 1562)
+++ trunk/code/qcommon/common.c	2009-05-31 20:30:37 UTC (rev 1563)
@@ -3340,7 +3340,6 @@
 		return;
 
 	Com_Printf( "Com_RandomBytes: using weak randomization\n" );
-	srand( time( 0 ) );
 	for( i = 0; i < len; i++ )
 		string[i] = (unsigned char)( rand() % 255 );
 }

Modified: trunk/code/renderer/tr_noise.c
===================================================================
--- trunk/code/renderer/tr_noise.c	2009-05-31 20:24:10 UTC (rev 1562)
+++ trunk/code/renderer/tr_noise.c	2009-05-31 20:30:37 UTC (rev 1563)
@@ -44,8 +44,6 @@
 {
 	int i;
 
-	srand( 1001 );
-
 	for ( i = 0; i < NOISE_SIZE; i++ )
 	{
 		s_noise_table[i] = ( float ) ( ( ( rand() / ( float ) RAND_MAX ) * 2.0 - 1.0 ) );

Modified: trunk/code/server/sv_init.c
===================================================================
--- trunk/code/server/sv_init.c	2009-05-31 20:24:10 UTC (rev 1562)
+++ trunk/code/server/sv_init.c	2009-05-31 20:30:37 UTC (rev 1563)
@@ -475,7 +475,6 @@
 	Cvar_Set("cl_paused", "0");
 
 	// get a new checksum feed and restart the file system
-	srand(Com_Milliseconds());
 	sv.checksumFeed = ( ((int) rand() << 16) ^ rand() ) ^ Com_Milliseconds();
 	FS_Restart( sv.checksumFeed );
 



More information about the quake3-commits mailing list