2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 mempool_t *menu_mempool;
32 enum m_state_e m_state;
34 void M_Menu_Main_f (void);
35 void M_Menu_SinglePlayer_f (void);
36 void M_Menu_Load_f (void);
37 void M_Menu_Save_f (void);
38 void M_Menu_MultiPlayer_f (void);
39 void M_Menu_Setup_f (void);
40 void M_Menu_Options_f (void);
41 void M_Menu_Options_Effects_f (void);
42 void M_Menu_Options_ColorControl_f (void);
43 void M_Menu_Keys_f (void);
44 void M_Menu_Video_f (void);
45 void M_Menu_Help_f (void);
46 void M_Menu_Quit_f (void);
47 void M_Menu_LanConfig_f (void);
48 void M_Menu_GameOptions_f (void);
49 void M_Menu_ServerList_f (void);
51 void M_Main_Draw (void);
52 void M_SinglePlayer_Draw (void);
53 void M_Load_Draw (void);
54 void M_Save_Draw (void);
55 void M_MultiPlayer_Draw (void);
56 void M_Setup_Draw (void);
57 void M_Options_Draw (void);
58 void M_Options_Effects_Draw (void);
59 void M_Options_ColorControl_Draw (void);
60 void M_Keys_Draw (void);
61 void M_Video_Draw (void);
62 void M_Help_Draw (void);
63 void M_Quit_Draw (void);
64 void M_LanConfig_Draw (void);
65 void M_GameOptions_Draw (void);
66 void M_ServerList_Draw (void);
68 void M_Main_Key (int key);
69 void M_SinglePlayer_Key (int key);
70 void M_Load_Key (int key);
71 void M_Save_Key (int key);
72 void M_MultiPlayer_Key (int key);
73 void M_Setup_Key (int key);
74 void M_Options_Key (int key);
75 void M_Options_Effects_Key (int key);
76 void M_Options_ColorControl_Key (int key);
77 void M_Keys_Key (int key);
78 void M_Video_Key (int key);
79 void M_Help_Key (int key);
80 void M_Quit_Key (int key);
81 void M_LanConfig_Key (int key);
82 void M_GameOptions_Key (int key);
83 void M_ServerList_Key (int key);
85 qboolean m_entersound; // play after drawing a frame, so caching
86 // won't disrupt the sound
88 char m_return_reason [32];
90 #define StartingGame (m_multiplayer_cursor == 1)
91 #define JoiningGame (m_multiplayer_cursor == 0)
94 #define NumberOfNehahraDemos 34
101 nehahrademonames_t NehahraDemos[NumberOfNehahraDemos] =
103 {"intro", "Prologue"},
104 {"genf", "The Beginning"},
105 {"genlab", "A Doomed Project"},
106 {"nehcre", "The New Recruits"},
107 {"maxneh", "Breakthrough"},
108 {"maxchar", "Renewal and Duty"},
109 {"crisis", "Worlds Collide"},
110 {"postcris", "Darkening Skies"},
111 {"hearing", "The Hearing"},
112 {"getjack", "On a Mexican Radio"},
113 {"prelude", "Honor and Justice"},
114 {"abase", "A Message Sent"},
115 {"effect", "The Other Side"},
116 {"uhoh", "Missing in Action"},
117 {"prepare", "The Response"},
118 {"vision", "Farsighted Eyes"},
119 {"maxturns", "Enter the Immortal"},
120 {"backlot", "Separate Ways"},
121 {"maxside", "The Ancient Runes"},
122 {"counter", "The New Initiative"},
123 {"warprep", "Ghosts to the World"},
124 {"counter1", "A Fate Worse Than Death"},
125 {"counter2", "Friendly Fire"},
126 {"counter3", "Minor Setback"},
127 {"madmax", "Scores to Settle"},
128 {"quake", "One Man"},
129 {"cthmm", "Shattered Masks"},
130 {"shades", "Deal with the Dead"},
131 {"gophil", "An Unlikely Hero"},
132 {"cstrike", "War in Hell"},
133 {"shubset", "The Conspiracy"},
134 {"shubdie", "Even Death May Die"},
135 {"newranks", "An Empty Throne"},
136 {"seal", "The Seal is Broken"}
139 float menu_x, menu_y, menu_width, menu_height;
141 void M_Background(int width, int height)
144 menu_height = height;
145 menu_x = (vid.conwidth - menu_width) * 0.5;
146 menu_y = (vid.conheight - menu_height) * 0.5;
147 DrawQ_Fill(menu_x, menu_y, menu_width, menu_height, 0, 0, 0, 0.5, 0);
148 //DrawQ_Fill(0, 0, vid.conwidth, vid.conheight, 0, 0, 0, 0.5, 0);
155 Draws one solid graphics character
158 void M_DrawCharacter (float cx, float cy, int num)
163 DrawQ_String(menu_x + cx, menu_y + cy, temp, 1, 8, 8, 1, 1, 1, 1, 0);
166 void M_Print (float cx, float cy, const char *str)
168 DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0);
171 void M_PrintWhite (float cx, float cy, const char *str)
173 DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0);
176 void M_ItemPrint (float cx, float cy, char *str, int unghosted)
179 DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0);
181 DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 0.4, 0.4, 0.4, 1, 0);
184 void M_DrawPic (float cx, float cy, char *picname)
186 DrawQ_Pic (menu_x + cx, menu_y + cy, picname, 0, 0, 1, 1, 1, 1, 0);
189 qbyte identityTable[256];
190 qbyte translationTable[256];
192 void M_BuildTranslationTable(int top, int bottom)
195 qbyte *dest, *source;
197 for (j = 0; j < 256; j++)
198 identityTable[j] = j;
199 dest = translationTable;
200 source = identityTable;
201 memcpy (dest, source, 256);
203 // LordHavoc: corrected skin color ranges
204 if (top < 128 || (top >= 224 && top < 240)) // the artists made some backwards ranges. sigh.
205 memcpy (dest + TOP_RANGE, source + top, 16);
207 for (j=0 ; j<16 ; j++)
208 dest[TOP_RANGE+j] = source[top+15-j];
210 // LordHavoc: corrected skin color ranges
211 if (bottom < 128 || (bottom >= 224 && bottom < 240))
212 memcpy (dest + BOTTOM_RANGE, source + bottom, 16);
214 for (j=0 ; j<16 ; j++)
215 dest[BOTTOM_RANGE+j] = source[bottom+15-j];
219 void M_DrawTextBox (float x, float y, float width, float height)
227 M_DrawPic (cx, cy, "gfx/box_tl.lmp");
228 for (n = 0; n < height; n++)
231 M_DrawPic (cx, cy, "gfx/box_ml.lmp");
233 M_DrawPic (cx, cy+8, "gfx/box_bl.lmp");
240 M_DrawPic (cx, cy, "gfx/box_tm.lmp");
241 for (n = 0; n < height; n++)
245 M_DrawPic (cx, cy, "gfx/box_mm2.lmp");
247 M_DrawPic (cx, cy, "gfx/box_mm.lmp");
249 M_DrawPic (cx, cy+8, "gfx/box_bm.lmp");
256 M_DrawPic (cx, cy, "gfx/box_tr.lmp");
257 for (n = 0; n < height; n++)
260 M_DrawPic (cx, cy, "gfx/box_mr.lmp");
262 M_DrawPic (cx, cy+8, "gfx/box_br.lmp");
265 //=============================================================================
267 //int m_save_demonum;
274 void M_ToggleMenu_f (void)
278 if (key_dest != key_menu || m_state != m_main)
289 void M_Demo_Draw (void)
293 M_Background(320, 200);
295 for (i = 0;i < NumberOfNehahraDemos;i++)
296 M_Print (16, 16 + 8*i, NehahraDemos[i].desc);
299 M_DrawCharacter (8, 16 + demo_cursor*8, 12+((int)(realtime*4)&1));
303 void M_Menu_Demos_f (void)
310 void M_Demo_Key (int k)
319 S_LocalSound ("misc/menu2.wav");
322 Cbuf_AddText (va ("playdemo %s\n", NehahraDemos[demo_cursor].name));
327 S_LocalSound ("misc/menu1.wav");
330 demo_cursor = NumberOfNehahraDemos;
335 S_LocalSound ("misc/menu1.wav");
337 if (demo_cursor > NumberOfNehahraDemos)
343 //=============================================================================
348 int MAIN_ITEMS = 4; // Nehahra: Menu Disable
350 void M_Menu_Main_f (void)
352 if (gamemode == GAME_NEHAHRA)
354 if (NehGameType == TYPE_DEMO)
356 else if (NehGameType == TYPE_GAME)
365 if (key_dest != key_menu)
367 m_save_demonum = cls.demonum;
377 void M_Main_Draw (void)
382 M_Background(320, 200);
384 M_DrawPic (16, 4, "gfx/qplaque.lmp");
385 p = Draw_CachePic ("gfx/ttl_main.lmp");
386 M_DrawPic ( (320-p->width)/2, 4, "gfx/ttl_main.lmp");
388 if (gamemode == GAME_NEHAHRA)
390 if (NehGameType == TYPE_BOTH)
391 M_DrawPic (72, 32, "gfx/mainmenu.lmp");
392 else if (NehGameType == TYPE_GAME)
393 M_DrawPic (72, 32, "gfx/gamemenu.lmp");
395 M_DrawPic (72, 32, "gfx/demomenu.lmp");
398 M_DrawPic (72, 32, "gfx/mainmenu.lmp");
400 f = (int)(realtime * 10)%6;
402 M_DrawPic (54, 32 + m_main_cursor * 20, va("gfx/menudot%i.lmp", f+1));
406 void M_Main_Key (int key)
413 //cls.demonum = m_save_demonum;
414 //if (cls.demonum != -1 && !cls.demoplayback && cls.state != ca_connected)
419 S_LocalSound ("misc/menu1.wav");
420 if (++m_main_cursor >= MAIN_ITEMS)
425 S_LocalSound ("misc/menu1.wav");
426 if (--m_main_cursor < 0)
427 m_main_cursor = MAIN_ITEMS - 1;
433 if (gamemode == GAME_NEHAHRA)
438 switch (m_main_cursor)
441 M_Menu_SinglePlayer_f ();
449 M_Menu_MultiPlayer_f ();
459 Cbuf_AddText ("disconnect\n");
460 Cbuf_AddText ("playdemo endcred\n");
469 switch (m_main_cursor)
472 M_Menu_SinglePlayer_f ();
476 M_Menu_MultiPlayer_f ();
486 Cbuf_AddText ("disconnect\n");
487 Cbuf_AddText ("playdemo endcred\n");
496 switch (m_main_cursor)
505 Cbuf_AddText ("disconnect\n");
506 Cbuf_AddText ("playdemo endcred\n");
522 switch (m_main_cursor)
525 M_Menu_SinglePlayer_f ();
529 M_Menu_MultiPlayer_f ();
548 //=============================================================================
549 /* SINGLE PLAYER MENU */
551 int m_singleplayer_cursor;
552 #define SINGLEPLAYER_ITEMS 3
555 void M_Menu_SinglePlayer_f (void)
558 m_state = m_singleplayer;
563 void M_SinglePlayer_Draw (void)
567 M_Background(320, 200);
569 M_DrawPic (16, 4, "gfx/qplaque.lmp");
570 p = Draw_CachePic ("gfx/ttl_sgl.lmp");
572 // Transfusion doesn't have a single player mode
573 if (gamemode == GAME_TRANSFUSION || gamemode == GAME_NEXUIZ)
575 M_DrawPic ((320 - p->width) / 2, 4, "gfx/ttl_sgl.lmp");
577 M_DrawTextBox (60, 8 * 8, 23, 4);
578 if (gamemode == GAME_NEXUIZ)
579 M_PrintWhite (95, 10 * 8, "Nexuiz is for");
581 M_PrintWhite (95, 10 * 8, "Transfusion is for");
582 M_PrintWhite (83, 11 * 8, "multiplayer play only");
588 M_DrawPic ( (320-p->width)/2, 4, "gfx/ttl_sgl.lmp");
589 M_DrawPic (72, 32, "gfx/sp_menu.lmp");
591 f = (int)(realtime * 10)%6;
593 M_DrawPic (54, 32 + m_singleplayer_cursor * 20, va("gfx/menudot%i.lmp", f+1));
598 void M_SinglePlayer_Key (int key)
600 if (gamemode == GAME_TRANSFUSION || gamemode == GAME_NEXUIZ)
602 if (key == K_ESCAPE || key == K_ENTER)
614 S_LocalSound ("misc/menu1.wav");
615 if (++m_singleplayer_cursor >= SINGLEPLAYER_ITEMS)
616 m_singleplayer_cursor = 0;
620 S_LocalSound ("misc/menu1.wav");
621 if (--m_singleplayer_cursor < 0)
622 m_singleplayer_cursor = SINGLEPLAYER_ITEMS - 1;
628 switch (m_singleplayer_cursor)
633 Cbuf_AddText ("disconnect\n");
634 Cbuf_AddText ("maxplayers 1\n");
635 Cbuf_AddText ("deathmatch 0\n");
636 Cbuf_AddText ("coop 0\n");
637 if (gamemode == GAME_NEHAHRA)
638 Cbuf_AddText ("map nehstart\n");
640 Cbuf_AddText ("map start\n");
654 //=============================================================================
657 int load_cursor; // 0 < load_cursor < MAX_SAVEGAMES
659 #define MAX_SAVEGAMES 12
660 char m_filenames[MAX_SAVEGAMES][SAVEGAME_COMMENT_LENGTH+1];
661 int loadable[MAX_SAVEGAMES];
663 void M_ScanSaves (void)
666 char name[MAX_OSPATH];
671 for (i=0 ; i<MAX_SAVEGAMES ; i++)
673 strcpy (m_filenames[i], "--- UNUSED SLOT ---");
675 sprintf (name, "s%i.sav", i);
676 f = FS_Open (name, "r", false);
679 str = FS_Getline (f);
680 sscanf (str, "%i\n", &version);
681 str = FS_Getline (f);
682 strncpy (m_filenames[i], str, sizeof(m_filenames[i])-1);
684 // change _ back to space
685 for (j=0 ; j<SAVEGAME_COMMENT_LENGTH ; j++)
686 if (m_filenames[i][j] == '_')
687 m_filenames[i][j] = ' ';
693 void M_Menu_Load_f (void)
702 void M_Menu_Save_f (void)
708 if (svs.maxclients != 1)
717 void M_Load_Draw (void)
722 M_Background(320, 200);
724 p = Draw_CachePic ("gfx/p_load.lmp");
725 M_DrawPic ( (320-p->width)/2, 4, "gfx/p_load.lmp");
727 for (i=0 ; i< MAX_SAVEGAMES; i++)
728 M_Print (16, 32 + 8*i, m_filenames[i]);
731 M_DrawCharacter (8, 32 + load_cursor*8, 12+((int)(realtime*4)&1));
735 void M_Save_Draw (void)
740 M_Background(320, 200);
742 p = Draw_CachePic ("gfx/p_save.lmp");
743 M_DrawPic ( (320-p->width)/2, 4, "gfx/p_save.lmp");
745 for (i=0 ; i<MAX_SAVEGAMES ; i++)
746 M_Print (16, 32 + 8*i, m_filenames[i]);
749 M_DrawCharacter (8, 32 + load_cursor*8, 12+((int)(realtime*4)&1));
753 void M_Load_Key (int k)
758 M_Menu_SinglePlayer_f ();
762 S_LocalSound ("misc/menu2.wav");
763 if (!loadable[load_cursor])
768 // issue the load command
769 Cbuf_AddText (va ("load s%i\n", load_cursor) );
774 S_LocalSound ("misc/menu1.wav");
777 load_cursor = MAX_SAVEGAMES-1;
782 S_LocalSound ("misc/menu1.wav");
784 if (load_cursor >= MAX_SAVEGAMES)
791 void M_Save_Key (int k)
796 M_Menu_SinglePlayer_f ();
802 Cbuf_AddText (va("save s%i\n", load_cursor));
807 S_LocalSound ("misc/menu1.wav");
810 load_cursor = MAX_SAVEGAMES-1;
815 S_LocalSound ("misc/menu1.wav");
817 if (load_cursor >= MAX_SAVEGAMES)
823 //=============================================================================
824 /* MULTIPLAYER MENU */
826 int m_multiplayer_cursor;
827 #define MULTIPLAYER_ITEMS 3
830 void M_Menu_MultiPlayer_f (void)
833 m_state = m_multiplayer;
838 void M_MultiPlayer_Draw (void)
843 M_Background(320, 200);
845 M_DrawPic (16, 4, "gfx/qplaque.lmp");
846 p = Draw_CachePic ("gfx/p_multi.lmp");
847 M_DrawPic ( (320-p->width)/2, 4, "gfx/p_multi.lmp");
848 M_DrawPic (72, 32, "gfx/mp_menu.lmp");
850 f = (int)(realtime * 10)%6;
852 M_DrawPic (54, 32 + m_multiplayer_cursor * 20, va("gfx/menudot%i.lmp", f+1));
856 void M_MultiPlayer_Key (int key)
865 S_LocalSound ("misc/menu1.wav");
866 if (++m_multiplayer_cursor >= MULTIPLAYER_ITEMS)
867 m_multiplayer_cursor = 0;
871 S_LocalSound ("misc/menu1.wav");
872 if (--m_multiplayer_cursor < 0)
873 m_multiplayer_cursor = MULTIPLAYER_ITEMS - 1;
878 switch (m_multiplayer_cursor)
882 M_Menu_LanConfig_f ();
892 //=============================================================================
895 int setup_cursor = 4;
896 int setup_cursor_table[] = {40, 56, 80, 104, 140};
898 char setup_hostname[16];
899 char setup_myname[16];
905 #define NUM_SETUP_CMDS 5
907 void M_Menu_Setup_f (void)
912 strcpy(setup_myname, cl_name.string);
913 strcpy(setup_hostname, hostname.string);
914 setup_top = setup_oldtop = cl_color.integer >> 4;
915 setup_bottom = setup_oldbottom = cl_color.integer & 15;
918 static int menuplyr_width, menuplyr_height, menuplyr_top, menuplyr_bottom, menuplyr_load;
919 static qbyte *menuplyr_pixels;
920 static unsigned int *menuplyr_translated;
922 void M_Setup_Draw (void)
927 M_Background(320, 200);
929 M_DrawPic (16, 4, "gfx/qplaque.lmp");
930 p = Draw_CachePic ("gfx/p_multi.lmp");
931 M_DrawPic ( (320-p->width)/2, 4, "gfx/p_multi.lmp");
933 M_Print (64, 40, "Hostname");
934 M_DrawTextBox (160, 32, 16, 1);
935 M_Print (168, 40, setup_hostname);
937 M_Print (64, 56, "Your name");
938 M_DrawTextBox (160, 48, 16, 1);
939 M_Print (168, 56, setup_myname);
941 M_Print (64, 80, "Shirt color");
942 M_Print (64, 104, "Pants color");
944 M_DrawTextBox (64, 140-8, 14, 1);
945 M_Print (72, 140, "Accept Changes");
947 M_DrawPic (160, 64, "gfx/bigbox.lmp");
949 // LordHavoc: rewrote this code greatly
953 menuplyr_load = false;
955 menuplyr_bottom = -1;
956 if ((f = FS_LoadFile("gfx/menuplyr.lmp", true)))
958 data = LoadLMPAs8Bit (f, 0, 0);
959 menuplyr_width = image_width;
960 menuplyr_height = image_height;
962 menuplyr_pixels = Mem_Alloc(menu_mempool, menuplyr_width * menuplyr_height);
963 menuplyr_translated = Mem_Alloc(menu_mempool, menuplyr_width * menuplyr_height * 4);
964 memcpy(menuplyr_pixels, data, menuplyr_width * menuplyr_height);
971 if (menuplyr_top != setup_top || menuplyr_bottom != setup_bottom)
973 menuplyr_top = setup_top;
974 menuplyr_bottom = setup_bottom;
975 M_BuildTranslationTable(menuplyr_top*16, menuplyr_bottom*16);
976 for (i = 0;i < menuplyr_width * menuplyr_height;i++)
977 menuplyr_translated[i] = palette_complete[translationTable[menuplyr_pixels[i]]];
978 Draw_NewPic("gfx/menuplyr.lmp", menuplyr_width, menuplyr_height, true, (qbyte *)menuplyr_translated);
980 M_DrawPic(172, 72, "gfx/menuplyr.lmp");
983 M_DrawCharacter (56, setup_cursor_table [setup_cursor], 12+((int)(realtime*4)&1));
985 if (setup_cursor == 0)
986 M_DrawCharacter (168 + 8*strlen(setup_hostname), setup_cursor_table [setup_cursor], 10+((int)(realtime*4)&1));
988 if (setup_cursor == 1)
989 M_DrawCharacter (168 + 8*strlen(setup_myname), setup_cursor_table [setup_cursor], 10+((int)(realtime*4)&1));
993 void M_Setup_Key (int k)
1000 M_Menu_MultiPlayer_f ();
1004 S_LocalSound ("misc/menu1.wav");
1006 if (setup_cursor < 0)
1007 setup_cursor = NUM_SETUP_CMDS-1;
1011 S_LocalSound ("misc/menu1.wav");
1013 if (setup_cursor >= NUM_SETUP_CMDS)
1018 if (setup_cursor < 2)
1020 S_LocalSound ("misc/menu3.wav");
1021 if (setup_cursor == 2)
1022 setup_top = setup_top - 1;
1023 if (setup_cursor == 3)
1024 setup_bottom = setup_bottom - 1;
1027 if (setup_cursor < 2)
1030 S_LocalSound ("misc/menu3.wav");
1031 if (setup_cursor == 2)
1032 setup_top = setup_top + 1;
1033 if (setup_cursor == 3)
1034 setup_bottom = setup_bottom + 1;
1038 if (setup_cursor == 0 || setup_cursor == 1)
1041 if (setup_cursor == 2 || setup_cursor == 3)
1044 // setup_cursor == 4 (OK)
1045 if (strcmp(cl_name.string, setup_myname) != 0)
1046 Cbuf_AddText ( va ("name \"%s\"\n", setup_myname) );
1047 if (strcmp(hostname.string, setup_hostname) != 0)
1048 Cvar_Set("hostname", setup_hostname);
1049 if (setup_top != setup_oldtop || setup_bottom != setup_oldbottom)
1050 Cbuf_AddText( va ("color %i %i\n", setup_top, setup_bottom) );
1051 m_entersound = true;
1052 M_Menu_MultiPlayer_f ();
1056 if (setup_cursor == 0)
1058 if (strlen(setup_hostname))
1059 setup_hostname[strlen(setup_hostname)-1] = 0;
1062 if (setup_cursor == 1)
1064 if (strlen(setup_myname))
1065 setup_myname[strlen(setup_myname)-1] = 0;
1070 if (k < 32 || k > 127)
1072 if (setup_cursor == 0)
1074 l = strlen(setup_hostname);
1077 setup_hostname[l+1] = 0;
1078 setup_hostname[l] = k;
1081 if (setup_cursor == 1)
1083 l = strlen(setup_myname);
1086 setup_myname[l+1] = 0;
1087 setup_myname[l] = k;
1096 if (setup_bottom > 15)
1098 if (setup_bottom < 0)
1102 //=============================================================================
1105 #define SLIDER_RANGE 10
1107 void M_DrawSlider (int x, int y, float num, float rangemin, float rangemax)
1112 range = bound(0, (num - rangemin) / (rangemax - rangemin), 1);
1113 M_DrawCharacter (x-8, y, 128);
1114 for (i = 0;i < SLIDER_RANGE;i++)
1115 M_DrawCharacter (x + i*8, y, 129);
1116 M_DrawCharacter (x+i*8, y, 130);
1117 M_DrawCharacter (x + (SLIDER_RANGE-1)*8 * range, y, 131);
1118 sprintf(text, "%g", num);
1119 M_Print(x + (SLIDER_RANGE+2) * 8, y, text);
1122 void M_DrawCheckbox (int x, int y, int on)
1125 M_Print (x, y, "on");
1127 M_Print (x, y, "off");
1131 #define OPTIONS_ITEMS 28
1135 void M_Menu_Options_f (void)
1137 key_dest = key_menu;
1138 m_state = m_options;
1139 m_entersound = true;
1142 extern cvar_t gl_delayfinish;
1143 extern cvar_t slowmo;
1144 extern dllhandle_t jpeg_dll;
1146 void M_Menu_Options_AdjustSliders (int dir)
1148 S_LocalSound ("misc/menu3.wav");
1150 switch (options_cursor)
1153 Cvar_SetValueQuick (&scr_2dresolution, bound(0, scr_2dresolution.value + dir * 0.2, 1));
1156 Cvar_SetValueQuick (&scr_viewsize, bound(30, scr_viewsize.value + dir * 10, 120));
1159 if (jpeg_dll != NULL)
1160 Cvar_SetValueQuick (&scr_screenshot_jpeg, !scr_screenshot_jpeg.integer);
1163 Cvar_SetValueQuick (&r_sky, !r_sky.integer);
1166 Cvar_SetValueQuick (&v_overbrightbits, bound(0, v_overbrightbits.integer + dir, 4));
1169 Cvar_SetValueQuick (&gl_combine, !gl_combine.integer);
1172 Cvar_SetValueQuick (&gl_dither, !gl_dither.integer);
1175 Cvar_SetValueQuick (&gl_delayfinish, !gl_delayfinish.integer);
1178 Cvar_SetValueQuick (&slowmo, bound(0, slowmo.value + dir * 0.25, 5));
1180 case 15: // music volume
1182 Cvar_SetValueQuick (&bgmvolume, bound(0, bgmvolume.value + dir * 1.0, 1));
1184 Cvar_SetValueQuick (&bgmvolume, bound(0, bgmvolume.value + dir * 0.1, 1));
1187 case 16: // sfx volume
1188 Cvar_SetValueQuick (&volume, bound(0, volume.value + dir * 0.1, 1));
1191 Cvar_SetValueQuick (&crosshair, bound(0, crosshair.integer + dir, 5));
1194 Cvar_SetValueQuick (&crosshair_size, bound(1, crosshair_size.value + dir, 5));
1196 case 19: // static crosshair
1197 Cvar_SetValueQuick (&crosshair_static, !crosshair_static.integer);
1199 case 20: // show framerate
1200 Cvar_SetValueQuick (&showfps, !showfps.integer);
1202 case 21: // always run
1203 if (cl_forwardspeed.value > 200)
1205 Cvar_SetValueQuick (&cl_forwardspeed, 200);
1206 Cvar_SetValueQuick (&cl_backspeed, 200);
1210 Cvar_SetValueQuick (&cl_forwardspeed, 400);
1211 Cvar_SetValueQuick (&cl_backspeed, 400);
1214 case 22: // lookspring
1215 Cvar_SetValueQuick (&lookspring, !lookspring.integer);
1217 case 23: // lookstrafe
1218 Cvar_SetValueQuick (&lookstrafe, !lookstrafe.integer);
1220 case 24: // mouse speed
1221 Cvar_SetValueQuick (&sensitivity, bound(1, sensitivity.value + dir * 0.5, 50));
1223 case 25: // mouse look
1224 Cvar_SetValueQuick (&freelook, !freelook.integer);
1226 case 26: // invert mouse
1227 Cvar_SetValueQuick (&m_pitch, -m_pitch.value);
1229 case 27: // windowed mouse
1230 Cvar_SetValueQuick (&vid_mouse, !vid_mouse.integer);
1235 void M_Options_Draw (void)
1240 M_Background(320, 240);
1242 M_DrawPic(16, 4, "gfx/qplaque.lmp");
1243 p = Draw_CachePic("gfx/p_option.lmp");
1244 M_DrawPic((320-p->width)/2, 4, "gfx/p_option.lmp");
1247 M_Print(16, y, " Customize controls");y += 8;
1248 M_Print(16, y, " Go to console");y += 8;
1249 M_Print(16, y, " Reset to defaults");y += 8;
1250 M_Print(16, y, " Video Options");y += 8;
1251 M_Print(16, y, " Effects Options");y += 8;
1252 M_Print(16, y, " Color Control Options");y += 8;
1253 M_Print(16, y, " 2D Resolution");M_DrawSlider(220, y, scr_2dresolution.value, 0, 1);y += 8;
1254 M_Print(16, y, " Screen size");M_DrawSlider(220, y, scr_viewsize.value, 30, 120);y += 8;
1255 M_ItemPrint(16, y, " JPEG screenshots", jpeg_dll != NULL);M_DrawCheckbox(220, y, scr_screenshot_jpeg.integer);y += 8;
1256 M_Print(16, y, " Sky");M_DrawCheckbox(220, y, r_sky.integer);y += 8;
1257 M_Print(16, y, " Overbright Bits");M_DrawSlider(220, y, v_overbrightbits.value, 0, 4);y += 8;
1258 M_Print(16, y, " Texture Combine");M_DrawCheckbox(220, y, gl_combine.integer);y += 8;
1259 M_Print(16, y, " Dithering");M_DrawCheckbox(220, y, gl_dither.integer);y += 8;
1260 M_Print(16, y, "Delay refresh (faster)");M_DrawCheckbox(220, y, gl_delayfinish.integer);y += 8;
1261 M_ItemPrint(16, y, " Game Speed", sv.active);M_DrawSlider(220, y, slowmo.value, 0, 5);y += 8;
1262 M_ItemPrint(16, y, " CD Music Volume", cdaudioinitialized);M_DrawSlider(220, y, bgmvolume.value, 0, 1);y += 8;
1263 M_ItemPrint(16, y, " Sound Volume", snd_initialized);M_DrawSlider(220, y, volume.value, 0, 1);y += 8;
1264 M_Print(16, y, " Crosshair");M_DrawSlider(220, y, crosshair.value, 0, 5);y += 8;
1265 M_Print(16, y, " Crosshair Size");M_DrawSlider(220, y, crosshair_size.value, 1, 5);y += 8;
1266 M_Print(16, y, " Static Crosshair");M_DrawCheckbox(220, y, crosshair_static.integer);y += 8;
1267 M_Print(16, y, " Show Framerate");M_DrawCheckbox(220, y, showfps.integer);y += 8;
1268 M_Print(16, y, " Always Run");M_DrawCheckbox(220, y, cl_forwardspeed.value > 200);y += 8;
1269 M_Print(16, y, " Lookspring");M_DrawCheckbox(220, y, lookspring.integer);y += 8;
1270 M_Print(16, y, " Lookstrafe");M_DrawCheckbox(220, y, lookstrafe.integer);y += 8;
1271 M_Print(16, y, " Mouse Speed");M_DrawSlider(220, y, sensitivity.value, 1, 50);y += 8;
1272 M_Print(16, y, " Mouse Look");M_DrawCheckbox(220, y, freelook.integer);y += 8;
1273 M_Print(16, y, " Invert Mouse");M_DrawCheckbox(220, y, m_pitch.value < 0);y += 8;
1274 M_Print(16, y, " Use Mouse");M_DrawCheckbox(220, y, vid_mouse.integer);y += 8;
1277 M_DrawCharacter(200, 32 + options_cursor*8, 12+((int)(realtime*4)&1));
1281 void M_Options_Key (int k)
1290 m_entersound = true;
1291 switch (options_cursor)
1298 key_dest = key_game;
1299 Con_ToggleConsole_f ();
1302 Cbuf_AddText ("exec default.cfg\n");
1308 M_Menu_Options_Effects_f ();
1311 M_Menu_Options_ColorControl_f ();
1314 M_Menu_Options_AdjustSliders (1);
1320 S_LocalSound ("misc/menu1.wav");
1322 if (options_cursor < 0)
1323 options_cursor = OPTIONS_ITEMS-1;
1327 S_LocalSound ("misc/menu1.wav");
1329 if (options_cursor >= OPTIONS_ITEMS)
1334 M_Menu_Options_AdjustSliders (-1);
1338 M_Menu_Options_AdjustSliders (1);
1343 #define OPTIONS_EFFECTS_ITEMS 16
1345 int options_effects_cursor;
1347 void M_Menu_Options_Effects_f (void)
1349 key_dest = key_menu;
1350 m_state = m_options_effects;
1351 m_entersound = true;
1355 extern cvar_t r_detailtextures;
1356 extern cvar_t cl_particles;
1357 extern cvar_t cl_explosions;
1358 extern cvar_t cl_stainmaps;
1359 extern cvar_t r_explosionclip;
1360 extern cvar_t r_dlightmap;
1361 extern cvar_t r_modellights;
1362 extern cvar_t r_coronas;
1363 extern cvar_t gl_flashblend;
1364 extern cvar_t cl_particles_bulletimpacts;
1365 extern cvar_t cl_particles_smoke;
1366 extern cvar_t cl_particles_sparks;
1367 extern cvar_t cl_particles_bubbles;
1368 extern cvar_t cl_particles_blood;
1369 extern cvar_t cl_particles_blood_size;
1370 extern cvar_t cl_particles_blood_alpha;
1372 void M_Menu_Options_Effects_AdjustSliders (int dir)
1374 S_LocalSound ("misc/menu3.wav");
1376 switch (options_effects_cursor)
1379 Cvar_SetValueQuick (&r_modellights, bound(0, r_modellights.value + dir, 8));
1382 Cvar_SetValueQuick (&r_dlightmap, !r_dlightmap.integer);
1385 Cvar_SetValueQuick (&r_coronas, !r_coronas.integer);
1388 Cvar_SetValueQuick (&gl_flashblend, !gl_flashblend.integer);
1391 Cvar_SetValueQuick (&cl_particles, !cl_particles.integer);
1394 Cvar_SetValueQuick (&cl_explosions, !cl_explosions.integer);
1397 Cvar_SetValueQuick (&r_explosionclip, !r_explosionclip.integer);
1400 Cvar_SetValueQuick (&cl_stainmaps, !cl_stainmaps.integer);
1403 Cvar_SetValueQuick (&r_detailtextures, !r_detailtextures.integer);
1406 Cvar_SetValueQuick (&cl_particles_bulletimpacts, !cl_particles_bulletimpacts.integer);
1409 Cvar_SetValueQuick (&cl_particles_smoke, !cl_particles_smoke.integer);
1412 Cvar_SetValueQuick (&cl_particles_sparks, !cl_particles_sparks.integer);
1415 Cvar_SetValueQuick (&cl_particles_bubbles, !cl_particles_bubbles.integer);
1418 Cvar_SetValueQuick (&cl_particles_blood, !cl_particles_blood.integer);
1421 Cvar_SetValueQuick (&cl_particles_blood_size, bound(2, cl_particles_blood_size.value + dir * 1, 20));
1424 Cvar_SetValueQuick (&cl_particles_blood_alpha, bound(0.2, cl_particles_blood_alpha.value + dir * 0.1, 1));
1429 void M_Options_Effects_Draw (void)
1434 M_Background(320, 200);
1436 M_DrawPic(16, 4, "gfx/qplaque.lmp");
1437 p = Draw_CachePic("gfx/p_option.lmp");
1438 M_DrawPic((320-p->width)/2, 4, "gfx/p_option.lmp");
1441 M_Print(16, y, " Lights Per Model");M_DrawSlider(220, y, r_modellights.value, 0, 8);y += 8;
1442 M_Print(16, y, " Fast Dynamic Lighting");M_DrawCheckbox(220, y, !r_dlightmap.integer);y += 8;
1443 M_Print(16, y, " Coronas");M_DrawCheckbox(220, y, r_coronas.integer);y += 8;
1444 M_Print(16, y, " Use Only Coronas");M_DrawCheckbox(220, y, gl_flashblend.integer);y += 8;
1445 M_Print(16, y, " Particles");M_DrawCheckbox(220, y, cl_particles.integer);y += 8;
1446 M_Print(16, y, " Explosions");M_DrawCheckbox(220, y, cl_explosions.integer);y += 8;
1447 M_Print(16, y, " Explosion Clipping");M_DrawCheckbox(220, y, r_explosionclip.integer);y += 8;
1448 M_Print(16, y, " Stainmaps");M_DrawCheckbox(220, y, cl_stainmaps.integer);y += 8;
1449 M_Print(16, y, " Detail Texturing");M_DrawCheckbox(220, y, r_detailtextures.integer);y += 8;
1450 M_Print(16, y, " Bullet Impacts");M_DrawCheckbox(220, y, cl_particles_bulletimpacts.integer);y += 8;
1451 M_Print(16, y, " Smoke");M_DrawCheckbox(220, y, cl_particles_smoke.integer);y += 8;
1452 M_Print(16, y, " Sparks");M_DrawCheckbox(220, y, cl_particles_sparks.integer);y += 8;
1453 M_Print(16, y, " Bubbles");M_DrawCheckbox(220, y, cl_particles_bubbles.integer);y += 8;
1454 M_Print(16, y, " Blood");M_DrawCheckbox(220, y, cl_particles_blood.integer);y += 8;
1455 M_Print(16, y, " Blood Size");M_DrawSlider(220, y, cl_particles_blood_size.value, 2, 20);y += 8;
1456 M_Print(16, y, " Blood Opacity");M_DrawSlider(220, y, cl_particles_blood_alpha.value, 0.2, 1);y += 8;
1459 M_DrawCharacter(200, 32 + options_effects_cursor*8, 12+((int)(realtime*4)&1));
1463 void M_Options_Effects_Key (int k)
1468 M_Menu_Options_f ();
1472 M_Menu_Options_Effects_AdjustSliders (1);
1476 S_LocalSound ("misc/menu1.wav");
1477 options_effects_cursor--;
1478 if (options_effects_cursor < 0)
1479 options_effects_cursor = OPTIONS_EFFECTS_ITEMS-1;
1483 S_LocalSound ("misc/menu1.wav");
1484 options_effects_cursor++;
1485 if (options_effects_cursor >= OPTIONS_EFFECTS_ITEMS)
1486 options_effects_cursor = 0;
1490 M_Menu_Options_Effects_AdjustSliders (-1);
1494 M_Menu_Options_Effects_AdjustSliders (1);
1503 #define OPTIONS_COLORCONTROL_ITEMS 18
1505 int options_colorcontrol_cursor;
1507 // intensity value to match up to 50% dither to 'correct' quake
1508 cvar_t menu_options_colorcontrol_correctionvalue = {0, "menu_options_colorcontrol_correctionvalue", "0.25"};
1510 void M_Menu_Options_ColorControl_f (void)
1512 key_dest = key_menu;
1513 m_state = m_options_colorcontrol;
1514 m_entersound = true;
1518 void M_Menu_Options_ColorControl_AdjustSliders (int dir)
1521 S_LocalSound ("misc/menu3.wav");
1523 switch (options_colorcontrol_cursor)
1526 Cvar_SetValueQuick (&v_hwgamma, !v_hwgamma.integer);
1529 Cvar_SetValueQuick (&v_color_enable, 0);
1530 Cvar_SetValueQuick (&v_gamma, bound(1, v_gamma.value + dir * 0.125, 5));
1533 Cvar_SetValueQuick (&v_color_enable, 0);
1534 Cvar_SetValueQuick (&v_contrast, bound(1, v_contrast.value + dir * 0.125, 5));
1537 Cvar_SetValueQuick (&v_color_enable, 0);
1538 Cvar_SetValueQuick (&v_brightness, bound(0, v_brightness.value + dir * 0.05, 0.8));
1541 Cvar_SetValueQuick (&v_color_enable, !v_color_enable.integer);
1544 Cvar_SetValueQuick (&v_color_enable, 1);
1545 Cvar_SetValueQuick (&v_color_black_r, bound(0, v_color_black_r.value + dir * 0.0125, 0.8));
1548 Cvar_SetValueQuick (&v_color_enable, 1);
1549 Cvar_SetValueQuick (&v_color_black_g, bound(0, v_color_black_g.value + dir * 0.0125, 0.8));
1552 Cvar_SetValueQuick (&v_color_enable, 1);
1553 Cvar_SetValueQuick (&v_color_black_b, bound(0, v_color_black_b.value + dir * 0.0125, 0.8));
1556 Cvar_SetValueQuick (&v_color_enable, 1);
1557 f = bound(0, (v_color_black_r.value + v_color_black_g.value + v_color_black_b.value) / 3 + dir * 0.0125, 0.8);
1558 Cvar_SetValueQuick (&v_color_black_r, f);
1559 Cvar_SetValueQuick (&v_color_black_g, f);
1560 Cvar_SetValueQuick (&v_color_black_b, f);
1563 Cvar_SetValueQuick (&v_color_enable, 1);
1564 Cvar_SetValueQuick (&v_color_grey_r, bound(0, v_color_grey_r.value + dir * 0.0125, 0.95));
1567 Cvar_SetValueQuick (&v_color_enable, 1);
1568 Cvar_SetValueQuick (&v_color_grey_g, bound(0, v_color_grey_g.value + dir * 0.0125, 0.95));
1571 Cvar_SetValueQuick (&v_color_enable, 1);
1572 Cvar_SetValueQuick (&v_color_grey_b, bound(0, v_color_grey_b.value + dir * 0.0125, 0.95));
1575 Cvar_SetValueQuick (&v_color_enable, 1);
1576 f = bound(0, (v_color_grey_r.value + v_color_grey_g.value + v_color_grey_b.value) / 3 + dir * 0.0125, 0.95);
1577 Cvar_SetValueQuick (&v_color_grey_r, f);
1578 Cvar_SetValueQuick (&v_color_grey_g, f);
1579 Cvar_SetValueQuick (&v_color_grey_b, f);
1582 Cvar_SetValueQuick (&v_color_enable, 1);
1583 Cvar_SetValueQuick (&v_color_white_r, bound(1, v_color_white_r.value + dir * 0.125, 5));
1586 Cvar_SetValueQuick (&v_color_enable, 1);
1587 Cvar_SetValueQuick (&v_color_white_g, bound(1, v_color_white_g.value + dir * 0.125, 5));
1590 Cvar_SetValueQuick (&v_color_enable, 1);
1591 Cvar_SetValueQuick (&v_color_white_b, bound(1, v_color_white_b.value + dir * 0.125, 5));
1594 Cvar_SetValueQuick (&v_color_enable, 1);
1595 f = bound(1, (v_color_white_r.value + v_color_white_g.value + v_color_white_b.value) / 3 + dir * 0.125, 5);
1596 Cvar_SetValueQuick (&v_color_white_r, f);
1597 Cvar_SetValueQuick (&v_color_white_g, f);
1598 Cvar_SetValueQuick (&v_color_white_b, f);
1603 void M_Options_ColorControl_Draw (void)
1605 float x, y, c, s, t, u, v;
1608 M_Background(320, 256);
1610 M_DrawPic(16, 4, "gfx/qplaque.lmp");
1611 p = Draw_CachePic("gfx/p_option.lmp");
1612 M_DrawPic((320-p->width)/2, 4, "gfx/p_option.lmp");
1615 M_Print(16, y, " Reset to defaults");y += 8;
1616 M_ItemPrint(16, y, "Hardware Gamma Control", vid_hardwaregammasupported);M_DrawCheckbox(220, y, v_hwgamma.integer);y += 8;
1617 M_ItemPrint(16, y, " Gamma", !v_color_enable.integer && vid_hardwaregammasupported && v_hwgamma.integer);M_DrawSlider(220, y, v_gamma.value, 1, 5);y += 8;
1618 M_ItemPrint(16, y, " Contrast", !v_color_enable.integer);M_DrawSlider(220, y, v_contrast.value, 1, 5);y += 8;
1619 M_ItemPrint(16, y, " Brightness", !v_color_enable.integer);M_DrawSlider(220, y, v_brightness.value, 0, 0.8);y += 8;
1620 M_Print(16, y, " Color Level Controls");M_DrawCheckbox(220, y, v_color_enable.integer);y += 8;
1621 M_ItemPrint(16, y, " Black: Red ", v_color_enable.integer);M_DrawSlider(220, y, v_color_black_r.value, 0, 0.8);y += 8;
1622 M_ItemPrint(16, y, " Black: Green", v_color_enable.integer);M_DrawSlider(220, y, v_color_black_g.value, 0, 0.8);y += 8;
1623 M_ItemPrint(16, y, " Black: Blue ", v_color_enable.integer);M_DrawSlider(220, y, v_color_black_b.value, 0, 0.8);y += 8;
1624 M_ItemPrint(16, y, " Black: Grey ", v_color_enable.integer);M_DrawSlider(220, y, (v_color_black_r.value + v_color_black_g.value + v_color_black_b.value) / 3, 0, 0.8);y += 8;
1625 M_ItemPrint(16, y, " Grey: Red ", v_color_enable.integer && vid_hardwaregammasupported && v_hwgamma.integer);M_DrawSlider(220, y, v_color_grey_r.value, 0, 0.95);y += 8;
1626 M_ItemPrint(16, y, " Grey: Green", v_color_enable.integer && vid_hardwaregammasupported && v_hwgamma.integer);M_DrawSlider(220, y, v_color_grey_g.value, 0, 0.95);y += 8;
1627 M_ItemPrint(16, y, " Grey: Blue ", v_color_enable.integer && vid_hardwaregammasupported && v_hwgamma.integer);M_DrawSlider(220, y, v_color_grey_b.value, 0, 0.95);y += 8;
1628 M_ItemPrint(16, y, " Grey: Grey ", v_color_enable.integer && vid_hardwaregammasupported && v_hwgamma.integer);M_DrawSlider(220, y, (v_color_grey_r.value + v_color_grey_g.value + v_color_grey_b.value) / 3, 0, 0.95);y += 8;
1629 M_ItemPrint(16, y, " White: Red ", v_color_enable.integer);M_DrawSlider(220, y, v_color_white_r.value, 1, 5);y += 8;
1630 M_ItemPrint(16, y, " White: Green", v_color_enable.integer);M_DrawSlider(220, y, v_color_white_g.value, 1, 5);y += 8;
1631 M_ItemPrint(16, y, " White: Blue ", v_color_enable.integer);M_DrawSlider(220, y, v_color_white_b.value, 1, 5);y += 8;
1632 M_ItemPrint(16, y, " White: Grey ", v_color_enable.integer);M_DrawSlider(220, y, (v_color_white_r.value + v_color_white_g.value + v_color_white_b.value) / 3, 1, 5);y += 8;
1635 DrawQ_Fill(menu_x, menu_y + y, 320, 4 + 64 + 8 + 64 + 4, 0, 0, 0, 1, 0);y += 4;
1636 s = (float) 312 / 2 * vid.realwidth / vid.conwidth;
1637 t = (float) 4 / 2 * vid.realheight / vid.conheight;
1638 DrawQ_SuperPic(menu_x + 4, menu_y + y, "gfx/colorcontrol/ditherpattern.tga", 312, 4, 0,0, 1,0,0,1, s,0, 1,0,0,1, 0,t, 1,0,0,1, s,t, 1,0,0,1, 0);y += 4;
1639 DrawQ_SuperPic(menu_x + 4, menu_y + y, NULL , 312, 4, 0,0, 0,0,0,1, 1,0, 1,0,0,1, 0,1, 0,0,0,1, 1,1, 1,0,0,1, 0);y += 4;
1640 DrawQ_SuperPic(menu_x + 4, menu_y + y, "gfx/colorcontrol/ditherpattern.tga", 312, 4, 0,0, 0,1,0,1, s,0, 0,1,0,1, 0,t, 0,1,0,1, s,t, 0,1,0,1, 0);y += 4;
1641 DrawQ_SuperPic(menu_x + 4, menu_y + y, NULL , 312, 4, 0,0, 0,0,0,1, 1,0, 0,1,0,1, 0,1, 0,0,0,1, 1,1, 0,1,0,1, 0);y += 4;
1642 DrawQ_SuperPic(menu_x + 4, menu_y + y, "gfx/colorcontrol/ditherpattern.tga", 312, 4, 0,0, 0,0,1,1, s,0, 0,0,1,1, 0,t, 0,0,1,1, s,t, 0,0,1,1, 0);y += 4;
1643 DrawQ_SuperPic(menu_x + 4, menu_y + y, NULL , 312, 4, 0,0, 0,0,0,1, 1,0, 0,0,1,1, 0,1, 0,0,0,1, 1,1, 0,0,1,1, 0);y += 4;
1644 DrawQ_SuperPic(menu_x + 4, menu_y + y, "gfx/colorcontrol/ditherpattern.tga", 312, 4, 0,0, 1,1,1,1, s,0, 1,1,1,1, 0,t, 1,1,1,1, s,t, 1,1,1,1, 0);y += 4;
1645 DrawQ_SuperPic(menu_x + 4, menu_y + y, NULL , 312, 4, 0,0, 0,0,0,1, 1,0, 1,1,1,1, 0,1, 0,0,0,1, 1,1, 1,1,1,1, 0);y += 4;
1647 c = menu_options_colorcontrol_correctionvalue.value; // intensity value that should be matched up to a 50% dither to 'correct' quake
1648 s = (float) 48 / 2 * vid.realwidth / vid.conwidth;
1649 t = (float) 48 / 2 * vid.realheight / vid.conheight;
1654 DrawQ_Fill(menu_x + x, menu_y + y, 64, 48, c, 0, 0, 1, 0);
1655 DrawQ_SuperPic(menu_x + x + 16, menu_y + y + 16, "gfx/colorcontrol/ditherpattern.tga", 16, 16, 0,0, 1,0,0,1, s,0, 1,0,0,1, 0,t, 1,0,0,1, s,t, 1,0,0,1, 0);
1656 DrawQ_SuperPic(menu_x + x + 32, menu_y + y + 16, "gfx/colorcontrol/ditherpattern.tga", 16, 16, 0,0, 1,0,0,1, u,0, 1,0,0,1, 0,v, 1,0,0,1, u,v, 1,0,0,1, 0);
1658 DrawQ_Fill(menu_x + x, menu_y + y, 64, 48, 0, c, 0, 1, 0);
1659 DrawQ_SuperPic(menu_x + x + 16, menu_y + y + 16, "gfx/colorcontrol/ditherpattern.tga", 16, 16, 0,0, 0,1,0,1, s,0, 0,1,0,1, 0,t, 0,1,0,1, s,t, 0,1,0,1, 0);
1660 DrawQ_SuperPic(menu_x + x + 32, menu_y + y + 16, "gfx/colorcontrol/ditherpattern.tga", 16, 16, 0,0, 0,1,0,1, u,0, 0,1,0,1, 0,v, 0,1,0,1, u,v, 0,1,0,1, 0);
1662 DrawQ_Fill(menu_x + x, menu_y + y, 64, 48, 0, 0, c, 1, 0);
1663 DrawQ_SuperPic(menu_x + x + 16, menu_y + y + 16, "gfx/colorcontrol/ditherpattern.tga", 16, 16, 0,0, 0,0,1,1, s,0, 0,0,1,1, 0,t, 0,0,1,1, s,t, 0,0,1,1, 0);
1664 DrawQ_SuperPic(menu_x + x + 32, menu_y + y + 16, "gfx/colorcontrol/ditherpattern.tga", 16, 16, 0,0, 0,0,1,1, u,0, 0,0,1,1, 0,v, 0,0,1,1, u,v, 0,0,1,1, 0);
1666 DrawQ_Fill(menu_x + x, menu_y + y, 64, 48, c, c, c, 1, 0);
1667 DrawQ_SuperPic(menu_x + x + 16, menu_y + y + 16, "gfx/colorcontrol/ditherpattern.tga", 16, 16, 0,0, 1,1,1,1, s,0, 1,1,1,1, 0,t, 1,1,1,1, s,t, 1,1,1,1, 0);
1668 DrawQ_SuperPic(menu_x + x + 32, menu_y + y + 16, "gfx/colorcontrol/ditherpattern.tga", 16, 16, 0,0, 1,1,1,1, u,0, 1,1,1,1, 0,v, 1,1,1,1, u,v, 1,1,1,1, 0);
1671 M_DrawCharacter(200, 32 + options_colorcontrol_cursor*8, 12+((int)(realtime*4)&1));
1675 void M_Options_ColorControl_Key (int k)
1684 m_entersound = true;
1685 switch (options_colorcontrol_cursor)
1688 Cvar_SetValueQuick(&v_hwgamma, 1);
1689 Cvar_SetValueQuick(&v_gamma, 1);
1690 Cvar_SetValueQuick(&v_contrast, 1);
1691 Cvar_SetValueQuick(&v_brightness, 0);
1692 Cvar_SetValueQuick(&v_color_enable, 0);
1693 Cvar_SetValueQuick(&v_color_black_r, 0);
1694 Cvar_SetValueQuick(&v_color_black_g, 0);
1695 Cvar_SetValueQuick(&v_color_black_b, 0);
1696 Cvar_SetValueQuick(&v_color_grey_r, 0);
1697 Cvar_SetValueQuick(&v_color_grey_g, 0);
1698 Cvar_SetValueQuick(&v_color_grey_b, 0);
1699 Cvar_SetValueQuick(&v_color_white_r, 1);
1700 Cvar_SetValueQuick(&v_color_white_g, 1);
1701 Cvar_SetValueQuick(&v_color_white_b, 1);
1702 Cbuf_AddText ("exec default.cfg\n");
1705 M_Menu_Options_ColorControl_AdjustSliders (1);
1711 S_LocalSound ("misc/menu1.wav");
1712 options_colorcontrol_cursor--;
1713 if (options_colorcontrol_cursor < 0)
1714 options_colorcontrol_cursor = OPTIONS_COLORCONTROL_ITEMS-1;
1718 S_LocalSound ("misc/menu1.wav");
1719 options_colorcontrol_cursor++;
1720 if (options_colorcontrol_cursor >= OPTIONS_COLORCONTROL_ITEMS)
1721 options_colorcontrol_cursor = 0;
1725 M_Menu_Options_ColorControl_AdjustSliders (-1);
1729 M_Menu_Options_ColorControl_AdjustSliders (1);
1735 //=============================================================================
1738 char *quakebindnames[][2] =
1740 {"+attack", "attack"},
1741 {"impulse 10", "next weapon"},
1742 {"impulse 12", "previous weapon"},
1743 {"+jump", "jump / swim up"},
1744 {"+forward", "walk forward"},
1745 {"+back", "backpedal"},
1746 {"+left", "turn left"},
1747 {"+right", "turn right"},
1749 {"+moveleft", "step left"},
1750 {"+moveright", "step right"},
1751 {"+strafe", "sidestep"},
1752 {"+lookup", "look up"},
1753 {"+lookdown", "look down"},
1754 {"centerview", "center view"},
1755 {"+mlook", "mouse look"},
1756 {"+klook", "keyboard look"},
1757 {"+moveup", "swim up"},
1758 {"+movedown", "swim down"}
1761 char *transfusionbindnames[][2] =
1763 {"+forward", "walk forward"},
1764 {"+back", "backpedal"},
1765 {"+left", "turn left"},
1766 {"+right", "turn right"},
1767 {"+moveleft", "step left"},
1768 {"+moveright", "step right"},
1769 {"+jump", "jump / swim up"},
1770 {"+movedown", "swim down"},
1771 {"+attack", "attack"},
1772 {"+button3", "altfire"},
1773 {"impulse 1", "Pitch Fork"},
1774 {"impulse 2", "Flare Gun"},
1775 {"impulse 3", "Shotgun"},
1776 {"impulse 4", "Machine Gun"},
1777 {"impulse 5", "Incinerator"},
1778 {"impulse 6", "Bombs"},
1779 {"impulse 7", "Aerosol Can"},
1780 {"impulse 8", "Tesla Cannon"},
1781 {"impulse 9", "Life Leech"},
1782 {"impulse 17", "Voodoo Doll"},
1783 {"impulse 11", "previous weapon"},
1784 {"impulse 10", "next weapon"},
1785 {"impulse 14", "previous item"},
1786 {"impulse 15", "next item"},
1787 {"impulse 13", "use item"},
1788 {"impulse 100", "add bot (red)"},
1789 {"impulse 101", "add bot (blue)"},
1790 {"impulse 102", "kick a bot"},
1791 {"impulse 50", "voting menu"},
1792 {"impulse 141", "identify player"},
1793 {"impulse 16", "next armor type"},
1794 {"impulse 20", "observer mode"}
1798 char *(*bindnames)[2];
1801 typedef struct binditem_s
1803 char *command, *description;
1804 struct binditem_s *next;
1808 typedef struct bindcategory_s
1812 struct bindcategory_s *next;
1816 bindcategory_t *bindcategories = NULL;
1818 void M_ClearBinds (void)
1820 for (c = bindcategories;c;c = cnext)
1823 for (b = c->binds;b;b = bnext)
1830 bindcategories = NULL;
1833 void M_AddBindToCategory(bindcategory_t *c, char *command, char *description)
1835 for (b = &c->binds;*b;*b = &(*b)->next);
1836 *b = Z_Alloc(sizeof(binditem_t) + strlen(command) + 1 + strlen(description) + 1);
1837 *b->command = (char *)((*b) + 1);
1838 *b->description = *b->command + strlen(command) + 1;
1839 strcpy(*b->command, command);
1840 strcpy(*b->description, description);
1843 void M_AddBind (char *category, char *command, char *description)
1845 for (c = &bindcategories;*c;c = &(*c)->next)
1847 if (!strcmp(category, (*c)->name))
1849 M_AddBindToCategory(*c, command, description);
1853 *c = Z_Alloc(sizeof(bindcategory_t));
1854 M_AddBindToCategory(*c, command, description);
1857 void M_DefaultBinds (void)
1860 M_AddBind("movement", "+jump", "jump / swim up");
1861 M_AddBind("movement", "+forward", "walk forward");
1862 M_AddBind("movement", "+back", "backpedal");
1863 M_AddBind("movement", "+left", "turn left");
1864 M_AddBind("movement", "+right", "turn right");
1865 M_AddBind("movement", "+speed", "run");
1866 M_AddBind("movement", "+moveleft", "step left");
1867 M_AddBind("movement", "+moveright", "step right");
1868 M_AddBind("movement", "+strafe", "sidestep");
1869 M_AddBind("movement", "+lookup", "look up");
1870 M_AddBind("movement", "+lookdown", "look down");
1871 M_AddBind("movement", "centerview", "center view");
1872 M_AddBind("movement", "+mlook", "mouse look");
1873 M_AddBind("movement", "+klook", "keyboard look");
1874 M_AddBind("movement", "+moveup", "swim up");
1875 M_AddBind("movement", "+movedown", "swim down");
1876 M_AddBind("weapons", "+attack", "attack");
1877 M_AddBind("weapons", "impulse 10", "next weapon");
1878 M_AddBind("weapons", "impulse 12", "previous weapon");
1879 M_AddBind("weapons", "impulse 1", "select weapon 1 (axe)");
1880 M_AddBind("weapons", "impulse 2", "select weapon 2 (shotgun)");
1881 M_AddBind("weapons", "impulse 3", "select weapon 3 (super )");
1882 M_AddBind("weapons", "impulse 4", "select weapon 4 (nailgun)");
1883 M_AddBind("weapons", "impulse 5", "select weapon 5 (super nailgun)");
1884 M_AddBind("weapons", "impulse 6", "select weapon 6 (grenade launcher)");
1885 M_AddBind("weapons", "impulse 7", "select weapon 7 (rocket launcher)");
1886 M_AddBind("weapons", "impulse 8", "select weapon 8 (lightning gun)");
1894 void M_Menu_Keys_f (void)
1896 key_dest = key_menu;
1898 m_entersound = true;
1903 void M_FindKeysForCommand (char *command, int *keys)
1909 for (j = 0;j < NUMKEYS;j++)
1914 for (j=0 ; j<256 ; j++)
1919 if (!strcmp (b, command) )
1922 if (count == NUMKEYS)
1928 void M_UnbindCommand (char *command)
1933 for (j=0 ; j<256 ; j++)
1938 if (!strcmp (b, command))
1939 Key_SetBinding (j, "");
1944 void M_Keys_Draw (void)
1950 char keystring[1024];
1952 M_Background(320, 200);
1954 p = Draw_CachePic ("gfx/ttl_cstm.lmp");
1955 M_DrawPic ( (320-p->width)/2, 4, "gfx/ttl_cstm.lmp");
1958 M_Print (12, 32, "Press a key or button for this action");
1960 M_Print (18, 32, "Enter to change, backspace to clear");
1962 // search for known bindings
1963 for (i=0 ; i<numcommands ; i++)
1967 M_Print (16, y, bindnames[i][1]);
1969 M_FindKeysForCommand (bindnames[i][0], keys);
1971 // LordHavoc: redesigned to print more than 2 keys, inspired by Tomaz's MiniRacer
1973 strcpy(keystring, "???");
1977 for (j = 0;j < NUMKEYS;j++)
1982 strcat(keystring, " or ");
1983 strcat(keystring, Key_KeynumToString (keys[j]));
1987 M_Print (150, y, keystring);
1991 M_DrawCharacter (140, 48 + keys_cursor*8, '=');
1993 M_DrawCharacter (140, 48 + keys_cursor*8, 12+((int)(realtime*4)&1));
1997 void M_Keys_Key (int k)
2004 S_LocalSound ("misc/menu1.wav");
2009 else //if (k != '`')
2011 sprintf (cmd, "bind \"%s\" \"%s\"\n", Key_KeynumToString (k), bindnames[keys_cursor][0]);
2012 Cbuf_InsertText (cmd);
2022 M_Menu_Options_f ();
2027 S_LocalSound ("misc/menu1.wav");
2029 if (keys_cursor < 0)
2030 keys_cursor = numcommands-1;
2035 S_LocalSound ("misc/menu1.wav");
2037 if (keys_cursor >= numcommands)
2041 case K_ENTER: // go into bind mode
2042 M_FindKeysForCommand (bindnames[keys_cursor][0], keys);
2043 S_LocalSound ("misc/menu2.wav");
2044 if (keys[NUMKEYS - 1] != -1)
2045 M_UnbindCommand (bindnames[keys_cursor][0]);
2049 case K_BACKSPACE: // delete bindings
2050 case K_DEL: // delete bindings
2051 S_LocalSound ("misc/menu2.wav");
2052 M_UnbindCommand (bindnames[keys_cursor][0]);
2057 //=============================================================================
2060 #define VIDEO_ITEMS 5
2062 int video_cursor = 0;
2063 int video_cursor_table[] = {56, 68, 80, 92, 116};
2064 // note: if modes are added to the beginning of this list, update the
2065 // video_resolution = x; in M_Menu_Video_f below
2066 unsigned short video_resolutions[][2] = {{320,240}, {400,300}, {512,384}, {640,480}, {800,600}, {1024,768}, {1152,864}, {1280,960}, {1280,1024}, {1600,1200}, {1792,1344}, {1920,1440}, {2048,1536}};
2067 int video_resolution;
2069 extern int current_vid_fullscreen;
2070 extern int current_vid_width;
2071 extern int current_vid_height;
2072 extern int current_vid_bitsperpixel;
2073 extern int current_vid_stencil;
2076 void M_Menu_Video_f (void)
2078 key_dest = key_menu;
2080 m_entersound = true;
2082 // Look for the current resolution
2083 for (video_resolution = 0; video_resolution < (int) (sizeof (video_resolutions) / sizeof (video_resolutions[0])); video_resolution++)
2085 if (video_resolutions[video_resolution][0] == current_vid_width &&
2086 video_resolutions[video_resolution][1] == current_vid_height)
2090 // Default to 800x600 if we didn't find it
2091 if (video_resolution == sizeof (video_resolutions) / sizeof (video_resolutions[0]))
2093 // may need to update this number if mode list changes
2094 video_resolution = 4;
2095 Cvar_SetValueQuick (&vid_width, video_resolutions[video_resolution][0]);
2096 Cvar_SetValueQuick (&vid_height, video_resolutions[video_resolution][1]);
2101 void M_Video_Draw (void)
2106 M_Background(320, 200);
2108 M_DrawPic(16, 4, "gfx/qplaque.lmp");
2109 p = Draw_CachePic("gfx/vidmodes.lmp");
2110 M_DrawPic((320-p->width)/2, 4, "gfx/vidmodes.lmp");
2113 M_Print(16, video_cursor_table[0], " Resolution");
2114 string = va("%dx%d", video_resolutions[video_resolution][0], video_resolutions[video_resolution][1]);
2115 M_Print (220, video_cursor_table[0], string);
2118 M_Print(16, video_cursor_table[1], " Bits per pixel");
2119 M_Print (220, video_cursor_table[1], (vid_bitsperpixel.integer == 32) ? "32" : "16");
2122 M_Print(16, video_cursor_table[2], " Fullscreen");
2123 M_DrawCheckbox(220, video_cursor_table[2], vid_fullscreen.integer);
2126 M_Print(16, video_cursor_table[3], " Stencil");
2127 M_DrawCheckbox(220, video_cursor_table[3], vid_stencil.integer);
2130 M_Print(220, video_cursor_table[4], "Apply");
2133 M_DrawCharacter(200, video_cursor_table[video_cursor], 12+((int)(realtime*4)&1));
2137 void M_Menu_Video_AdjustSliders (int dir)
2139 S_LocalSound ("misc/menu3.wav");
2141 switch (video_cursor)
2146 int new_resolution = video_resolution + dir;
2147 if (new_resolution < 0)
2148 video_resolution = sizeof (video_resolutions) / sizeof (video_resolutions[0]) - 1;
2149 else if (new_resolution > (int) (sizeof (video_resolutions) / sizeof (video_resolutions[0]) - 1))
2150 video_resolution = 0;
2152 video_resolution = new_resolution;
2154 Cvar_SetValueQuick (&vid_width, video_resolutions[video_resolution][0]);
2155 Cvar_SetValueQuick (&vid_height, video_resolutions[video_resolution][1]);
2161 Cvar_SetValueQuick (&vid_bitsperpixel, (vid_bitsperpixel.integer == 32) ? 16 : 32);
2164 Cvar_SetValueQuick (&vid_fullscreen, !vid_fullscreen.integer);
2167 Cvar_SetValueQuick (&vid_stencil, !vid_stencil.integer);
2173 void M_Video_Key (int key)
2178 // vid_shared.c has a copy of the current video config. We restore it
2179 Cvar_SetValueQuick(&vid_fullscreen, current_vid_fullscreen);
2180 Cvar_SetValueQuick(&vid_width, current_vid_width);
2181 Cvar_SetValueQuick(&vid_height, current_vid_height);
2182 Cvar_SetValueQuick(&vid_bitsperpixel, current_vid_bitsperpixel);
2183 Cvar_SetValueQuick(&vid_stencil, current_vid_stencil);
2185 S_LocalSound ("misc/menu1.wav");
2186 M_Menu_Options_f ();
2190 m_entersound = true;
2191 switch (video_cursor)
2194 Cbuf_AddText ("vid_restart\n");
2195 M_Menu_Options_f ();
2198 M_Menu_Video_AdjustSliders (1);
2203 S_LocalSound ("misc/menu1.wav");
2205 if (video_cursor < 0)
2206 video_cursor = VIDEO_ITEMS-1;
2210 S_LocalSound ("misc/menu1.wav");
2212 if (video_cursor >= VIDEO_ITEMS)
2217 M_Menu_Video_AdjustSliders (-1);
2221 M_Menu_Video_AdjustSliders (1);
2226 //=============================================================================
2230 #define NUM_HELP_PAGES 6
2233 void M_Menu_Help_f (void)
2235 key_dest = key_menu;
2237 m_entersound = true;
2243 void M_Help_Draw (void)
2245 M_Background(320, 200);
2246 M_DrawPic (0, 0, va("gfx/help%i.lmp", help_page));
2250 void M_Help_Key (int key)
2260 m_entersound = true;
2261 if (++help_page >= NUM_HELP_PAGES)
2267 m_entersound = true;
2268 if (--help_page < 0)
2269 help_page = NUM_HELP_PAGES-1;
2275 //=============================================================================
2279 int m_quit_prevstate;
2280 qboolean wasInMenus;
2282 char *quitMessage [] =
2284 /* .........1.........2.... */
2286 " Are you gonna quit ",
2287 " this game just like ",
2288 " everything else? ",
2291 " Milord, methinks that ",
2292 " thou art a lowly ",
2293 " quitter. Is this true? ",
2296 " Do I need to bust your ",
2297 " face open for trying ",
2301 " Man, I oughta smack you",
2302 " for trying to quit! ",
2306 " Press Y to quit like a ",
2307 " big loser in life. ",
2308 " Press N to stay proud ",
2309 " and successful! ",
2311 " If you press Y to ",
2312 " quit, I will summon ",
2313 " Satan all over your ",
2316 " Um, Asmodeus dislikes ",
2317 " his children trying to ",
2318 " quit. Press Y to return",
2319 " to your Tinkertoys. ",
2321 " If you quit now, I'll ",
2322 " throw a blanket-party ",
2323 " for you next time! ",
2327 /* .........1.........2.... */
2329 " Tired of fragging ",
2334 " Quit now and forfeit ",
2335 " your bodycount? ",
2339 " Are you sure you ",
2344 " Off to do something ",
2349 void M_Menu_Quit_f (void)
2351 if (m_state == m_quit)
2353 wasInMenus = (key_dest == key_menu);
2354 key_dest = key_menu;
2355 m_quit_prevstate = m_state;
2357 m_entersound = true;
2358 msgNumber = rand()&3; //&7;
2362 void M_Quit_Key (int key)
2371 m_state = m_quit_prevstate;
2372 m_entersound = true;
2376 key_dest = key_game;
2393 void M_Quit_Draw (void)
2395 M_Background(208, 48);
2396 M_DrawTextBox(0, 0, 24, 4);
2397 M_Print(8, 8, quitMessage[msgNumber*4+0]);
2398 M_Print(8, 16, quitMessage[msgNumber*4+1]);
2399 M_Print(8, 24, quitMessage[msgNumber*4+2]);
2400 M_Print(8, 32, quitMessage[msgNumber*4+3]);
2403 //=============================================================================
2404 /* LAN CONFIG MENU */
2406 int lanConfig_cursor = -1;
2407 int lanConfig_cursor_table [] = {56, 76, 112};
2408 #define NUM_LANCONFIG_CMDS 3
2411 char lanConfig_portname[6];
2412 char lanConfig_joinname[22];
2414 void M_Menu_LanConfig_f (void)
2416 key_dest = key_menu;
2417 m_state = m_lanconfig;
2418 m_entersound = true;
2419 if (lanConfig_cursor == -1)
2422 lanConfig_cursor = 1;
2425 lanConfig_cursor = 1;
2426 lanConfig_port = 26000;
2427 sprintf(lanConfig_portname, "%u", lanConfig_port);
2429 m_return_reason[0] = 0;
2433 void M_LanConfig_Draw (void)
2440 M_Background(320, 200);
2442 M_DrawPic (16, 4, "gfx/qplaque.lmp");
2443 p = Draw_CachePic ("gfx/p_multi.lmp");
2444 basex = (320-p->width)/2;
2445 M_DrawPic (basex, 4, "gfx/p_multi.lmp");
2448 startJoin = "New Game";
2450 startJoin = "Join Game";
2451 protocol = "TCP/IP";
2452 M_Print (basex, 32, va ("%s - %s", startJoin, protocol));
2455 M_Print (basex, lanConfig_cursor_table[0], "Port");
2456 M_DrawTextBox (basex+8*8, lanConfig_cursor_table[0]-8, 6, 1);
2457 M_Print (basex+9*8, lanConfig_cursor_table[0], lanConfig_portname);
2461 M_Print (basex, lanConfig_cursor_table[1], "Search for games...");
2462 M_Print (basex, lanConfig_cursor_table[2]-16, "Join game at:");
2463 M_DrawTextBox (basex+8, lanConfig_cursor_table[2]-8, 22, 1);
2464 M_Print (basex+16, lanConfig_cursor_table[2], lanConfig_joinname);
2468 M_DrawTextBox (basex, lanConfig_cursor_table[1]-8, 2, 1);
2469 M_Print (basex+8, lanConfig_cursor_table[1], "OK");
2472 M_DrawCharacter (basex-8, lanConfig_cursor_table [lanConfig_cursor], 12+((int)(realtime*4)&1));
2474 if (lanConfig_cursor == 0)
2475 M_DrawCharacter (basex+9*8 + 8*strlen(lanConfig_portname), lanConfig_cursor_table [0], 10+((int)(realtime*4)&1));
2477 if (lanConfig_cursor == 2)
2478 M_DrawCharacter (basex+16 + 8*strlen(lanConfig_joinname), lanConfig_cursor_table [2], 10+((int)(realtime*4)&1));
2480 if (*m_return_reason)
2481 M_PrintWhite (basex, 168, m_return_reason);
2485 void M_LanConfig_Key (int key)
2492 M_Menu_MultiPlayer_f ();
2496 S_LocalSound ("misc/menu1.wav");
2498 if (lanConfig_cursor < 0)
2499 lanConfig_cursor = NUM_LANCONFIG_CMDS-1;
2503 S_LocalSound ("misc/menu1.wav");
2505 if (lanConfig_cursor >= NUM_LANCONFIG_CMDS)
2506 lanConfig_cursor = 0;
2510 if (lanConfig_cursor == 0)
2513 m_entersound = true;
2515 Cbuf_AddText ("stopdemo\n");
2517 Cvar_SetValue("port", lanConfig_port);
2519 if (lanConfig_cursor == 1)
2523 M_Menu_GameOptions_f ();
2526 M_Menu_ServerList_f();
2530 if (lanConfig_cursor == 2)
2531 Cbuf_AddText ( va ("connect \"%s\"\n", lanConfig_joinname) );
2535 if (lanConfig_cursor == 0)
2537 if (strlen(lanConfig_portname))
2538 lanConfig_portname[strlen(lanConfig_portname)-1] = 0;
2541 if (lanConfig_cursor == 2)
2543 if (strlen(lanConfig_joinname))
2544 lanConfig_joinname[strlen(lanConfig_joinname)-1] = 0;
2549 if (key < 32 || key > 127)
2552 if (lanConfig_cursor == 2)
2554 l = strlen(lanConfig_joinname);
2557 lanConfig_joinname[l+1] = 0;
2558 lanConfig_joinname[l] = key;
2562 if (key < '0' || key > '9')
2564 if (lanConfig_cursor == 0)
2566 l = strlen(lanConfig_portname);
2569 lanConfig_portname[l+1] = 0;
2570 lanConfig_portname[l] = key;
2575 if (StartingGame && lanConfig_cursor == 2)
2577 if (key == K_UPARROW)
2578 lanConfig_cursor = 1;
2580 lanConfig_cursor = 0;
2583 l = atoi(lanConfig_portname);
2586 sprintf(lanConfig_portname, "%u", lanConfig_port);
2589 //=============================================================================
2590 /* GAME OPTIONS MENU */
2609 episode_t *episodes;
2614 level_t quakelevels[] =
2616 {"start", "Entrance"}, // 0
2618 {"e1m1", "Slipgate Complex"}, // 1
2619 {"e1m2", "Castle of the Damned"},
2620 {"e1m3", "The Necropolis"},
2621 {"e1m4", "The Grisly Grotto"},
2622 {"e1m5", "Gloom Keep"},
2623 {"e1m6", "The Door To Chthon"},
2624 {"e1m7", "The House of Chthon"},
2625 {"e1m8", "Ziggurat Vertigo"},
2627 {"e2m1", "The Installation"}, // 9
2628 {"e2m2", "Ogre Citadel"},
2629 {"e2m3", "Crypt of Decay"},
2630 {"e2m4", "The Ebon Fortress"},
2631 {"e2m5", "The Wizard's Manse"},
2632 {"e2m6", "The Dismal Oubliette"},
2633 {"e2m7", "Underearth"},
2635 {"e3m1", "Termination Central"}, // 16
2636 {"e3m2", "The Vaults of Zin"},
2637 {"e3m3", "The Tomb of Terror"},
2638 {"e3m4", "Satan's Dark Delight"},
2639 {"e3m5", "Wind Tunnels"},
2640 {"e3m6", "Chambers of Torment"},
2641 {"e3m7", "The Haunted Halls"},
2643 {"e4m1", "The Sewage System"}, // 23
2644 {"e4m2", "The Tower of Despair"},
2645 {"e4m3", "The Elder God Shrine"},
2646 {"e4m4", "The Palace of Hate"},
2647 {"e4m5", "Hell's Atrium"},
2648 {"e4m6", "The Pain Maze"},
2649 {"e4m7", "Azure Agony"},
2650 {"e4m8", "The Nameless City"},
2652 {"end", "Shub-Niggurath's Pit"}, // 31
2654 {"dm1", "Place of Two Deaths"}, // 32
2655 {"dm2", "Claustrophobopolis"},
2656 {"dm3", "The Abandoned Base"},
2657 {"dm4", "The Bad Place"},
2658 {"dm5", "The Cistern"},
2659 {"dm6", "The Dark Zone"}
2662 episode_t quakeepisodes[] =
2664 {"Welcome to Quake", 0, 1},
2665 {"Doomed Dimension", 1, 8},
2666 {"Realm of Black Magic", 9, 7},
2667 {"Netherworld", 16, 7},
2668 {"The Elder World", 23, 8},
2669 {"Final Level", 31, 1},
2670 {"Deathmatch Arena", 32, 6}
2673 //MED 01/06/97 added hipnotic levels
2674 level_t hipnoticlevels[] =
2676 {"start", "Command HQ"}, // 0
2678 {"hip1m1", "The Pumping Station"}, // 1
2679 {"hip1m2", "Storage Facility"},
2680 {"hip1m3", "The Lost Mine"},
2681 {"hip1m4", "Research Facility"},
2682 {"hip1m5", "Military Complex"},
2684 {"hip2m1", "Ancient Realms"}, // 6
2685 {"hip2m2", "The Black Cathedral"},
2686 {"hip2m3", "The Catacombs"},
2687 {"hip2m4", "The Crypt"},
2688 {"hip2m5", "Mortum's Keep"},
2689 {"hip2m6", "The Gremlin's Domain"},
2691 {"hip3m1", "Tur Torment"}, // 12
2692 {"hip3m2", "Pandemonium"},
2693 {"hip3m3", "Limbo"},
2694 {"hip3m4", "The Gauntlet"},
2696 {"hipend", "Armagon's Lair"}, // 16
2698 {"hipdm1", "The Edge of Oblivion"} // 17
2701 //MED 01/06/97 added hipnotic episodes
2702 episode_t hipnoticepisodes[] =
2704 {"Scourge of Armagon", 0, 1},
2705 {"Fortress of the Dead", 1, 5},
2706 {"Dominion of Darkness", 6, 6},
2707 {"The Rift", 12, 4},
2708 {"Final Level", 16, 1},
2709 {"Deathmatch Arena", 17, 1}
2712 //PGM 01/07/97 added rogue levels
2713 //PGM 03/02/97 added dmatch level
2714 level_t roguelevels[] =
2716 {"start", "Split Decision"},
2717 {"r1m1", "Deviant's Domain"},
2718 {"r1m2", "Dread Portal"},
2719 {"r1m3", "Judgement Call"},
2720 {"r1m4", "Cave of Death"},
2721 {"r1m5", "Towers of Wrath"},
2722 {"r1m6", "Temple of Pain"},
2723 {"r1m7", "Tomb of the Overlord"},
2724 {"r2m1", "Tempus Fugit"},
2725 {"r2m2", "Elemental Fury I"},
2726 {"r2m3", "Elemental Fury II"},
2727 {"r2m4", "Curse of Osiris"},
2728 {"r2m5", "Wizard's Keep"},
2729 {"r2m6", "Blood Sacrifice"},
2730 {"r2m7", "Last Bastion"},
2731 {"r2m8", "Source of Evil"},
2732 {"ctf1", "Division of Change"}
2735 //PGM 01/07/97 added rogue episodes
2736 //PGM 03/02/97 added dmatch episode
2737 episode_t rogueepisodes[] =
2739 {"Introduction", 0, 1},
2740 {"Hell's Fortress", 1, 7},
2741 {"Corridors of Time", 8, 8},
2742 {"Deathmatch Arena", 16, 1}
2745 level_t nehahralevels[] =
2747 {"nehstart", "Welcome to Nehahra"},
2748 {"neh1m1", "Forge City1: Slipgates"},
2749 {"neh1m2", "Forge City2: Boiler"},
2750 {"neh1m3", "Forge City3: Escape"},
2751 {"neh1m4", "Grind Core"},
2752 {"neh1m5", "Industrial Silence"},
2753 {"neh1m6", "Locked-Up Anger"},
2754 {"neh1m7", "Wanderer of the Wastes"},
2755 {"neh1m8", "Artemis System Net"},
2756 {"neh1m9", "To the Death"},
2757 {"neh2m1", "The Gates of Ghoro"},
2758 {"neh2m2", "Sacred Trinity"},
2759 {"neh2m3", "Realm of the Ancients"},
2760 {"neh2m4", "Temple of the Ancients"},
2761 {"neh2m5", "Dreams Made Flesh"},
2762 {"neh2m6", "Your Last Cup of Sorrow"},
2763 {"nehsec", "Ogre's Bane"},
2764 {"nehahra", "Nehahra's Den"},
2765 {"nehend", "Quintessence"}
2768 episode_t nehahraepisodes[] =
2770 {"Welcome to Nehahra", 0, 1},
2771 {"The Fall of Forge", 1, 9},
2772 {"The Outlands", 10, 7},
2773 {"Dimension of the Lost", 17, 2}
2776 // Map list for Transfusion
2777 level_t transfusionlevels[] =
2779 {"bb1", "The Stronghold"},
2780 {"bb2", "Winter Wonderland"},
2782 {"bb4", "The Tower"},
2784 {"bb6", "Twin Fortress"},
2786 {"bb8", "Fun With Heads"},
2788 {"e1m1", "Cradle to Grave"},
2789 {"e1m2", "Wrong Side of the Tracks"},
2790 {"e1m7", "Altar of Stone"},
2791 {"e2m8", "The Lair of Shial"},
2792 {"e3m7", "The Pit of Cerberus"},
2793 {"e4m8", "The Hall of the Epiphany"},
2794 {"e4m9", "Mall of the Dead"},
2796 {"dm1", "Monolith Building 11"},
2799 {"e6m1", "Welcome to Your Life"},
2800 {"e6m8", "Beauty and the Beast"},
2802 {"cpbb01", "Crypt of Despair"},
2803 {"cpbb03", "Unholy Cathedral"},
2805 {"b2a15", "Area 15 (B2)"},
2806 {"barena", "Blood Arena"},
2807 {"bkeep", "Blood Keep"},
2808 {"bstar", "Brown Star"},
2809 {"crypt", "The Crypt"},
2811 {"bb3_2k1", "Bodies Infusion"},
2812 {"dcamp", "DeathCamp"},
2813 {"highnoon", "HighNoon"},
2814 {"qbb1", "The Confluence"},
2815 {"qbb2", "KathartiK"},
2816 {"qbb3", "Caleb's Woodland Retreat"},
2818 {"dranzbb6", "Black Coffee"},
2819 {"fragm", "Frag'M"},
2821 {"qe1m7", "The House of Chthon"},
2822 {"simple", "Dead Simple"}
2825 episode_t transfusionepisodes[] =
2828 {"Blood Single Player", 8, 7},
2829 {"Plasma Pack", 15, 5},
2830 {"Cryptic Passage", 20, 2},
2832 {"Transfusion", 27, 6},
2833 {"Conversions", 33, 5}
2836 gamelevels_t sharewarequakegame = {"Shareware Quake", quakelevels, quakeepisodes, 2};
2837 gamelevels_t registeredquakegame = {"Quake", quakelevels, quakeepisodes, 7};
2838 gamelevels_t hipnoticgame = {"Scourge of Armagon", hipnoticlevels, hipnoticepisodes, 6};
2839 gamelevels_t roguegame = {"Dissolution of Eternity", roguelevels, rogueepisodes, 4};
2840 gamelevels_t nehahragame = {"Nehahra", nehahralevels, nehahraepisodes, 4};
2841 gamelevels_t transfusiongame = {"Transfusion", transfusionlevels, transfusionepisodes, 7};
2846 gamelevels_t *notregistered;
2847 gamelevels_t *registered;
2851 gameinfo_t gamelist[] =
2853 {GAME_NORMAL, &sharewarequakegame, ®isteredquakegame},
2854 {GAME_HIPNOTIC, &hipnoticgame, &hipnoticgame},
2855 {GAME_ROGUE, &roguegame, &roguegame},
2856 {GAME_NEHAHRA, &nehahragame, &nehahragame},
2857 {GAME_TRANSFUSION, &transfusiongame, &transfusiongame},
2858 {-1, &sharewarequakegame, ®isteredquakegame} // final fallback
2861 gamelevels_t *lookupgameinfo(void)
2864 for (i = 0;gamelist[i].gameid >= 0 && gamelist[i].gameid != gamemode;i++);
2865 if (registered.integer)
2866 return gamelist[i].registered;
2868 return gamelist[i].notregistered;
2874 qboolean m_serverInfoMessage = false;
2875 double m_serverInfoMessageTime;
2877 extern cvar_t sv_public;
2879 void M_Menu_GameOptions_f (void)
2881 key_dest = key_menu;
2882 m_state = m_gameoptions;
2883 m_entersound = true;
2884 if (maxplayers == 0)
2885 maxplayers = svs.maxclients;
2887 maxplayers = MAX_SCOREBOARD;
2891 int gameoptions_cursor_table[] = {40, 56, 64, 72, 80, 88, 96, 104, 120, 128};
2892 #define NUM_GAMEOPTIONS 10
2893 int gameoptions_cursor;
2895 void M_GameOptions_Draw (void)
2901 M_Background(320, 200);
2903 M_DrawPic (16, 4, "gfx/qplaque.lmp");
2904 p = Draw_CachePic ("gfx/p_multi.lmp");
2905 M_DrawPic ( (320-p->width)/2, 4, "gfx/p_multi.lmp");
2907 M_DrawTextBox (152, 32, 10, 1);
2908 M_Print (160, 40, "begin game");
2910 M_Print (0, 56, " Max players");
2911 M_Print (160, 56, va("%i", maxplayers) );
2913 M_Print (0, 64, " Game Type");
2914 if (gamemode == GAME_TRANSFUSION)
2916 if (!deathmatch.integer)
2917 Cvar_SetValue("deathmatch", 1);
2918 if (deathmatch.integer == 2)
2919 M_Print (160, 64, "Capture the Flag");
2921 M_Print (160, 64, "Blood Bath");
2925 if (!coop.integer && !deathmatch.integer)
2926 Cvar_SetValue("deathmatch", 1);
2928 M_Print (160, 64, "Cooperative");
2930 M_Print (160, 64, "Deathmatch");
2933 M_Print (0, 72, " Teamplay");
2934 if (gamemode == GAME_ROGUE)
2938 switch((int)teamplay.integer)
2940 case 1: msg = "No Friendly Fire"; break;
2941 case 2: msg = "Friendly Fire"; break;
2942 case 3: msg = "Tag"; break;
2943 case 4: msg = "Capture the Flag"; break;
2944 case 5: msg = "One Flag CTF"; break;
2945 case 6: msg = "Three Team CTF"; break;
2946 default: msg = "Off"; break;
2948 M_Print (160, 72, msg);
2950 else if (gamemode == GAME_TRANSFUSION)
2954 switch (teamplay.integer)
2956 case 0: msg = "Off"; break;
2957 case 2: msg = "Friendly Fire"; break;
2958 default: msg = "No Friendly Fire"; break;
2960 M_Print (160, 72, msg);
2966 switch((int)teamplay.integer)
2968 case 1: msg = "No Friendly Fire"; break;
2969 case 2: msg = "Friendly Fire"; break;
2970 default: msg = "Off"; break;
2972 M_Print (160, 72, msg);
2975 M_Print (0, 80, " Skill");
2976 if (skill.integer == 0)
2977 M_Print (160, 80, "Easy difficulty");
2978 else if (skill.integer == 1)
2979 M_Print (160, 80, "Normal difficulty");
2980 else if (skill.integer == 2)
2981 M_Print (160, 80, "Hard difficulty");
2983 M_Print (160, 80, "Nightmare difficulty");
2985 M_Print (0, 88, " Frag Limit");
2986 if (fraglimit.integer == 0)
2987 M_Print (160, 88, "none");
2989 M_Print (160, 88, va("%i frags", fraglimit.integer));
2991 M_Print (0, 96, " Time Limit");
2992 if (timelimit.integer == 0)
2993 M_Print (160, 96, "none");
2995 M_Print (160, 96, va("%i minutes", timelimit.integer));
2997 M_Print (0, 104, " Public server");
2998 M_Print (160, 104, (sv_public.integer == 0) ? "no" : "yes");
3000 g = lookupgameinfo();
3002 M_Print (0, 120, " Episode");
3003 M_Print (160, 120, g->episodes[startepisode].description);
3005 M_Print (0, 128, " Level");
3006 M_Print (160, 128, g->levels[g->episodes[startepisode].firstLevel + startlevel].description);
3007 M_Print (160, 136, g->levels[g->episodes[startepisode].firstLevel + startlevel].name);
3010 M_DrawCharacter (144, gameoptions_cursor_table[gameoptions_cursor], 12+((int)(realtime*4)&1));
3012 if (m_serverInfoMessage)
3014 if ((realtime - m_serverInfoMessageTime) < 5.0)
3017 M_DrawTextBox (x, 138, 24, 4);
3019 M_Print (x, 146, " More than 64 players?? ");
3020 M_Print (x, 154, " First, question your ");
3021 M_Print (x, 162, " sanity, then email ");
3022 M_Print (x, 170, " havoc@telefragged.com ");
3026 m_serverInfoMessage = false;
3032 void M_NetStart_Change (int dir)
3037 switch (gameoptions_cursor)
3041 if (maxplayers > MAX_SCOREBOARD)
3043 maxplayers = MAX_SCOREBOARD;
3044 m_serverInfoMessage = true;
3045 m_serverInfoMessageTime = realtime;
3052 if (gamemode == GAME_TRANSFUSION)
3054 if (deathmatch.integer == 2) // changing from CTF to BloodBath
3055 Cvar_SetValueQuick (&deathmatch, 0);
3056 else // changing from BloodBath to CTF
3057 Cvar_SetValueQuick (&deathmatch, 2);
3061 if (deathmatch.integer) // changing from deathmatch to coop
3063 Cvar_SetValueQuick (&coop, 1);
3064 Cvar_SetValueQuick (&deathmatch, 0);
3066 else // changing from coop to deathmatch
3068 Cvar_SetValueQuick (&coop, 0);
3069 Cvar_SetValueQuick (&deathmatch, 1);
3075 if (gamemode == GAME_ROGUE)
3080 Cvar_SetValueQuick (&teamplay, teamplay.integer + dir);
3081 if (teamplay.integer > count)
3082 Cvar_SetValueQuick (&teamplay, 0);
3083 else if (teamplay.integer < 0)
3084 Cvar_SetValueQuick (&teamplay, count);
3088 Cvar_SetValueQuick (&skill, skill.integer + dir);
3089 if (skill.integer > 3)
3090 Cvar_SetValueQuick (&skill, 0);
3091 if (skill.integer < 0)
3092 Cvar_SetValueQuick (&skill, 3);
3096 Cvar_SetValueQuick (&fraglimit, fraglimit.integer + dir*10);
3097 if (fraglimit.integer > 100)
3098 Cvar_SetValueQuick (&fraglimit, 0);
3099 if (fraglimit.integer < 0)
3100 Cvar_SetValueQuick (&fraglimit, 100);
3104 Cvar_SetValueQuick (&timelimit, timelimit.value + dir*5);
3105 if (timelimit.value > 60)
3106 Cvar_SetValueQuick (&timelimit, 0);
3107 if (timelimit.value < 0)
3108 Cvar_SetValueQuick (&timelimit, 60);
3112 Cvar_SetValueQuick (&sv_public, !sv_public.integer);
3116 startepisode += dir;
3117 g = lookupgameinfo();
3119 if (startepisode < 0)
3120 startepisode = g->numepisodes - 1;
3122 if (startepisode >= g->numepisodes)
3130 g = lookupgameinfo();
3133 startlevel = g->episodes[startepisode].levels - 1;
3135 if (startlevel >= g->episodes[startepisode].levels)
3141 void M_GameOptions_Key (int key)
3148 M_Menu_MultiPlayer_f ();
3152 S_LocalSound ("misc/menu1.wav");
3153 gameoptions_cursor--;
3154 if (gameoptions_cursor < 0)
3155 gameoptions_cursor = NUM_GAMEOPTIONS-1;
3159 S_LocalSound ("misc/menu1.wav");
3160 gameoptions_cursor++;
3161 if (gameoptions_cursor >= NUM_GAMEOPTIONS)
3162 gameoptions_cursor = 0;
3166 if (gameoptions_cursor == 0)
3168 S_LocalSound ("misc/menu3.wav");
3169 M_NetStart_Change (-1);
3173 if (gameoptions_cursor == 0)
3175 S_LocalSound ("misc/menu3.wav");
3176 M_NetStart_Change (1);
3180 S_LocalSound ("misc/menu2.wav");
3181 if (gameoptions_cursor == 0)
3184 Cbuf_AddText ("disconnect\n");
3185 Cbuf_AddText ( va ("maxplayers %u\n", maxplayers) );
3187 g = lookupgameinfo();
3188 Cbuf_AddText ( va ("map %s\n", g->levels[g->episodes[startepisode].firstLevel + startlevel].name) );
3192 M_NetStart_Change (1);
3197 //=============================================================================
3202 void M_Menu_ServerList_f (void)
3204 key_dest = key_menu;
3206 m_entersound = true;
3208 m_return_reason[0] = 0;
3213 void M_ServerList_Draw (void)
3215 int n, y, visible, start, end;
3218 // use as much vertical space as available
3219 M_Background(640, vid.conheight);
3220 // scroll the list as the cursor moves
3221 visible = (vid.conheight - 16 - 32) / 8;
3222 start = bound(0, slist_cursor - (visible >> 1), hostCacheCount - visible);
3223 end = min(start + visible, hostCacheCount);
3225 p = Draw_CachePic("gfx/p_multi.lmp");
3226 M_DrawPic((640 - p->width) / 2, 4, "gfx/p_multi.lmp");
3228 for (n = start;n < end;n++)
3230 M_Print(0, y, hostcache[n].line1);y += 8;
3231 M_Print(0, y, hostcache[n].line2);y += 8;
3233 M_DrawCharacter(0, 32 + (slist_cursor - start) * 16, 12+((int)(realtime*4)&1));
3235 if (*m_return_reason)
3236 M_PrintWhite(16, vid.conheight - 8, m_return_reason);
3240 void M_ServerList_Key(int k)
3245 M_Menu_LanConfig_f();
3254 S_LocalSound("misc/menu1.wav");
3256 if (slist_cursor < 0)
3257 slist_cursor = hostCacheCount - 1;
3262 S_LocalSound("misc/menu1.wav");
3264 if (slist_cursor >= hostCacheCount)
3269 S_LocalSound("misc/menu2.wav");
3270 Cbuf_AddText(va("connect \"%s\"\n", hostcache[slist_cursor].cname));
3279 //=============================================================================
3280 /* Menu Subsystem */
3285 menu_mempool = Mem_AllocPool("Menu");
3286 menuplyr_load = true;
3287 menuplyr_pixels = NULL;
3289 Cmd_AddCommand ("togglemenu", M_ToggleMenu_f);
3291 Cmd_AddCommand ("menu_main", M_Menu_Main_f);
3292 Cmd_AddCommand ("menu_singleplayer", M_Menu_SinglePlayer_f);
3293 Cmd_AddCommand ("menu_load", M_Menu_Load_f);
3294 Cmd_AddCommand ("menu_save", M_Menu_Save_f);
3295 Cmd_AddCommand ("menu_multiplayer", M_Menu_MultiPlayer_f);
3296 Cmd_AddCommand ("menu_setup", M_Menu_Setup_f);
3297 Cmd_AddCommand ("menu_options", M_Menu_Options_f);
3298 Cmd_AddCommand ("menu_options_effects", M_Menu_Options_Effects_f);
3299 Cmd_AddCommand ("menu_options_colorcontrol", M_Menu_Options_ColorControl_f);
3300 Cvar_RegisterVariable (&menu_options_colorcontrol_correctionvalue);
3301 Cmd_AddCommand ("menu_keys", M_Menu_Keys_f);
3302 Cmd_AddCommand ("menu_video", M_Menu_Video_f);
3303 Cmd_AddCommand ("help", M_Menu_Help_f);
3304 Cmd_AddCommand ("menu_quit", M_Menu_Quit_f);
3306 if (gamemode == GAME_TRANSFUSION)
3308 numcommands = sizeof(transfusionbindnames) / sizeof(transfusionbindnames[0]);
3309 bindnames = transfusionbindnames;
3313 numcommands = sizeof(quakebindnames) / sizeof(quakebindnames[0]);
3314 bindnames = quakebindnames;
3317 if (gamemode == GAME_NEHAHRA)
3319 if (FS_FileExists("maps/neh1m4.bsp"))
3321 if (FS_FileExists("hearing.dem"))
3323 Con_Printf("Nehahra movie and game detected.\n");
3324 NehGameType = TYPE_BOTH;
3328 Con_Printf("Nehahra game detected.\n");
3329 NehGameType = TYPE_GAME;
3334 if (FS_FileExists("hearing.dem"))
3336 Con_Printf("Nehahra movie detected.\n");
3337 NehGameType = TYPE_DEMO;
3341 Con_Printf("Nehahra not found.\n");
3342 NehGameType = TYPE_GAME; // could just complain, but...
3350 if (key_dest != key_menu)
3352 if (m_state == m_none)
3368 case m_singleplayer:
3369 M_SinglePlayer_Draw ();
3381 M_MultiPlayer_Draw ();
3392 case m_options_effects:
3393 M_Options_Effects_Draw ();
3396 case m_options_colorcontrol:
3397 M_Options_ColorControl_Draw ();
3417 M_LanConfig_Draw ();
3421 M_GameOptions_Draw ();
3425 M_ServerList_Draw ();
3431 S_LocalSound ("misc/menu2.wav");
3432 m_entersound = false;
3439 void M_Keydown (int key)
3454 case m_singleplayer:
3455 M_SinglePlayer_Key (key);
3467 M_MultiPlayer_Key (key);
3475 M_Options_Key (key);
3478 case m_options_effects:
3479 M_Options_Effects_Key (key);
3482 case m_options_colorcontrol:
3483 M_Options_ColorControl_Key (key);
3503 M_LanConfig_Key (key);
3507 M_GameOptions_Key (key);
3511 M_ServerList_Key (key);