mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-25 22:10:59 +00:00
Provide the gl_retexturing CVAR to switch retexturing off. Default is
"1", retexturing enabled.
This commit is contained in:
parent
48a0d6a50d
commit
d0133509e1
3 changed files with 46 additions and 27 deletions
|
@ -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;
|
||||||
|
|
|
@ -1080,38 +1080,51 @@ R_FindImage ( char *name, imagetype_t type )
|
||||||
}
|
}
|
||||||
else if ( !strcmp( name + len - 4, ".wal" ) )
|
else if ( !strcmp( name + len - 4, ".wal" ) )
|
||||||
{
|
{
|
||||||
/* Get size of the original texture */
|
if (gl_retexturing->value)
|
||||||
GetWalInfo(name, &realwidth, &realheight);
|
|
||||||
|
|
||||||
/* Try to load a TGA */
|
|
||||||
LoadTGA( namewe, &pic, &width, &height );
|
|
||||||
|
|
||||||
if( !pic )
|
|
||||||
{
|
{
|
||||||
/* JPEG if no TGA available */
|
/* Get size of the original texture */
|
||||||
LoadJPG( namewe, &pic, &width, &height );
|
GetWalInfo(name, &realwidth, &realheight);
|
||||||
|
|
||||||
|
/* Try to load a TGA */
|
||||||
|
LoadTGA( namewe, &pic, &width, &height );
|
||||||
|
|
||||||
|
if( !pic )
|
||||||
|
{
|
||||||
|
/* JPEG if no TGA available */
|
||||||
|
LoadJPG( namewe, &pic, &width, &height );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Upload TGA */
|
||||||
|
image = R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !pic )
|
||||||
|
{
|
||||||
|
/* WAL of no JPEG available (exists always) */
|
||||||
|
image = LoadWal( namewe );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Upload JPEG */
|
||||||
|
image = R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !image )
|
||||||
|
{
|
||||||
|
/* No texture found */
|
||||||
|
return ( NULL );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Upload TGA */
|
image = LoadWal( name );
|
||||||
image = R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !pic )
|
if ( !image )
|
||||||
{
|
{
|
||||||
/* WAL of no JPEG available (exists always) */
|
/* No texture found */
|
||||||
image = LoadWal( namewe );
|
return ( NULL );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Upload JPEG */
|
|
||||||
image = R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !image )
|
|
||||||
{
|
|
||||||
/* No texture found */
|
|
||||||
return ( NULL );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( !strcmp( name + len - 4, ".tga" ) )
|
else if ( !strcmp( name + len - 4, ".tga" ) )
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
Loading…
Reference in a new issue