Hind retexturing support behind RETEXTURE

This commit is contained in:
Yamagi Burmeister 2012-04-25 08:59:40 +00:00
parent 03015a686b
commit 92da6ed580
4 changed files with 14 additions and 0 deletions

View file

@ -24,6 +24,8 @@
* =======================================================================
*/
#ifdef RETEXTURE
#include "../header/local.h"
#include <jpeglib.h>
#include <jerror.h>
@ -169,3 +171,5 @@ LoadJPG(char *origname, byte **pic, int *width, int *height)
*pic = rgbadata;
}
#endif /* RETEXTURE */

View file

@ -200,7 +200,9 @@ extern cvar_t *gl_mode;
extern cvar_t *gl_customwidth;
extern cvar_t *gl_customheight;
#ifdef RETEXTURE
extern cvar_t *gl_retexturing;
#endif
extern cvar_t *gl_log;
extern cvar_t *gl_lightmap;

View file

@ -1069,6 +1069,7 @@ R_FindImage ( char *name, imagetype_t type )
if ( !strcmp( name + len - 4, ".pcx" ) )
{
#ifdef RETEXTURE
if (gl_retexturing->value)
{
GetPCXInfo( name, &realwidth, &realheight );
@ -1108,6 +1109,7 @@ R_FindImage ( char *name, imagetype_t type )
}
}
else
#endif
{
LoadPCX( name, &pic, &palette, &width, &height );
@ -1121,6 +1123,7 @@ R_FindImage ( char *name, imagetype_t type )
}
else if ( !strcmp( name + len - 4, ".wal" ) )
{
#ifdef RETEXTURE
if (gl_retexturing->value)
{
/* Get size of the original texture */
@ -1158,6 +1161,7 @@ R_FindImage ( char *name, imagetype_t type )
}
}
else
#endif
{
image = LoadWal( name );

View file

@ -134,7 +134,9 @@ cvar_t *gl_mode;
cvar_t *gl_customwidth;
cvar_t *gl_customheight;
#ifdef RETEXTURE
cvar_t *gl_retexturing;
#endif
cvar_t *gl_dynamic;
cvar_t *gl_modulate;
@ -1012,7 +1014,9 @@ R_Register ( void )
gl_customwidth = ri.Cvar_Get( "gl_customwidth", "1024", CVAR_ARCHIVE );
gl_customheight = ri.Cvar_Get( "gl_customheight", "768", CVAR_ARCHIVE );
#ifdef RETEXTURE
gl_retexturing = ri.Cvar_Get( "gl_retexturing", "1", CVAR_ARCHIVE );
#endif
ri.Cmd_AddCommand( "imagelist", R_ImageList_f );
ri.Cmd_AddCommand( "screenshot", R_ScreenShot );