Skip to content

Commit 32bdbb0

Browse files
committed
Add option to toggle crosshair and dithering
1 parent 5fa2a8c commit 32bdbb0

2 files changed

Lines changed: 19 additions & 18 deletions

File tree

source/d_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2727
cvar_t d_subdiv16 = {"d_subdiv16", "1"};
2828
cvar_t d_mipcap = {"d_mipcap", "0"};
2929
cvar_t d_mipscale = {"d_mipscale", "1"};
30-
cvar_t dither_filter = { "dither_filter", "0" };
30+
cvar_t dither_filter = { "dither_filter", "0", true };
3131

3232
surfcache_t *d_initial_rover;
3333
qboolean d_roverwrapped;

source/menu.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,11 +1036,7 @@ void M_Net_Key (int k)
10361036
//=============================================================================
10371037
/* OPTIONS MENU */
10381038

1039-
#ifdef _WIN32
10401039
#define OPTIONS_ITEMS 14
1041-
#else
1042-
#define OPTIONS_ITEMS 13
1043-
#endif
10441040

10451041
#define SLIDER_RANGE 10
10461042

@@ -1060,6 +1056,8 @@ void M_Menu_Options_f (void)
10601056
#endif
10611057
}
10621058

1059+
extern cvar_t dither_filter;
1060+
extern cvar_t crosshair;
10631061

10641062
void M_AdjustSliders (int dir)
10651063
{
@@ -1155,6 +1153,14 @@ void M_AdjustSliders (int dir)
11551153
Cvar_SetValue ("lookstrafe", !lookstrafe.value);
11561154
break;
11571155

1156+
case 12:
1157+
Cvar_SetValue ("dither_filter", !dither_filter.value);
1158+
break;
1159+
1160+
case 13:
1161+
Cvar_SetValue ("crosshair", !crosshair.value);
1162+
break;
1163+
11581164
#ifdef _WIN32
11591165
case 13: // _windowed_mouse
11601166
Cvar_SetValue ("_windowed_mouse", !_windowed_mouse.value);
@@ -1196,8 +1202,8 @@ void M_DrawCheckbox (int x, int y, int on)
11961202
void M_Options_Draw (void)
11971203
{
11981204
float r;
1199-
12001205
qpic_t *p;
1206+
cvar_t *cvar = NULL;
12011207

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

1273+
M_Print (16, 128, " Dithering");
1274+
M_DrawCheckbox (220, 128, dither_filter.value);
1275+
1276+
M_Print(16, 136, " Crosshair");
1277+
M_DrawCheckbox(220, 136, crosshair.value);
1278+
12671279
if (vid_menudrawfn)
12681280
M_Print (16, 128, " Video Options");
12691281

@@ -1306,9 +1318,6 @@ void M_Options_Key (int k)
13061318
Sys_DefaultConfig();
13071319
#endif
13081320

1309-
break;
1310-
case 12:
1311-
M_Menu_Video_f ();
13121321
break;
13131322
default:
13141323
M_AdjustSliders (1);
@@ -1326,7 +1335,7 @@ void M_Options_Key (int k)
13261335
case K_DOWNARROW:
13271336
S_LocalSound ("misc/menu1.wav");
13281337
options_cursor++;
1329-
if (options_cursor >= OPTIONS_ITEMS)
1338+
if (options_cursor > OPTIONS_ITEMS)
13301339
options_cursor = 0;
13311340
break;
13321341

@@ -1339,14 +1348,6 @@ void M_Options_Key (int k)
13391348
break;
13401349
}
13411350

1342-
if (options_cursor == 12 && vid_menudrawfn == NULL)
1343-
{
1344-
if (k == K_UPARROW)
1345-
options_cursor = 11;
1346-
else
1347-
options_cursor = 0;
1348-
}
1349-
13501351
#ifdef _WIN32
13511352
if ((options_cursor == 13) && (modestate != MS_WINDOWED))
13521353
{

0 commit comments

Comments
 (0)