Provide the gl_retexturing CVAR to switch retexturing off. Default is

"1", retexturing enabled.
This commit is contained in:
Yamagi Burmeister 2012-03-12 09:31:33 +00:00
parent 48a0d6a50d
commit d0133509e1
3 changed files with 46 additions and 27 deletions

View file

@ -200,6 +200,8 @@ extern cvar_t *gl_mode;
extern cvar_t *gl_customwidth; extern cvar_t *gl_customwidth;
extern cvar_t *gl_customheight; extern cvar_t *gl_customheight;
extern cvar_t *gl_retexturing;
extern cvar_t *gl_log; extern cvar_t *gl_log;
extern cvar_t *gl_lightmap; extern cvar_t *gl_lightmap;
extern cvar_t *gl_shadows; extern cvar_t *gl_shadows;

View file

@ -1079,6 +1079,8 @@ R_FindImage ( char *name, imagetype_t type )
image = R_LoadPic( name, pic, width, 0, height, 0, type, 8 ); image = R_LoadPic( name, pic, width, 0, height, 0, type, 8 );
} }
else if ( !strcmp( name + len - 4, ".wal" ) ) else if ( !strcmp( name + len - 4, ".wal" ) )
{
if (gl_retexturing->value)
{ {
/* Get size of the original texture */ /* Get size of the original texture */
GetWalInfo(name, &realwidth, &realheight); GetWalInfo(name, &realwidth, &realheight);
@ -1114,6 +1116,17 @@ R_FindImage ( char *name, imagetype_t type )
return ( NULL ); return ( NULL );
} }
} }
else
{
image = LoadWal( name );
if ( !image )
{
/* No texture found */
return ( NULL );
}
}
}
else if ( !strcmp( name + len - 4, ".tga" ) ) else if ( !strcmp( name + len - 4, ".tga" ) )
{ {
LoadTGA( name, &pic, &width, &height ); LoadTGA( name, &pic, &width, &height );

View file

@ -134,6 +134,8 @@ cvar_t *gl_mode;
cvar_t *gl_customwidth; cvar_t *gl_customwidth;
cvar_t *gl_customheight; cvar_t *gl_customheight;
cvar_t *gl_retexturing;
cvar_t *gl_dynamic; cvar_t *gl_dynamic;
cvar_t *gl_modulate; cvar_t *gl_modulate;
cvar_t *gl_nobind; cvar_t *gl_nobind;
@ -1010,6 +1012,8 @@ R_Register ( void )
gl_customwidth = ri.Cvar_Get( "gl_customwidth", "1024", CVAR_ARCHIVE ); gl_customwidth = ri.Cvar_Get( "gl_customwidth", "1024", CVAR_ARCHIVE );
gl_customheight = ri.Cvar_Get( "gl_customheight", "768", CVAR_ARCHIVE ); gl_customheight = ri.Cvar_Get( "gl_customheight", "768", CVAR_ARCHIVE );
gl_retexturing = ri.Cvar_Get( "gl_retexturing", "1", CVAR_ARCHIVE );
ri.Cmd_AddCommand( "imagelist", R_ImageList_f ); ri.Cmd_AddCommand( "imagelist", R_ImageList_f );
ri.Cmd_AddCommand( "screenshot", R_ScreenShot ); ri.Cmd_AddCommand( "screenshot", R_ScreenShot );
ri.Cmd_AddCommand( "modellist", Mod_Modellist_f ); ri.Cmd_AddCommand( "modellist", Mod_Modellist_f );