r734 - in trunk/code: renderer unix win32

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun Apr 30 10:32:57 EDT 2006


Author: thilo
Date: 2006-04-30 10:32:56 -0400 (Sun, 30 Apr 2006)
New Revision: 734

Modified:
   trunk/code/renderer/tr_flares.c
   trunk/code/renderer/tr_image.c
   trunk/code/renderer/tr_init.c
   trunk/code/renderer/tr_local.h
   trunk/code/unix/linux_glimp.c
   trunk/code/unix/sdl_glimp.c
   trunk/code/win32/win_glimp.c
Log:
- Fixed incompatibility to original VMs introduced by anisotropic filtering patch.
- Removed dependency of flares from tr.identityLight because they are barely visible with r_overbrightbits set to 1


Modified: trunk/code/renderer/tr_flares.c
===================================================================
--- trunk/code/renderer/tr_flares.c	2006-04-30 13:50:13 UTC (rev 733)
+++ trunk/code/renderer/tr_flares.c	2006-04-30 14:32:56 UTC (rev 734)
@@ -351,7 +351,7 @@
 	
 	intensity = flareCoeff * size * size / (factor * factor);
 
-	VectorScale(f->color, f->drawIntensity * tr.identityLight * intensity, color);
+	VectorScale(f->color, f->drawIntensity * intensity, color);
 
 // Calculations for fogging
 	if(tr.world && f->fogNum < tr.world->numfogs)

Modified: trunk/code/renderer/tr_image.c
===================================================================
--- trunk/code/renderer/tr_image.c	2006-04-30 13:50:13 UTC (rev 733)
+++ trunk/code/renderer/tr_image.c	2006-04-30 14:32:56 UTC (rev 734)
@@ -699,16 +699,16 @@
 
 	if (mipmap)
 	{
-		if ( glConfig.textureFilterAnisotropic )
+		if ( textureFilterAnisotropic )
 			qglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
-					(GLint)Com_Clamp( 1, glConfig.maxAnisotropy, r_ext_max_anisotropy->integer ) );
+					(GLint)Com_Clamp( 1, maxAnisotropy, r_ext_max_anisotropy->integer ) );
 
 		qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min);
 		qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
 	}
 	else
 	{
-		if ( glConfig.textureFilterAnisotropic )
+		if ( textureFilterAnisotropic )
 			qglTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1 );
 
 		qglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );

Modified: trunk/code/renderer/tr_init.c
===================================================================
--- trunk/code/renderer/tr_init.c	2006-04-30 13:50:13 UTC (rev 733)
+++ trunk/code/renderer/tr_init.c	2006-04-30 14:32:56 UTC (rev 734)
@@ -24,6 +24,9 @@
 #include "tr_local.h"
 
 glconfig_t	glConfig;
+qboolean	textureFilterAnisotropic = qfalse;
+int		maxAnisotropy = 0;
+                
 glstate_t	glState;
 
 static void GfxInfo_f( void );

Modified: trunk/code/renderer/tr_local.h
===================================================================
--- trunk/code/renderer/tr_local.h	2006-04-30 13:50:13 UTC (rev 733)
+++ trunk/code/renderer/tr_local.h	2006-04-30 14:32:56 UTC (rev 734)
@@ -970,6 +970,12 @@
 extern glconfig_t	glConfig;		// outside of TR since it shouldn't be cleared during ref re-init
 extern glstate_t	glState;		// outside of TR since it shouldn't be cleared during ref re-init
 
+// These two variables should live inside glConfig but can't because of compatibility issues to the original ID vms.
+// If you release a stand-alone game and your mod uses tr_types.h from this build you can safely move them to
+// the glconfig_t struct.
+extern qboolean		textureFilterAnisotropic;
+extern int		maxAnisotropy;
+                
 
 //
 // cvars

Modified: trunk/code/unix/linux_glimp.c
===================================================================
--- trunk/code/unix/linux_glimp.c	2006-04-30 13:50:13 UTC (rev 733)
+++ trunk/code/unix/linux_glimp.c	2006-04-30 14:32:56 UTC (rev 734)
@@ -1323,19 +1323,19 @@
     ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" );
   }
 
-  glConfig.textureFilterAnisotropic = qfalse;
+  textureFilterAnisotropic = qfalse;
   if ( strstr( glConfig.extensions_string, "GL_EXT_texture_filter_anisotropic" ) )
   {
     if ( r_ext_texture_filter_anisotropic->integer ) {
-      qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glConfig.maxAnisotropy );
-      if ( glConfig.maxAnisotropy <= 0 ) {
+      qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy );
+      if ( maxAnisotropy <= 0 ) {
         ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not properly supported!\n" );
-        glConfig.maxAnisotropy = 0;
+        maxAnisotropy = 0;
       }
       else
       {
-        ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", glConfig.maxAnisotropy );
-        glConfig.textureFilterAnisotropic = qtrue;
+        ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", maxAnisotropy );
+        textureFilterAnisotropic = qtrue;
       }
     }
     else

Modified: trunk/code/unix/sdl_glimp.c
===================================================================
--- trunk/code/unix/sdl_glimp.c	2006-04-30 13:50:13 UTC (rev 733)
+++ trunk/code/unix/sdl_glimp.c	2006-04-30 14:32:56 UTC (rev 734)
@@ -827,19 +827,19 @@
     ri.Printf( PRINT_ALL, "...GL_EXT_compiled_vertex_array not found\n" );
   }
 
-  glConfig.textureFilterAnisotropic = qfalse;
+  textureFilterAnisotropic = qfalse;
   if ( strstr( glConfig.extensions_string, "GL_EXT_texture_filter_anisotropic" ) )
   {
     if ( r_ext_texture_filter_anisotropic->integer ) {
-      qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glConfig.maxAnisotropy );
-      if ( glConfig.maxAnisotropy <= 0 ) {
+      qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy );
+      if ( maxAnisotropy <= 0 ) {
         ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not properly supported!\n" );
-        glConfig.maxAnisotropy = 0;
+        maxAnisotropy = 0;
       }
       else
       {
-        ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", glConfig.maxAnisotropy );
-        glConfig.textureFilterAnisotropic = qtrue;
+        ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", maxAnisotropy );
+        textureFilterAnisotropic = qtrue;
       }
     }
     else

Modified: trunk/code/win32/win_glimp.c
===================================================================
--- trunk/code/win32/win_glimp.c	2006-04-30 13:50:13 UTC (rev 733)
+++ trunk/code/win32/win_glimp.c	2006-04-30 14:32:56 UTC (rev 734)
@@ -1112,19 +1112,19 @@
 		ri.Printf( PRINT_ALL, "...WGL_3DFX_gamma_control not found\n" );
 	}
 
-	glConfig.textureFilterAnisotropic = qfalse;
+	textureFilterAnisotropic = qfalse;
 	if ( strstr( glConfig.extensions_string, "GL_EXT_texture_filter_anisotropic" ) )
 	{
 		if ( r_ext_texture_filter_anisotropic->integer ) {
-			qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glConfig.maxAnisotropy );
-			if ( glConfig.maxAnisotropy <= 0 ) {
+			qglGetIntegerv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy );
+			if ( maxAnisotropy <= 0 ) {
 				ri.Printf( PRINT_ALL, "...GL_EXT_texture_filter_anisotropic not properly supported!\n" );
-				glConfig.maxAnisotropy = 0;
+				maxAnisotropy = 0;
 			}
 			else
 			{
-				ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", glConfig.maxAnisotropy );
-				glConfig.textureFilterAnisotropic = qtrue;
+				ri.Printf( PRINT_ALL, "...using GL_EXT_texture_filter_anisotropic (max: %i)\n", maxAnisotropy );
+				textureFilterAnisotropic = qtrue;
 			}
 		}
 		else




More information about the quake3-commits mailing list