From b27fc8e5d87eb934a1ac50f2fae03ec19885f581 Mon Sep 17 00:00:00 2001 From: thilo Date: Sun, 30 Apr 2006 14:32:56 +0000 Subject: - 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 git-svn-id: svn://svn.icculus.org/quake3/trunk@734 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/renderer/tr_flares.c | 2 +- code/renderer/tr_image.c | 6 +++--- code/renderer/tr_init.c | 3 +++ code/renderer/tr_local.h | 6 ++++++ code/unix/linux_glimp.c | 12 ++++++------ code/unix/sdl_glimp.c | 12 ++++++------ code/win32/win_glimp.c | 12 ++++++------ 7 files changed, 31 insertions(+), 22 deletions(-) diff --git a/code/renderer/tr_flares.c b/code/renderer/tr_flares.c index 89a959c..0e650f2 100644 --- a/code/renderer/tr_flares.c +++ b/code/renderer/tr_flares.c @@ -351,7 +351,7 @@ void RB_RenderFlare( flare_t *f ) { 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) diff --git a/code/renderer/tr_image.c b/code/renderer/tr_image.c index 88d0ec2..d97a42a 100644 --- a/code/renderer/tr_image.c +++ b/code/renderer/tr_image.c @@ -699,16 +699,16 @@ done: 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 ); diff --git a/code/renderer/tr_init.c b/code/renderer/tr_init.c index 7300978..b13d9d4 100644 --- a/code/renderer/tr_init.c +++ b/code/renderer/tr_init.c @@ -24,6 +24,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "tr_local.h" glconfig_t glConfig; +qboolean textureFilterAnisotropic = qfalse; +int maxAnisotropy = 0; + glstate_t glState; static void GfxInfo_f( void ); diff --git a/code/renderer/tr_local.h b/code/renderer/tr_local.h index 6fe7ee9..d68e79c 100644 --- a/code/renderer/tr_local.h +++ b/code/renderer/tr_local.h @@ -970,6 +970,12 @@ extern trGlobals_t tr; 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 diff --git a/code/unix/linux_glimp.c b/code/unix/linux_glimp.c index 16a0eda..b52bf17 100644 --- a/code/unix/linux_glimp.c +++ b/code/unix/linux_glimp.c @@ -1323,19 +1323,19 @@ static void GLW_InitExtensions( void ) 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 diff --git a/code/unix/sdl_glimp.c b/code/unix/sdl_glimp.c index bd0f330..adf5dc3 100644 --- a/code/unix/sdl_glimp.c +++ b/code/unix/sdl_glimp.c @@ -827,19 +827,19 @@ static void GLW_InitExtensions( void ) 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 diff --git a/code/win32/win_glimp.c b/code/win32/win_glimp.c index f9b1289..460d868 100644 --- a/code/win32/win_glimp.c +++ b/code/win32/win_glimp.c @@ -1112,19 +1112,19 @@ static void GLW_InitExtensions( void ) 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 -- cgit v1.2.3