X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=gl_textures.c;h=2e2bd3d61fd6145e9f0ef4a5426ab243139dd2ac;hb=892af9237609d72a8c9f4e563b52bf844ea3bf15;hp=f62d0243580e9f6efd40808fc4fd03d7aa2c09b4;hpb=fd091d66e2673b19eb9c7d73d95160ef874de5e6;p=xonotic%2Fdarkplaces.git diff --git a/gl_textures.c b/gl_textures.c index f62d0243..2e2bd3d6 100644 --- a/gl_textures.c +++ b/gl_textures.c @@ -16,7 +16,7 @@ cvar_t gl_texturecompression_gloss = {CVAR_SAVE, "gl_texturecompression_gloss", cvar_t gl_texturecompression_glow = {CVAR_SAVE, "gl_texturecompression_glow", "1", "whether to compress glowmap (luma) textures"}; cvar_t gl_texturecompression_2d = {CVAR_SAVE, "gl_texturecompression_2d", "1", "whether to compress 2d (hud/menu) textures other than the font"}; cvar_t gl_texturecompression_q3bsplightmaps = {CVAR_SAVE, "gl_texturecompression_q3bsplightmaps", "1", "whether to compress lightmaps in q3bsp format levels"}; -cvar_t gl_texturecompression_q3bspdeluxemaps = {CVAR_SAVE, "gl_texturecompression_q3bspdeluxemaps", "1", "whether to compress deluxemaps in q3bsp format levels (only levels compiled with q3map2 -deluxe have these)"}; +cvar_t gl_texturecompression_q3bspdeluxemaps = {CVAR_SAVE, "gl_texturecompression_q3bspdeluxemaps", "0", "whether to compress deluxemaps in q3bsp format levels (only levels compiled with q3map2 -deluxe have these)"}; cvar_t gl_texturecompression_sky = {CVAR_SAVE, "gl_texturecompression_sky", "0", "whether to compress sky textures"}; cvar_t gl_texturecompression_lightcubemaps = {CVAR_SAVE, "gl_texturecompression_lightcubemaps", "1", "whether to compress light cubemaps (spotlights and other light projection images)"}; @@ -141,7 +141,7 @@ static gltexturepool_t *gltexturepoolchain = NULL; static unsigned char *resizebuffer = NULL, *colorconvertbuffer; static int resizebuffersize = 0; -static unsigned char *texturebuffer; +static const unsigned char *texturebuffer; static int texturebuffersize = 0; static textypeinfo_t *R_GetTexTypeInfo(textype_t textype, int flags) @@ -287,6 +287,13 @@ int R_RealGetTexture(rtexture_t *rt) return 0; } +void R_PurgeTexture(rtexture_t *rt) +{ + if(rt && !(((gltexture_t*) rt)->flags & TEXF_PERSISTENT)) { + R_FreeTexture(rt); + } +} + void R_FreeTexture(rtexture_t *rt) { gltexture_t *glt, **gltpointer; @@ -1112,3 +1119,9 @@ void R_UpdateTexture(rtexture_t *rt, const unsigned char *data, int x, int y, in R_Upload(glt, data, x, y, 0, width, height, 1); } +void R_ClearTexture (rtexture_t *rt) +{ + gltexture_t *glt = (gltexture_t *)rt; + + R_Upload( glt, NULL, 0, 0, 0, glt->tilewidth, glt->tileheight, glt->tiledepth ); +}