Skip to content

Commit

Permalink
Add option to toggle crosshair and dithering
Browse files Browse the repository at this point in the history
  • Loading branch information
masterfeizz committed Sep 13, 2016
1 parent 5fa2a8c commit 32bdbb0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion source/d_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cvar_t d_subdiv16 = {"d_subdiv16", "1"};
cvar_t d_mipcap = {"d_mipcap", "0"};
cvar_t d_mipscale = {"d_mipscale", "1"};
cvar_t dither_filter = { "dither_filter", "0" };
cvar_t dither_filter = { "dither_filter", "0", true };

surfcache_t *d_initial_rover;
qboolean d_roverwrapped;
Expand Down
35 changes: 18 additions & 17 deletions source/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,11 +1036,7 @@ void M_Net_Key (int k)
//=============================================================================
/* OPTIONS MENU */

#ifdef _WIN32
#define OPTIONS_ITEMS 14
#else
#define OPTIONS_ITEMS 13
#endif

#define SLIDER_RANGE 10

Expand All @@ -1060,6 +1056,8 @@ void M_Menu_Options_f (void)
#endif
}

extern cvar_t dither_filter;
extern cvar_t crosshair;

void M_AdjustSliders (int dir)
{
Expand Down Expand Up @@ -1155,6 +1153,14 @@ void M_AdjustSliders (int dir)
Cvar_SetValue ("lookstrafe", !lookstrafe.value);
break;

case 12:
Cvar_SetValue ("dither_filter", !dither_filter.value);
break;

case 13:
Cvar_SetValue ("crosshair", !crosshair.value);
break;

#ifdef _WIN32
case 13: // _windowed_mouse
Cvar_SetValue ("_windowed_mouse", !_windowed_mouse.value);
Expand Down Expand Up @@ -1196,8 +1202,8 @@ void M_DrawCheckbox (int x, int y, int on)
void M_Options_Draw (void)
{
float r;

qpic_t *p;
cvar_t *cvar = NULL;

p = Draw_CachePic ("gfx/p_option.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
Expand Down Expand Up @@ -1264,6 +1270,12 @@ void M_Options_Draw (void)
#endif
M_DrawCheckbox (220, 120, lookstrafe.value);

M_Print (16, 128, " Dithering");
M_DrawCheckbox (220, 128, dither_filter.value);

M_Print(16, 136, " Crosshair");
M_DrawCheckbox(220, 136, crosshair.value);

if (vid_menudrawfn)
M_Print (16, 128, " Video Options");

Expand Down Expand Up @@ -1306,9 +1318,6 @@ void M_Options_Key (int k)
Sys_DefaultConfig();
#endif

break;
case 12:
M_Menu_Video_f ();
break;
default:
M_AdjustSliders (1);
Expand All @@ -1326,7 +1335,7 @@ void M_Options_Key (int k)
case K_DOWNARROW:
S_LocalSound ("misc/menu1.wav");
options_cursor++;
if (options_cursor >= OPTIONS_ITEMS)
if (options_cursor > OPTIONS_ITEMS)
options_cursor = 0;
break;

Expand All @@ -1339,14 +1348,6 @@ void M_Options_Key (int k)
break;
}

if (options_cursor == 12 && vid_menudrawfn == NULL)
{
if (k == K_UPARROW)
options_cursor = 11;
else
options_cursor = 0;
}

#ifdef _WIN32
if ((options_cursor == 13) && (modestate != MS_WINDOWED))
{
Expand Down

0 comments on commit 32bdbb0

Please sign in to comment.