From ecb0472e4ddcf0b629e31e94ca615c718bed712c Mon Sep 17 00:00:00 2001 From: tomaz Date: Wed, 25 Aug 2004 23:05:25 +0000 Subject: [PATCH] Added Tei's "whack" that adds a drop down shadow on all text. r_textshadow 1 to enable. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4385 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_screen.c | 12 +++++++++++- menu.c | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/cl_screen.c b/cl_screen.c index 0f9f6ae8..927a3a66 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -22,6 +22,7 @@ cvar_t scr_screenshot_jpeg = {CVAR_SAVE, "scr_screenshot_jpeg","0"}; cvar_t scr_screenshot_jpeg_quality = {CVAR_SAVE, "scr_screenshot_jpeg_quality","0.9"}; cvar_t scr_screenshot_name = {0, "scr_screenshot_name","dp"}; cvar_t cl_avidemo = {0, "cl_avidemo", "0"}; +cvar_t r_textshadow = {0, "r_textshadow", "0"}; int jpeg_supported = false; @@ -476,6 +477,7 @@ void CL_Screen_Init(void) Cvar_RegisterVariable (&scr_screenshot_jpeg); Cvar_RegisterVariable (&scr_screenshot_jpeg_quality); Cvar_RegisterVariable (&cl_avidemo); + Cvar_RegisterVariable (&r_textshadow); Cmd_AddCommand ("sizeup",SCR_SizeUp_f); Cmd_AddCommand ("sizedown",SCR_SizeDown_f); @@ -496,7 +498,7 @@ void DrawQ_Pic(float x, float y, char *picname, float width, float height, float DrawQ_SuperPic(x,y,picname,width,height,0,0,red,green,blue,alpha,1,0,red,green,blue,alpha,0,1,red,green,blue,alpha,1,1,red,green,blue,alpha,flags); } -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) +void DrawQ_String_Real(float x, float y, const char *string, int maxlen, float scalex, float scaley, float red, float green, float blue, float alpha, int flags) { int size, len; drawqueue_t *dq; @@ -535,6 +537,14 @@ void DrawQ_String(float x, float y, const char *string, int maxlen, float scalex r_refdef.drawqueuesize += dq->size; } +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); + + DrawQ_String_Real(x,y,string,maxlen,scalex,scaley,red,green,blue,alpha,flags); +} + void DrawQ_Fill (float x, float y, float w, float h, float red, float green, float blue, float alpha, int flags) { DrawQ_SuperPic(x,y,NULL,w,h,0,0,red,green,blue,alpha,1,0,red,green,blue,alpha,0,1,red,green,blue,alpha,1,1,red,green,blue,alpha,flags); diff --git a/menu.c b/menu.c index ed3e79ce..e2d322a8 100644 --- a/menu.c +++ b/menu.c @@ -1171,7 +1171,7 @@ void M_DrawCheckbox (int x, int y, int on) } -#define OPTIONS_ITEMS 37 +#define OPTIONS_ITEMS 38 int options_cursor; @@ -1186,6 +1186,7 @@ extern cvar_t snd_staticvolume; extern cvar_t slowmo; extern dllhandle_t jpeg_dll; extern cvar_t gl_texture_anisotropy; +extern cvar_t r_textshadow; void M_Menu_Options_AdjustSliders (int dir) { @@ -1227,6 +1228,8 @@ void M_Menu_Options_AdjustSliders (int dir) Cvar_SetValueQuick (&volume, bound(0, volume.value + dir * 0.1, 1)); else if (options_cursor == optnum++) Cvar_SetValueQuick (&snd_staticvolume, bound(0, snd_staticvolume.value + dir * 0.1, 1)); + else if (options_cursor == optnum++) + Cvar_SetValueQuick (&r_textshadow, !r_textshadow.integer); else if (options_cursor == optnum++) Cvar_SetValueQuick (&crosshair, bound(0, crosshair.integer + dir, 5)); else if (options_cursor == optnum++) @@ -1345,6 +1348,7 @@ void M_Options_Draw (void) M_Options_PrintSlider( " CD Music Volume", cdaudioinitialized.integer, bgmvolume.value, 0, 1); M_Options_PrintSlider( " Sound Volume", snd_initialized.integer, volume.value, 0, 1); M_Options_PrintSlider(gamemode == GAME_GOODVSBAD2 ? " Music Volume" : " Ambient Volume", snd_initialized.integer, snd_staticvolume.value, 0, 1); + M_Options_PrintCheckbox(" Text Shadow", true, r_textshadow.integer); M_Options_PrintSlider( " Crosshair", true, crosshair.value, 0, 5); M_Options_PrintSlider( " Crosshair Size", true, crosshair_size.value, 1, 5); M_Options_PrintCheckbox(" Static Crosshair", true, crosshair_static.integer); -- 2.39.2