[quake3-commits] r2044 - trunk/code/cgame

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jun 18 10:52:17 EDT 2011


Author: thilo
Date: 2011-06-18 10:52:16 -0400 (Sat, 18 Jun 2011)
New Revision: 2044

Modified:
   trunk/code/cgame/cg_ents.c
Log:
Bug 5048 - Entity constant light does not work correctly, bug found by Eraesr (Eraser?)


Modified: trunk/code/cgame/cg_ents.c
===================================================================
--- trunk/code/cgame/cg_ents.c	2011-06-18 14:30:20 UTC (rev 2043)
+++ trunk/code/cgame/cg_ents.c	2011-06-18 14:52:16 UTC (rev 2044)
@@ -139,16 +139,17 @@
 
 
 	// constant light glow
-	if ( cent->currentState.constantLight ) {
+	if(cent->currentState.constantLight)
+	{
 		int		cl;
-		int		i, r, g, b;
+		float		i, r, g, b;
 
 		cl = cent->currentState.constantLight;
-		r = cl & 255;
-		g = ( cl >> 8 ) & 255;
-		b = ( cl >> 16 ) & 255;
-		i = ( ( cl >> 24 ) & 255 ) * 4;
-		trap_R_AddLightToScene( cent->lerpOrigin, i, r, g, b );
+		r = (float) (cl & 0xFF) / 255.0;
+		g = (float) ((cl >> 8) & 0xFF) / 255.0;
+		b = (float) ((cl >> 16) & 0xFF) / 255.0;
+		i = (float) ((cl >> 24) & 0xFF) * 4.0;
+		trap_R_AddLightToScene(cent->lerpOrigin, i, r, g, b);
 	}
 
 }



More information about the quake3-commits mailing list