-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmenu.c
6347 lines (5407 loc) · 152 KB
/
menu.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright (C) 1996-1997 Id Software, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// menu.c
// JDH: introduced data structures, consolidated code
#include "quakedef.h"
#ifndef RQM_SV_ONLY
#include "winquake.h"
#include "menu_defs.h"
#define M_CVARINFO_Y 196
#define M_VARLEFT 220
typedef void (*m_var_draw_f) (cvar_t *var, int y, qboolean selected);
static const char *MenuSoundsDefault[] = {"misc/menu1.wav", "misc/menu2.wav", "misc/menu3.wav"};
#ifdef HEXEN2_SUPPORT
static const char *MenuSoundsHexen2[] = {"raven/menu1.wav", "raven/menu2.wav", "raven/menu3.wav"};
extern qboolean has_portals;
extern int m_enter_portals;
#endif
//extern int char_menufonttexture;
extern mpic_t draw_menufont;
extern cvar_t scr_menusize, scr_centermenu;
extern cvar_t vid_vsync, host_maxfps, scr_sshot_format, jpeg_compression_level, png_compression_level;
extern cvar_t gl_texturemode, gl_texbrighten, gl_zfightfix, r_oldsky, r_flatlightstyles, r_modelbrightness, gl_glows, r_powerupglow;
extern cvar_t nosound, sv_entpatch, sv_altnoclip;
extern cvar_t scr_consize, scr_conspeed, gl_conalpha, con_linespacing, con_logcenterprint, gl_consolefont, gl_smoothfont;
extern cvar_t scr_centersbar, scr_sbarsize, scr_hudscale, scr_notifyscale, scr_showspeed, scr_showorigin, scr_showfps, con_notifytime, _con_notifylines, con_autocomplete;
extern cvar_t crosshair, crosshairsize, gl_crosshairalpha, crosshaircolor, gl_crosshairimage, cl_crossx, cl_crossy;
extern cvar_t com_matchfilecase, sv_protocol, host_cutscenehack, sv_fishfix, sv_imp12hack, nospr32;
extern cvar_t v_gunkick, cl_deadbodyfilter, cl_gibfilter, cl_demo_compress, cl_demo_compress_fmt;
static const char **gMenuSounds = MenuSoundsDefault;
menu_t *menu_current = NULL;
qboolean vid_windowedmouse = true;
/*enum {m_none, m_main, m_singleplayer, m_load, m_save, m_multiplayer,
m_setup, m_net, m_options, m_videomodes,
//#ifdef GLQUAKE
m_videooptions, m_particles,
//#endif
m_keys, m_nehdemos, m_maps, m_demos, m_help, m_quit, m_serialconfig, m_modemconfig,
m_lanconfig, m_gameoptions, m_search, m_slist,
#ifdef HEXEN2_SUPPORT
m_class, m_difficulty
#endif
} m_state;
*/
void M_Menu_Main_f (cmd_source_t src);
void M_Menu_SinglePlayer_f (cmd_source_t src);
void M_Menu_Load_f (cmd_source_t src);
void M_Menu_Save_f (cmd_source_t src);
void M_Menu_MultiPlayer_f (cmd_source_t src);
void M_Menu_Setup_f (cmd_source_t src);
void M_Menu_Net_f (cmd_source_t src);
void M_Menu_Options_f (cmd_source_t src);
void M_Menu_Video_f (cmd_source_t src);
void M_Menu_VidGeneral_f (cmd_source_t src);
void M_Menu_Textures_f (cmd_source_t src);
void M_Menu_HUD_f (cmd_source_t src);
void M_Menu_Crosshair_f (cmd_source_t src);
void M_Menu_Lighting_f (cmd_source_t src);
void M_Menu_SkyWater_f (cmd_source_t src);
void M_Menu_Particles_f (cmd_source_t src);
// void M_Menu_VideoOptions_f (cmd_source_t src);
void M_Menu_VideoModes_f (cmd_source_t src);
void M_Menu_Audio_f (cmd_source_t src);
void M_Menu_Controls_f (cmd_source_t src);
void M_Menu_Keys_f (cmd_source_t src);
void M_Menu_Keys2_f (cmd_source_t src);
void M_Menu_MenuConsole_f (cmd_source_t src);
void M_Menu_Compat_f (cmd_source_t src);
void M_Menu_Game_f (cmd_source_t src);
void M_Menu_NehDemos_f (cmd_source_t src);
void M_Menu_Maps_f (cmd_source_t src);
void M_Menu_Demos_f (cmd_source_t src);
void M_Menu_Help_f (cmd_source_t src);
void M_Menu_Quit_f (cmd_source_t src);
//void M_Menu_SerialConfig_f (cmd_source_t src);
// void M_Menu_ModemConfig_f (cmd_source_t src);
void M_Menu_LanConfig_f (cmd_source_t src);
void M_Menu_GameOptions_f (cmd_source_t src);
void M_Menu_Search_f (cmd_source_t src);
void M_Menu_ServerList_f (cmd_source_t src);
void M_Main_Draw (void);
void M_SinglePlayer_Draw (void);
void M_Load_Draw (void);
void M_Save_Draw (void);
void M_MultiPlayer_Draw (void);
void M_Setup_Draw (void);
void M_Net_Draw (void);
void M_Options_Draw (void);
void M_Video_Draw (void);
void M_VidGeneral_Draw (void);
void M_Textures_Draw (void);
void M_HUD_Draw (void);
void M_Crosshair_Draw (void);
void M_Lighting_Draw (void);
void M_SkyWater_Draw (void);
void M_Particles_Draw (void);
// void M_VideoOptions_Draw (void);
void M_VideoModes_Draw (void);
void M_Audio_Draw (void);
void M_Controls_Draw (void);
void M_Keys_Draw (void);
void M_MenuConsole_Draw (void);
void M_Compat_Draw (void);
void M_Game_Draw (void);
void M_NehDemos_Draw (void);
void M_Maps_Draw (void);
void M_Demos_Draw (void);
void M_Quit_Draw (void);
//void M_SerialConfig_Draw (void);
// void M_ModemConfig_Draw (void);
void M_LanConfig_Draw (void);
void M_GameOptions_Draw (void);
void M_Search_Draw (void);
void M_ServerList_Draw (void);
void M_Help_Draw (void);
qboolean M_Load_Key (int key, qboolean down);
qboolean M_Save_Key (int key, qboolean down);
qboolean M_Setup_Key (int key, qboolean down);
//qboolean M_Video_Key (int key, qboolean down);
// qboolean M_VidGeneral_Key (int key, qboolean down);
// qboolean M_Textures_Key (int key, qboolean down);
// qboolean M_HUD_Key (int key, qboolean down);
qboolean M_Crosshair_Key (int key, qboolean down);
// qboolean M_Lighting_Key (int key, qboolean down);
qboolean M_SkyWater_Key (int key, qboolean down);
// qboolean M_Particles_Key (int key, qboolean down);
// qboolean M_VideoOptions_Key (int key, qboolean down);
//qboolean M_Audio_Key (int key, qboolean down);
//qboolean M_Controls_Key (int key, qboolean down);
qboolean M_Keys_Key (int key, qboolean down);
qboolean M_MenuConsole_Key (int key, qboolean down);
//qboolean M_Compat_Key (int key, qboolean down);
//qboolean M_Game_Key (int key, qboolean down);
qboolean M_NehDemos_Key (int key, qboolean down);
qboolean M_Maps_Key (int key, qboolean down);
qboolean M_Demos_Key (int key, qboolean down);
qboolean M_Quit_Key (int key, qboolean down);
//qboolean M_SerialConfig_Key (int key, qboolean down);
// qboolean M_ModemConfig_Key (int key, qboolean down);
qboolean M_LanConfig_Key (int key, qboolean down);
qboolean M_GameOptions_Key (int key, qboolean down);
qboolean M_Search_Key (int key, qboolean down);
qboolean M_ServerList_Key (int key, qboolean down);
qboolean M_Help_Key (int key, qboolean down);
qboolean M_Main_Close (void);
qboolean M_Keys_Close (void);
qboolean M_Crosshair_Close (void);
qboolean M_SkyWater_Close (void);
qboolean M_VideoModes_Close (void);
qboolean M_Maps_Close (void);
qboolean M_Demos_Close (void);
qboolean M_Quit_Close (void);
qboolean M_Help_Close (void);
qboolean m_entersound; // play after drawing a frame, so caching
// won't disrupt the sound
qboolean m_recursiveDraw;
qboolean m_bind_grab; // Keys and Menu/Console menus
menu_t *m_return_state = NULL;
double m_close_time = -9999;
int translate_texture; // for player setup menu
qboolean M_OnChange_keyvar (cvar_t *, const char *);
cvar_t key_menuclose = {"key_menuclose", "ESCAPE", CVAR_FLAG_ARCHIVE | CVAR_FLAG_NOCASE, M_OnChange_keyvar};
cvar_t key_menuprev = {"key_menuprev", "BACKSPACE", CVAR_FLAG_ARCHIVE | CVAR_FLAG_NOCASE, M_OnChange_keyvar};
extern qboolean net_return_onerror;
extern char net_return_reason[32];
//extern qboolean menubound[256];
/*#ifdef HEXEN2_SUPPORT
#define StartingGame ((hexen2 && menu_mp_H2.cursor == 1) || (!hexen2 && menu_mp.cursor == 1))
#define JoiningGame ((hexen2 && menu_mp_H2.cursor == 0) || (!hexen2 && menu_mp.cursor == 0))
#else*/
#define StartingGame (menu_mp.cursor == 1)
#define JoiningGame (menu_mp.cursor == 0)
//#endif
//#define SerialConfig (menu_net.cursor == 0)
//#define DirectConfig (menu_net.cursor == 1)
#define IPXConfig (menu_net.cursor == 0)
#define TCPIPConfig (menu_net.cursor == 1)
void M_ConfigureNetSubsystem (void);
//int menuwidth = 320;
//int menuheight = 240;
int m_yofs = 0;
#define MAX_SAVEGAMES 12
#define MAX_VIEWITEMS 14 /* max menu items that can be seen without scrolling */
void M_ShowNehCredits (cmd_source_t src);
void M_CheckEnter_NetMenu (cmd_source_t src);
void M_StartSPGame (cmd_source_t src);
void M_StartMPGame (cmd_source_t src);
void M_Options_GoToConsole (cmd_source_t src);
void M_Options_Reset (cmd_source_t src);
// these aren't official (registered) cvars, but data structure is useful:
#define DECLARE_CVAR_PRESET(name) \
qboolean M_OnChange_##name (cvar_t *var, const char *value); \
cvar_t name = {NULL, NULL, 0, M_OnChange_##name, 0, NULL, CVAR_INT, 0}
/*
qboolean M_OnChange_render_preset (cvar_t *var, char *value);
qboolean M_OnChange_particle_preset (cvar_t *var, char *value);
qboolean M_OnChange_compat_preset (cvar_t *var, char *value);
qboolean M_OnChange_exttex_preset (cvar_t *var, char *value);
qboolean M_OnChange_fbcolors_preset (cvar_t *var, char *value);
qboolean M_OnChange_aim_preset (cvar_t *var, char *value);
cvar_t render_preset = {NULL, NULL, 0, M_OnChange_render_preset, 0, NULL, CVAR_INT, 0};
cvar_t particle_preset = {NULL, NULL, 0, M_OnChange_particle_preset, 0, NULL, CVAR_INT, 0};
cvar_t compat_preset = {NULL, NULL, 0, M_OnChange_compat_preset, 0, NULL, CVAR_INT, 0};
cvar_t exttex_preset = {NULL, NULL, 0, M_OnChange_exttex_preset, 0, NULL, CVAR_INT, 0};
cvar_t fbcolors_preset = {NULL, NULL, 0, M_OnChange_fbcolors_preset, 0, NULL, CVAR_INT, 0};
cvar_t aim_preset = {NULL, NULL, 0, M_OnChange_aim_preset, 0, NULL, CVAR_INT, 0};
*/
DECLARE_CVAR_PRESET(render_preset);
DECLARE_CVAR_PRESET(particle_preset);
DECLARE_CVAR_PRESET(compat_preset);
DECLARE_CVAR_PRESET(exttex_preset);
DECLARE_CVAR_PRESET(fbcolors_preset);
DECLARE_CVAR_PRESET(aim_preset);
#ifdef HEXEN2_SUPPORT
#define M_TITLE(str, lmp) str, lmp
#else
#define M_TITLE(str, lmp) str
#endif
menu_t menu_main =
{
M_TITLE("reQuiem", "title0"), M_Menu_Main_f, M_Main_Draw, NULL, M_Main_Close, NULL, 0, 0, 0, 4,
{
{"Single Player", M_Menu_SinglePlayer_f, NULL, M_ITEM_BIG},
{"Multiplayer", M_Menu_MultiPlayer_f, NULL, M_ITEM_BIG},
{"Options", M_Menu_Options_f, NULL, M_ITEM_BIG},
{"Quit", M_Menu_Quit_f, NULL, M_ITEM_BIG}
}
};
menu_t menu_main_nehmovie =
{
M_TITLE("reQuiem", "title0"), M_Menu_Main_f, M_Main_Draw, NULL, M_Main_Close, NULL, 0, 0, 0, 4,
{
{"Play Movie", M_Menu_NehDemos_f, NULL, M_ITEM_BIG},
{"Credits", M_ShowNehCredits, NULL, M_ITEM_BIG},
{"Options", M_Menu_Options_f, NULL, M_ITEM_BIG},
{"Quit", M_Menu_Quit_f, NULL, M_ITEM_BIG}
}
};
menu_t menu_main_nehgame =
{
M_TITLE("reQuiem", "title0"), M_Menu_Main_f, M_Main_Draw, NULL, M_Main_Close, NULL, 0, 0, 0, 5,
{
{"Single Player", M_Menu_SinglePlayer_f, NULL, M_ITEM_BIG},
{"Multiplayer", M_Menu_MultiPlayer_f, NULL, M_ITEM_BIG},
{"Credits", M_ShowNehCredits, NULL, M_ITEM_BIG},
{"Options", M_Menu_Options_f, NULL, M_ITEM_BIG},
{"Quit", M_Menu_Quit_f, NULL, M_ITEM_BIG}
}
};
menu_t menu_main_nehboth =
{
M_TITLE("reQuiem", "title0"), M_Menu_Main_f, M_Main_Draw, NULL, M_Main_Close, NULL, 0, 0, 0, 6,
{
{"Single Player", M_Menu_SinglePlayer_f, NULL, M_ITEM_BIG},
{"Play Movie", M_Menu_NehDemos_f, NULL, M_ITEM_BIG},
{"Multiplayer", M_Menu_MultiPlayer_f, NULL, M_ITEM_BIG},
{"Credits", M_ShowNehCredits, NULL, M_ITEM_BIG},
{"Options", M_Menu_Options_f, NULL, M_ITEM_BIG},
{"Quit", M_Menu_Quit_f, NULL, M_ITEM_BIG}
}
};
menu_t menu_sp =
{
M_TITLE("Single Player", "title1"), M_Menu_SinglePlayer_f, M_SinglePlayer_Draw, NULL, NULL, &menu_main, 0, 0, 0, 5,
{
{"New Game", M_StartSPGame, NULL, M_ITEM_BIG},
{"Load", M_Menu_Load_f, NULL, M_ITEM_BIG},
{"Save", M_Menu_Save_f, NULL, M_ITEM_BIG},
{"Maps", M_Menu_Maps_f, NULL, M_ITEM_BIG},
{"Demos", M_Menu_Demos_f, NULL, M_ITEM_BIG}
}
};
menu_t menu_mp =
{
M_TITLE("Multiplayer", "title4"), M_Menu_MultiPlayer_f, M_MultiPlayer_Draw, NULL, NULL, &menu_main, 0, 0, 0, 3,
{
{"Join Game", M_CheckEnter_NetMenu, NULL, M_ITEM_BIG},
{"Create Game", M_CheckEnter_NetMenu, NULL, M_ITEM_BIG},
{"Player Setup", M_Menu_Setup_f, NULL, M_ITEM_BIG}
}
};
menu_t menu_load =
{
M_TITLE("Load", "load"), M_Menu_Load_f, M_Load_Draw, M_Load_Key, NULL, &menu_sp, 0, 0, 0, MAX_SAVEGAMES
};
menu_t menu_save =
{
M_TITLE("Save", "save"), M_Menu_Save_f, M_Save_Draw, M_Save_Key, NULL, &menu_sp, 0, 0, 0, MAX_SAVEGAMES
};
menu_t menu_setup =
{
M_TITLE("Player Setup", "title4"), M_Menu_Setup_f, M_Setup_Draw, M_Setup_Key, NULL, &menu_mp, 0, 4, 0, 5,
{
{"Hostname"},
{"Your Name"},
{"Shirt Color"},
{"Pants Color"},
{"Accept Changes"}
}
};
menu_t menu_net =
{
M_TITLE("Network Protocol", "title4"), M_Menu_Net_f, M_Net_Draw, NULL, NULL, &menu_mp, 0, 0, 0, 2,
{
// {"Modem", M_Menu_SerialConfig_f},
// {"Direct Connect", M_Menu_SerialConfig_f},
{"IPX", M_Menu_LanConfig_f},
{"TCP/IP", M_Menu_LanConfig_f}
// {"Multiprotocol"}
}
};
menu_t menu_options =
{
M_TITLE("Options", "title3"), M_Menu_Options_f, M_Options_Draw, NULL, NULL, &menu_main, 0, 0, 0, 9,
{
{"Video", M_Menu_Video_f, NULL, M_ITEM_BIG},
{"Audio", M_Menu_Audio_f, NULL, M_ITEM_BIG},
{"Controls", M_Menu_Controls_f, NULL, M_ITEM_BIG},
{"Menu/Console", M_Menu_MenuConsole_f, NULL, M_ITEM_BIG},
{"Compatibility", M_Menu_Compat_f, NULL, M_ITEM_BIG},
{"Game", M_Menu_Game_f, NULL, M_ITEM_BIG},
{"", NULL, NULL, M_ITEM_DISABLED},
{"Go to console", M_Options_GoToConsole, NULL, M_ITEM_WHITE},
{"Reset to defaults", M_Options_Reset, NULL, M_ITEM_WHITE}
}
};
menu_t menu_video =
{
M_TITLE("Video Options", "title3"), M_Menu_Video_f, M_Video_Draw, NULL/*M_Video_Key*/, NULL, &menu_options, 0, 0, 0, 10,
{
{"General", M_Menu_VidGeneral_f},
{"Textures", M_Menu_Textures_f},
{"HUD", M_Menu_HUD_f},
{"Crosshair", M_Menu_Crosshair_f},
{"Lighting", M_Menu_Lighting_f},
{"Sky & water", M_Menu_SkyWater_f},
{"Particles", M_Menu_Particles_f},
// {"Advanced Options", M_Menu_VideoOptions_f},
{"Video Modes", M_Menu_VideoModes_f},
{"", NULL, NULL, M_ITEM_DISABLED},
{"Preset config", NULL, &render_preset, M_ITEM_WHITE}
}
};
menu_t menu_vidgeneral =
{
M_TITLE("General Video Options", "title3"), M_Menu_VidGeneral_f, M_VidGeneral_Draw,
NULL/*M_VidGeneral_Key*/, NULL, &menu_video, M_ALIGN_RIGHT, 0, 0, 8,
{
{ "Screen size", NULL, &scr_viewsize, M_ITEM_SLIDER},
{ "Brightness", NULL, &v_gamma, M_ITEM_SLIDER},
{ "Contrast", NULL, &v_contrast, M_ITEM_SLIDER},
{ "Vertical Sync", NULL, &vid_vsync},
{ "Max frames/sec", NULL, &host_maxfps},
{ "Smooth animations", NULL, &gl_interpolate_animation},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Screenshot format", NULL, &scr_sshot_format}
// next item depends on value of scr_sshot_format
}
};
menu_t menu_textures =
{
M_TITLE("Texture Options", "title3"), M_Menu_Textures_f, M_Textures_Draw,
NULL /*M_Textures_Key*/, NULL, &menu_video, M_ALIGN_RIGHT, 0, 0, 14,
{
{ "Texture filter", NULL, &gl_texturemode},
{ "Texture quality", NULL, &gl_picmip, M_ITEM_SLIDER},
{ "Brighten world tex", NULL, &gl_texbrighten},
{ "Detail textures", NULL, &gl_detail},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "External textures", NULL, &exttex_preset, M_ITEM_WHITE},
{ "world", NULL, &gl_externaltextures_world},
{ "brush models", NULL, &gl_externaltextures_bmodels},
{ "alias models", NULL, &gl_externaltextures_models},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Fullbright colors", NULL, &fbcolors_preset, M_ITEM_WHITE},
{ "world", NULL, &gl_fb_world},
{ "brush models", NULL, &gl_fb_bmodels},
{ "alias models", NULL, &gl_fb_models}
}
};
menu_t menu_hud =
{
M_TITLE("HUD Options", "title3"), M_Menu_HUD_f, M_HUD_Draw, NULL/*M_HUD_Key*/,
NULL, &menu_video, M_ALIGN_RIGHT, 0, 0, 13,
{
{ "Solid status bar", NULL, &cl_sbar},
{ "Centered status bar", NULL, &scr_centersbar},
{ "Status bar size", NULL, &scr_sbarsize, M_ITEM_SLIDER},
{ "Weapon transparency", NULL, &r_drawviewmodel, M_ITEM_SLIDER},
{ "Weapon size", NULL, &r_viewmodelsize, M_ITEM_SLIDER},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "HUD text scale", NULL, &scr_hudscale, M_ITEM_SLIDER},
{ "Notify text scale", NULL, &scr_notifyscale, M_ITEM_SLIDER},
{ "Show player speed", NULL, &scr_showspeed},
{ "Show player pos", NULL, &scr_showorigin},
{ "Show FPS", NULL, &scr_showfps},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Message duration", NULL, &con_notifytime},
{ "Max message lines", NULL, &_con_notifylines}
}
};
menu_t menu_crosshair =
{
M_TITLE("Crosshair Options", "title3"), M_Menu_Crosshair_f, M_Crosshair_Draw, M_Crosshair_Key,
M_Crosshair_Close, &menu_video, M_ALIGN_RIGHT, 0, 0, 7,
{
{ "Style", NULL, &crosshair, M_ITEM_SLIDER},
{ "Size", NULL, &crosshairsize, M_ITEM_SLIDER},
{ "Color", NULL, &crosshaircolor},
{ "Transparency", NULL, &gl_crosshairalpha, M_ITEM_SLIDER},
{ "External image", NULL, &gl_crosshairimage},
{ "Horz offset", NULL, &cl_crossx, M_ITEM_SLIDER},
{ "Vert offset", NULL, &cl_crossy, M_ITEM_SLIDER}
}
};
menu_t menu_lighting =
{
M_TITLE("Lighting Options", "title3"), M_Menu_Lighting_f, M_Lighting_Draw, NULL/*M_Lighting_Key*/, NULL,
&menu_video, M_ALIGN_RIGHT, 0, 0, 13,
{
{ "World light style", NULL, &gl_lightmode},
{ "Colored lights", NULL, &gl_loadlitfiles},
{ "Dynamic lights", NULL, &r_dynamic},
{ "Animated lights", NULL, &r_flatlightstyles},
{ "Model light level", NULL, &r_modelbrightness, M_ITEM_SLIDER},
{ "Shadows", NULL, &r_shadows, M_ITEM_SLIDER},
{ "Vertex lighting", NULL, &gl_vertexlights},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Lightning glow", NULL, &gl_glows},
{ "Other glows", NULL, &gl_flashblend},
{ "Player powerup glow", NULL, &r_powerupglow},
{ "Glow color", NULL, &r_explosionlightcolor},
{ "Glow radius", NULL, &r_explosionlight, M_ITEM_SLIDER}
}
};
menu_t menu_skywater =
{
M_TITLE("Sky & Water Options", "title3"), M_Menu_SkyWater_f, M_SkyWater_Draw,
M_SkyWater_Key, M_SkyWater_Close, &menu_video, M_ALIGN_RIGHT, 0, 0, 10,
{
{ "Sky type", NULL, &r_skytype},
{ "Solid sky color", NULL, &r_skycolor},
{ "Use skyboxes", NULL, &r_oldsky},
{ "Current skybox", NULL, &r_skybox},
{ "Fast but buggy sky", NULL, &gl_skyhack},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Water caustics", NULL, &gl_caustics},
{ "Underwater fog", NULL, &gl_waterfog},
{ "Waterfog density", NULL, &gl_waterfog_density, M_ITEM_SLIDER},
{ "Water alpha", NULL, &r_wateralpha, M_ITEM_SLIDER}
}
};
menu_t menu_particles =
{
M_TITLE("Particle Options", "title3"), M_Menu_Particles_f, M_Particles_Draw, NULL /*M_Particles_Key*/,
NULL, &menu_video, M_ALIGN_RIGHT, 0, 0, 16,
{
{ "Bounce particles", NULL, &gl_bounceparticles},
{ "Clip particles", NULL, &gl_clipparticles},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Preset config", NULL, &particle_preset, M_ITEM_WHITE},
{ "Explosions", NULL, &gl_part_explosions},
{ "Trails", NULL, &gl_part_trails},
{ "Spikes", NULL, &gl_part_spikes},
{ "Gunshots", NULL, &gl_part_gunshots},
{ "Blood", NULL, &gl_part_blood},
{ "Teleport splashes", NULL, &gl_part_telesplash},
{ "Spawn explosions", NULL, &gl_part_blobs},
{ "Lava splashes", NULL, &gl_part_lavasplash},
{ "Inferno", NULL, &gl_part_inferno},
{ "Flames", NULL, &gl_part_flames},
{ "Lightning", NULL, &gl_part_lightning},
{ "Spike trails", NULL, &gl_part_spiketrails}
}
};
/*menu_t menu_options_video =
{
M_TITLE("Video Options", "title3"), M_Menu_VideoOptions_f, M_VideoOptions_Draw, M_VideoOptions_Key,
NULL, &menu_video, M_ALIGN_RIGHT, 0, 0, 4,
{
{ "Smooth animations", NULL, &gl_interpolate_animation},
{ "Texture filter", NULL, &gl_texturemode},
{ "Texture quality", NULL, &gl_picmip},
{ "Detail textures", NULL, &gl_detail}
}
};*/
menu_t menu_videomodes =
{
M_TITLE("Video Modes", NULL), M_Menu_VideoModes_f, M_VideoModes_Draw, NULL, M_VideoModes_Close, &menu_video, 0, 0, 0, 0
};
menu_t menu_audio =
{
M_TITLE("Audio Options", "title3"), M_Menu_Audio_f, M_Audio_Draw, NULL/*M_Audio_Key*/, NULL, &menu_options, M_ALIGN_RIGHT, 0, 0, 3,
{
{ "CD/Music Volume", NULL, &bgmvolume, M_ITEM_SLIDER},
{ "Sound Volume", NULL, &volume, M_ITEM_SLIDER},
{ "Disable sound FX", NULL, &nosound}
}
};
#define M_CONTROLS_NUMITEMS 13
menu_t menu_controls =
{
M_TITLE("Control Options", "title3"), M_Menu_Controls_f, M_Controls_Draw, NULL/*M_Controls_Key*/,
NULL, &menu_options, M_ALIGN_RIGHT, 0, 0, M_CONTROLS_NUMITEMS,
{
{ "Gameplay controls", M_Menu_Keys_f, NULL, M_ITEM_WHITE},
{ "Other controls", M_Menu_Keys2_f, NULL, M_ITEM_WHITE},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Mouse Speed", NULL, &sensitivity, M_ITEM_SLIDER},
{ "Always Run", NULL, &cl_forwardspeed},
{ "Always Mouselook", NULL, &m_look},
{ "Invert Mouse", NULL, &m_pitch},
{ "Lookspring", NULL, &lookspring},
{ "Lookstrafe", NULL, &lookstrafe},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Noclip: viewangle", NULL, NULL, M_ITEM_DISABLED},
{ "determines pitch", NULL, &sv_altnoclip},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Capture Mouse", NULL, &_windowed_mouse}
}
};
menu_t menu_menuconsole =
{
M_TITLE("Menu/Console Options", "title3"), M_Menu_MenuConsole_f, M_MenuConsole_Draw, M_MenuConsole_Key,
NULL, &menu_options, M_ALIGN_RIGHT, 0, 0, 14,
{
{ "Center menu", NULL, &scr_centermenu},
{ "Menu size", NULL, &scr_menusize, M_ITEM_SLIDER},
{ "Key: close menu", NULL, &key_menuclose},
{ "Key: prev. menu", NULL, &key_menuprev},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Console height", NULL, &scr_consize, M_ITEM_SLIDER},
{ "Console speed", NULL, &scr_conspeed, M_ITEM_SLIDER},
{ "Console alpha", NULL, &gl_conalpha, M_ITEM_SLIDER},
// { "Line spacing", NULL, &con_linespacing},
{ "Log centerprints", NULL, &con_logcenterprint},
{ "Tab-completion", NULL, &cl_advancedcompletion},
{ "Auto-completion", NULL, &con_autocomplete},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "External charset", NULL, &gl_consolefont}, // for console AND menu
{ "Smooth font edges", NULL, &gl_smoothfont}
}
};
menu_t menu_compat =
{
M_TITLE("Compatibility Options", "title3"), M_Menu_Compat_f, M_Compat_Draw, NULL/*M_Compat_Key*/,
NULL, &menu_options, M_ALIGN_RIGHT, 0, 0, 14,
{
{ "Preset config", NULL, &compat_preset, M_ITEM_WHITE},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Match filename case", NULL, &com_matchfilecase},
{ "Load .ent files", NULL, &sv_entpatch},
{ "Server protocol", NULL, &sv_protocol},
{ "Fix fish count", NULL, &sv_fishfix},
{ "Prev. weapon hack", NULL, &sv_imp12hack},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Smooth cutscene cam", NULL, &host_cutscenehack},
{ "Reduce Z-fighting", NULL, &gl_zfightfix},
{ "Hi-res textures", NULL, &exttex_preset},
{ "Fullbright colors", NULL, &fbcolors_preset},
{ "Transparent models", NULL, &gl_notrans},
{ "32-bit sprites", NULL, &nospr32}
}
};
menu_t menu_game =
{
M_TITLE("Game Options", "title3"), M_Menu_Game_f, M_Game_Draw, NULL,
NULL, &menu_options, M_ALIGN_RIGHT, 0, 0, 9,
{
{ "Weapon kick", NULL, &v_gunkick},
{ "Aim precision", NULL, &aim_preset},
{ "LG tracking rate", NULL, &cl_truelightning, M_ITEM_SLIDER},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Corpse removal", NULL, &cl_deadbodyfilter},
{ "Gib removal", NULL, &cl_gibfilter},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Demo compression", NULL, &cl_demo_compress},
{ "Compress format", NULL, &cl_demo_compress_fmt}
}
};
typedef struct menu50_s MENU_T(50) menu50_t;
menu50_t menu_keys =
{
M_TITLE("Key Configuration", "title6"), M_Menu_Keys_f, M_Keys_Draw, M_Keys_Key,
M_Keys_Close, &menu_controls, M_NO_QUAKELOGO | M_NO_CVARINFO | M_NO_CURSOR, 0, 0, 0
// num_items is set in M_Menu_Keys_f
};
menu50_t menu_keys2 =
{
M_TITLE("Key Configuration", "title6"), M_Menu_Keys2_f, M_Keys_Draw, M_Keys_Key,
M_Keys_Close, &menu_controls, M_NO_QUAKELOGO | M_NO_CVARINFO | M_NO_CURSOR, 0, 0, 0
// num_items is set in M_Menu_Keys_f
};
menu_t menu_maps =
{
M_TITLE("MAPS", NULL), M_Menu_Maps_f, M_Maps_Draw, M_Maps_Key, M_Maps_Close, &menu_sp, 0, 0, 0, 0
};
menu_t menu_demos =
{
M_TITLE("DEMOS", NULL), M_Menu_Demos_f, M_Demos_Draw, M_Demos_Key, M_Demos_Close, &menu_sp, 0, 0, 0, 0
};
menu_t menu_nehdemos =
{
M_TITLE("DEMOS", NULL), M_Menu_NehDemos_f, M_NehDemos_Draw, M_NehDemos_Key, NULL, &menu_main, 0, 0, 0, NUM_NEHDEMOS
};
menu_t menu_lanconfig =
{
M_TITLE("LAN Configuration", "title4"), M_Menu_LanConfig_f, M_LanConfig_Draw, M_LanConfig_Key, NULL, &menu_net, 0, -1, 0, 0
};
/*
menu_t menu_serialconfig =
{
M_TITLE(NULL, NULL), M_Menu_SerialConfig_f, M_SerialConfig_Draw, M_SerialConfig_Key, NULL, &menu_net, 0, 0, 0, 0
};
menu_t menu_modemconfig =
{
M_TITLE(NULL, NULL), M_Menu_ModemConfig_f, M_ModemConfig_Draw, M_ModemConfig_Key, NULL, &menu_net, 0, 0, 0, 0
};
*/
menu_t menu_quit =
{
M_TITLE(NULL, NULL), M_Menu_Quit_f, M_Quit_Draw, M_Quit_Key, M_Quit_Close, NULL, 0, 0, 0, 0
};
menu_t menu_gameoptions =
{
M_TITLE("LAN Game Options", "title4"), M_Menu_GameOptions_f, M_GameOptions_Draw, M_GameOptions_Key,
NULL, &menu_lanconfig, M_ALIGN_RIGHT, 0, 0, 11,
{
{ " ", M_StartMPGame, NULL}, // "Begin Game" button
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Max players ", NULL, NULL},
{ "Game Type ", NULL, &coop},
{ "Teamplay ", NULL, &teamplay},
{ "Skill ", NULL, &skill},
{ "Frag Limit ", NULL, &fraglimit},
{ "Time Limit ", NULL, &timelimit},
{ "", NULL, NULL, M_ITEM_DISABLED},
{ "Episode ", NULL, NULL},
{ "Level ", NULL, NULL}
}
};
menu_t menu_search =
{
M_TITLE(NULL, "title4"), M_Menu_Search_f, M_Search_Draw, M_Search_Key, NULL, NULL, 0, 0, 0, 0
};
menu_t menu_serverlist =
{
M_TITLE(NULL, "load"), M_Menu_ServerList_f, M_ServerList_Draw, M_ServerList_Key, NULL, &menu_lanconfig, 0, 0, 0, 0
};
menu_t menu_help =
{
M_TITLE(NULL, NULL), M_Menu_Help_f, M_Help_Draw, M_Help_Key, M_Help_Close, &menu_main, 0, 0, 0, 5
};
// JDH: data for up & down arrow characters
byte m_scroll_up_data[64] =
{
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0x68, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0x67, 0x67, 0x67, 0xFF, 0xFF, 0xFF,
0xFF, 0x66, 0x66, 0x60, 0x66, 0x66, 0xFF, 0xFF,
0x65, 0x65, 0x60, 0x60, 0xFF, 0x65, 0x65, 0xFF,
0xFF, 0x60, 0x60, 0xFF, 0xFF, 0xFF, 0x60, 0x60,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};
byte m_scroll_dn_data[64] =
{
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x68, 0x68, 0xFF, 0xFF, 0xFF, 0x68, 0x68, 0xFF,
0xFF, 0x67, 0x67, 0xFF, 0x67, 0x67, 0x60, 0x60,
0xFF, 0xFF, 0x66, 0x66, 0x66, 0x60, 0x60, 0xFF,
0xFF, 0xFF, 0xFF, 0x65, 0x60, 0x60, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0x60, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};
#define M_MAX_PRESETS 5
typedef struct
{
cvar_t *cvar;
float value[M_MAX_PRESETS];
} m_preset_t;
typedef struct
{
cvar_t *cvar; // local cvar used for preset config
int num_configs; // including custom
char *config_names[M_MAX_PRESETS];
qboolean custom_valid;
int num_vars; // #items in following array
m_preset_t *presets; // pointer to array
} m_preset_config_t;
mpic_t m_scroll_up = {8, 8};
mpic_t m_scroll_dn = {8, 8};
/*
================
M_DrawCharacter
Draws one solid graphics character
================
*/
void M_DrawCharacter (int cx, int line, int num)
{
Draw_Character (cx + ((vid.width - 320) >> 1), line + m_yofs, num);
}
/*void M_DrawCharacter2 (int cx, int line, int num)
{
Draw_Character2 (cx + ((vid.width - 320) >> 1), line + m_yofs, num);
}*/
void M_Print (int cx, int cy, const char *str)
{
Draw_Alt_String (cx + ((vid.width - 320) >> 1), cy + m_yofs, str);
}
void M_PrintWhite (int cx, int cy, const char *str)
{
Draw_String (cx + ((vid.width - 320) >> 1), cy + m_yofs, str);
}
void M_DrawTransPic (int x, int y, const mpic_t *pic)
{
Draw_TransPic (x + ((vid.width - 320) >> 1), y + m_yofs, pic);
}
void M_PrintBig (int cx, int cy, const char *str)
{
Draw_BigString (cx + (vid.width - 320)/2, cy + m_yofs, str);
}
void M_DrawPic (int x, int y, const mpic_t *pic)
{
Draw_Pic (x + ((vid.width - 320) >> 1), y + m_yofs, pic);
}
void M_DrawBar (int x, int y, int width)
{
// assumes 1 < width < 128
char buf[128];
buf[width--] = 0;
buf[width--] = '\x1f';
while (width > 0)
buf[width--] = '\x1e';
buf[0] = '\x1d';
M_Print (x, y, buf);
}
/*
void M_DrawTransPicTranslate (int x, int y, mpic_t *pic)
{
Draw_TransPicTranslate (x + ((vid.width - 320) >> 1), y + m_yofs, pic, translationTable, 0);
}
*/
void M_DrawTextBox (int x, int y, int width, int height)
{
Draw_TextBox (x + ((vid.width - 320) >> 1), y + m_yofs, width, height);
}
#if 0
void M_SetScale (qboolean enable)
{
float percent, maxscale;
percent = scr_menusize.value;
if (percent < 0)
{
Cvar_SetDirect (&scr_menusize, "0");
percent = 0;
}
if (enable)
{
if (percent)
{
//menuwidth = 320;
//menuheight = min(vid.height, 240);
maxscale = min ((float)vid.width / 320.0, (float)vid.height / 240.0);
menuwidth = vid.width / ((percent/100.0) * maxscale);
menuheight = vid.height / ((percent/100.0) * maxscale);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho (0, menuwidth, menuheight, 0, -99999, 99999);
}
else
{
menuwidth = vid.width;
menuheight = vid.height;
}
if (scr_centermenu.value)
{
m_yofs = (menuheight - 200) / 2;
}
else
{
#ifdef HEXEN2_SUPPORT
if (hexen2)
m_yofs = 34; // for title plaques
else
#endif
m_yofs = 0;
}
}
else if (percent)
{
// restore standard projection
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho (0, vid.width, vid.height, 0, -99999, 99999);
}
}
#else
void M_SetScale (qboolean enable)
{
static unsigned orig_vidwidth, orig_vidheight;
float percent, maxscale;
percent = scr_menusize.value;
if (percent > 0)
{
assert (!!orig_vidwidth != enable);
if (enable)
{
orig_vidwidth = vid.width;
orig_vidheight = vid.height;
maxscale = min (vid.width / 320.0, vid.height / 240.0);
vid.width = ceil(vid.width / ((percent/100.0) * maxscale));
// menuwidth = vid.width;
vid.height = ceil(vid.height / ((percent/100.0) * maxscale));
// menuheight = vid.height;
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho (0, vid.width, vid.height, 0, -99999, 99999);
}
else
{
// restore standard projection
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
glOrtho (0, orig_vidwidth, orig_vidheight, 0, -99999, 99999);
vid.width = orig_vidwidth;
vid.height = orig_vidheight;
orig_vidwidth = orig_vidheight = 0;
}
}
#ifdef HEXEN2_SUPPORT
if (hexen2)
{
m_yofs = scr_centermenu.value ? (vid.height - 200) / 2 : 34;
}
else
#endif
{
m_yofs = scr_centermenu.value ? (vid.height - 240) / 2 : 0;
}
}
#endif
//=============================================================================
int m_save_demonum;
/*
================
M_ToggleMenu_f
================
*/
void M_ToggleMenu_f (cmd_source_t src)
{
m_entersound = true;
if (key_dest == key_menu)
{
if (menu_current != &menu_main)
{
M_Menu_Main_f (src);
return;
}
key_dest = key_game;
menu_current = NULL;
return;
}
if (key_dest == key_console)
{
Con_ToggleConsole_f (src);
}
else
{
if (menu_current)
{
menu_current->openproc (src);
// JDH: if menu was closed & reopened within 2 seconds, display backspace tip
if (realtime - m_close_time < 2)
m_close_time = realtime;
}
else
M_Menu_Main_f (src);
}
}