cvar_t r_picmip = {CVAR_SAVE, "r_picmip", "0"};
cvar_t r_lerpimages = {CVAR_SAVE, "r_lerpimages", "1"};
cvar_t r_precachetextures = {CVAR_SAVE, "r_precachetextures", "1"};
+cvar_t gl_texture_anisotropy = {CVAR_SAVE, "gl_texture_anisotropy", "0"};
int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
int gl_filter_mag = GL_LINEAR;
}
textypeinfo_t;
-static textypeinfo_t textype_palette = {TEXTYPE_PALETTE, 1, 4, GL_RGBA, 3};
-static textypeinfo_t textype_rgb = {TEXTYPE_RGB , 3, 3, GL_RGB , 3};
-static textypeinfo_t textype_rgba = {TEXTYPE_RGBA , 4, 4, GL_RGBA, 3};
-static textypeinfo_t textype_palette_alpha = {TEXTYPE_PALETTE, 1, 4, GL_RGBA, 4};
-static textypeinfo_t textype_rgba_alpha = {TEXTYPE_RGBA , 4, 4, GL_RGBA, 4};
+static textypeinfo_t textype_palette = {TEXTYPE_PALETTE, 1, 4, GL_RGBA , 3};
+static textypeinfo_t textype_rgb = {TEXTYPE_RGB , 3, 3, GL_RGB , 3};
+static textypeinfo_t textype_rgba = {TEXTYPE_RGBA , 4, 4, GL_RGBA , 3};
+static textypeinfo_t textype_palette_alpha = {TEXTYPE_PALETTE, 1, 4, GL_RGBA , 4};
+static textypeinfo_t textype_rgba_alpha = {TEXTYPE_RGBA , 4, 4, GL_RGBA , 4};
+static textypeinfo_t textype_dsdt = {TEXTYPE_DSDT , 2, 2, GL_DSDT_NV, GL_DSDT8_NV};
// a tiling texture (most common type)
#define GLIMAGETYPE_TILE 0
return &textype_rgb;
case TEXTYPE_RGBA:
return &textype_rgba;
+ case TEXTYPE_DSDT:
+ return &textype_dsdt;
default:
Host_Error("R_GetTexTypeInfo: unknown texture format\n");
return NULL;
{
if (gl_filter_min == modes[i].minification)
{
- Con_Printf ("%s\n", modes[i].name);
+ Con_Printf("%s\n", modes[i].name);
return;
}
}
- Con_Printf ("current filter is unknown???\n");
+ Con_Print("current filter is unknown???\n");
return;
}
break;
if (i == 6)
{
- Con_Printf ("bad filter name\n");
+ Con_Print("bad filter name\n");
return;
}
for (image = pool->imagechain;image;image = image->imagechain)
{
// only update already uploaded images
- if (!(image->flags & GLTEXF_UPLOAD))
+ if (!(image->flags & GLTEXF_UPLOAD) && !(image->flags & (TEXF_FORCENEAREST | TEXF_FORCELINEAR)))
{
qglGetIntegerv(gltexturetypebindingenums[image->texturetype], &oldbindtexnum);
qglBindTexture(gltexturetypeenums[image->texturetype], image->texnum);
int loaded;
gltexture_t *glt;
gltexturepool_t *pool;
- Con_Printf("glsize input loaded mip alpha name\n");
+ Con_Print("glsize input loaded mip alpha name\n");
for (pool = gltexturepoolchain;pool;pool = pool->next)
{
for (glt = pool->gltchain;glt;glt = glt->chain)
Cvar_RegisterVariable (&r_picmip);
Cvar_RegisterVariable (&r_lerpimages);
Cvar_RegisterVariable (&r_precachetextures);
+ Cvar_RegisterVariable (&gl_texture_anisotropy);
R_RegisterModule("R_Textures", r_textures_start, r_textures_shutdown, r_textures_newmap);
}
CHECKGLERROR
+ if (gl_support_anisotropy)
+ qglTexParameterf(textureenum, GL_TEXTURE_MAX_ANISOTROPY_EXT, gl_texture_anisotropy.value);
qglTexParameteri(textureenum, GL_TEXTURE_WRAP_S, wrapmode);
qglTexParameteri(textureenum, GL_TEXTURE_WRAP_T, wrapmode);
if (gltexturetypedimensions[texturetype] >= 3)
if (glt->image->flags & GLTEXF_UPLOAD)
{
glt->image->flags &= ~GLTEXF_UPLOAD;
- Con_DPrintf("uploaded new fragments image\n");
+ Con_DPrint("uploaded new fragments image\n");
R_MakeResizeBufferBigger(glt->image->width * glt->image->height * glt->image->depth * glt->image->bytesperpixel);
memset(resizebuffer, 255, glt->image->width * glt->image->height * glt->image->depth * glt->image->bytesperpixel);
switch(glt->image->texturetype)
for (i = 0;i < 6;i++)
{
prevbuffer = texturebuffer;
- texturebuffer += width * height * depth * glt->textype->inputbytesperpixel;
+ texturebuffer += glt->width * glt->height * glt->depth * glt->textype->inputbytesperpixel;
if (glt->width != width || glt->height != height || glt->depth != depth)
{
Image_Resample(prevbuffer, glt->width, glt->height, glt->depth, resizebuffer, width, height, depth, glt->image->bytesperpixel, r_lerpimages.integer);
}
}
break;
+ case TEXTYPE_DSDT:
+ break;
default:
Host_Error("R_LoadTexture: unknown texture type\n");
}