flags |= TEXF_CLAMP;
// load a high quality image from disk if possible
- pic->tex = loadtextureimage(drawtexturepool, path, 0, 0, false, flags);
+ pic->tex = loadtextureimage(drawtexturepool, path, 0, 0, false, flags | (gl_texturecompression_2d.integer ? TEXF_COMPRESS : 0));
if (pic->tex == NULL && !strncmp(path, "gfx/", 4))
{
// compatibility with older versions which did not require gfx/ prefix
- pic->tex = loadtextureimage(drawtexturepool, path + 4, 0, 0, false, flags);
+ pic->tex = loadtextureimage(drawtexturepool, path + 4, 0, 0, false, flags | (gl_texturecompression_2d.integer ? TEXF_COMPRESS : 0));
}
// if a high quality image was loaded, set the pic's size to match it, just
// in case there's no low quality version to get the size from
GL_DepthMask(true);
GL_DepthRange(0, 1);
+ GL_PolygonOffset(0, 0);
GL_DepthTest(false);
GL_Color(1,1,1,1);
GL_AlphaTest(false);
float DrawQ_String(float startx, float starty, const char *text, int maxlen, float w, float h, float basered, float basegreen, float baseblue, float basealpha, int flags, int *outcolor, qboolean ignorecolorcodes)
{
- int i, num, shadow, colorindex;
+ int i, num, shadow, colorindex = STRING_COLOR_DEFAULT;
float x = startx, y, s, t, u, v;
float *av, *at, *ac;
float color[4];
x += r_textshadow.value;
y += r_textshadow.value;
}
- // because this loop increments x before it draws, we must bias x first
- x -= w;
for (i = 0;i < maxlen && text[i];i++, x += w)
{
if (text[i] == ' ')
GL_LockArrays(0, 0);
}
}
+
+ if (outcolor)
+ *outcolor = colorindex;
+
// note: this relies on the proper text (not shadow) being drawn last
return x;
}
R_Mesh_ResetTextureState();
GL_DepthMask(true);
GL_DepthRange(0, 1);
+ GL_PolygonOffset(0, 0);
GL_DepthTest(false);
if (v_color_enable.integer)
{