#include "cl_video.h"
-cvar_t r_textshadow = {0, "r_textshadow", "0", "draws a shadow on all text to improve readability"};
+cvar_t r_textshadow = {CVAR_SAVE, "r_textshadow", "0", "draws a shadow on all text to improve readability"};
static rtexture_t *char_texture;
cachepic_t *r_crosshairs[NUMCROSSHAIRS+1];
void DrawQ_String(float x, float y, const char *string, int maxlen, float scalex, float scaley, float red, float green, float blue, float alpha, int flags)
{
- if (r_textshadow.integer)
- DrawQ_String_Real(x+scalex*0.25,y+scaley*0.25,string,maxlen,scalex,scaley,0,0,0,alpha*0.8,flags);
+ float shadow;
+ if (r_textshadow.integer) {
+ shadow = (1-((red+green+blue)));
+ shadow = bound(0, shadow, 1);
+ DrawQ_String_Real(x+scalex*0.25,y+scaley*0.25,string,maxlen,scalex,scaley,shadow,shadow,shadow,alpha*0.8,flags);
+ }
DrawQ_String_Real(x,y,string,maxlen,scalex,scaley,red,green,blue,alpha,flags);
}