diff options
author | Tim Angus <tim@ngus.net> | 2013-02-16 20:58:04 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-02-16 22:12:07 +0000 |
commit | 0d15e50542e1bd791bc1d87744dcca9971e040f6 (patch) | |
tree | 99aa8ede5daccc1234889cc1da034005c7839383 /src/renderergl1/tr_init.c | |
parent | 1e105cd9071bbf7603f004ad5ed84af491231819 (diff) |
Add renderercommon/tr_common.h
Diffstat (limited to 'src/renderergl1/tr_init.c')
-rw-r--r-- | src/renderergl1/tr_init.c | 87 |
1 files changed, 3 insertions, 84 deletions
diff --git a/src/renderergl1/tr_init.c b/src/renderergl1/tr_init.c index 650c848e..c85c9952 100644 --- a/src/renderergl1/tr_init.c +++ b/src/renderergl1/tr_init.c @@ -166,90 +166,6 @@ int max_polyverts; #define GENERIC_HW_R_TEXTUREMODE_DEFAULT "GL_LINEAR_MIPMAP_LINEAR" /* -================== -GL_ResolveHardwareType - -Chipset specific configuration -================== -*/ -void GL_ResolveHardwareType( void ) -{ - char buf[ 1024 ]; - cvar_t *lastValidRenderer = ri.Cvar_Get( - "r_lastValidRenderer", "(uninitialized)", CVAR_ARCHIVE ); - - Q_strncpyz( buf, glConfig.renderer_string, sizeof( buf ) ); - Q_strlwr( buf ); - - // NOTE: if changing cvars, do it within this block. This allows them - // to be overridden when testing driver fixes, etc. but only sets - // them to their default state when the hardware is first installed/run. - if( Q_stricmp( lastValidRenderer->string, glConfig.renderer_string ) ) - { - glConfig.hardwareType = GLHW_GENERIC; - - ri.Cvar_Set( "r_textureMode", GENERIC_HW_R_TEXTUREMODE_DEFAULT ); - - // VOODOO GRAPHICS w/ 2MB - if ( strstr( buf, "voodoo graphics/1 tmu/2 mb" ) ) - { - ri.Cvar_Set( "r_picmip", "2" ); - ri.Cvar_Get( "r_picmip", "1", CVAR_ARCHIVE | CVAR_LATCH ); - } - else - { - ri.Cvar_Set( "r_picmip", GENERIC_HW_R_PICMIP_DEFAULT ); - - if ( strstr( buf, "rage 128" ) || strstr( buf, "rage128" ) ) - { - ri.Cvar_Set( "r_finish", "0" ); - } - // Savage3D and Savage4 should always have trilinear enabled - else if ( strstr( buf, "savage3d" ) || strstr( buf, "s3 savage4" ) ) - { - ri.Cvar_Set( "r_texturemode", "GL_LINEAR_MIPMAP_LINEAR" ); - } - } - } - - // - // this is where hardware specific workarounds that should be - // detected/initialized every startup should go. - // - if ( strstr( buf, "banshee" ) || strstr( buf, "voodoo3" ) ) - { - glConfig.hardwareType = GLHW_3DFX_2D3D; - } - // VOODOO GRAPHICS w/ 2MB - else if ( strstr( buf, "voodoo graphics/1 tmu/2 mb" ) ) - { - } - else if ( strstr( buf, "glzicd" ) ) - { - } - else if ( strstr( buf, "rage pro" ) || - strstr( buf, "Rage Pro" ) || - strstr( buf, "ragepro" ) ) - { - glConfig.hardwareType = GLHW_RAGEPRO; - } - else if ( strstr( buf, "rage 128" ) ) - { - } - else if ( strstr( buf, "permedia2" ) ) - { - glConfig.hardwareType = GLHW_PERMEDIA2; - } - else if ( strstr( buf, "riva 128" ) ) - { - glConfig.hardwareType = GLHW_RIVA128; - } - else if ( strstr( buf, "riva tnt " ) ) - { - } -} - -/* ** InitOpenGL ** ** This function is responsible for initializing a valid OpenGL subsystem. This @@ -1295,6 +1211,9 @@ void RE_Shutdown( qboolean destroyWindow ) { // shut down platform specific OpenGL stuff if ( destroyWindow ) { GLimp_Shutdown(); + + Com_Memset( &glConfig, 0, sizeof( glConfig ) ); + Com_Memset( &glState, 0, sizeof( glState ) ); } tr.registered = qfalse; |