diff --git a/src/refresh/header/local.h b/src/refresh/header/local.h index d43641e9..1ba6d8f8 100644 --- a/src/refresh/header/local.h +++ b/src/refresh/header/local.h @@ -200,6 +200,8 @@ extern cvar_t *gl_mode; extern cvar_t *gl_customwidth; extern cvar_t *gl_customheight; +extern cvar_t *gl_retexturing; + extern cvar_t *gl_log; extern cvar_t *gl_lightmap; extern cvar_t *gl_shadows; diff --git a/src/refresh/r_image.c b/src/refresh/r_image.c index 6718ddba..d145650f 100644 --- a/src/refresh/r_image.c +++ b/src/refresh/r_image.c @@ -1080,38 +1080,51 @@ R_FindImage ( char *name, imagetype_t type ) } else if ( !strcmp( name + len - 4, ".wal" ) ) { - /* Get size of the original texture */ - GetWalInfo(name, &realwidth, &realheight); - - /* Try to load a TGA */ - LoadTGA( namewe, &pic, &width, &height ); - - if( !pic ) + if (gl_retexturing->value) { - /* JPEG if no TGA available */ - LoadJPG( namewe, &pic, &width, &height ); + /* Get size of the original texture */ + 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 { - /* Upload TGA */ - image = R_LoadPic( name, pic, width, realwidth, height, realheight, type, 32 ); - } + image = LoadWal( name ); - 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 ); + if ( !image ) + { + /* No texture found */ + return ( NULL ); + } } } else if ( !strcmp( name + len - 4, ".tga" ) ) diff --git a/src/refresh/r_main.c b/src/refresh/r_main.c index ff0995fa..c6105b22 100644 --- a/src/refresh/r_main.c +++ b/src/refresh/r_main.c @@ -134,6 +134,8 @@ cvar_t *gl_mode; cvar_t *gl_customwidth; cvar_t *gl_customheight; +cvar_t *gl_retexturing; + cvar_t *gl_dynamic; cvar_t *gl_modulate; cvar_t *gl_nobind; @@ -1010,6 +1012,8 @@ R_Register ( void ) gl_customwidth = ri.Cvar_Get( "gl_customwidth", "1024", 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( "screenshot", R_ScreenShot ); ri.Cmd_AddCommand( "modellist", Mod_Modellist_f );