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"};
+cvar_t gl_texture_anisotropy = {CVAR_SAVE, "gl_texture_anisotropy", "1"};
int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR;
int gl_filter_mag = GL_LINEAR;
{
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;
}
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)
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);
+ {
+ int aniso = bound(1, gl_texture_anisotropy.integer, 128);
+ if (gl_texture_anisotropy.integer != aniso)
+ Cvar_SetValueQuick(&gl_texture_anisotropy, aniso);
+ qglTexParameteri(textureenum, GL_TEXTURE_MAX_ANISOTROPY_EXT, aniso);CHECKGLERROR
+ }
+ qglTexParameteri(textureenum, GL_TEXTURE_WRAP_S, wrapmode);CHECKGLERROR
+ qglTexParameteri(textureenum, GL_TEXTURE_WRAP_T, wrapmode);CHECKGLERROR
if (gltexturetypedimensions[texturetype] >= 3)
- qglTexParameteri(textureenum, GL_TEXTURE_WRAP_R, wrapmode);
+ {
+ qglTexParameteri(textureenum, GL_TEXTURE_WRAP_R, wrapmode);CHECKGLERROR
+ }
+ CHECKGLERROR
if (flags & TEXF_FORCENEAREST)
{
if (flags & TEXF_MIPMAP)
- qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
+ {
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);CHECKGLERROR
+ }
else
- qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ {
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_NEAREST);CHECKGLERROR
+ }
+ qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, GL_NEAREST);CHECKGLERROR
}
else if (flags & TEXF_FORCELINEAR)
{
if (flags & TEXF_MIPMAP)
{
if (gl_filter_min == GL_NEAREST_MIPMAP_LINEAR || gl_filter_min == GL_LINEAR_MIPMAP_LINEAR)
- qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ {
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);CHECKGLERROR
+ }
else
- qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
+ {
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);CHECKGLERROR
+ }
}
else
- qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ {
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, GL_LINEAR);CHECKGLERROR
+ }
+ qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, GL_LINEAR);CHECKGLERROR
}
else
{
if (flags & TEXF_MIPMAP)
- qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, gl_filter_min);
+ {
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, gl_filter_min);CHECKGLERROR
+ }
else
- qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, gl_filter_mag);
- qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, gl_filter_mag);
+ {
+ qglTexParameteri(textureenum, GL_TEXTURE_MIN_FILTER, gl_filter_mag);CHECKGLERROR
+ }
+ qglTexParameteri(textureenum, GL_TEXTURE_MAG_FILTER, gl_filter_mag);CHECKGLERROR
}
CHECKGLERROR
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);