Subversion Repositories eduke32

Rev

Rev 4623 | Rev 4645 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 Plagman 1
//-------------------------------------------------------------------------
2
/*
1652 terminx 3
Copyright (C) 2010 EDuke32 developers and contributors
5 Plagman 4
 
1652 terminx 5
This file is part of EDuke32.
5 Plagman 6
 
7
EDuke32 is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License version 2
9
as published by the Free Software Foundation.
10
 
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 
15
See the GNU General Public License for more details.
16
 
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
4541 hendricks2 19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
5 Plagman 20
*/
21
//-------------------------------------------------------------------------
22
 
23
#include "duke3d.h"
2290 helixhorne 24
#include "net.h"
25
#include "player.h"
5 Plagman 26
#include "mouse.h"
2728 hendricks2 27
#include "joystick.h"
5 Plagman 28
#include "osd.h"
911 terminx 29
#include "osdcmds.h"
1215 terminx 30
#include "gamedef.h"
1677 terminx 31
#include "gameexec.h"
32
#include "savegame.h"
33
#include "premap.h"
1678 terminx 34
#include "demo.h"
4387 terminx 35
#include "xxhash.h"
2556 helixhorne 36
#include "common.h"
2726 hendricks2 37
#include "common_game.h"
2728 hendricks2 38
#include "input.h"
3084 terminx 39
#include "menus.h"
1707 terminx 40
 
5 Plagman 41
#include <sys/stat.h>
42
 
4449 helixhorne 43
int32_t g_skillSoundVoice = -1;
5 Plagman 44
 
1205 terminx 45
extern int32_t voting;
147 terminx 46
 
921 terminx 47
#define USERMAPENTRYLENGTH 25
48
 
1604 terminx 49
#define mgametext(x,y,t,s,dabits) G_PrintGameText(2,STARTALPHANUM, x,y,t,s,0,dabits,0, 0, xdim-1, ydim-1, 65536)
50
#define mgametextpal(x,y,t,s,p) G_PrintGameText(2,STARTALPHANUM, x,y,t,s,p,26,0, 0, xdim-1, ydim-1, 65536)
1037 terminx 51
 
4496 hendricks2 52
 
53
 
54
int32_t menutext_(int32_t x,int32_t y,int32_t s,int32_t p,char *t,int32_t bits)
5 Plagman 55
{
4496 hendricks2 56
    vec2_t dim;
57
    int32_t f = TEXT_BIGALPHANUM|TEXT_UPPERCASE|TEXT_LITERALESCAPE;
5 Plagman 58
 
4496 hendricks2 59
    if (x == 160)
60
        f |= TEXT_XCENTER;
3101 hendricks2 61
 
4496 hendricks2 62
    dim = G_ScreenText(BIGALPHANUM, x, y-12, 65536L, 0, 0, t, s, p, bits, 0, 5, 16, 0, 0, f, 0, 0, xdim-1, ydim-1);
3101 hendricks2 63
 
4496 hendricks2 64
    return dim.x;
3101 hendricks2 65
}
3084 terminx 66
 
4496 hendricks2 67
#pragma pack(push,1)
68
static savehead_t savehead;
69
//static struct savehead_ savehead;
70
#pragma pack(pop)
71
 
72
static void M_DrawBackground(void)
3101 hendricks2 73
{
4550 hendricks2 74
    rotatesprite_fs(160<<16,100<<16,65536L,0,MENUSCREEN,16,0,10+64);
4496 hendricks2 75
}
3101 hendricks2 76
 
4549 hendricks2 77
static void M_DrawTopBar(void)
78
{
79
    rotatesprite_fs(160<<16,19<<16,65536L,0,MENUBAR,16,0,10);
80
}
3101 hendricks2 81
 
4549 hendricks2 82
static void M_DrawTopBarCaption(const char *caption)
4496 hendricks2 83
{
4624 terminx 84
    char *s = Bstrdup(caption), p = Bstrlen(caption)-1;
85
    if (s[p] == ':') s[p] = 0;
86
    menutext(160,24,0,0,s);
87
    Bfree(s);
5 Plagman 88
}
89
 
4496 hendricks2 90
extern int32_t g_quitDeadline;
5 Plagman 91
 
92
 
93
 
94
 
1631 terminx 95
 
2728 hendricks2 96
 
5 Plagman 97
 
2313 helixhorne 98
 
5 Plagman 99
 
2313 helixhorne 100
 
101
 
102
 
103
 
4496 hendricks2 104
/*
105
All MAKE_* macros are generally for the purpose of keeping state initialization
106
separate from actual data. Alternatively, they can serve to factor out repetitive
107
stuff and keep the important bits from getting lost to our eyes.
4506 hendricks2 108
 
109
They serve as a stand-in for C++ default value constructors, since we're using C89.
4496 hendricks2 110
*/
2313 helixhorne 111
 
112
 
4496 hendricks2 113
// common font types
114
// tilenums are set after namesdyn runs
115
static MenuTextType_t MF_Redfont          = { -1, 10, 0,  1,  5<<16, 15<<16,  0<<16, 0<<16, TEXT_BIGALPHANUM | TEXT_UPPERCASE, };
4609 terminx 116
static MenuTextType_t MF_RedfontRt        = { -1, 10, 0,  1,  5<<16, 15<<16,  0<<16, 0<<16, TEXT_BIGALPHANUM | TEXT_UPPERCASE | TEXT_XRIGHT, };
4496 hendricks2 117
static MenuTextType_t MF_RedfontBlue      = { -1, 10, 1,  1,  5<<16, 15<<16,  0<<16, 0<<16, TEXT_BIGALPHANUM | TEXT_UPPERCASE, };
118
static MenuTextType_t MF_RedfontGreen     = { -1, 10, 8,  1,  5<<16, 15<<16,  0<<16, 0<<16, TEXT_BIGALPHANUM | TEXT_UPPERCASE, };
4609 terminx 119
static MenuTextType_t MF_Bluefont         = { -1, 10, 0,  16, 5<<16,  7<<16, -1<<16, 0<<16, TEXT_YBOTTOM, };
120
static MenuTextType_t MF_BluefontRed      = { -1, 10, 10, 16, 5<<16,  7<<16, -1<<16, 0<<16, TEXT_YBOTTOM, };
4496 hendricks2 121
static MenuTextType_t MF_Minifont         = { -1, 10, 0,  16, 4<<16,  5<<16,  1<<16, 1<<16, 0, };
122
static MenuTextType_t MF_MinifontRed      = { -1, 16, 21, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0, };
123
static MenuTextType_t MF_MinifontDarkGray = { -1, 10, 13, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0, };
2313 helixhorne 124
 
125
 
4496 hendricks2 126
// common positions
127
#define MENU_MARGIN_REGULAR 40
128
#define MENU_MARGIN_WIDE    32
129
#define MENU_MARGIN_CENTER  160
130
#define MENU_HEIGHT_CENTER  100
2313 helixhorne 131
 
4609 terminx 132
 
133
static MenuPos_t MP_TOP_MAIN =             { { MENU_MARGIN_CENTER<<16,       55<<16, }, 0,     4<<16,  0,       -170<<16, 110<<16, 65536, };
134
static MenuPos_t MP_TOP_EPISODE =          { { MENU_MARGIN_CENTER<<16,       48<<16, }, 4<<16, 7<<16,  0,       -190<<16, 110<<16, 65536, };
135
static MenuPos_t MP_TOP_SKILL =            { { MENU_MARGIN_CENTER<<16,       58<<16, }, 0,     7<<16, 0,       -190<<16, 110<<16, 65536, };
136
static MenuPos_t MP_TOP_OPTIONS =          { { MENU_MARGIN_CENTER<<16,       38<<16, }, 0,     7<<16,  0,       -190<<16, 110<<16, 65536, };
137
static MenuPos_t MP_TOP_JOYSTICK_NETWORK = { { MENU_MARGIN_CENTER<<16,       70<<16, }, 0,     7<<16,  0,       -190<<16, 110<<16, 65536, };
138
static MenuPos_t MP_BIGOPTIONS =           { { MENU_MARGIN_WIDE<<16,         38<<16, }, 2<<16, 4<<16,  190<<16, -190<<16,  20<<16, 65536, };
139
static MenuPos_t MP_BIGOPTIONSRT =         { { MENU_MARGIN_WIDE<<16,         38<<16, }, 2<<16, 4<<16,  260<<16, -190<<16,  20<<16, 65536, };
4496 hendricks2 140
static MenuPos_t MP_OPTIONS =              { { MENU_MARGIN_WIDE<<16,         37<<16, }, 4<<16, 1<<16,  216<<16, 160<<16,  10<<16, 32768, };
141
static MenuPos_t MP_PLAYER_1 =             { { MENU_MARGIN_WIDE<<16,         37<<16, }, 4<<16, 1<<16,   90<<16, 160<<16,  10<<16, 32768, };
142
static MenuPos_t MP_PLAYER_2 =             { { MENU_MARGIN_WIDE<<16,         37<<16, }, 8<<16, 1<<16,   90<<16, 160<<16,  10<<16, 32768, };
143
static MenuPos_t MP_PLAYER_3 =             { { MENU_MARGIN_WIDE<<16,         37<<16, }, 8<<16, 1<<16,  190<<16, 160<<16,  10<<16, 32768, };
144
static MenuPos_t MP_MACROS =               { { 26<<16,                       40<<16, }, 4<<16, 2<<16,    1<<16, 160<<16,  10<<16, 32768, };
4609 terminx 145
static MenuPos_t MP_VIDEOSETUP =           { { MENU_MARGIN_REGULAR<<16,      38<<16, }, 6<<16, 7<<16,  168<<16, -190<<16,  20<<16, 65536, };
146
static MenuPos_t MP_VIDEOSETUP_APPLY =     { { (MENU_MARGIN_REGULAR+16)<<16, 38<<16, }, 6<<16, 7<<16,  168<<16, -190<<16,  36<<16, 65536, };
4496 hendricks2 147
static MenuPos_t MP_KEYBOARDSETUPFUNCS =   { { 70<<16,                       34<<16, }, 4<<16, 3<<16,  100<<16, 151<<16,  10<<16, 32768, };
148
static MenuPos_t MP_KEYBOARDSETUP =        { { MENU_MARGIN_CENTER<<16,       37<<16, }, 4<<16, 0<<16,  0,       160<<16,  92<<16, 32768, };
149
static MenuPos_t MP_MOUSEJOYSETUPBTNS =    { { 76<<16,                       34<<16, }, 4<<16, 3<<16,  100<<16, 143<<16,  10<<16, 32768, };
150
static MenuPos_t MP_GAMEFUNCLIST =         { { 100<<16,                      51<<16, }, 4<<16, 3<<16,  100<<16, 152<<16,  10<<16, 32768, };
151
static MenuPos_t MP_MOUSESETUP =           { { MENU_MARGIN_REGULAR<<16,      37<<16, }, 4<<16, 2<<16,  200<<16, 160<<16,  10<<16, 32768, };
152
static MenuPos_t MP_COLCORR =              { { MENU_MARGIN_REGULAR<<16,      86<<16, }, 8<<16, 2<<16, -240<<16, 190<<16,  20<<16, 65536, };
153
static MenuPos_t MP_REDSLIDE =             { { MENU_MARGIN_WIDE<<16,         37<<16, }, 8<<16, 2<<16,  170<<16, 190<<16,  20<<16, 65536, };
154
static MenuPos_t MP_LOADSAVE =             { { 223<<16,                      48<<16, }, 4<<16, 7<<16,    1<<16, 320<<16,  20<<16, 65536, };
155
static MenuPos_t MP_NETSETUP =             { { (MENU_MARGIN_REGULAR-4)<<16,  38<<16, }, 4<<16, 2<<16,  114<<16, 190<<16,  20<<16, 65536, };
4609 terminx 156
static MenuPos_t MP_ADULTMODE =            { { (MENU_MARGIN_REGULAR+20)<<16, 54<<16, }, 4<<16, 4<<16,  200<<16, -190<<16,  20<<16, 65536, };
2313 helixhorne 157
 
158
 
4496 hendricks2 159
// common menu option sets
160
#define MAKE_MENUOPTIONSET(a, b, c) { a, b, c, ARRAY_SIZE(b), &MP_GAMEFUNCLIST, -1, 0, }
161
#define MAKE_MENUOPTIONSETLIST(a, b, c, d) { a, b, c, ARRAY_SIZE(b), d, -1, 0, }
162
#define MAKE_MENUOPTIONSETDYN(...) { __VA_ARGS__, &MP_GAMEFUNCLIST, -1, 0, }
163
#define MAKE_MENUOPTIONSETDYNLIST(...) { __VA_ARGS__, -1, 0, }
2313 helixhorne 164
 
4496 hendricks2 165
static char *MEOSN_OffOn[] = { "Off", "On", };
166
static MenuOptionSet_t MEOS_OffOn = MAKE_MENUOPTIONSET( 0x3, MEOSN_OffOn, NULL );
167
static char *MEOSN_OnOff[] = { "On", "Off", };
168
static MenuOptionSet_t MEOS_OnOff = MAKE_MENUOPTIONSET( 0x3, MEOSN_OnOff, NULL );
169
static char *MEOSN_NoYes[] = { "No", "Yes", };
170
static MenuOptionSet_t MEOS_NoYes = MAKE_MENUOPTIONSET( 0x3, MEOSN_NoYes, NULL );
171
static char *MEOSN_YesNo[] = { "Yes", "No", };
172
static MenuOptionSet_t MEOS_YesNo = MAKE_MENUOPTIONSET( 0x3, MEOSN_YesNo, NULL );
2313 helixhorne 173
 
5 Plagman 174
 
4496 hendricks2 175
static char MenuGameFuncs[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
176
static char *MenuGameFuncNone = "  -None-";
177
static char *MEOSN_Gamefuncs[NUMGAMEFUNCTIONS+1];
178
static MenuOptionSet_t MEOS_Gamefuncs = MAKE_MENUOPTIONSET( 0x1, MEOSN_Gamefuncs, NULL );
2313 helixhorne 179
 
5 Plagman 180
 
181
 
4496 hendricks2 182
/*
183
MenuEntry_t and MenuGroup_t are passed in arrays of pointers so that the callback function
184
that is called when an entry is modified or activated can test equality of the current
185
entry/group pointer directly against the known ones, instead of relying on an ID number.
5 Plagman 186
 
4496 hendricks2 187
That way, individual menu entries/groups can be ifdef'd out painlessly.
188
*/
2728 hendricks2 189
 
4496 hendricks2 190
static MenuLink_t MEO_NULL = { MENU_NULL, };
191
static const char* MenuCustom = "Custom";
2728 hendricks2 192
 
4496 hendricks2 193
#define MAKE_MENUSTRING(...) { __VA_ARGS__, NULL, }
194
#define MAKE_MENUOPTION(...) { __VA_ARGS__, -1, }
195
#define MAKE_MENURANGE(...) { __VA_ARGS__, }
196
#define MAKE_MENUENTRY(...) { __VA_ARGS__, 0, 0, 0, }
2728 hendricks2 197
 
4496 hendricks2 198
#define MAKE_MENU_TOP_ENTRYLINK(EntryName, LinkID, Title) \
199
static MenuLink_t MEO_ ## EntryName = { LinkID, };\
200
static MenuEntry_t ME_ ## EntryName = MAKE_MENUENTRY( &MF_Redfont, Title, Link, &MEO_ ## EntryName )
2728 hendricks2 201
 
202
 
4496 hendricks2 203
MAKE_MENU_TOP_ENTRYLINK( MAIN_NEWGAME, MENU_EPISODE, "New Game" );
204
MAKE_MENU_TOP_ENTRYLINK( MAIN_NEWGAME_INGAME, MENU_NEWVERIFY, "New Game" );
205
static MenuLink_t MEO_MAIN_NEWGAME_NETWORK = { MENU_NETWORK, };
206
MAKE_MENU_TOP_ENTRYLINK( MAIN_SAVEGAME, MENU_SAVE, "Save Game" );
207
MAKE_MENU_TOP_ENTRYLINK( MAIN_LOADGAME, MENU_LOAD, "Load Game" );
208
MAKE_MENU_TOP_ENTRYLINK( MAIN_OPTIONS, MENU_OPTIONS, "Options" );
209
MAKE_MENU_TOP_ENTRYLINK( MAIN_HELP, MENU_STORY, "Help" );
210
MAKE_MENU_TOP_ENTRYLINK( MAIN_CREDITS, MENU_CREDITS, "Credits" );
211
MAKE_MENU_TOP_ENTRYLINK( MAIN_QUITTOTITLE, MENU_QUITTOTITLE, "Quit To Title" );
212
MAKE_MENU_TOP_ENTRYLINK( MAIN_QUIT, MENU_QUIT, "Quit" );
213
MAKE_MENU_TOP_ENTRYLINK( MAIN_QUITGAME, MENU_QUIT, "Quit Game" );
2728 hendricks2 214
 
4496 hendricks2 215
static MenuEntry_t *MEL_MAIN[] = {
216
    &ME_MAIN_NEWGAME,
217
    &ME_MAIN_OPTIONS,
218
    &ME_MAIN_LOADGAME,
4609 terminx 219
#ifndef DROIDMENU
4496 hendricks2 220
    &ME_MAIN_HELP,
4609 terminx 221
#endif
4496 hendricks2 222
    &ME_MAIN_CREDITS,
223
    &ME_MAIN_QUIT,
224
};
4609 terminx 225
 
4496 hendricks2 226
static MenuEntry_t *MEL_MAIN_INGAME[] = {
227
    &ME_MAIN_NEWGAME_INGAME,
228
    &ME_MAIN_SAVEGAME,
229
    &ME_MAIN_LOADGAME,
230
    &ME_MAIN_OPTIONS,
4609 terminx 231
#ifndef DROIDMENU
4496 hendricks2 232
    &ME_MAIN_HELP,
4609 terminx 233
#endif
4496 hendricks2 234
    &ME_MAIN_QUITTOTITLE,
235
    &ME_MAIN_QUITGAME,
236
};
2728 hendricks2 237
 
4496 hendricks2 238
// Episode and Skill will be dynamically generated after CONs are parsed
239
static MenuLink_t MEO_EPISODE = { MENU_SKILL, };
240
static MenuLink_t MEO_EPISODE_SHAREWARE = { MENU_BUYDUKE, };
241
static MenuEntry_t ME_EPISODE_TEMPLATE = MAKE_MENUENTRY( &MF_Redfont, NULL, Link, &MEO_EPISODE );
242
static MenuEntry_t ME_EPISODE[MAXVOLUMES];
243
static MenuEntry_t *MEL_EPISODE[MAXVOLUMES];
2728 hendricks2 244
 
4496 hendricks2 245
static MenuLink_t MEO_EPISODE_USERMAP = { MENU_USERMAP, };
246
static MenuEntry_t ME_EPISODE_USERMAP = MAKE_MENUENTRY( &MF_Redfont, "User Map", Link, &MEO_EPISODE_USERMAP );
247
static MenuEntry_t *MEL_EPISODE_USERMAP[] = {
248
    &ME_EPISODE_USERMAP,
249
};
398 terminx 250
 
4496 hendricks2 251
static MenuEntry_t ME_SKILL_TEMPLATE = MAKE_MENUENTRY( &MF_Redfont, NULL, Link, &MEO_NULL );
252
static MenuEntry_t ME_SKILL[MAXSKILLS];
253
static MenuEntry_t *MEL_SKILL[MAXSKILLS];
5 Plagman 254
 
4496 hendricks2 255
// All NULL MenuEntry_t are to-do.
2728 hendricks2 256
 
4609 terminx 257
static MenuOption_t MEO_GAMESETUP_STARTWIN = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_OffOn, &ud.config.ForceSetup );
258
static MenuEntry_t ME_GAMESETUP_STARTWIN = MAKE_MENUENTRY( &MF_Redfont, "Startup window:", Option, &MEO_GAMESETUP_STARTWIN );
259
 
260
static char *MEOSN_GAMESETUP_AIM_AUTO[] = { "None", "Regular", "Bullets only",
261
#ifdef DROIDMENU
262
"Extra wide"
263
#endif
264
};
265
static int32_t MEOSV_GAMESETUP_AIM_AUTO[] = { 0, 1, 2,
266
#ifdef DROIDMENU
267
3,
268
#endif
269
};
270
 
271
static MenuOptionSet_t MEOS_GAMESETUP_AIM_AUTO = MAKE_MENUOPTIONSET(0x2, MEOSN_GAMESETUP_AIM_AUTO, MEOSV_GAMESETUP_AIM_AUTO);
272
static MenuOption_t MEO_GAMESETUP_AIM_AUTO = MAKE_MENUOPTION(&MF_RedfontRt, &MEOS_GAMESETUP_AIM_AUTO, &ud.config.AutoAim);
273
static MenuEntry_t ME_GAMESETUP_AIM_AUTO = MAKE_MENUENTRY(&MF_Redfont, "Auto aim:", Option, &MEO_GAMESETUP_AIM_AUTO);
274
 
275
static char *MEOSN_GAMESETUP_WEAPSWITCH_PICKUP[] = { "Never", "If new", "By rating", };
276
static MenuOptionSet_t MEOS_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUOPTIONSET(0x2, MEOSN_GAMESETUP_WEAPSWITCH_PICKUP, NULL);
277
static MenuOption_t MEO_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUOPTION(&MF_RedfontRt, &MEOS_GAMESETUP_WEAPSWITCH_PICKUP, NULL);
278
static MenuEntry_t ME_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUENTRY(&MF_Redfont, "Equip pickups:", Option, &MEO_GAMESETUP_WEAPSWITCH_PICKUP);
279
 
4496 hendricks2 280
static char *MEOSN_DemoRec[] = { "Off", "Running", };
281
static MenuOptionSet_t MEOS_DemoRec = MAKE_MENUOPTIONSET( 0x3, MEOSN_DemoRec, NULL );
4609 terminx 282
static MenuOption_t MEO_GAMESETUP_DEMOREC = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_OffOn, &ud.m_recstat );
283
static MenuEntry_t ME_GAMESETUP_DEMOREC = MAKE_MENUENTRY( &MF_Redfont, "Record demo:", Option, &MEO_GAMESETUP_DEMOREC );
284
 
4496 hendricks2 285
#ifdef _WIN32
4609 terminx 286
static MenuOption_t MEO_GAMESETUP_UPDATES = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_NoYes, &ud.config.CheckForUpdates );
287
static MenuEntry_t ME_GAMESETUP_UPDATES = MAKE_MENUENTRY( &MF_Redfont, "Online updates:", Option, &MEO_GAMESETUP_UPDATES );
4496 hendricks2 288
#endif
2728 hendricks2 289
 
4609 terminx 290
static MenuOption_t MEO_ADULTMODE = MAKE_MENUOPTION(&MF_RedfontRt, &MEOS_OffOn, &ud.lockout);
291
static MenuEntry_t ME_ADULTMODE = MAKE_MENUENTRY(&MF_Redfont, "Parental lock:", Option, &MEO_ADULTMODE);
292
static MenuLink_t MEO_ADULTMODE_PASSWORD ={ MENU_ADULTPASSWORD, };
293
static MenuEntry_t ME_ADULTMODE_PASSWORD = MAKE_MENUENTRY( &MF_Redfont, "Enter Password", Link, &MEO_ADULTMODE_PASSWORD );
294
 
4496 hendricks2 295
static MenuEntry_t *MEL_GAMESETUP1[] = {
4609 terminx 296
        &ME_ADULTMODE,
297
#ifndef DROIDMENU
4496 hendricks2 298
    &ME_GAMESETUP_STARTWIN,
4609 terminx 299
#endif
300
        &ME_GAMESETUP_AIM_AUTO,
301
        &ME_GAMESETUP_WEAPSWITCH_PICKUP,
302
#ifndef DROIDMENU
4496 hendricks2 303
    &ME_GAMESETUP_DEMOREC,
304
#ifdef _WIN32
4609 terminx 305
        &ME_GAMESETUP_UPDATES,
306
#endif
307
#endif
4496 hendricks2 308
};
2728 hendricks2 309
 
4496 hendricks2 310
MAKE_MENU_TOP_ENTRYLINK( OPTIONS_GAMESETUP, MENU_GAMESETUP, "Game Setup" );
311
MAKE_MENU_TOP_ENTRYLINK( OPTIONS_SOUNDSETUP, MENU_SOUND, "Sound Setup" );
4609 terminx 312
MAKE_MENU_TOP_ENTRYLINK( OPTIONS_ADVSOUND, MENU_ADVSOUND, "Sound Setup" );
313
MAKE_MENU_TOP_ENTRYLINK( OPTIONS_DISPLAYSETUP, MENU_DISPLAYSETUP, "Display Setup" );
4496 hendricks2 314
MAKE_MENU_TOP_ENTRYLINK( OPTIONS_PLAYERSETUP, MENU_PLAYER, "Player Setup" );
4609 terminx 315
MAKE_MENU_TOP_ENTRYLINK( OPTIONS_CONTROLS, MENU_CONTROLS, "Control Setup" );
4496 hendricks2 316
MAKE_MENU_TOP_ENTRYLINK( OPTIONS_KEYBOARDSETUP, MENU_KEYBOARDSETUP, "Keyboard Setup" );
317
MAKE_MENU_TOP_ENTRYLINK( OPTIONS_MOUSESETUP, MENU_MOUSESETUP, "Mouse Setup" );
318
MAKE_MENU_TOP_ENTRYLINK( OPTIONS_JOYSTICKSETUP, MENU_JOYSTICKSETUP, "Joystick Setup" );
2728 hendricks2 319
 
5 Plagman 320
 
4496 hendricks2 321
static int32_t newresolution, newrendermode, newfullscreen;
5 Plagman 322
 
4496 hendricks2 323
enum resflags_t {
324
    RES_FS  = 0x1,
325
    RES_WIN = 0x2,
326
};
5 Plagman 327
 
4496 hendricks2 328
#define MAXRESOLUTIONSTRINGLENGTH 16
5 Plagman 329
 
4496 hendricks2 330
typedef struct resolution_t {
331
    int32_t xdim, ydim;
332
    int32_t flags;
333
    int32_t bppmax;
334
    char name[MAXRESOLUTIONSTRINGLENGTH];
335
} resolution_t;
2358 helixhorne 336
 
4496 hendricks2 337
resolution_t resolution[MAXVALIDMODES];
5 Plagman 338
 
4496 hendricks2 339
static char *MEOSN_VIDEOSETUP_RESOLUTION[MAXVALIDMODES];
340
static MenuOptionSet_t MEOS_VIDEOSETUP_RESOLUTION = MAKE_MENUOPTIONSETDYN( 0x0, MEOSN_VIDEOSETUP_RESOLUTION, NULL, 0 );
4624 terminx 341
static MenuOption_t MEO_VIDEOSETUP_RESOLUTION = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_VIDEOSETUP_RESOLUTION, &newresolution );
4609 terminx 342
static MenuEntry_t ME_VIDEOSETUP_RESOLUTION = MAKE_MENUENTRY( &MF_Redfont, "Resolution:", Option, &MEO_VIDEOSETUP_RESOLUTION );
5 Plagman 343
 
4496 hendricks2 344
#ifdef USE_OPENGL
345
#ifdef POLYMER
4609 terminx 346
static char *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", "Polymost.f", "Polymer", };
4496 hendricks2 347
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, REND_POLYMOST, REND_POLYMER, };
348
#else
4609 terminx 349
static char *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", "OpenGL", };
4496 hendricks2 350
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, REND_POLYMOST, };
351
#endif
352
#else
353
static char *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", };
354
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, };
355
#endif
5 Plagman 356
 
4496 hendricks2 357
static MenuOptionSet_t MEOS_VIDEOSETUP_RENDERER = MAKE_MENUOPTIONSET( 0x2, MEOSN_VIDEOSETUP_RENDERER, MEOSV_VIDEOSETUP_RENDERER );
5 Plagman 358
 
4624 terminx 359
static MenuOption_t MEO_VIDEOSETUP_RENDERER = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_VIDEOSETUP_RENDERER, &newrendermode );
4609 terminx 360
static MenuEntry_t ME_VIDEOSETUP_RENDERER = MAKE_MENUENTRY( &MF_Redfont, "Renderer:", Option, &MEO_VIDEOSETUP_RENDERER );
4624 terminx 361
static MenuOption_t MEO_VIDEOSETUP_FULLSCREEN = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_NoYes, &newfullscreen );
4609 terminx 362
static MenuEntry_t ME_VIDEOSETUP_FULLSCREEN = MAKE_MENUENTRY( &MF_Redfont, "Fullscreen:", Option, &MEO_VIDEOSETUP_FULLSCREEN );
4496 hendricks2 363
static MenuEntry_t ME_VIDEOSETUP_APPLY = MAKE_MENUENTRY( &MF_Redfont, "Apply Changes", Link, &MEO_NULL );
4609 terminx 364
 
365
 
366
static MenuLink_t MEO_DISPLAYSETUP_COLORCORR =  { MENU_COLCORR, };
367
static MenuEntry_t ME_DISPLAYSETUP_COLORCORR = MAKE_MENUENTRY( &MF_Redfont, "Color Correction", Link, &MEO_DISPLAYSETUP_COLORCORR );
368
static MenuOption_t MEO_DISPLAYSETUP_PIXELDOUBLING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OnOff, &ud.detail );
369
static MenuEntry_t ME_DISPLAYSETUP_PIXELDOUBLING = MAKE_MENUENTRY( &MF_Redfont, "Pixel Doubling:", Option, &MEO_DISPLAYSETUP_PIXELDOUBLING );
370
 
371
 
4496 hendricks2 372
#ifdef USE_OPENGL
4609 terminx 373
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, NULL);
374
#else
375
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &r_usenewaspect);
4496 hendricks2 376
#endif
4609 terminx 377
static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUENTRY(&MF_Redfont, "Widescreen:", Option, &MEO_DISPLAYSETUP_ASPECTRATIO);
378
#ifdef POLYMER
379
static char *MEOSN_DISPLAYSETUP_ASPECTRATIO_POLYMER[] = { "Auto", "4:3", "16:10", "5:3", "16:9", "1.85:1", "2.39:1", };
380
static double MEOSV_DISPLAYSETUP_ASPECTRATIO_POLYMER[] = { 0., 1.33, 1.6, 1.66, 1.78, 1.85, 2.39, };
381
static MenuOptionSet_t MEOS_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUOPTIONSET(0x1, MEOSN_DISPLAYSETUP_ASPECTRATIO_POLYMER, NULL);
382
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_ASPECTRATIO_POLYMER, NULL);
383
static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUENTRY(&MF_Redfont, "Aspect ratio:", Option, &MEO_DISPLAYSETUP_ASPECTRATIO_POLYMER);
384
#endif
5 Plagman 385
 
4609 terminx 386
 
387
#ifdef USE_OPENGL
388
static char *MEOSN_DISPLAYSETUP_TEXFILTER[] = { "Classic", "Filtered" };
389
static MenuOptionSet_t MEOS_DISPLAYSETUP_TEXFILTER = MAKE_MENUOPTIONSET( 0x2, MEOSN_DISPLAYSETUP_TEXFILTER, NULL );
390
int32_t menufiltermode;
391
static MenuOption_t MEO_DISPLAYSETUP_TEXFILTER = MAKE_MENUOPTION( &MF_Redfont, &MEOS_DISPLAYSETUP_TEXFILTER, &menufiltermode );
392
static MenuEntry_t ME_DISPLAYSETUP_TEXFILTER = MAKE_MENUENTRY( &MF_Redfont, "Texture Mode:", Option, &MEO_DISPLAYSETUP_TEXFILTER );
393
 
394
static char *MEOSN_DISPLAYSETUP_ANISOTROPY[] = { "None", "2x", "4x", "8x", "16x", };
395
static int32_t MEOSV_DISPLAYSETUP_ANISOTROPY[] = { 0, 2, 4, 8, 16, };
4624 terminx 396
static MenuOptionSet_t MEOS_DISPLAYSETUP_ANISOTROPY = MAKE_MENUOPTIONSET(0x0, MEOSN_DISPLAYSETUP_ANISOTROPY, MEOSV_DISPLAYSETUP_ANISOTROPY);
4609 terminx 397
static MenuOption_t MEO_DISPLAYSETUP_ANISOTROPY = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_ANISOTROPY, &glanisotropy);
398
static MenuEntry_t ME_DISPLAYSETUP_ANISOTROPY = MAKE_MENUENTRY(&MF_Redfont, "Anisotropy:", Option, &MEO_DISPLAYSETUP_ANISOTROPY);
399
static char *MEOSN_DISPLAYSETUP_VSYNC[] = { "NVIDIA", "Off", "On", };
400
static int32_t MEOSV_DISPLAYSETUP_VSYNC[] = { -1, 0, 1, };
401
static MenuOptionSet_t MEOS_DISPLAYSETUP_VSYNC = MAKE_MENUOPTIONSET(0x2, MEOSN_DISPLAYSETUP_VSYNC, MEOSV_DISPLAYSETUP_VSYNC);
402
static MenuOption_t MEO_DISPLAYSETUP_VSYNC = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_VSYNC, &vsync);
403
static MenuEntry_t ME_DISPLAYSETUP_VSYNC = MAKE_MENUENTRY(&MF_Redfont, "VSync:", Option, &MEO_DISPLAYSETUP_VSYNC);
404
 
405
#endif
406
 
407
static MenuOption_t MEO_SCREENSETUP_CROSSHAIR = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.crosshair);
408
static MenuEntry_t ME_SCREENSETUP_CROSSHAIR = MAKE_MENUENTRY(&MF_Redfont, "Crosshair:", Option, &MEO_SCREENSETUP_CROSSHAIR);
409
static MenuRangeInt32_t MEO_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENURANGE(&MF_Redfont, 2, 25, 100, 16, 0, &ud.crosshairscale);
410
static MenuEntry_t ME_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENUENTRY(&MF_Redfont, "Size:", RangeInt32, &MEO_SCREENSETUP_CROSSHAIRSIZE);
411
 
412
static int32_t vpsize;
413
static MenuRangeInt32_t MEO_SCREENSETUP_SCREENSIZE = MAKE_MENURANGE(&MF_Redfont, 0, 12, 0, 4, 0, &vpsize);
414
static MenuEntry_t ME_SCREENSETUP_SCREENSIZE = MAKE_MENUENTRY(&MF_Redfont, "Screen size:", RangeInt32, &MEO_SCREENSETUP_SCREENSIZE);
415
static MenuRangeInt32_t MEO_SCREENSETUP_TEXTSIZE = MAKE_MENURANGE(&MF_Redfont, 2, 100, 400, 7, 0, &ud.textscale);
416
static MenuEntry_t ME_SCREENSETUP_TEXTSIZE = MAKE_MENUENTRY(&MF_Redfont, "Size:", RangeInt32, &MEO_SCREENSETUP_TEXTSIZE);
417
static MenuOption_t MEO_SCREENSETUP_LEVELSTATS = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.levelstats);
418
static MenuEntry_t ME_SCREENSETUP_LEVELSTATS = MAKE_MENUENTRY(&MF_Redfont, "Level stats:", Option, &MEO_SCREENSETUP_LEVELSTATS);
419
 
420
 
421
static MenuOption_t MEO_SCREENSETUP_SHOWPICKUPMESSAGES = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.fta_on);
422
static MenuEntry_t ME_SCREENSETUP_SHOWPICKUPMESSAGES = MAKE_MENUENTRY(&MF_Redfont, "Pickup messages:", Option, &MEO_SCREENSETUP_SHOWPICKUPMESSAGES);
423
 
424
static char *MEOSN_SCREENSETUP_NEWSTATUSBAR[] = { "Classic", "New",
425
#ifdef DROIDMENU
426
"On top",
427
#endif
428
};
429
 
430
static int32_t MEOSV_SCREENSETUP_NEWSTATUSBAR[] = { 0, 1,
431
#ifdef DROIDMENU
432
2,
433
#endif
434
};
435
 
436
static MenuOptionSet_t MEOS_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUOPTIONSET(0x2, MEOSN_SCREENSETUP_NEWSTATUSBAR, MEOSV_SCREENSETUP_NEWSTATUSBAR);
437
static MenuOption_t MEO_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUOPTION(&MF_Redfont, &MEOS_SCREENSETUP_NEWSTATUSBAR, &ud.althud);
438
static MenuEntry_t ME_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUENTRY(&MF_Redfont, "Status bar:", Option, &MEO_SCREENSETUP_NEWSTATUSBAR);
439
 
440
 
441
 
442
static MenuRangeInt32_t MEO_SCREENSETUP_SBARSIZE = MAKE_MENURANGE(&MF_Redfont, 2, 36, 100, 17, 0, &ud.statusbarscale);
443
static MenuEntry_t ME_SCREENSETUP_SBARSIZE = MAKE_MENUENTRY(&MF_Redfont, "Size:", RangeInt32, &MEO_SCREENSETUP_SBARSIZE);
444
 
445
 
446
static MenuLink_t MEO_DISPLAYSETUP_SCREENSETUP = { MENU_SCREENSETUP, };
447
static MenuEntry_t ME_DISPLAYSETUP_SCREENSETUP = MAKE_MENUENTRY(&MF_Redfont, "On-screen displays", Link, &MEO_DISPLAYSETUP_SCREENSETUP);
448
 
449
 
450
static MenuLink_t MEO_DISPLAYSETUP_RENDERERSETUP =  { MENU_RENDERERSETUP, };
451
static MenuEntry_t ME_DISPLAYSETUP_RENDERERSETUP = MAKE_MENUENTRY( &MF_Redfont, "Advanced", Link, &MEO_DISPLAYSETUP_RENDERERSETUP );
452
 
453
static MenuLink_t MEO_DISPLAYSETUP_VIDEOSETUP = { MENU_VIDEOSETUP, };
454
static MenuEntry_t ME_DISPLAYSETUP_VIDEOSETUP = MAKE_MENUENTRY(&MF_Redfont, "Video mode", Link, &MEO_DISPLAYSETUP_VIDEOSETUP);
455
 
4496 hendricks2 456
static MenuEntry_t *MEL_OPTIONS[] = {
457
    &ME_OPTIONS_GAMESETUP,
458
    &ME_OPTIONS_SOUNDSETUP,
4609 terminx 459
    &ME_OPTIONS_DISPLAYSETUP,
460
#ifndef DROIDMENU
4496 hendricks2 461
    &ME_OPTIONS_PLAYERSETUP,
4609 terminx 462
#endif
463
    &ME_OPTIONS_CONTROLS,
4496 hendricks2 464
};
5 Plagman 465
 
4609 terminx 466
static MenuEntry_t *MEL_CONTROLS[] = {
467
        &ME_OPTIONS_KEYBOARDSETUP,
468
        &ME_OPTIONS_MOUSESETUP,
469
        &ME_OPTIONS_JOYSTICKSETUP,
470
};
471
 
472
 
4496 hendricks2 473
static MenuEntry_t *MEL_VIDEOSETUP1[] = {
474
    &ME_VIDEOSETUP_RESOLUTION,
475
    &ME_VIDEOSETUP_RENDERER,
476
    &ME_VIDEOSETUP_FULLSCREEN,
477
};
478
static MenuEntry_t *MEL_VIDEOSETUP_APPLY[] = {
479
    &ME_VIDEOSETUP_APPLY,
480
};
4609 terminx 481
static MenuEntry_t *MEL_DISPLAYSETUP[] = {
482
    &ME_DISPLAYSETUP_SCREENSETUP,
483
    &ME_DISPLAYSETUP_COLORCORR,
484
#ifndef DROIDMENU
485
        &ME_DISPLAYSETUP_VIDEOSETUP,
486
#endif
487
        &ME_DISPLAYSETUP_ASPECTRATIO,
488
        &ME_DISPLAYSETUP_PIXELDOUBLING,
489
#ifndef DROIDMENU
490
    &ME_DISPLAYSETUP_RENDERERSETUP,
491
#endif
4496 hendricks2 492
};
4609 terminx 493
 
4496 hendricks2 494
#ifdef USE_OPENGL
4609 terminx 495
static MenuEntry_t *MEL_DISPLAYSETUP_GL[] = {
496
        &ME_DISPLAYSETUP_SCREENSETUP,
497
    &ME_DISPLAYSETUP_COLORCORR,
498
#ifndef DROIDMENU
499
        &ME_DISPLAYSETUP_VIDEOSETUP,
500
#endif
501
        &ME_DISPLAYSETUP_ASPECTRATIO,
502
        &ME_DISPLAYSETUP_TEXFILTER,
503
#ifndef DROIDMENU
504
        &ME_DISPLAYSETUP_ANISOTROPY,
505
        &ME_DISPLAYSETUP_VSYNC,
506
    &ME_DISPLAYSETUP_RENDERERSETUP,
507
#endif
4496 hendricks2 508
};
4609 terminx 509
 
510
#ifdef POLYMER
511
static MenuEntry_t *MEL_DISPLAYSETUP_GL_POLYMER[] = {
512
        &ME_DISPLAYSETUP_SCREENSETUP,
513
        &ME_DISPLAYSETUP_COLORCORR,
514
#ifndef DROIDMENU
515
        &ME_DISPLAYSETUP_VIDEOSETUP,
4496 hendricks2 516
#endif
4609 terminx 517
        &ME_DISPLAYSETUP_ASPECTRATIO_POLYMER,
518
        &ME_DISPLAYSETUP_TEXFILTER,
519
#ifndef DROIDMENU
520
        &ME_DISPLAYSETUP_ANISOTROPY,
521
        &ME_DISPLAYSETUP_VSYNC,
522
        &ME_DISPLAYSETUP_RENDERERSETUP,
523
#endif
524
};
5 Plagman 525
 
4609 terminx 526
#endif
527
#endif
528
 
529
 
530
 
4496 hendricks2 531
static char *MenuKeyNone = "  -";
532
static char *MEOSN_Keys[NUMKEYS];
5 Plagman 533
 
4496 hendricks2 534
static MenuCustom2Col_t MEO_KEYBOARDSETUPFUNCS_TEMPLATE = { &MF_MinifontRed, 54<<16, MEOSN_Keys, NUMKEYS, { NULL, NULL, }, 0, };
535
static MenuCustom2Col_t MEO_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
536
static MenuEntry_t ME_KEYBOARDSETUPFUNCS_TEMPLATE = MAKE_MENUENTRY( &MF_Minifont, NULL, Custom2Col, &MEO_KEYBOARDSETUPFUNCS_TEMPLATE );
537
static MenuEntry_t ME_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
538
static MenuEntry_t *MEL_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
5 Plagman 539
 
4496 hendricks2 540
static MenuLink_t MEO_KEYBOARDSETUP_KEYS =  { MENU_KEYBOARDKEYS, };
4609 terminx 541
static MenuEntry_t ME_KEYBOARDSETUP_KEYS = MAKE_MENUENTRY( &MF_Redfont, "Configure Keys", Link, &MEO_KEYBOARDSETUP_KEYS );
542
static MenuEntry_t ME_KEYBOARDSETUP_RESET = MAKE_MENUENTRY( &MF_Redfont, "Reset To Defaults", Link, &MEO_NULL );
543
static MenuEntry_t ME_KEYBOARDSETUP_RESETCLASSIC = MAKE_MENUENTRY( &MF_Redfont, "Reset To Classic", Link, &MEO_NULL );
5 Plagman 544
 
4496 hendricks2 545
static MenuEntry_t *MEL_KEYBOARDSETUP[] = {
546
    &ME_KEYBOARDSETUP_KEYS,
547
    &ME_KEYBOARDSETUP_RESET,
548
    &ME_KEYBOARDSETUP_RESETCLASSIC,
549
};
5 Plagman 550
 
551
 
4496 hendricks2 552
// There is no better way to do this than manually.
4399 hendricks2 553
 
4496 hendricks2 554
#define MENUMOUSEFUNCTIONS 12
78 terminx 555
 
4496 hendricks2 556
static char *MenuMouseNames[MENUMOUSEFUNCTIONS] = {
557
    "Button 1",
558
    "Double Button 1",
559
    "Button 2",
560
    "Double Button 2",
561
    "Button 3",
562
    "Double Button 3",
5 Plagman 563
 
4496 hendricks2 564
    "Wheel Up",
565
    "Wheel Down",
5 Plagman 566
 
4496 hendricks2 567
    "Button 4",
568
    "Double Button 4",
569
    "Button 5",
570
    "Double Button 5",
571
};
572
static int32_t MenuMouseDataIndex[MENUMOUSEFUNCTIONS][2] = {
573
    { 0, 0, },
574
    { 0, 1, },
575
    { 1, 0, },
576
    { 1, 1, },
577
    { 2, 0, },
578
    { 2, 1, },
1677 terminx 579
 
4496 hendricks2 580
    // note the mouse wheel
581
    { 4, 0, },
582
    { 5, 0, },
5 Plagman 583
 
4496 hendricks2 584
    { 3, 0, },
585
    { 3, 1, },
586
    { 6, 0, },
587
    { 6, 1, },
588
};
3084 terminx 589
 
4496 hendricks2 590
static MenuOption_t MEO_MOUSEJOYSETUPBTNS_TEMPLATE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
591
static MenuOption_t MEO_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
592
static MenuEntry_t ME_MOUSEJOYSETUPBTNS_TEMPLATE = MAKE_MENUENTRY( &MF_Minifont, NULL, Option, NULL );
593
static MenuEntry_t ME_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
594
static MenuEntry_t *MEL_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
3084 terminx 595
 
4496 hendricks2 596
static MenuLink_t MEO_MOUSESETUP_BTNS =  { MENU_MOUSEBTNS, };
4609 terminx 597
static MenuEntry_t ME_MOUSESETUP_BTNS = MAKE_MENUENTRY( &MF_Redfont, "Button assignment", Link, &MEO_MOUSESETUP_BTNS );
598
static MenuRangeFloat_t MEO_MOUSESETUP_SENSITIVITY = MAKE_MENURANGE( &MF_RedfontRt, 1, .5f, 16.f, 32, 0.f, &CONTROL_MouseSensitivity );
599
static MenuEntry_t ME_MOUSESETUP_SENSITIVITY = MAKE_MENUENTRY( &MF_Redfont, "Sensitivity:", RangeFloat, &MEO_MOUSESETUP_SENSITIVITY );
600
static MenuOption_t MEO_MOUSESETUP_MOUSEAIMING = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_NoYes, &g_myAimMode );
601
static MenuEntry_t ME_MOUSESETUP_MOUSEAIMING = MAKE_MENUENTRY( &MF_Redfont, "Vertical aiming:", Option, &MEO_MOUSESETUP_MOUSEAIMING );
602
static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_YesNo, &ud.mouseflip );
603
static MenuEntry_t ME_MOUSESETUP_INVERT = MAKE_MENUENTRY( &MF_Redfont, "Invert aiming:", Option, &MEO_MOUSESETUP_INVERT );
604
static MenuOption_t MEO_MOUSESETUP_SMOOTH = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_NoYes, &ud.config.SmoothInput );
605
static MenuEntry_t ME_MOUSESETUP_SMOOTH = MAKE_MENUENTRY( &MF_Redfont, "Filter input:", Option, &MEO_MOUSESETUP_SMOOTH );
4496 hendricks2 606
static MenuLink_t MEO_MOUSESETUP_ADVANCED =  { MENU_MOUSEADVANCED, };
4609 terminx 607
static MenuEntry_t ME_MOUSESETUP_ADVANCED = MAKE_MENUENTRY( &MF_Redfont, "Advanced setup", Link, &MEO_MOUSESETUP_ADVANCED );
3084 terminx 608
 
4609 terminx 609
static MenuEntry_t *MEL_MOUSESETUP1[] = {
4496 hendricks2 610
    &ME_MOUSESETUP_SENSITIVITY,
4609 terminx 611
        &ME_MOUSESETUP_BTNS,
4496 hendricks2 612
};
5 Plagman 613
 
4609 terminx 614
static MenuEntry_t *MEL_MOUSESETUP2[] = {
615
        &ME_MOUSESETUP_MOUSEAIMING,
616
        &ME_MOUSESETUP_INVERT,
617
        &ME_MOUSESETUP_SMOOTH,
618
        &ME_MOUSESETUP_ADVANCED,
619
};
620
 
4496 hendricks2 621
MAKE_MENU_TOP_ENTRYLINK( JOYSTICK_EDITBUTTONS, MENU_JOYSTICKBTNS, "Edit Buttons" );
622
MAKE_MENU_TOP_ENTRYLINK( JOYSTICK_EDITAXES, MENU_JOYSTICKAXES, "Edit Axes" );
5 Plagman 623
 
4496 hendricks2 624
static MenuEntry_t *MEL_JOYSTICKSETUP[] = {
625
    &ME_JOYSTICK_EDITBUTTONS,
626
    &ME_JOYSTICK_EDITAXES,
627
};
5 Plagman 628
 
4496 hendricks2 629
#define MAXJOYBUTTONSTRINGLENGTH 32
5 Plagman 630
 
4496 hendricks2 631
static char MenuJoystickNames[MAXJOYBUTTONS<<1][MAXJOYBUTTONSTRINGLENGTH];
5 Plagman 632
 
4496 hendricks2 633
static MenuOption_t MEO_JOYSTICKBTNS[MAXJOYBUTTONS<<1];
634
static MenuEntry_t ME_JOYSTICKBTNS[MAXJOYBUTTONS<<1];
635
static MenuEntry_t *MEL_JOYSTICKBTNS[MAXJOYBUTTONS<<1];
59 terminx 636
 
4496 hendricks2 637
static MenuLink_t MEO_JOYSTICKAXES = { MENU_JOYSTICKAXIS, };
638
static MenuEntry_t ME_JOYSTICKAXES_TEMPLATE = MAKE_MENUENTRY( &MF_Redfont, NULL, Link, &MEO_JOYSTICKAXES );
639
static MenuEntry_t ME_JOYSTICKAXES[MAXJOYAXES];
640
static char MenuJoystickAxes[MAXJOYAXES][MAXJOYBUTTONSTRINGLENGTH];
59 terminx 641
 
4496 hendricks2 642
static MenuEntry_t *MEL_JOYSTICKAXES[MAXJOYAXES];
2188 helixhorne 643
 
4496 hendricks2 644
static MenuRangeInt32_t MEO_MOUSEADVANCED_SCALEX = MAKE_MENURANGE( &MF_Bluefont, 3, -262144, 262144, 65, 65536, &ud.config.MouseAnalogueScale[0] );
645
static MenuEntry_t ME_MOUSEADVANCED_SCALEX = MAKE_MENUENTRY( &MF_Redfont, "X-Axis Scale", RangeInt32, &MEO_MOUSEADVANCED_SCALEX );
646
static MenuRangeInt32_t MEO_MOUSEADVANCED_SCALEY = MAKE_MENURANGE( &MF_Bluefont, 3, -262144, 262144, 65, 65536, &ud.config.MouseAnalogueScale[1] );
647
static MenuEntry_t ME_MOUSEADVANCED_SCALEY = MAKE_MENUENTRY( &MF_Redfont, "Y-Axis Scale", RangeInt32, &MEO_MOUSEADVANCED_SCALEY );
2188 helixhorne 648
 
4496 hendricks2 649
static MenuEntry_t *MEL_MOUSEADVANCED[] = {
650
    &ME_MOUSEADVANCED_SCALEX,
651
    &ME_MOUSEADVANCED_SCALEY,
652
};
3048 helixhorne 653
 
4609 terminx 654
static MenuOption_t MEO_MOUSEADVANCED_DAXES_UP = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[1][0] );
655
static MenuEntry_t ME_MOUSEADVANCED_DAXES_UP = MAKE_MENUENTRY( &MF_Redfont, "Digital Up", Option, &MEO_MOUSEADVANCED_DAXES_UP );
656
static MenuOption_t MEO_MOUSEADVANCED_DAXES_DOWN = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[1][1] );
657
static MenuEntry_t ME_MOUSEADVANCED_DAXES_DOWN = MAKE_MENUENTRY( &MF_Redfont, "Digital Down", Option, &MEO_MOUSEADVANCED_DAXES_DOWN );
658
static MenuOption_t MEO_MOUSEADVANCED_DAXES_LEFT = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[0][0] );
659
static MenuEntry_t ME_MOUSEADVANCED_DAXES_LEFT = MAKE_MENUENTRY( &MF_Redfont, "Digital Left", Option, &MEO_MOUSEADVANCED_DAXES_LEFT );
660
static MenuOption_t MEO_MOUSEADVANCED_DAXES_RIGHT = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[0][1] );
661
static MenuEntry_t ME_MOUSEADVANCED_DAXES_RIGHT = MAKE_MENUENTRY( &MF_Redfont, "Digital Right", Option, &MEO_MOUSEADVANCED_DAXES_RIGHT );
2188 helixhorne 662
 
4496 hendricks2 663
static MenuEntry_t *MEL_MOUSEADVANCED_DAXES[] = {
664
    &ME_MOUSEADVANCED_DAXES_UP,
665
    &ME_MOUSEADVANCED_DAXES_DOWN,
666
    &ME_MOUSEADVANCED_DAXES_LEFT,
667
    &ME_MOUSEADVANCED_DAXES_RIGHT,
668
};
3084 terminx 669
 
4496 hendricks2 670
static const char *MenuJoystickHatDirections[] = { "Up", "Right", "Down", "Left", };
3084 terminx 671
 
4609 terminx 672
static char *MEOSN_JOYSTICKAXIS_ANALOG[] = { "  -None-", "Turning", "Strafing", "Looking", "Moving", };
4496 hendricks2 673
static int32_t MEOSV_JOYSTICKAXIS_ANALOG[] = { -1, analog_turning, analog_strafing, analog_lookingupanddown, analog_moving, };
674
static MenuOptionSet_t MEOS_JOYSTICKAXIS_ANALOG = MAKE_MENUOPTIONSET( 0x0, MEOSN_JOYSTICKAXIS_ANALOG, MEOSV_JOYSTICKAXIS_ANALOG );
675
static MenuOption_t MEO_JOYSTICKAXIS_ANALOG = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_JOYSTICKAXIS_ANALOG, NULL );
676
static MenuEntry_t ME_JOYSTICKAXIS_ANALOG = MAKE_MENUENTRY( &MF_Redfont, "Analog", Option, &MEO_JOYSTICKAXIS_ANALOG );
677
static MenuRangeInt32_t MEO_JOYSTICKAXIS_SCALE = MAKE_MENURANGE( &MF_Bluefont, 3, -262144, 262144, 65, 65536, NULL );
678
static MenuEntry_t ME_JOYSTICKAXIS_SCALE = MAKE_MENUENTRY( &MF_Redfont, "Scale", RangeInt32, &MEO_JOYSTICKAXIS_SCALE );
679
static MenuRangeInt32_t MEO_JOYSTICKAXIS_DEAD = MAKE_MENURANGE( &MF_Bluefont, 2, 0, 1000000, 33, 0, NULL );
680
static MenuEntry_t ME_JOYSTICKAXIS_DEAD = MAKE_MENUENTRY( &MF_Redfont, "Dead Zone", RangeInt32, &MEO_JOYSTICKAXIS_DEAD );
681
static MenuRangeInt32_t MEO_JOYSTICKAXIS_SATU = MAKE_MENURANGE( &MF_Bluefont, 2, 0, 1000000, 33, 0, NULL );
682
static MenuEntry_t ME_JOYSTICKAXIS_SATU = MAKE_MENUENTRY( &MF_Redfont, "Saturation", RangeInt32, &MEO_JOYSTICKAXIS_SATU );
3084 terminx 683
 
4496 hendricks2 684
static MenuOption_t MEO_JOYSTICKAXIS_DIGITALNEGATIVE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
685
static MenuEntry_t ME_JOYSTICKAXIS_DIGITALNEGATIVE = MAKE_MENUENTRY( &MF_BluefontRed, "Digital -", Option, &MEO_JOYSTICKAXIS_DIGITALNEGATIVE );
686
static MenuOption_t MEO_JOYSTICKAXIS_DIGITALPOSITIVE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
687
static MenuEntry_t ME_JOYSTICKAXIS_DIGITALPOSITIVE = MAKE_MENUENTRY( &MF_BluefontRed, "Digital +", Option, &MEO_JOYSTICKAXIS_DIGITALPOSITIVE );
3084 terminx 688
 
4496 hendricks2 689
static MenuEntry_t *MEL_JOYSTICKAXIS[] = {
690
    &ME_JOYSTICKAXIS_ANALOG,
691
    &ME_JOYSTICKAXIS_SCALE,
692
    &ME_JOYSTICKAXIS_DEAD,
693
    &ME_JOYSTICKAXIS_SATU,
694
};
3084 terminx 695
 
4496 hendricks2 696
static MenuEntry_t *MEL_JOYSTICKAXIS_DIGITAL[] = {
697
    &ME_JOYSTICKAXIS_DIGITALNEGATIVE,
698
    &ME_JOYSTICKAXIS_DIGITALPOSITIVE,
699
};
3084 terminx 700
 
4609 terminx 701
static MenuOption_t MEO_RENDERERSETUP_FRAMERATE = MAKE_MENUOPTION(&MF_Bluefont, &MEOS_NoYes, &ud.tickrate);
702
static MenuEntry_t ME_RENDERERSETUP_FRAMERATE = MAKE_MENUENTRY(&MF_BluefontRed, "Show framerate:", Option, &MEO_RENDERERSETUP_FRAMERATE);
703
 
4496 hendricks2 704
#ifdef USE_OPENGL
705
static MenuOption_t MEO_RENDERERSETUP_HIGHTILE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &usehightile );
4609 terminx 706
static MenuEntry_t ME_RENDERERSETUP_HIGHTILE = MAKE_MENUENTRY( &MF_BluefontRed, "Hires textures:", Option, &MEO_RENDERERSETUP_HIGHTILE );
4496 hendricks2 707
static MenuRangeInt32_t MEO_RENDERERSETUP_TEXQUALITY = MAKE_MENURANGE( &MF_Bluefont, 0, 2, 0, 3, 0, &r_downsize );
708
static MenuEntry_t ME_RENDERERSETUP_TEXQUALITY = MAKE_MENUENTRY( &MF_BluefontRed, "Hires texture quality", RangeInt32, &MEO_RENDERERSETUP_TEXQUALITY );
709
static MenuOption_t MEO_RENDERERSETUP_PRECACHE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.config.useprecache );
710
static MenuEntry_t ME_RENDERERSETUP_PRECACHE = MAKE_MENUENTRY( &MF_BluefontRed, "Pre-load map textures", Option, &MEO_RENDERERSETUP_PRECACHE );
711
static char *MEOSN_RENDERERSETUP_TEXCACHE[] = { "Off", "On", "Compress", };
712
static MenuOptionSet_t MEOS_RENDERERSETUP_TEXCACHE = MAKE_MENUOPTIONSET( 0x2, MEOSN_RENDERERSETUP_TEXCACHE, NULL );
713
static MenuOption_t MEO_RENDERERSETUP_TEXCACHE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_RENDERERSETUP_TEXCACHE, &glusetexcache );
714
static MenuEntry_t ME_RENDERERSETUP_TEXCACHE = MAKE_MENUENTRY( &MF_BluefontRed, "On disk texture cache", Option, &MEO_RENDERERSETUP_TEXCACHE );
715
static MenuOption_t MEO_RENDERERSETUP_DETAILTEX = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &r_detailmapping );
4609 terminx 716
static MenuEntry_t ME_RENDERERSETUP_DETAILTEX = MAKE_MENUENTRY( &MF_BluefontRed, "Detail textures:", Option, &MEO_RENDERERSETUP_DETAILTEX );
4496 hendricks2 717
static MenuOption_t MEO_RENDERERSETUP_MODELS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &usemodels );
4609 terminx 718
static MenuEntry_t ME_RENDERERSETUP_MODELS = MAKE_MENUENTRY( &MF_BluefontRed, "Models:", Option, &MEO_RENDERERSETUP_MODELS );
4496 hendricks2 719
#endif
3084 terminx 720
 
4496 hendricks2 721
#ifdef USE_OPENGL
722
static MenuEntry_t *MEL_RENDERERSETUP_GL2[] = {
723
    &ME_RENDERERSETUP_HIGHTILE,
724
    &ME_RENDERERSETUP_TEXQUALITY,
725
    &ME_RENDERERSETUP_PRECACHE,
726
    &ME_RENDERERSETUP_TEXCACHE,
727
    &ME_RENDERERSETUP_DETAILTEX,
728
};
729
static MenuEntry_t *MEL_RENDERERSETUP_GL3[] = {
730
    &ME_RENDERERSETUP_MODELS,
731
};
732
#endif
3084 terminx 733
 
4609 terminx 734
#ifdef DROIDMENU
735
static MenuRangeFloat_t MEO_COLCORR_GAMMA = MAKE_MENURANGE( &MF_Bluefont, 1.f, 1.f, 2.5f, 39.f, 0.f, &vid_gamma );
736
#else
737
static MenuRangeFloat_t MEO_COLCORR_GAMMA = MAKE_MENURANGE( &MF_Bluefont, 1.f, 0.2f, 4.f, 39.f, 0.f, &vid_gamma );
738
#endif
739
static MenuEntry_t ME_COLCORR_GAMMA = MAKE_MENUENTRY( &MF_Redfont, "Gamma:", RangeFloat, &MEO_COLCORR_GAMMA );
740
static MenuRangeFloat_t MEO_COLCORR_CONTRAST = MAKE_MENURANGE( &MF_Bluefont, 1.f, 0.1f, 2.7f, 53.f, 0.f, &vid_contrast );
741
static MenuEntry_t ME_COLCORR_CONTRAST = MAKE_MENUENTRY( &MF_Redfont, "Contrast:", RangeFloat, &MEO_COLCORR_CONTRAST );
742
static MenuRangeFloat_t MEO_COLCORR_BRIGHTNESS = MAKE_MENURANGE( &MF_Bluefont, 1.f, -0.8f, 0.8f, 33.f, 0.f, &vid_brightness );
743
static MenuEntry_t ME_COLCORR_BRIGHTNESS = MAKE_MENUENTRY( &MF_Redfont, "Brightness:", RangeFloat, &MEO_COLCORR_BRIGHTNESS );
4496 hendricks2 744
static MenuEntry_t ME_COLCORR_RESET = MAKE_MENUENTRY( &MF_Redfont, "Reset To Defaults", Link, &MEO_NULL );
4609 terminx 745
static MenuRangeFloat_t MEO_COLCORR_AMBIENT = MAKE_MENURANGE(&MF_Bluefont, 1.f, 0.125f, 4.f, 32.f, 0.f, &r_ambientlight);
746
static MenuEntry_t ME_COLCORR_AMBIENT = MAKE_MENUENTRY(&MF_Redfont, "Visibility:", RangeFloat, &MEO_COLCORR_AMBIENT);
3084 terminx 747
 
4496 hendricks2 748
static MenuEntry_t *MEL_COLCORR[] = {
749
    &ME_COLCORR_GAMMA,
4609 terminx 750
#ifndef DROIDMENU
4496 hendricks2 751
    &ME_COLCORR_CONTRAST,
752
    &ME_COLCORR_BRIGHTNESS,
4609 terminx 753
#endif
754
        &ME_COLCORR_AMBIENT,
4496 hendricks2 755
};
4609 terminx 756
 
4496 hendricks2 757
static MenuEntry_t *MEL_COLCORR_RESET[] = {
758
    &ME_COLCORR_RESET,
759
};
3084 terminx 760
 
4609 terminx 761
static MenuEntry_t *MEL_SCREENSETUP1[] = {
762
        &ME_SCREENSETUP_SCREENSIZE,
763
};
764
 
765
static MenuEntry_t *MEL_SCREENSETUP2[] = {
766
        &ME_SCREENSETUP_NEWSTATUSBAR,
767
        &ME_SCREENSETUP_SBARSIZE,
768
};
769
 
770
static MenuEntry_t *MEL_SCREENSETUP3[] = {
771
        &ME_SCREENSETUP_CROSSHAIR,
772
        &ME_SCREENSETUP_CROSSHAIRSIZE,
773
};
774
 
775
static MenuEntry_t *MEL_SCREENSETUP4[] = {
776
        &ME_SCREENSETUP_LEVELSTATS,
777
        &ME_SCREENSETUP_TEXTSIZE,
778
};
779
 
780
static MenuEntry_t *MEL_SCREENSETUP5[] = {
781
        &ME_SCREENSETUP_SHOWPICKUPMESSAGES,
782
};
783
 
4496 hendricks2 784
// Save and load will be filled in before every viewing of the save/load screen.
785
static MenuLink_t MEO_LOAD = { MENU_NULL, };
786
static MenuLink_t MEO_LOAD_VALID = { MENU_LOADVERIFY, };
787
static MenuEntry_t ME_LOAD_TEMPLATE = MAKE_MENUENTRY( &MF_MinifontRed, NULL, Link, &MEO_LOAD );
788
static MenuEntry_t ME_LOAD[MAXSAVEGAMES];
789
static MenuEntry_t *MEL_LOAD[MAXSAVEGAMES];
3084 terminx 790
 
4496 hendricks2 791
static MenuString_t MEO_SAVE_TEMPLATE = MAKE_MENUSTRING( &MF_MinifontRed, NULL, MAXSAVEGAMENAME, 0 );
792
static MenuString_t MEO_SAVE[MAXSAVEGAMES];
793
static MenuEntry_t ME_SAVE_TEMPLATE = MAKE_MENUENTRY( &MF_MinifontRed, NULL, String, &MEO_SAVE_TEMPLATE );
794
static MenuEntry_t ME_SAVE[MAXSAVEGAMES];
795
static MenuEntry_t *MEL_SAVE[MAXSAVEGAMES];
3084 terminx 796
 
4496 hendricks2 797
static int32_t soundrate, soundbits, soundvoices;
4609 terminx 798
static MenuOption_t MEO_SOUND = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_OffOn, &ud.config.SoundToggle );
799
static MenuEntry_t ME_SOUND = MAKE_MENUENTRY( &MF_Redfont, "Sound:", Option, &MEO_SOUND );
800
 
801
static MenuOption_t MEO_SOUND_MUSIC = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_OffOn, &ud.config.MusicToggle );
802
static MenuEntry_t ME_SOUND_MUSIC = MAKE_MENUENTRY( &MF_Redfont, "Music:", Option, &MEO_SOUND_MUSIC );
803
 
804
static MenuRangeInt32_t MEO_SOUND_VOLUME_MASTER = MAKE_MENURANGE( &MF_RedfontRt, 2, 0, 255, 33, 0, &ud.config.MasterVolume );
805
static MenuEntry_t ME_SOUND_VOLUME_MASTER = MAKE_MENUENTRY( &MF_Redfont, "Volume:", RangeInt32, &MEO_SOUND_VOLUME_MASTER );
806
 
807
static MenuRangeInt32_t MEO_SOUND_VOLUME_EFFECTS = MAKE_MENURANGE( &MF_RedfontRt, 2, 0, 255, 33, 0, &ud.config.FXVolume );
808
static MenuEntry_t ME_SOUND_VOLUME_EFFECTS = MAKE_MENUENTRY( &MF_Redfont, "Effects:", RangeInt32, &MEO_SOUND_VOLUME_EFFECTS );
809
 
810
static MenuRangeInt32_t MEO_SOUND_VOLUME_MUSIC = MAKE_MENURANGE( &MF_RedfontRt, 2, 0, 255, 33, 0, &ud.config.MusicVolume );
811
static MenuEntry_t ME_SOUND_VOLUME_MUSIC = MAKE_MENUENTRY( &MF_Redfont, "Music:", RangeInt32, &MEO_SOUND_VOLUME_MUSIC );
812
 
813
static MenuOption_t MEO_SOUND_DUKETALK = MAKE_MENUOPTION(&MF_RedfontRt, &MEOS_NoYes, NULL);
814
static MenuEntry_t ME_SOUND_DUKETALK = MAKE_MENUENTRY(&MF_Redfont, "Duke talk:", Option, &MEO_SOUND_DUKETALK);
815
 
816
static char *MEOSN_SOUND_SAMPLINGRATE[] = { "22050Hz", "44100Hz", "48000Hz", };
817
static int32_t MEOSV_SOUND_SAMPLINGRATE[] = { 22050, 44100, 48000, };
818
static MenuOptionSet_t MEOS_SOUND_SAMPLINGRATE = MAKE_MENUOPTIONSET( 0x3, MEOSN_SOUND_SAMPLINGRATE, MEOSV_SOUND_SAMPLINGRATE );
819
static MenuOption_t MEO_SOUND_SAMPLINGRATE = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_SOUND_SAMPLINGRATE, &soundrate );
820
static MenuEntry_t ME_SOUND_SAMPLINGRATE = MAKE_MENUENTRY( &MF_Redfont, "Sample rate:", Option, &MEO_SOUND_SAMPLINGRATE );
821
 
4496 hendricks2 822
static char *MEOSN_SOUND_SAMPLESIZE[] = { "8-bit", "16-bit", };
823
static int32_t MEOSV_SOUND_SAMPLESIZE[] = { 8, 16, };
824
static MenuOptionSet_t MEOS_SOUND_SAMPLESIZE = MAKE_MENUOPTIONSET( 0x3, MEOSN_SOUND_SAMPLESIZE, MEOSV_SOUND_SAMPLESIZE );
4609 terminx 825
static MenuOption_t MEO_SOUND_SAMPLESIZE = MAKE_MENUOPTION( &MF_RedfontRt, &MEOS_SOUND_SAMPLESIZE, &soundbits );
826
static MenuEntry_t ME_SOUND_SAMPLESIZE = MAKE_MENUENTRY( &MF_Redfont, "Sample size:", Option, &MEO_SOUND_SAMPLESIZE );
3084 terminx 827
 
4609 terminx 828
static MenuRangeInt32_t MEO_SOUND_NUMVOICES = MAKE_MENURANGE( &MF_RedfontRt, 1, 16, 256, 16, 0, &soundvoices );
829
static MenuEntry_t ME_SOUND_NUMVOICES = MAKE_MENUENTRY( &MF_Redfont, "Voices:", RangeInt32, &MEO_SOUND_NUMVOICES );
830
 
831
static MenuEntry_t ME_SOUND_RESTART = MAKE_MENUENTRY( &MF_Redfont, "Restart sound system", Link, &MEO_NULL );
832
 
833
static MenuLink_t MEO_ADVSOUND = { MENU_ADVSOUND, };
834
static MenuEntry_t ME_SOUND_ADVSOUND = MAKE_MENUENTRY( &MF_Redfont, "Advanced", Link, &MEO_ADVSOUND );
835
 
4496 hendricks2 836
static MenuEntry_t *MEL_SOUND1[] = {
837
    &ME_SOUND,
838
    &ME_SOUND_MUSIC,
839
};
840
static MenuEntry_t *MEL_SOUND2[] = {
4609 terminx 841
        &ME_SOUND_VOLUME_MASTER,
842
        &ME_SOUND_VOLUME_EFFECTS,
843
        &ME_SOUND_VOLUME_MUSIC,
4496 hendricks2 844
};
845
static MenuEntry_t *MEL_SOUND3[] = {
846
    &ME_SOUND_DUKETALK,
4609 terminx 847
#ifndef DROIDMENU
848
        &ME_SOUND_ADVSOUND,
849
#endif
4496 hendricks2 850
};
3084 terminx 851
 
4609 terminx 852
static MenuEntry_t *MEL_ADVSOUND1[] = {
853
        &ME_SOUND_SAMPLINGRATE,
854
        &ME_SOUND_SAMPLESIZE,
855
};
4399 hendricks2 856
 
4609 terminx 857
static MenuEntry_t *MEL_ADVSOUND2[] = {
858
        &ME_SOUND_NUMVOICES,
4496 hendricks2 859
};
4399 hendricks2 860
 
4609 terminx 861
static MenuEntry_t *MEL_ADVSOUND3[] = {
862
        &ME_SOUND_RESTART,
863
};
864
 
4496 hendricks2 865
MAKE_MENU_TOP_ENTRYLINK( NETWORK_PLAYERSETUP, MENU_PLAYER, "Player Setup" );
866
MAKE_MENU_TOP_ENTRYLINK( NETWORK_JOINGAME, MENU_NETJOIN, "Join Game" );
867
MAKE_MENU_TOP_ENTRYLINK( NETWORK_HOSTGAME, MENU_NETHOST, "Host Game" );
4399 hendricks2 868
 
4496 hendricks2 869
static MenuEntry_t *MEL_NETWORK[] = {
870
    &ME_NETWORK_PLAYERSETUP,
871
    &ME_NETWORK_JOINGAME,
872
    &ME_NETWORK_HOSTGAME,
873
};
4399 hendricks2 874
 
4496 hendricks2 875
static MenuString_t MEO_PLAYER_NAME = MAKE_MENUSTRING( &MF_Bluefont, szPlayerName, MAXPLAYERNAME, 0 );
876
static MenuEntry_t ME_PLAYER_NAME = MAKE_MENUENTRY( &MF_BluefontRed, "Name", String, &MEO_PLAYER_NAME );
877
static char *MEOSN_PLAYER_COLOR[] = { "Auto", "Blue", "Red", "Green", "Gray", "Dark gray", "Dark green", "Brown", "Dark blue", "Bright red", "Yellow", };
878
static int32_t MEOSV_PLAYER_COLOR[] = { 0, 9, 10, 11, 12, 13, 14, 15, 16, 22, 23, };
879
static MenuOptionSet_t MEOS_PLAYER_COLOR = MAKE_MENUOPTIONSET( 0x2, MEOSN_PLAYER_COLOR, MEOSV_PLAYER_COLOR );
880
static MenuOption_t MEO_PLAYER_COLOR = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_PLAYER_COLOR, &ud.color );
881
static MenuEntry_t ME_PLAYER_COLOR = MAKE_MENUENTRY( &MF_BluefontRed, "Color", Option, &MEO_PLAYER_COLOR );
882
static char *MEOSN_PLAYER_TEAM[] = { "Blue", "Red", "Green", "Gray", };
883
static MenuOptionSet_t MEOS_PLAYER_TEAM = MAKE_MENUOPTIONSET( 0x2, MEOSN_PLAYER_TEAM, NULL );
884
static MenuOption_t MEO_PLAYER_TEAM = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_PLAYER_TEAM, &ud.team );
885
static MenuEntry_t ME_PLAYER_TEAM = MAKE_MENUENTRY( &MF_BluefontRed, "Team", Option, &MEO_PLAYER_TEAM );
886
static MenuLink_t MEO_PLAYER_MACROS = { MENU_MACROS, };
887
static MenuEntry_t ME_PLAYER_MACROS = MAKE_MENUENTRY( &MF_BluefontRed, "Multiplayer macros", Link, &MEO_PLAYER_MACROS );
5 Plagman 888
 
4496 hendricks2 889
static MenuEntry_t *MEL_PLAYER_NAME[] = {
890
    &ME_PLAYER_NAME,
891
};
892
static MenuEntry_t *MEL_PLAYER_COLOR[] = {
893
    &ME_PLAYER_COLOR,
894
};
895
static MenuEntry_t *MEL_PLAYER_TEAM[] = {
896
    &ME_PLAYER_TEAM,
897
};
898
static MenuEntry_t *MEL_PLAYER_MACROS[] = {
899
    &ME_PLAYER_MACROS,
900
};
5 Plagman 901
 
4496 hendricks2 902
static MenuString_t MEO_MACROS_TEMPLATE = MAKE_MENUSTRING( &MF_Bluefont, NULL, MAXRIDECULELENGTH, 0 );
903
static MenuString_t MEO_MACROS[MAXSAVEGAMES];
904
static MenuEntry_t ME_MACROS_TEMPLATE = MAKE_MENUENTRY( &MF_Bluefont, NULL, String, &MEO_MACROS_TEMPLATE );
905
static MenuEntry_t ME_MACROS[MAXRIDECULE];
906
static MenuEntry_t *MEL_MACROS[MAXRIDECULE];
5 Plagman 907
 
4496 hendricks2 908
static char *MenuUserMap = "User Map";
909
static char *MenuSkillNone = "None";
5 Plagman 910
 
4496 hendricks2 911
static char *MEOSN_NetGametypes[MAXGAMETYPES];
912
static char *MEOSN_NetEpisodes[MAXVOLUMES+1];
913
static char *MEOSN_NetLevels[MAXVOLUMES][MAXLEVELS];
914
static char *MEOSN_NetSkills[MAXSKILLS+1];
5 Plagman 915
 
4496 hendricks2 916
static MenuLink_t MEO_NETHOST_OPTIONS =  { MENU_NETOPTIONS, };
917
static MenuEntry_t ME_NETHOST_OPTIONS = MAKE_MENUENTRY( &MF_Redfont, "Game Options", Link, &MEO_NETHOST_OPTIONS );
918
static MenuEntry_t ME_NETHOST_LAUNCH = MAKE_MENUENTRY( &MF_Redfont, "Launch Game", Link, &MEO_NULL );
5 Plagman 919
 
4496 hendricks2 920
static MenuEntry_t *MEL_NETHOST[] = {
921
    &ME_NETHOST_OPTIONS,
922
    &ME_NETHOST_LAUNCH,
923
};
471 terminx 924
 
4496 hendricks2 925
static MenuOptionSet_t MEOS_NETOPTIONS_GAMETYPE = MAKE_MENUOPTIONSET( 0x0, MEOSN_NetGametypes, NULL );
926
static MenuOption_t MEO_NETOPTIONS_GAMETYPE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_GAMETYPE, &ud.m_coop );
927
static MenuEntry_t ME_NETOPTIONS_GAMETYPE = MAKE_MENUENTRY( &MF_Redfont, "Game Type", Option, &MEO_NETOPTIONS_GAMETYPE );
928
static MenuOptionSet_t MEOS_NETOPTIONS_EPISODE = MAKE_MENUOPTIONSET( 0x0, MEOSN_NetEpisodes, NULL );
929
static MenuOption_t MEO_NETOPTIONS_EPISODE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_EPISODE, NULL );
930
static MenuEntry_t ME_NETOPTIONS_EPISODE = MAKE_MENUENTRY( &MF_Redfont, "Episode", Option, &MEO_NETOPTIONS_EPISODE );
931
static MenuOptionSet_t MEOS_NETOPTIONS_LEVEL[MAXVOLUMES];
932
static MenuOption_t MEO_NETOPTIONS_LEVEL = MAKE_MENUOPTION( &MF_Bluefont, NULL, &ud.m_level_number );
933
static MenuEntry_t ME_NETOPTIONS_LEVEL = MAKE_MENUENTRY( &MF_Redfont, "Level", Option, &MEO_NETOPTIONS_LEVEL );
934
static MenuLink_t MEO_NETOPTIONS_USERMAP =  { MENU_NETUSERMAP, };
935
static MenuEntry_t ME_NETOPTIONS_USERMAP = MAKE_MENUENTRY( &MF_Redfont, "User Map", Link, &MEO_NETOPTIONS_USERMAP );
936
static MenuOptionSet_t MEOS_NETOPTIONS_MONSTERS = MAKE_MENUOPTIONSET( 0x0, MEOSN_NetSkills, NULL );
937
static MenuOption_t MEO_NETOPTIONS_MONSTERS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_MONSTERS, NULL );
938
static MenuEntry_t ME_NETOPTIONS_MONSTERS = MAKE_MENUENTRY( &MF_Redfont, "Monsters", Option, &MEO_NETOPTIONS_MONSTERS );
939
static MenuOption_t MEO_NETOPTIONS_MARKERS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.m_marker );
940
static MenuEntry_t ME_NETOPTIONS_MARKERS = MAKE_MENUENTRY( &MF_Redfont, "Markers", Option, &MEO_NETOPTIONS_MARKERS );
941
static MenuEntry_t ME_NETOPTIONS_MARKERS_DISABLED = MAKE_MENUENTRY( &MF_RedfontBlue, "Markers", Dummy, NULL );
942
static MenuOption_t MEO_NETOPTIONS_MAPEXITS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OnOff, &ud.m_noexits );
943
static MenuEntry_t ME_NETOPTIONS_MAPEXITS = MAKE_MENUENTRY( &MF_Redfont, "Map Exits", Option, &MEO_NETOPTIONS_MAPEXITS );
944
static MenuOption_t MEO_NETOPTIONS_FRFIRE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.m_ffire );
945
static MenuEntry_t ME_NETOPTIONS_FRFIRE = MAKE_MENUENTRY( &MF_Redfont, "Fr. Fire", Option, &MEO_NETOPTIONS_FRFIRE );
946
static MenuEntry_t ME_NETOPTIONS_ACCEPT = MAKE_MENUENTRY( &MF_RedfontGreen, "Accept", Link, &MEO_NULL );
471 terminx 947
 
4496 hendricks2 948
static MenuEntry_t *MEL_NETOPTIONS[] = {
949
    &ME_NETOPTIONS_GAMETYPE,
950
    &ME_NETOPTIONS_EPISODE,
951
    &ME_NETOPTIONS_LEVEL,
952
    &ME_NETOPTIONS_MONSTERS,
953
    &ME_NETOPTIONS_MARKERS,
954
    &ME_NETOPTIONS_MAPEXITS,
955
    &ME_NETOPTIONS_ACCEPT,
956
};
5 Plagman 957
 
4496 hendricks2 958
static char MenuServer[BMAX_PATH] = "localhost";
959
static MenuString_t MEO_NETJOIN_SERVER = MAKE_MENUSTRING( &MF_Bluefont, MenuServer, BMAX_PATH, 0 );
960
static MenuEntry_t ME_NETJOIN_SERVER = MAKE_MENUENTRY( &MF_Redfont, "Server", String, &MEO_NETJOIN_SERVER );
961
#define MAXPORTSTRINGLENGTH 6 // unsigned 16-bit integer
962
static char MenuPort[MAXPORTSTRINGLENGTH] = "19014";
963
static MenuString_t MEO_NETJOIN_PORT = MAKE_MENUSTRING( &MF_Bluefont, MenuPort, MAXPORTSTRINGLENGTH, INPUT_NUMERIC );
964
static MenuEntry_t ME_NETJOIN_PORT = MAKE_MENUENTRY( &MF_Redfont, "Port", String, &MEO_NETJOIN_PORT );
965
static MenuEntry_t ME_NETJOIN_CONNECT = MAKE_MENUENTRY( &MF_RedfontGreen, "Connect", Link, &MEO_NULL );
471 terminx 966
 
4496 hendricks2 967
static MenuEntry_t *MEL_NETJOIN[] = {
968
    &ME_NETJOIN_SERVER,
969
    &ME_NETJOIN_PORT,
970
    &ME_NETJOIN_CONNECT,
971
};
5 Plagman 972
 
973
 
4496 hendricks2 974
#define MAKE_MENUGROUP(Entries, ...) { Entries, ARRAY_SIZE(Entries), __VA_ARGS__, 0, 0, }
5 Plagman 975
 
4496 hendricks2 976
static MenuGroup_t MG_MAIN = MAKE_MENUGROUP( MEL_MAIN, &MP_TOP_MAIN );
977
static MenuGroup_t *MGL_MAIN[] = {
978
    &MG_MAIN,
979
};
5 Plagman 980
 
4496 hendricks2 981
static MenuGroup_t MG_MAIN_INGAME = MAKE_MENUGROUP( MEL_MAIN_INGAME, &MP_TOP_MAIN );
982
static MenuGroup_t *MGL_MAIN_INGAME[] = {
983
    &MG_MAIN_INGAME,
984
};
5 Plagman 985
 
4496 hendricks2 986
static MenuGroup_t MG_EPISODE = MAKE_MENUGROUP( MEL_EPISODE, &MP_TOP_EPISODE );
987
static MenuGroup_t MG_EPISODE_USERMAP = MAKE_MENUGROUP( MEL_EPISODE_USERMAP, &MP_TOP_EPISODE );
988
static MenuGroup_t *MGL_EPISODE[] = {
989
    &MG_EPISODE,
990
    &MG_EPISODE_USERMAP,
991
};
992
static MenuGroup_t *MGL_EPISODE_SHAREWARE[] = {
993
    &MG_EPISODE,
994
};
5 Plagman 995
 
4496 hendricks2 996
static MenuGroup_t MG_SKILL = MAKE_MENUGROUP( MEL_SKILL, &MP_TOP_SKILL );
997
static MenuGroup_t *MGL_SKILL[] = {
998
    &MG_SKILL,
999
};
5 Plagman 1000
 
4609 terminx 1001
static MenuGroup_t MG_GAMESETUP1 = MAKE_MENUGROUP( MEL_GAMESETUP1, &MP_BIGOPTIONSRT );
1002
 
1003
static MenuGroup_t MG_SCREENSETUP1 = MAKE_MENUGROUP( MEL_SCREENSETUP1, &MP_BIGOPTIONS );
1004
static MenuGroup_t MG_SCREENSETUP2 = MAKE_MENUGROUP( MEL_SCREENSETUP2, &MP_BIGOPTIONS );
1005
static MenuGroup_t MG_SCREENSETUP3 = MAKE_MENUGROUP( MEL_SCREENSETUP3, &MP_BIGOPTIONS );
1006
static MenuGroup_t MG_SCREENSETUP4 = MAKE_MENUGROUP( MEL_SCREENSETUP4, &MP_BIGOPTIONS );
1007
static MenuGroup_t MG_SCREENSETUP5 = MAKE_MENUGROUP( MEL_SCREENSETUP5, &MP_BIGOPTIONS );
1008
 
1009
static MenuGroup_t *MGL_SCREENSETUP[] = {
1010
#ifndef DROIDMENU
1011
        &MG_SCREENSETUP1,
4496 hendricks2 1012
#endif
4609 terminx 1013
        &MG_SCREENSETUP2,
1014
        &MG_SCREENSETUP3,
1015
        &MG_SCREENSETUP4,
1016
        &MG_SCREENSETUP5,
1017
};
1018
 
1019
 
1020
static MenuGroup_t MG_DISPLAYSETUP = MAKE_MENUGROUP(MEL_DISPLAYSETUP, &MP_BIGOPTIONS);
1021
 
1022
static MenuGroup_t *MGL_DISPLAYSETUP[] = {
1023
        &MG_DISPLAYSETUP,
1024
};
1025
 
1026
#ifdef USE_OPENGL
1027
static MenuGroup_t MG_DISPLAYSETUP_GL = MAKE_MENUGROUP(MEL_DISPLAYSETUP_GL, &MP_BIGOPTIONS);
1028
 
1029
static MenuGroup_t *MGL_DISPLAYSETUP_GL[] = {
1030
        &MG_DISPLAYSETUP_GL,
1031
};
1032
 
1033
#ifdef POLYMER
1034
static MenuGroup_t MG_DISPLAYSETUP_GL_POLYMER = MAKE_MENUGROUP(MEL_DISPLAYSETUP_GL_POLYMER, &MP_BIGOPTIONS);
1035
 
1036
static MenuGroup_t *MGL_DISPLAYSETUP_GL_POLYMER[] = {
1037
        &MG_DISPLAYSETUP_GL_POLYMER,
1038
};
1039
#endif
1040
#endif
1041
 
4496 hendricks2 1042
static MenuGroup_t *MGL_GAMESETUP[] = {
1043
    &MG_GAMESETUP1,
1044
};
471 terminx 1045
 
4496 hendricks2 1046
static MenuGroup_t MG_OPTIONS = MAKE_MENUGROUP( MEL_OPTIONS, &MP_TOP_OPTIONS );
1047
static MenuGroup_t *MGL_OPTIONS[] = {
1048
    &MG_OPTIONS,
1049
};
471 terminx 1050
 
4624 terminx 1051
static MenuGroup_t MG_VIDEOSETUP1 = MAKE_MENUGROUP( MEL_VIDEOSETUP1, &MP_BIGOPTIONSRT );
4496 hendricks2 1052
static MenuGroup_t MG_VIDEOSETUP_APPLY = MAKE_MENUGROUP( MEL_VIDEOSETUP_APPLY, &MP_VIDEOSETUP_APPLY );
1053
static MenuGroup_t *MGL_VIDEOSETUP[] = {
1054
    &MG_VIDEOSETUP1,
1055
    &MG_VIDEOSETUP_APPLY,
1056
};
4609 terminx 1057
 
1058
static MenuGroup_t MG_CONTROLS = MAKE_MENUGROUP(MEL_CONTROLS, &MP_TOP_OPTIONS);
1059
static MenuGroup_t *MGL_CONTROLS[] = {
1060
        &MG_CONTROLS,
4496 hendricks2 1061
};
5 Plagman 1062
 
4609 terminx 1063
static MenuGroup_t MG_KEYBOARDSETUP = MAKE_MENUGROUP( MEL_KEYBOARDSETUP, &MP_TOP_OPTIONS );
4496 hendricks2 1064
static MenuGroup_t *MGL_KEYBOARDSETUP[] = {
1065
    &MG_KEYBOARDSETUP,
1066
};
482 terminx 1067
 
4609 terminx 1068
static MenuGroup_t MG_MOUSESETUP1 = MAKE_MENUGROUP( MEL_MOUSESETUP1, &MP_BIGOPTIONS );
1069
static MenuGroup_t MG_MOUSESETUP2 = MAKE_MENUGROUP( MEL_MOUSESETUP2, &MP_BIGOPTIONSRT );
1070
 
4496 hendricks2 1071
static MenuGroup_t *MGL_MOUSESETUP[] = {
4609 terminx 1072
    &MG_MOUSESETUP1,
1073
        &MG_MOUSESETUP2,
4496 hendricks2 1074
};
56 terminx 1075
 
4496 hendricks2 1076
static MenuGroup_t MG_JOYSTICKSETUP = MAKE_MENUGROUP( MEL_JOYSTICKSETUP, &MP_TOP_JOYSTICK_NETWORK );
1077
static MenuGroup_t *MGL_JOYSTICKSETUP[] = {
1078
    &MG_JOYSTICKSETUP,
1079
};
5 Plagman 1080
 
4496 hendricks2 1081
static MenuGroup_t MG_JOYSTICKBTNS = MAKE_MENUGROUP( MEL_JOYSTICKBTNS, &MP_MOUSEJOYSETUPBTNS );
1082
static MenuGroup_t *MGL_JOYSTICKBTNS[] = {
1083
    &MG_JOYSTICKBTNS,
1084
};
56 terminx 1085
 
4496 hendricks2 1086
static MenuGroup_t MG_KEYBOARDSETUPFUNCS = MAKE_MENUGROUP( MEL_KEYBOARDSETUPFUNCS, &MP_KEYBOARDSETUPFUNCS );
1087
static MenuGroup_t *MGL_KEYBOARDKEYS[] = {
1088
    &MG_KEYBOARDSETUPFUNCS,
1089
};
58 terminx 1090
 
4496 hendricks2 1091
static MenuGroup_t MG_MOUSESETUPBTNS = MAKE_MENUGROUP( MEL_MOUSESETUPBTNS, &MP_MOUSEJOYSETUPBTNS );
1092
static MenuGroup_t *MGL_MOUSEBTNS[] = {
1093
    &MG_MOUSESETUPBTNS,
1094
};
268 terminx 1095
 
4496 hendricks2 1096
static MenuGroup_t MG_JOYSTICKAXES = MAKE_MENUGROUP( MEL_JOYSTICKAXES, &MP_REDSLIDE );
1097
static MenuGroup_t *MGL_JOYSTICKAXES[] = {
1098
    &MG_JOYSTICKAXES,
1099
};
53 terminx 1100
 
4496 hendricks2 1101
static MenuGroup_t MG_MOUSEADVANCED = MAKE_MENUGROUP( MEL_MOUSEADVANCED, &MP_REDSLIDE );
1102
static MenuGroup_t MG_MOUSEADVANCED_DAXES = MAKE_MENUGROUP( MEL_MOUSEADVANCED_DAXES, &MP_REDSLIDE );
1103
static MenuGroup_t *MGL_MOUSEADVANCED[] = {
1104
    &MG_MOUSEADVANCED,
1105
    &MG_MOUSEADVANCED_DAXES,
1106
};
471 terminx 1107
 
4496 hendricks2 1108
static MenuGroup_t MG_JOYSTICKAXIS = MAKE_MENUGROUP( MEL_JOYSTICKAXIS, &MP_REDSLIDE );
1109
static MenuGroup_t MG_JOYSTICKAXIS_DIGITAL = MAKE_MENUGROUP( MEL_JOYSTICKAXIS_DIGITAL, &MP_REDSLIDE );
1110
static MenuGroup_t *MGL_JOYSTICKAXIS[] = {
1111
    &MG_JOYSTICKAXIS,
1112
    &MG_JOYSTICKAXIS_DIGITAL,
1113
};
482 terminx 1114
 
4496 hendricks2 1115
#ifdef USE_OPENGL
1116
static MenuGroup_t MG_RENDERERSETUP_GL2 = MAKE_MENUGROUP( MEL_RENDERERSETUP_GL2, &MP_OPTIONS );
1117
static MenuGroup_t MG_RENDERERSETUP_GL3 = MAKE_MENUGROUP( MEL_RENDERERSETUP_GL3, &MP_OPTIONS );
4609 terminx 1118
 
1119
static MenuGroup_t *MGL_RENDERERSETUP[] = {
4496 hendricks2 1120
    &MG_RENDERERSETUP_GL2,
1121
    &MG_RENDERERSETUP_GL3,
1122
};
1123
#endif
471 terminx 1124
 
4496 hendricks2 1125
static MenuGroup_t MG_COLCORR = MAKE_MENUGROUP( MEL_COLCORR, &MP_COLCORR );
1126
static MenuGroup_t MG_COLCORR_RESET = MAKE_MENUGROUP( MEL_COLCORR_RESET, &MP_COLCORR );
1127
static MenuGroup_t *MGL_COLCORR[] = {
1128
    &MG_COLCORR,
1129
    &MG_COLCORR_RESET,
1130
};
337 terminx 1131
 
4496 hendricks2 1132
static MenuGroup_t MG_LOAD = MAKE_MENUGROUP( MEL_LOAD, &MP_LOADSAVE );
1133
static MenuGroup_t *MGL_LOAD[] = {
1134
    &MG_LOAD,
1135
};
471 terminx 1136
 
4496 hendricks2 1137
static MenuGroup_t MG_SAVE = MAKE_MENUGROUP( MEL_SAVE, &MP_LOADSAVE );
1138
static MenuGroup_t *MGL_SAVE[] = {
1139
    &MG_SAVE,
1140
};
471 terminx 1141
 
4609 terminx 1142
static MenuGroup_t MG_SOUND1 = MAKE_MENUGROUP( MEL_SOUND1, &MP_BIGOPTIONSRT );
1143
static MenuGroup_t MG_SOUND2 = MAKE_MENUGROUP( MEL_SOUND2, &MP_BIGOPTIONS );
1144
static MenuGroup_t MG_SOUND3 = MAKE_MENUGROUP( MEL_SOUND3, &MP_BIGOPTIONSRT );
1145
 
4496 hendricks2 1146
static MenuGroup_t *MGL_SOUND[] = {
4609 terminx 1147
        &MG_SOUND1,
1148
        &MG_SOUND2,
1149
        &MG_SOUND3,
4496 hendricks2 1150
};
151 terminx 1151
 
4609 terminx 1152
static MenuGroup_t MG_ADVSOUND1 = MAKE_MENUGROUP( MEL_ADVSOUND1, &MP_BIGOPTIONSRT );
1153
static MenuGroup_t MG_ADVSOUND2 = MAKE_MENUGROUP( MEL_ADVSOUND2, &MP_BIGOPTIONS );
1154
static MenuGroup_t MG_ADVSOUND3 = MAKE_MENUGROUP( MEL_ADVSOUND3, &MP_BIGOPTIONSRT );
1155
 
1156
static MenuGroup_t *MGL_ADVSOUND[] = {
1157
        &MG_ADVSOUND1,
1158
        &MG_ADVSOUND2,
1159
        &MG_ADVSOUND3,
4496 hendricks2 1160
};
335 terminx 1161
 
4609 terminx 1162
 
4496 hendricks2 1163
static MenuGroup_t MG_NETWORK = MAKE_MENUGROUP( MEL_NETWORK, &MP_TOP_JOYSTICK_NETWORK );
1164
static MenuGroup_t *MGL_NETWORK[] = {
1165
    &MG_NETWORK,
1166
};
5 Plagman 1167
 
4496 hendricks2 1168
static MenuGroup_t MG_PLAYER_NAME = MAKE_MENUGROUP( MEL_PLAYER_NAME, &MP_PLAYER_1 );
1169
static MenuGroup_t MG_PLAYER_COLOR = MAKE_MENUGROUP( MEL_PLAYER_COLOR, &MP_PLAYER_1 );
1170
static MenuGroup_t MG_PLAYER_TEAM = MAKE_MENUGROUP( MEL_PLAYER_TEAM, &MP_PLAYER_1 );
1171
static MenuGroup_t MG_PLAYER_MACROS = MAKE_MENUGROUP( MEL_PLAYER_MACROS, &MP_PLAYER_3 );
1172
static MenuGroup_t *MGL_PLAYER[] = {
1173
    &MG_PLAYER_NAME,
1174
    &MG_PLAYER_COLOR,
1175
    &MG_PLAYER_TEAM,
4609 terminx 1176
#ifndef DROIDMENU
4496 hendricks2 1177
    &MG_PLAYER_MACROS,
4609 terminx 1178
#endif
4496 hendricks2 1179
};
5 Plagman 1180
 
4496 hendricks2 1181
static MenuGroup_t MG_MACROS = MAKE_MENUGROUP( MEL_MACROS, &MP_MACROS );
1182
static MenuGroup_t *MGL_MACROS[] = {
1183
    &MG_MACROS,
1184
};
53 terminx 1185
 
4496 hendricks2 1186
static MenuGroup_t MG_NETHOST = MAKE_MENUGROUP( MEL_NETHOST, &MP_VIDEOSETUP );
1187
static MenuGroup_t *MGL_NETHOST[] = {
1188
    &MG_NETHOST,
1189
};
54 terminx 1190
 
4496 hendricks2 1191
static MenuGroup_t MG_NETOPTIONS = MAKE_MENUGROUP( MEL_NETOPTIONS, &MP_NETSETUP );
1192
static MenuGroup_t *MGL_NETOPTIONS[] = {
1193
    &MG_NETOPTIONS,
1194
};
482 terminx 1195
 
4496 hendricks2 1196
static MenuGroup_t MG_NETJOIN = MAKE_MENUGROUP( MEL_NETJOIN, &MP_VIDEOSETUP );
1197
static MenuGroup_t *MGL_NETJOIN[] = {
1198
    &MG_NETJOIN,
1199
};
1124 terminx 1200
 
5 Plagman 1201
 
88 terminx 1202
 
4496 hendricks2 1203
#define NoTitle NULL
91 terminx 1204
 
4496 hendricks2 1205
#define MAKE_MENUMENU(Groups, ...) { Groups, ARRAY_SIZE(Groups), __VA_ARGS__, 0, INT32_MAX, INT32_MIN, 0, 0, }
91 terminx 1206
 
4496 hendricks2 1207
static MenuMenu_t M_MAIN = MAKE_MENUMENU( MGL_MAIN, NoTitle );
1208
static MenuMenu_t M_MAIN_INGAME = MAKE_MENUMENU( MGL_MAIN_INGAME, NoTitle );
1209
static MenuMenu_t M_EPISODE = MAKE_MENUMENU( MGL_EPISODE, "Select An Episode" );
1210
static MenuMenu_t M_SKILL = MAKE_MENUMENU( MGL_SKILL, "Select Skill" );
1211
static MenuMenu_t M_GAMESETUP = MAKE_MENUMENU( MGL_GAMESETUP, "Game Setup" );
1212
static MenuMenu_t M_OPTIONS = MAKE_MENUMENU( MGL_OPTIONS, "Options" );
4609 terminx 1213
static MenuMenu_t M_VIDEOSETUP = MAKE_MENUMENU( MGL_VIDEOSETUP, "Video Mode" );
4496 hendricks2 1214
static MenuMenu_t M_KEYBOARDSETUP = MAKE_MENUMENU( MGL_KEYBOARDSETUP, "Keyboard Setup" );
4609 terminx 1215
static MenuMenu_t M_CONTROLS = MAKE_MENUMENU( MGL_CONTROLS, "Control Setup" );
4496 hendricks2 1216
static MenuMenu_t M_MOUSESETUP = MAKE_MENUMENU( MGL_MOUSESETUP, "Mouse Setup" );
1217
static MenuMenu_t M_JOYSTICKSETUP = MAKE_MENUMENU( MGL_JOYSTICKSETUP, "Joystick Setup" );
1218
static MenuMenu_t M_JOYSTICKBTNS = MAKE_MENUMENU( MGL_JOYSTICKBTNS, "Joystick Buttons" );
1219
static MenuMenu_t M_JOYSTICKAXES = MAKE_MENUMENU( MGL_JOYSTICKAXES, "Joystick Axes" );
1220
static MenuMenu_t M_KEYBOARDKEYS = MAKE_MENUMENU( MGL_KEYBOARDKEYS, "Keyboard Keys" );
1221
static MenuMenu_t M_MOUSEBTNS = MAKE_MENUMENU( MGL_MOUSEBTNS, "Mouse Buttons" );
1222
static MenuMenu_t M_MOUSEADVANCED = MAKE_MENUMENU( MGL_MOUSEADVANCED, "Advanced Mouse" );
1223
static MenuMenu_t M_JOYSTICKAXIS = MAKE_MENUMENU( MGL_JOYSTICKAXIS, NULL );
4609 terminx 1224
#ifdef USE_OPENGL
1225
static MenuMenu_t M_RENDERERSETUP = MAKE_MENUMENU( MGL_RENDERERSETUP, "Advanced Video" );
1226
#endif
4496 hendricks2 1227
static MenuMenu_t M_COLCORR = MAKE_MENUMENU( MGL_COLCORR, "Color Correction" );
4609 terminx 1228
static MenuMenu_t M_SCREENSETUP = MAKE_MENUMENU( MGL_SCREENSETUP, "On-Screen Displays" );
1229
static MenuMenu_t M_DISPLAYSETUP = MAKE_MENUMENU( MGL_DISPLAYSETUP, "Display Setup" );
4496 hendricks2 1230
static MenuMenu_t M_LOAD = MAKE_MENUMENU( MGL_LOAD, "Load Game" );
1231
static MenuMenu_t M_SAVE = MAKE_MENUMENU( MGL_SAVE, "Save Game" );
1232
static MenuMenu_t M_SOUND = MAKE_MENUMENU( MGL_SOUND, "Sound Setup" );
4609 terminx 1233
static MenuMenu_t M_ADVSOUND = MAKE_MENUMENU( MGL_ADVSOUND, "Sound Setup" );
4496 hendricks2 1234
static MenuMenu_t M_NETWORK = MAKE_MENUMENU( MGL_NETWORK, "Network Game" );
1235
static MenuMenu_t M_PLAYER = MAKE_MENUMENU( MGL_PLAYER, "Player Setup" );
1236
static MenuMenu_t M_MACROS = MAKE_MENUMENU( MGL_MACROS, "Multiplayer Macros" );
1237
static MenuMenu_t M_NETHOST = MAKE_MENUMENU( MGL_NETHOST, "Host Network Game" );
1238
static MenuMenu_t M_NETOPTIONS = MAKE_MENUMENU( MGL_NETOPTIONS, "Net Game Options" );
1239
static MenuMenu_t M_NETJOIN = MAKE_MENUMENU( MGL_NETJOIN, "Join Network Game" );
88 terminx 1240
 
4609 terminx 1241
#ifdef DROIDMENU
1242
static MenuPanel_t M_STORY = { NoTitle, MENU_STORY, MENU_STORY, };
1243
#else
4496 hendricks2 1244
static MenuPanel_t M_STORY = { NoTitle, MENU_F1HELP, MENU_F1HELP, };
4609 terminx 1245
#endif
1246
 
4496 hendricks2 1247
static MenuPanel_t M_F1HELP = { NoTitle, MENU_STORY, MENU_STORY, };
1248
static const char* MenuCredits = "Credits";
1249
static MenuPanel_t M_CREDITS = { NoTitle, MENU_CREDITS5, MENU_CREDITS2, };
1250
static MenuPanel_t M_CREDITS2 = { NoTitle, MENU_CREDITS, MENU_CREDITS3, };
1251
static MenuPanel_t M_CREDITS3 = { NoTitle, MENU_CREDITS2, MENU_CREDITS4, };
4609 terminx 1252
#ifdef DROIDMENU
1253
static MenuPanel_t M_CREDITS4 = { "Meltdown Collection", MENU_CREDITS3, MENU_CREDITS5, };
1254
#else
4496 hendricks2 1255
static MenuPanel_t M_CREDITS4 = { "About EDuke32", MENU_CREDITS3, MENU_CREDITS5, };
4609 terminx 1256
#endif
4496 hendricks2 1257
static MenuPanel_t M_CREDITS5 = { "About EDuke32", MENU_CREDITS4, MENU_CREDITS, };
5 Plagman 1258
 
4496 hendricks2 1259
#define CURSOR_CENTER_2LINE { 160<<16, 120<<16, }
1260
#define CURSOR_CENTER_3LINE { 160<<16, 129<<16, }
1261
#define CURSOR_BOTTOMRIGHT { 304<<16, 186<<16, }
5 Plagman 1262
 
4496 hendricks2 1263
static MenuVerify_t M_QUIT = { CURSOR_CENTER_2LINE, MENU_CLOSE, };
1264
static MenuVerify_t M_QUITTOTITLE = { CURSOR_CENTER_2LINE, MENU_CLOSE, };
1265
static MenuVerify_t M_LOADVERIFY = { CURSOR_CENTER_3LINE, MENU_CLOSE, };
1266
static MenuVerify_t M_NEWVERIFY = { CURSOR_CENTER_2LINE, MENU_EPISODE, };
1267
static MenuVerify_t M_SAVEVERIFY = { CURSOR_CENTER_2LINE, MENU_SAVE, };
1268
static MenuVerify_t M_RESETPLAYER = { CURSOR_CENTER_3LINE, MENU_CLOSE, };
5 Plagman 1269
 
4496 hendricks2 1270
static MenuMessage_t M_NETWAITMASTER = { CURSOR_BOTTOMRIGHT, MENU_NULL, };
1271
static MenuMessage_t M_NETWAITVOTES = { CURSOR_BOTTOMRIGHT, MENU_NULL, };
1272
static MenuMessage_t M_BUYDUKE = { CURSOR_BOTTOMRIGHT, MENU_EPISODE, };
5 Plagman 1273
 
4496 hendricks2 1274
static MenuPassword_t M_ADULTPASSWORD = { MAXPWLOCKOUT, NULL, };
5 Plagman 1275
 
4509 hendricks2 1276
#define MAKE_MENUFILESELECT(...) { __VA_ARGS__, FNLIST_INITIALIZER, { NULL, NULL, }, 0, { 0, 0, }, }
337 terminx 1277
 
4509 hendricks2 1278
static MenuFileSelect_t M_USERMAP = MAKE_MENUFILESELECT( "Select A User Map", { &MF_Minifont, &MF_MinifontRed, }, "*.map", boardfilename );
337 terminx 1279
 
4509 hendricks2 1280
static const int32_t MenuFileSelect_entryheight = 8<<16;
1281
static const int32_t MenuFileSelect_startx[2] = { 40<<16, 180<<16, };
1282
static const int32_t MenuFileSelect_ytop[2] = { ((1+12+32+8)<<16), (1+12+32)<<16, };
1283
static const int32_t MenuFileSelect_ybottom = (1+12+32+8*13)<<16;
1284
 
4496 hendricks2 1285
// MUST be in ascending order of MenuID enum values due to binary search
1286
static Menu_t Menus[] = {
1287
    { MENU_MAIN, MENU_CLOSE, Menu, &M_MAIN, },
1288
    { MENU_MAIN_INGAME, MENU_CLOSE, Menu, &M_MAIN_INGAME, },
1289
    { MENU_EPISODE, MENU_MAIN, Menu, &M_EPISODE, },
1290
    { MENU_USERMAP, MENU_EPISODE, FileSelect, &M_USERMAP, },
1291
    { MENU_SKILL, MENU_EPISODE, Menu, &M_SKILL, },
1292
    { MENU_GAMESETUP, MENU_OPTIONS, Menu, &M_GAMESETUP, },
1293
    { MENU_OPTIONS, MENU_MAIN, Menu, &M_OPTIONS, },
4609 terminx 1294
    { MENU_VIDEOSETUP, MENU_DISPLAYSETUP, Menu, &M_VIDEOSETUP, },
1295
    { MENU_KEYBOARDSETUP, MENU_CONTROLS, Menu, &M_KEYBOARDSETUP, },
1296
    { MENU_MOUSESETUP, MENU_CONTROLS, Menu, &M_MOUSESETUP, },
1297
    { MENU_JOYSTICKSETUP, MENU_CONTROLS, Menu, &M_JOYSTICKSETUP, },
4496 hendricks2 1298
    { MENU_JOYSTICKBTNS, MENU_JOYSTICKSETUP, Menu, &M_JOYSTICKBTNS, },
1299
    { MENU_JOYSTICKAXES, MENU_JOYSTICKSETUP, Menu, &M_JOYSTICKAXES, },
1300
    { MENU_KEYBOARDKEYS, MENU_KEYBOARDSETUP, Menu, &M_KEYBOARDKEYS, },
1301
    { MENU_MOUSEBTNS, MENU_MOUSESETUP, Menu, &M_MOUSEBTNS, },
1302
    { MENU_MOUSEADVANCED, MENU_MOUSESETUP, Menu, &M_MOUSEADVANCED, },
1303
    { MENU_JOYSTICKAXIS, MENU_JOYSTICKAXES, Menu, &M_JOYSTICKAXIS, },
4609 terminx 1304
        { MENU_CONTROLS, MENU_OPTIONS, Menu, &M_CONTROLS, },
1305
#ifdef USE_OPENGL
1306
    { MENU_RENDERERSETUP, MENU_DISPLAYSETUP, Menu, &M_RENDERERSETUP, },
1307
#endif
1308
    { MENU_COLCORR, MENU_DISPLAYSETUP, Menu, &M_COLCORR, },
4496 hendricks2 1309
    { MENU_COLCORR_INGAME, MENU_CLOSE, Menu, &M_COLCORR, },
4609 terminx 1310
        { MENU_SCREENSETUP, MENU_DISPLAYSETUP, Menu, &M_SCREENSETUP, },
1311
        { MENU_DISPLAYSETUP, MENU_OPTIONS, Menu, &M_DISPLAYSETUP, },
4496 hendricks2 1312
    { MENU_LOAD, MENU_MAIN, Menu, &M_LOAD, },
1313
    { MENU_SAVE, MENU_MAIN, Menu, &M_SAVE, },
1314
    { MENU_STORY, MENU_MAIN, Panel, &M_STORY, },
1315
    { MENU_F1HELP, MENU_MAIN, Panel, &M_F1HELP, },
1316
    { MENU_QUIT, MENU_PREVIOUS, Verify, &M_QUIT, },
1317
    { MENU_QUITTOTITLE, MENU_PREVIOUS, Verify, &M_QUITTOTITLE, },
1318
    { MENU_QUIT_INGAME, MENU_CLOSE, Verify, &M_QUIT, },
1319
    { MENU_NETSETUP, MENU_MAIN, Menu, &M_NETHOST, },
1320
    { MENU_NETWAITMASTER, MENU_MAIN, Message, &M_NETWAITMASTER, },
1321
    { MENU_NETWAITVOTES, MENU_MAIN, Message, &M_NETWAITVOTES, },
1322
    { MENU_SOUND, MENU_OPTIONS, Menu, &M_SOUND, },
1323
    { MENU_SOUND_INGAME, MENU_CLOSE, Menu, &M_SOUND, },
4609 terminx 1324
    { MENU_ADVSOUND, MENU_SOUND, Menu, &M_ADVSOUND, },
4496 hendricks2 1325
    { MENU_CREDITS, MENU_MAIN, Panel, &M_CREDITS, },
1326
    { MENU_CREDITS2, MENU_MAIN, Panel, &M_CREDITS2, },
1327
    { MENU_CREDITS3, MENU_MAIN, Panel, &M_CREDITS3, },
1328
    { MENU_CREDITS4, MENU_MAIN, Panel, &M_CREDITS4, },
1329
    { MENU_CREDITS5, MENU_MAIN, Panel, &M_CREDITS5, },
1330
    { MENU_LOADVERIFY, MENU_LOAD, Verify, &M_LOADVERIFY, },
1331
    { MENU_NEWVERIFY, MENU_MAIN, Verify, &M_NEWVERIFY, },
1332
    { MENU_SAVEVERIFY, MENU_SAVE, Verify, &M_SAVEVERIFY, },
4609 terminx 1333
    { MENU_ADULTPASSWORD, MENU_GAMESETUP, Password, &M_ADULTPASSWORD, },
4496 hendricks2 1334
    { MENU_RESETPLAYER, MENU_CLOSE, Verify, &M_RESETPLAYER, },
1335
    { MENU_BUYDUKE, MENU_EPISODE, Message, &M_BUYDUKE, },
1336
    { MENU_NETWORK, MENU_MAIN, Menu, &M_NETWORK, },
1337
    { MENU_PLAYER, MENU_OPTIONS, Menu, &M_PLAYER, },
1338
    { MENU_MACROS, MENU_PLAYER, Menu, &M_MACROS, },
1339
    { MENU_NETHOST, MENU_NETWORK, Menu, &M_NETHOST, },
1340
    { MENU_NETOPTIONS, MENU_NETWORK, Menu, &M_NETOPTIONS, },
1341
    { MENU_NETUSERMAP, MENU_NETOPTIONS, FileSelect, &M_USERMAP, },
1342
    { MENU_NETJOIN, MENU_NETWORK, Menu, &M_NETJOIN, },
1343
};
337 terminx 1344
 
4496 hendricks2 1345
static const size_t numMenus = ARRAY_SIZE(Menus);
337 terminx 1346
 
4496 hendricks2 1347
Menu_t *m_currentMenu = &Menus[0];
1348
static Menu_t *m_previousMenu = &Menus[0];
5 Plagman 1349
 
4496 hendricks2 1350
MenuID_t g_currentMenu;
1351
static MenuID_t g_previousMenu;
337 terminx 1352
 
5 Plagman 1353
 
4609 terminx 1354
#define MenuMenu_ChangeGroupList(_, gl)\
4496 hendricks2 1355
    do {\
4609 terminx 1356
        _.grouplist = gl;\
1357
        _.numGroups = ARRAY_SIZE(gl);\
4496 hendricks2 1358
    } while (0)
5 Plagman 1359
 
4496 hendricks2 1360
#define MenuGroup_ChangeEntryList(g, el)\
1361
    do {\
1362
        g.entrylist = el;\
1363
        g.numEntries = ARRAY_SIZE(el);\
1364
    } while (0)
5 Plagman 1365
 
1366
 
4496 hendricks2 1367
/*
1368
This function prepares data after ART and CON have been processed.
1369
It also initializes some data in loops rather than statically at compile time.
1370
*/
1371
void M_Init(void)
1372
{
1373
    int32_t i, j, k;
5 Plagman 1374
 
4496 hendricks2 1375
    // prepare menu fonts
4609 terminx 1376
    MF_Redfont.tilenum = MF_RedfontRt.tilenum = MF_RedfontBlue.tilenum = MF_RedfontGreen.tilenum = BIGALPHANUM;
4496 hendricks2 1377
    MF_Bluefont.tilenum = MF_BluefontRed.tilenum = STARTALPHANUM;
1378
    MF_Minifont.tilenum = MF_MinifontRed.tilenum = MF_MinifontDarkGray.tilenum = MINIFONT;
1379
    if (!minitext_lowercase)
1380
    {
1381
        MF_Minifont.textflags |= TEXT_UPPERCASE;
1382
        MF_MinifontRed.textflags |= TEXT_UPPERCASE;
1383
        MF_MinifontDarkGray.textflags |= TEXT_UPPERCASE;
1384
    }
5 Plagman 1385
 
4496 hendricks2 1386
    // prepare gamefuncs and keys
1387
    for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
1388
    {
1389
        Bstrcpy(MenuGameFuncs[i], gamefunctions[i]);
5 Plagman 1390
 
4496 hendricks2 1391
        for (j = 0; j < MAXGAMEFUNCLEN; ++j)
1392
            if (MenuGameFuncs[i][j] == '_')
1393
                MenuGameFuncs[i][j] = ' ';
5 Plagman 1394
 
4496 hendricks2 1395
        MEOSN_Gamefuncs[i] = MenuGameFuncs[i];
1396
    }
1397
    MEOSN_Gamefuncs[NUMGAMEFUNCTIONS] = MenuGameFuncNone;
1398
    for (i = 0; i < NUMKEYS; ++i)
1399
        MEOSN_Keys[i] = key_names[i];
1400
    MEOSN_Keys[NUMKEYS-1] = MenuKeyNone;
5 Plagman 1401
 
1402
 
4496 hendricks2 1403
    // prepare episodes
1404
    k = -1;
1405
    for (i = 0; i < MAXVOLUMES; ++i)
1406
    {
1407
        if (EpisodeNames[i][0])
337 terminx 1408
        {
4496 hendricks2 1409
            MEL_EPISODE[i] = &ME_EPISODE[i];
1410
            ME_EPISODE[i] = ME_EPISODE_TEMPLATE;
1411
            ME_EPISODE[i].name = EpisodeNames[i];
1412
 
1413
            MEOSN_NetEpisodes[i] = EpisodeNames[i];
1414
 
1415
            k = i;
337 terminx 1416
        }
5 Plagman 1417
 
4496 hendricks2 1418
        // prepare levels
1419
        for (j = 0; j < MAXLEVELS; ++j)
337 terminx 1420
        {
4496 hendricks2 1421
            MEOSN_NetLevels[i][j] = MapInfo[MAXLEVELS*i+j].name;
1422
            if (MapInfo[i*MAXLEVELS+j].filename != NULL)
1423
                MEOS_NETOPTIONS_LEVEL[i].numOptions = j+1;
337 terminx 1424
        }
4496 hendricks2 1425
        MEOS_NETOPTIONS_LEVEL[i].optionNames = MEOSN_NetLevels[i];
1426
    }
1427
    ++k;
1428
    MG_EPISODE.numEntries = g_numVolumes; // k;
1429
    MEOS_NETOPTIONS_EPISODE.numOptions = g_numVolumes + 1; // k+1;
1430
    MEOSN_NetEpisodes[g_numVolumes] = MenuUserMap;
1431
    MP_TOP_EPISODE.pos.y = (48-(g_numVolumes*2))<<16;
5 Plagman 1432
 
4496 hendricks2 1433
    // prepare skills
1434
    k = -1;
1435
    for (i = 0; i < g_numSkills && SkillNames[i][0]; ++i)
1436
    {
1437
        MEL_SKILL[i] = &ME_SKILL[i];
1438
        ME_SKILL[i] = ME_SKILL_TEMPLATE;
1439
        ME_SKILL[i].name = SkillNames[i];
5 Plagman 1440
 
4496 hendricks2 1441
        MEOSN_NetSkills[i] = SkillNames[i];
5 Plagman 1442
 
4496 hendricks2 1443
        k = i;
1444
    }
1445
    ++k;
1446
    MG_SKILL.numEntries = g_numSkills; // k;
1447
    MEOS_NETOPTIONS_MONSTERS.numOptions = g_numSkills + 1; // k+1;
1448
    MEOSN_NetSkills[g_numSkills] = MenuSkillNone;
1449
    MP_TOP_SKILL.pos.y = (58 + (4-g_numSkills)*6)<<16;
1450
    MG_SKILL.currentEntry = 1;
5 Plagman 1451
 
4496 hendricks2 1452
    // prepare multiplayer gametypes
1453
    k = -1;
1454
    for (i = 0; i < MAXGAMETYPES; ++i)
1455
        if (GametypeNames[i][0])
1456
        {
1457
            MEOSN_NetGametypes[i] = GametypeNames[i];
1458
            k = i;
1459
        }
1460
    ++k;
1461
    MEOS_NETOPTIONS_GAMETYPE.numOptions = k;
5 Plagman 1462
 
4496 hendricks2 1463
    // prepare savegames
1464
    for (i = 0; i < MAXSAVEGAMES; ++i)
1465
    {
1466
        MEL_LOAD[i] = &ME_LOAD[i];
1467
        MEL_SAVE[i] = &ME_SAVE[i];
1468
        ME_LOAD[i] = ME_LOAD_TEMPLATE;
1469
        ME_SAVE[i] = ME_SAVE_TEMPLATE;
1470
        ME_SAVE[i].entry = &MEO_SAVE[i];
1471
        MEO_SAVE[i] = MEO_SAVE_TEMPLATE;
5 Plagman 1472
 
4496 hendricks2 1473
        ME_LOAD[i].name = ud.savegame[i];
1474
        MEO_SAVE[i].variable = ud.savegame[i];
1475
    }
5 Plagman 1476
 
4496 hendricks2 1477
    // prepare text chat macros
1478
    for (i = 0; i < MAXRIDECULE; ++i)
1479
    {
1480
        MEL_MACROS[i] = &ME_MACROS[i];
1481
        ME_MACROS[i] = ME_MACROS_TEMPLATE;
1482
        ME_MACROS[i].entry = &MEO_MACROS[i];
1483
        MEO_MACROS[i] = MEO_MACROS_TEMPLATE;
5 Plagman 1484
 
4496 hendricks2 1485
        MEO_MACROS[i].variable = ud.ridecule[i];
1486
    }
1487
 
1488
    // prepare input
1489
    for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
1490
    {
1491
        MEL_KEYBOARDSETUPFUNCS[i] = &ME_KEYBOARDSETUPFUNCS[i];
1492
        ME_KEYBOARDSETUPFUNCS[i] = ME_KEYBOARDSETUPFUNCS_TEMPLATE;
1493
        ME_KEYBOARDSETUPFUNCS[i].name = MenuGameFuncs[i];
1494
        ME_KEYBOARDSETUPFUNCS[i].entry = &MEO_KEYBOARDSETUPFUNCS[i];
1495
        MEO_KEYBOARDSETUPFUNCS[i] = MEO_KEYBOARDSETUPFUNCS_TEMPLATE;
1496
        MEO_KEYBOARDSETUPFUNCS[i].column[0] = &ud.config.KeyboardKeys[i][0];
1497
        MEO_KEYBOARDSETUPFUNCS[i].column[1] = &ud.config.KeyboardKeys[i][1];
1498
    }
1499
    for (i = 0; i < MENUMOUSEFUNCTIONS; ++i)
1500
    {
1501
        MEL_MOUSESETUPBTNS[i] = &ME_MOUSESETUPBTNS[i];
1502
        ME_MOUSESETUPBTNS[i] = ME_MOUSEJOYSETUPBTNS_TEMPLATE;
1503
        ME_MOUSESETUPBTNS[i].name = MenuMouseNames[i];
1504
        ME_MOUSESETUPBTNS[i].entry = &MEO_MOUSESETUPBTNS[i];
1505
        MEO_MOUSESETUPBTNS[i] = MEO_MOUSEJOYSETUPBTNS_TEMPLATE;
1506
        MEO_MOUSESETUPBTNS[i].data = &ud.config.MouseFunctions[MenuMouseDataIndex[i][0]][MenuMouseDataIndex[i][1]];
1507
    }
1508
    for (i = 0; i < 2*joynumbuttons + 2*joynumhats; ++i)
1509
    {
1510
        if (i < 2*joynumbuttons)
337 terminx 1511
        {
4496 hendricks2 1512
            if (i & 1)
1513
                Bsnprintf(MenuJoystickNames[i], MAXJOYBUTTONSTRINGLENGTH, "Double %s", getjoyname(1, i>>1));
1514
            else
1515
                Bstrncpy(MenuJoystickNames[i], getjoyname(1, i>>1), MAXJOYBUTTONSTRINGLENGTH);
337 terminx 1516
        }
1517
        else
1518
        {
4496 hendricks2 1519
            Bsnprintf(MenuJoystickNames[i], MAXJOYBUTTONSTRINGLENGTH, (i & 1) ? "Double Hat %d %s" : "Hat %d %s", ((i - 2*joynumbuttons)>>3), MenuJoystickHatDirections[((i - 2*joynumbuttons)>>1) % 4]);
337 terminx 1520
        }
5 Plagman 1521
 
4496 hendricks2 1522
        MEL_JOYSTICKBTNS[i] = &ME_JOYSTICKBTNS[i];
1523
        ME_JOYSTICKBTNS[i] = ME_MOUSEJOYSETUPBTNS_TEMPLATE;
1524
        ME_JOYSTICKBTNS[i].name = MenuJoystickNames[i];
1525
        ME_JOYSTICKBTNS[i].entry = &MEO_JOYSTICKBTNS[i];
1526
        MEO_JOYSTICKBTNS[i] = MEO_MOUSEJOYSETUPBTNS_TEMPLATE;
1527
        MEO_JOYSTICKBTNS[i].data = &ud.config.JoystickFunctions[i>>1][i&1];
4399 hendricks2 1528
    }
4496 hendricks2 1529
    MG_JOYSTICKBTNS.numEntries = 2*joynumbuttons + 2*joynumhats;
1530
    for (i = 0; i < joynumaxes; ++i)
1531
    {
1532
        ME_JOYSTICKAXES[i] = ME_JOYSTICKAXES_TEMPLATE;
1533
        Bstrncpy(MenuJoystickAxes[i], getjoyname(0, i), MAXJOYBUTTONSTRINGLENGTH);
1534
        ME_JOYSTICKAXES[i].name = MenuJoystickAxes[i];
1535
        MEL_JOYSTICKAXES[i] = &ME_JOYSTICKAXES[i];
1536
    }
1537
    MG_JOYSTICKAXES.numEntries = joynumaxes;
5 Plagman 1538
 
4496 hendricks2 1539
    // prepare video setup
1540
    for (i = 0; i < validmodecnt; ++i)
1541
    {
1542
        int32_t *const r = &MEOS_VIDEOSETUP_RESOLUTION.numOptions;
5 Plagman 1543
 
4496 hendricks2 1544
        for (j = 0; j < *r; ++j)
337 terminx 1545
        {
4496 hendricks2 1546
            if (validmode[i].xdim == resolution[j].xdim && validmode[i].ydim == resolution[j].ydim)
335 terminx 1547
            {
4496 hendricks2 1548
                resolution[j].flags |= validmode[i].fs ? RES_FS : RES_WIN;
1549
                if (validmode[i].bpp > resolution[j].bppmax)
1550
                    resolution[j].bppmax = validmode[i].bpp;
1551
                break;
335 terminx 1552
            }
337 terminx 1553
        }
4496 hendricks2 1554
 
1555
        if (j == *r) // no match found
337 terminx 1556
        {
4496 hendricks2 1557
            resolution[j].xdim = validmode[i].xdim;
1558
            resolution[j].ydim = validmode[i].ydim;
1559
            resolution[j].bppmax = validmode[i].bpp;
1560
            resolution[j].flags = validmode[i].fs ? RES_FS : RES_WIN;
1561
            Bsnprintf(resolution[j].name, MAXRESOLUTIONSTRINGLENGTH, "%d x %d", resolution[j].xdim, resolution[j].ydim);
1562
            MEOSN_VIDEOSETUP_RESOLUTION[j] = resolution[j].name;
1563
            ++*r;
1564
        }
1565
    }
337 terminx 1566
 
4496 hendricks2 1567
    // prepare shareware
1568
    if (VOLUMEONE)
1569
    {
1570
        // remove User Map
1571
        MenuMenu_ChangeGroupList(M_EPISODE, MGL_EPISODE_SHAREWARE);
1572
 
1573
        // blue out episodes beyond the first
1574
        for (i = 1; i < MAXVOLUMES; ++i)
337 terminx 1575
        {
4496 hendricks2 1576
            if (MEL_EPISODE[i])
335 terminx 1577
            {
4496 hendricks2 1578
                ME_EPISODE[i].font = &MF_RedfontBlue;
1579
                ME_EPISODE[i].entry = &MEO_EPISODE_SHAREWARE;
5 Plagman 1580
            }
337 terminx 1581
        }
4496 hendricks2 1582
        MEOS_NETOPTIONS_EPISODE.numOptions = 1;
1583
        ME_NETOPTIONS_EPISODE.disabled = 1;
1584
    }
5 Plagman 1585
 
4496 hendricks2 1586
    // prepare pre-Atomic
1587
    if (!VOLUMEALL || !PLUTOPAK)
1588
    {
1589
        // prepare credits
1590
        M_CREDITS.title = M_CREDITS2.title = M_CREDITS3.title = MenuCredits;
1591
    }
1592
}
5 Plagman 1593
 
4496 hendricks2 1594
static void M_RunMenu(Menu_t *cm);
5 Plagman 1595
 
1596
 
1597
 
4496 hendricks2 1598
/*
1599
At present, no true difference is planned between M_PreMenu() and M_PreMenuDraw().
1600
They are separate for purposes of organization.
1601
*/
5 Plagman 1602
 
4496 hendricks2 1603
static void M_PreMenu(MenuID_t cm)
1604
{
1605
    int32_t i;
1606
    DukePlayer_t *ps = g_player[myconnectindex].ps;
5 Plagman 1607
 
4496 hendricks2 1608
    switch (cm)
1609
    {
1610
    case MENU_MAIN_INGAME:
1611
        ME_MAIN_SAVEGAME.disabled = (ud.recstat == 2);
1612
        ME_MAIN_QUITTOTITLE.disabled = (g_netServer || numplayers > 1);
1613
    case MENU_MAIN:
1614
        if ((g_netServer || ud.multimode > 1) && ud.recstat != 2)
1615
        {
1616
            ME_MAIN_NEWGAME.entry = &MEO_MAIN_NEWGAME_NETWORK;
1617
            ME_MAIN_NEWGAME_INGAME.entry = &MEO_MAIN_NEWGAME_NETWORK;
1618
        }
1619
        else
1620
        {
1621
            ME_MAIN_NEWGAME.entry = &MEO_MAIN_NEWGAME;
1622
            ME_MAIN_NEWGAME_INGAME.entry = &MEO_MAIN_NEWGAME_INGAME;
1623
        }
1624
        break;
4399 hendricks2 1625
 
4496 hendricks2 1626
    case MENU_GAMESETUP:
1627
        MEO_GAMESETUP_DEMOREC.options = (ps->gm&MODE_GAME) ? &MEOS_DemoRec : &MEOS_OffOn;
1628
        ME_GAMESETUP_DEMOREC.disabled = ((ps->gm&MODE_GAME) && ud.m_recstat != 1);
1629
        break;
5 Plagman 1630
 
4496 hendricks2 1631
#ifdef USE_OPENGL
4609 terminx 1632
        case MENU_DISPLAYSETUP:
4496 hendricks2 1633
        if (getrendermode() == REND_CLASSIC)
4609 terminx 1634
            MenuMenu_ChangeGroupList(M_DISPLAYSETUP, MGL_DISPLAYSETUP);
4496 hendricks2 1635
#ifdef POLYMER
1636
        else if (getrendermode() == REND_POLYMER)
4609 terminx 1637
            MenuMenu_ChangeGroupList(M_DISPLAYSETUP, MGL_DISPLAYSETUP_GL_POLYMER);
4496 hendricks2 1638
#endif
1639
        else
4609 terminx 1640
            MenuMenu_ChangeGroupList(M_DISPLAYSETUP, MGL_DISPLAYSETUP_GL);
5 Plagman 1641
 
4496 hendricks2 1642
        if (getrendermode() != REND_CLASSIC)
4609 terminx 1643
            for (i = (int32_t) ARRAY_SIZE(MEOSV_DISPLAYSETUP_ANISOTROPY) - 1; i >= 0; --i)
5 Plagman 1644
            {
4609 terminx 1645
                if (MEOSV_DISPLAYSETUP_ANISOTROPY[i] <= glinfo.maxanisotropy)
4496 hendricks2 1646
                {
4609 terminx 1647
                    MEOS_DISPLAYSETUP_ANISOTROPY.numOptions = i + 1;
4496 hendricks2 1648
                    break;
1649
                }
337 terminx 1650
            }
4609 terminx 1651
                break;
5 Plagman 1652
 
4609 terminx 1653
        case MENU_RENDERERSETUP:
4496 hendricks2 1654
        ME_RENDERERSETUP_TEXQUALITY.disabled = !usehightile;
1655
        ME_RENDERERSETUP_PRECACHE.disabled = !usehightile;
1656
        ME_RENDERERSETUP_TEXCACHE.disabled = !(glusetexcompr && usehightile);
1657
        ME_RENDERERSETUP_DETAILTEX.disabled = !usehightile;
1658
        break;
1659
#endif
5 Plagman 1660
 
4496 hendricks2 1661
    case MENU_VIDEOSETUP:
1662
        ME_VIDEOSETUP_APPLY.disabled = ((xdim == resolution[newresolution].xdim && ydim == resolution[newresolution].ydim && getrendermode() == newrendermode && fullscreen == newfullscreen) || (newfullscreen ? !(resolution[newresolution].flags & RES_FS) : !(resolution[newresolution].flags & RES_WIN)) || (newrendermode != REND_CLASSIC && resolution[newresolution].bppmax <= 8));
1663
        break;
5 Plagman 1664
 
4496 hendricks2 1665
    case MENU_SOUND:
4609 terminx 1666
        case MENU_ADVSOUND:
4496 hendricks2 1667
        ME_SOUND.disabled = (ud.config.FXDevice < 0);
1668
        ME_SOUND_MUSIC.disabled = (ud.config.MusicDevice < 0);
1669
        ME_SOUND_VOLUME_MASTER.disabled = (!ud.config.SoundToggle || ud.config.FXDevice < 0) && (!ud.config.MusicToggle || ud.config.MusicDevice < 0);
1670
        ME_SOUND_VOLUME_EFFECTS.disabled = (!ud.config.SoundToggle || ud.config.FXDevice < 0);
1671
        ME_SOUND_VOLUME_MUSIC.disabled = (!ud.config.MusicToggle || ud.config.MusicDevice < 0);
4609 terminx 1672
        ME_SOUND_DUKETALK.disabled = (!ud.config.SoundToggle || ud.config.FXDevice < 0);
4496 hendricks2 1673
        ME_SOUND_SAMPLINGRATE.disabled = (!ud.config.SoundToggle || ud.config.FXDevice < 0) && (!ud.config.MusicToggle || ud.config.MusicDevice < 0);
1674
        ME_SOUND_SAMPLESIZE.disabled = (!ud.config.SoundToggle || ud.config.FXDevice < 0) && (!ud.config.MusicToggle || ud.config.MusicDevice < 0);
1675
        ME_SOUND_NUMVOICES.disabled = (!ud.config.SoundToggle || ud.config.FXDevice < 0);
1676
        ME_SOUND_RESTART.disabled = (soundrate == ud.config.MixRate && soundvoices == ud.config.NumVoices && soundbits == ud.config.NumBits);
1677
        break;
1678
 
1679
    case MENU_MOUSESETUP:
1680
        ME_MOUSESETUP_MOUSEAIMING.disabled = ud.mouseaiming;
1681
        break;
1682
 
1683
    case MENU_NETOPTIONS:
1684
        if (MEO_NETOPTIONS_EPISODE.currentOption == MEOS_NETOPTIONS_EPISODE.numOptions-1)
1685
            MEL_NETOPTIONS[2] = &ME_NETOPTIONS_USERMAP;
1686
        else
337 terminx 1687
        {
4496 hendricks2 1688
            MEL_NETOPTIONS[2] = &ME_NETOPTIONS_LEVEL;
1689
            MEO_NETOPTIONS_LEVEL.options = &MEOS_NETOPTIONS_LEVEL[MEO_NETOPTIONS_EPISODE.currentOption];
1690
        }
1691
        MEL_NETOPTIONS[4] = (GametypeFlags[ud.m_coop] & GAMETYPE_MARKEROPTION) ? &ME_NETOPTIONS_MARKERS : &ME_NETOPTIONS_MARKERS_DISABLED;
1692
        MEL_NETOPTIONS[5] = (GametypeFlags[ud.m_coop] & (GAMETYPE_PLAYERSFRIENDLY|GAMETYPE_TDM)) ? &ME_NETOPTIONS_FRFIRE : &ME_NETOPTIONS_MAPEXITS;
1693
        break;
2728 hendricks2 1694
 
4496 hendricks2 1695
    case MENU_OPTIONS:
1696
        ME_OPTIONS_PLAYERSETUP.disabled = ud.recstat == 1;
1697
        ME_OPTIONS_JOYSTICKSETUP.disabled = CONTROL_JoyPresent == 0;
1698
        break;
337 terminx 1699
 
4496 hendricks2 1700
    case MENU_LOAD:
1701
        for (i = 0; i < MAXSAVEGAMES; ++i)
1702
        {
4609 terminx 1703
            ME_LOAD[i].entry = (ud.savegame[i][0] /*&& !g_oldverSavegame[i]*/) ? &MEO_LOAD_VALID : &MEO_LOAD;
4496 hendricks2 1704
            ME_LOAD[i].font = g_oldverSavegame[i] ? &MF_MinifontDarkGray : &MF_MinifontRed;
337 terminx 1705
        }
4496 hendricks2 1706
        break;
5 Plagman 1707
 
4496 hendricks2 1708
    case MENU_SAVE:
1709
        for (i = 0; i < MAXSAVEGAMES; ++i)
1710
            MEO_SAVE[i].font = (g_oldverSavegame[i] && MEO_SAVE[i].editfield == NULL) ? &MF_MinifontDarkGray : &MF_MinifontRed;
337 terminx 1711
        break;
1712
 
4496 hendricks2 1713
    case MENU_LOADVERIFY:
1714
    case MENU_SAVEVERIFY:
3084 terminx 1715
    case MENU_ADULTPASSWORD:
4496 hendricks2 1716
        M_RunMenu(m_previousMenu);
1717
        break;
337 terminx 1718
 
4496 hendricks2 1719
    default:
1720
        break;
1721
    }
1722
}
337 terminx 1723
 
4549 hendricks2 1724
 
1725
static void M_PreMenuDrawBackground(MenuID_t cm)
1726
{
1727
    switch (cm)
1728
    {
1729
    case MENU_CREDITS:
1730
    case MENU_CREDITS2:
1731
    case MENU_CREDITS3:
1732
        if (!VOLUMEALL || !PLUTOPAK)
1733
            M_DrawBackground();
1734
        else
4550 hendricks2 1735
            rotatesprite_fs(160<<16,100<<16,65536L,0,2504+g_currentMenu-MENU_CREDITS,0,0,10+64);
4549 hendricks2 1736
        break;
1737
 
1738
    case MENU_LOAD:
1739
    case MENU_SAVE:
1740
    case MENU_CREDITS4:
1741
    case MENU_CREDITS5:
1742
        M_DrawBackground();
1743
        break;
1744
 
1745
    case MENU_STORY:
4550 hendricks2 1746
        rotatesprite_fs(160<<16,100<<16,65536L,0,TEXTSTORY,0,0,10+64);
4549 hendricks2 1747
        break;
1748
 
1749
    case MENU_F1HELP:
4550 hendricks2 1750
        rotatesprite_fs(160<<16,100<<16,65536L,0,F1HELP,0,0,10+64);
4549 hendricks2 1751
        break;
1752
    }
1753
}
1754
 
1755
 
4496 hendricks2 1756
static void M_PreMenuDraw(MenuID_t cm, MenuGroup_t *group, MenuEntry_t *entry)
1757
{
1758
    int32_t i, j, l = 0, m;
5 Plagman 1759
 
4496 hendricks2 1760
    switch (cm)
1761
    {
1762
    case MENU_MAIN_INGAME:
1763
        l += 4;
1764
    case MENU_MAIN:
1765
        rotatesprite_fs(MENU_MARGIN_CENTER<<16,(28+l)<<16,65536L,0,INGAMEDUKETHREEDEE,0,0,10);
1766
        if (PLUTOPAK)   // JBF 20030804
1767
            rotatesprite_fs((MENU_MARGIN_CENTER+100)<<16,36<<16,65536L,0,PLUTOPAKSPRITE+2,(sintable[(totalclock<<4)&2047]>>11),0,2+8);
1768
        break;
5 Plagman 1769
 
4496 hendricks2 1770
    case MENU_PLAYER:
4623 terminx 1771
        rotatesprite_fs((260)<<16,(24+(tilesiz[APLAYER].y>>1))<<16,49152L,0,1441-((((4-(totalclock>>4)))&3)*5),0,entry == &ME_PLAYER_TEAM ? G_GetTeamPalette(ud.team) : ud.color,10);
4496 hendricks2 1772
        break;
1773
 
1774
    case MENU_MACROS:
1775
        mgametext(160,144,"Activate in-game with Shift-F#",0,2+8+16);
1776
        break;
1777
 
1778
    case MENU_COLCORR:
1779
    case MENU_COLCORR_INGAME:
1780
        rotatesprite(40<<16,24<<16,24576,0,BONUSSCREEN,0,0,2+8+16,0,scale(ydim,35,200),xdim-1,scale(ydim,80,200)-1);
1781
        rotatesprite(160<<16,27<<16,24576,0,3290,0,0,2+8+16,0,scale(ydim,35,200),xdim-1,scale(ydim,80,200)-1);
1782
        break;
1783
 
1784
    case MENU_NETSETUP:
1785
    case MENU_NETHOST:
1786
        minitext(90,90,            "Game Type"    ,2,26);
1787
        minitext(90,90+8,          "Episode"      ,2,26);
1788
        minitext(90,90+8+8,        "Level"        ,2,26);
1789
        minitext(90,90+8+8+8,      "Monsters"     ,2,26);
1790
        if (ud.m_coop == 0)
1791
            minitext(90,90+8+8+8+8,    "Markers"      ,2,26);
1792
        else if (ud.m_coop == 1)
1793
            minitext(90,90+8+8+8+8,    "Friendly Fire",2,26);
1794
        minitext(90,90+8+8+8+8+8,  "User Map"     ,2,26);
1795
 
1796
        minitext(90+60,90,GametypeNames[ud.m_coop],0,26);
1797
 
1798
        minitext(90+60,90+8,      EpisodeNames[ud.m_volume_number],0,26);
1799
        minitext(90+60,90+8+8,    MapInfo[MAXLEVELS*ud.m_volume_number+ud.m_level_number].name,0,26);
1800
        if (ud.m_monsters_off == 0 || ud.m_player_skill > 0)
1801
            minitext(90+60,90+8+8+8,  SkillNames[ud.m_player_skill],0,26);
1802
        else minitext(90+60,90+8+8+8,  "None",0,28);
1803
        if (ud.m_coop == 0)
337 terminx 1804
        {
4496 hendricks2 1805
            if (ud.m_marker) minitext(90+60,90+8+8+8+8,"On",0,26);
1806
            else minitext(90+60,90+8+8+8+8,"Off",0,26);
337 terminx 1807
        }
4496 hendricks2 1808
        else if (ud.m_coop == 1)
337 terminx 1809
        {
4496 hendricks2 1810
            if (ud.m_ffire) minitext(90+60,90+8+8+8+8,"On",0,26);
1811
            else minitext(90+60,90+8+8+8+8,"Off",0,26);
1812
        }
1813
        break;
4467 hendricks2 1814
 
4496 hendricks2 1815
    case MENU_KEYBOARDKEYS:
1816
        if (group == &MG_KEYBOARDSETUPFUNCS)
1817
        {
1818
            mgametext(160,144+9+3,"Up/Down = Select Action",0,2+8+16);
1819
            mgametext(160,144+9+9+3,"Left/Right = Select List",0,2+8+16);
1820
            mgametext(160,144+9+9+9+3,"Enter = Modify   Delete = Clear",0,2+8+16);
1821
        }
1822
        break;
335 terminx 1823
 
4496 hendricks2 1824
    case MENU_MOUSESETUP:
1825
        if (entry == &ME_MOUSESETUP_MOUSEAIMING)
1826
        {
1827
            if (entry->disabled)
337 terminx 1828
            {
4496 hendricks2 1829
                mgametext(160,140+9+9+9,"Set mouse aim type to toggle on/off",0,2+8+16);
1830
                mgametext(160,140+9+9+9+9,"in the Player Setup menu to enable",0,2+8+16);
337 terminx 1831
            }
1832
        }
4496 hendricks2 1833
        break;
5 Plagman 1834
 
4496 hendricks2 1835
    case MENU_MOUSEBTNS:
1836
        if (group == &MG_MOUSESETUPBTNS)
1837
        {
1838
            mgametext(160,160+9,"Up/Down = Select Button",0,2+8+16);
1839
            mgametext(160,160+9+9,"Enter = Modify",0,2+8+16);
1840
        }
337 terminx 1841
        break;
5 Plagman 1842
 
4496 hendricks2 1843
    case MENU_MOUSEADVANCED:
1844
        if (group == &MG_MOUSEADVANCED_DAXES)
1845
        {
1846
            mgametext(160,144+9+9,"Digital axes are not for mouse look",0,2+8+16);
1847
            mgametext(160,144+9+9+9,"or for aiming up and down",0,2+8+16);
1848
        }
1849
        break;
5 Plagman 1850
 
4496 hendricks2 1851
    case MENU_JOYSTICKBTNS:
1852
        if (group == &MG_JOYSTICKBTNS)
1853
        {
1854
            mgametext(160,149,"Up/Down = Select Button",0,2+8+16);
1855
            mgametext(160,149+9,"Enter = Modify",0,2+8+16);
1856
        }
1857
        break;
5 Plagman 1858
 
4496 hendricks2 1859
    case MENU_RESETPLAYER:
4609 terminx 1860
                fade_screen_black(1);
4496 hendricks2 1861
        mgametext(160,90,"Load last game:",0,2+8+16);
5 Plagman 1862
 
4496 hendricks2 1863
        Bsprintf(tempbuf,"\"%s\"",ud.savegame[g_lastSaveSlot]);
1864
        mgametext(160,99,tempbuf,0,2+8+16);
5 Plagman 1865
 
4609 terminx 1866
#ifndef DROIDMENU
4496 hendricks2 1867
        mgametext(160,99+9,"(Y/N)",0,2+8+16);
4609 terminx 1868
#endif
4496 hendricks2 1869
        break;
5 Plagman 1870
 
4496 hendricks2 1871
    case MENU_LOAD:
1872
        for (i = 0; i <= 108; i += 12)
1873
            rotatesprite_fs((160+64+91-64)<<16,(i+56)<<16,65536L,0,TEXTBOX,24,0,10);
337 terminx 1874
 
4496 hendricks2 1875
        rotatesprite_fs(22<<16,97<<16,65536L,0,WINDOWBORDER2,24,0,10);
1876
        rotatesprite_fs(180<<16,97<<16,65536L,1024,WINDOWBORDER2,24,0,10);
1877
        rotatesprite_fs(99<<16,50<<16,65536L,512,WINDOWBORDER1,24,0,10);
1878
        rotatesprite_fs(103<<16,144<<16,65536L,1024+512,WINDOWBORDER1,24,0,10);
2728 hendricks2 1879
 
4496 hendricks2 1880
        if (ud.savegame[group->currentEntry][0])
337 terminx 1881
        {
4496 hendricks2 1882
            rotatesprite_fs(101<<16,97<<16,65536>>1,512,TILE_LOADSHOT,-32,0,4+10+64);
2728 hendricks2 1883
 
4496 hendricks2 1884
            if (g_oldverSavegame[group->currentEntry])
1885
            {
4609 terminx 1886
                menutext(53,70,0,0,"Previous");
1887
                menutext(58,90,0,0,"Version");
337 terminx 1888
 
4609 terminx 1889
#ifndef DROIDMENU
4496 hendricks2 1890
                Bsprintf(tempbuf,"Saved: %d.%d.%d %d-bit", savehead.majorver, savehead.minorver,
1891
                         savehead.bytever, 8*savehead.ptrsize);
1892
                mgametext(31,104,tempbuf,0,2+8+16);
1893
                Bsprintf(tempbuf,"Our: %d.%d.%d %d-bit", SV_MAJOR_VER, SV_MINOR_VER, BYTEVERSION,
1894
                         (int32_t)(8*sizeof(intptr_t)));
4609 terminx 1895
                mgametext(31+16,114,tempbuf,0,2+8+16);
1896
#endif
337 terminx 1897
            }
5 Plagman 1898
 
4609 terminx 1899
                        if (savehead.numplayers > 1)
1900
                        {
1901
                                Bsprintf(tempbuf, "Players: %-2d                      ", savehead.numplayers);
1902
                                mgametext(160, 156, tempbuf, 0, 2 + 8 + 16);
1903
                        }
1904
 
1905
            Bsprintf(tempbuf,"%s / %s",MapInfo[(savehead.volnum*MAXLEVELS) + savehead.levnum].name, SkillNames[savehead.skill-1]);
4496 hendricks2 1906
            mgametext(160,168,tempbuf,0,2+8+16);
1907
            if (savehead.volnum == 0 && savehead.levnum == 7)
1908
                mgametext(160,180,savehead.boardfn,0,2+8+16);
337 terminx 1909
        }
4496 hendricks2 1910
        else
1911
            menutext(69,70,0,0,"Empty");
1912
        break;
410 terminx 1913
 
4496 hendricks2 1914
    case MENU_SAVE:
1915
        for (i = 0; i <= 108; i += 12)
1916
            rotatesprite_fs((160+64+91-64)<<16,(i+56)<<16,65536L,0,TEXTBOX,24,0,10);
337 terminx 1917
 
4496 hendricks2 1918
        rotatesprite_fs(22<<16,97<<16,65536L,0,WINDOWBORDER2,24,0,10);
1919
        rotatesprite_fs(180<<16,97<<16,65536L,1024,WINDOWBORDER2,24,0,10);
1920
        rotatesprite_fs(99<<16,50<<16,65536L,512,WINDOWBORDER1,24,0,10);
1921
        rotatesprite_fs(103<<16,144<<16,65536L,1024+512,WINDOWBORDER1,24,0,10);
337 terminx 1922
 
4496 hendricks2 1923
        if (ud.savegame[group->currentEntry][0])
1924
        {
1925
            j = 0;
1926
            for (i = 0; i < 10; ++i)
1927
                if (((MenuString_t*)group->entrylist[i]->entry)->editfield)
1928
                    j |= 1;
2728 hendricks2 1929
 
4496 hendricks2 1930
            rotatesprite_fs(101<<16,97<<16,65536L>>1,512,j?TILE_SAVESHOT:TILE_LOADSHOT,-32,0,4+10+64);
1931
 
1932
            if (g_oldverSavegame[group->currentEntry])
337 terminx 1933
            {
4609 terminx 1934
                menutext(53,70,0,0,"Previous");
1935
                menutext(58,90,0,0,"Version");
4496 hendricks2 1936
 
4609 terminx 1937
#ifndef DROIDMENU
4496 hendricks2 1938
                Bsprintf(tempbuf,"Saved: %d.%d.%d %d-bit", savehead.majorver, savehead.minorver,
1939
                         savehead.bytever, 8*savehead.ptrsize);
1940
                mgametext(31,104,tempbuf,0,2+8+16);
1941
                Bsprintf(tempbuf,"Our: %d.%d.%d %d-bit", SV_MAJOR_VER, SV_MINOR_VER, BYTEVERSION,
1942
                         (int32_t)(8*sizeof(intptr_t)));
4609 terminx 1943
                mgametext(31+16,114,tempbuf,0,2+8+16);
1944
#endif
337 terminx 1945
            }
1946
        }
4496 hendricks2 1947
        else
1948
            menutext(69,70,0,0,"Empty");
5 Plagman 1949
 
4609 terminx 1950
                if (ud.multimode > 1)
1951
                {
1952
                        Bsprintf(tempbuf, "Players: %-2d                      ", ud.multimode);
1953
                        mgametext(160, 156, tempbuf, 0, 2 + 8 + 16);
1954
                }
1955
 
1956
        Bsprintf(tempbuf,"%s / %s",MapInfo[(ud.volume_number*MAXLEVELS) + ud.level_number].name, SkillNames[ud.player_skill-1]);
887 terminx 1957
        mgametext(160,168,tempbuf,0,2+8+16);
337 terminx 1958
        if (ud.volume_number == 0 && ud.level_number == 7)
4496 hendricks2 1959
            mgametext(160,180,currentboardfilename,0,2+8+16);
1960
        break;
5 Plagman 1961
 
4609 terminx 1962
#ifdef DROIDMENU
1963
    case MENU_SKILL:
1964
    {
1965
        char *s[MAXSKILLS] = {"EASY - Few enemies, and lots of stuff.", "MEDIUM - Normal difficulty.", "HARD - For experienced players.", "EXPERTS - Lots of enemies, plus they respawn!" };
1966
        mgametext(160,168,s[group->currentEntry],0,2+8+16);
1967
    }
1968
        break;
1969
#endif
1970
 
4496 hendricks2 1971
    case MENU_LOADVERIFY:
4609 terminx 1972
                fade_screen_black(1);
1973
                if (g_oldverSavegame[MG_LOAD.currentEntry])
1974
                {
1975
                        mgametext(160, 90, "Start new game:", 0, 2 + 8 + 16);
1976
                        Bsprintf(tempbuf,"%s / %s",MapInfo[(ud.volume_number*MAXLEVELS) + ud.level_number].name, SkillNames[ud.player_skill-1]);
1977
                        mgametext(160, 99, tempbuf, 0, 2 + 8 + 16);
1978
                }
1979
                else
1980
                {
1981
                        mgametext(160, 90, "Load game:", 0, 2 + 8 + 16);
1982
                        Bsprintf(tempbuf, "\"%s\"", ud.savegame[MG_LOAD.currentEntry]);
1983
                        mgametext(160, 99, tempbuf, 0, 2 + 8 + 16);
1984
                }
1985
#ifndef DROIDMENU
4496 hendricks2 1986
        mgametext(160,99+9,"(Y/N)",0,2+8+16);
4609 terminx 1987
#endif
4496 hendricks2 1988
        break;
5 Plagman 1989
 
4496 hendricks2 1990
    case MENU_SAVEVERIFY:
4609 terminx 1991
                fade_screen_black(1);
4399 hendricks2 1992
        mgametext(160,90,"Overwrite previous saved game?",0,2+8+16);
4609 terminx 1993
#ifndef DROIDMENU
887 terminx 1994
        mgametext(160,90+9,"(Y/N)",0,2+8+16);
4609 terminx 1995
#endif
4496 hendricks2 1996
        break;
5 Plagman 1997
 
4496 hendricks2 1998
    case MENU_NEWVERIFY:
4609 terminx 1999
                fade_screen_black(1);
4496 hendricks2 2000
        mgametext(160,90,"Abort this game?",0,2+8+16);
4609 terminx 2001
#ifndef DROIDMENU
4496 hendricks2 2002
        mgametext(160,90+9,"(Y/N)",0,2+8+16);
4609 terminx 2003
#endif
4496 hendricks2 2004
        break;
2728 hendricks2 2005
 
4496 hendricks2 2006
    case MENU_QUIT:
2007
    case MENU_QUIT_INGAME:
4609 terminx 2008
                fade_screen_black(1);
4496 hendricks2 2009
        mgametext(MENU_MARGIN_CENTER,90,"Are you sure you want to quit?",0,2+8+16);
4609 terminx 2010
#ifndef DROIDMENU
4496 hendricks2 2011
        mgametext(MENU_MARGIN_CENTER,99,"(Y/N)",0,2+8+16);
4609 terminx 2012
#endif
4496 hendricks2 2013
        break;
2728 hendricks2 2014
 
4496 hendricks2 2015
    case MENU_QUITTOTITLE:
4609 terminx 2016
                fade_screen_black(1);
4496 hendricks2 2017
        mgametext(MENU_MARGIN_CENTER,90,"Quit to Title?",0,2+8+16);
4609 terminx 2018
#ifndef DROIDMENU
4496 hendricks2 2019
        mgametext(MENU_MARGIN_CENTER,99,"(Y/N)",0,2+8+16);
4609 terminx 2020
#endif
4496 hendricks2 2021
        break;
5 Plagman 2022
 
4496 hendricks2 2023
    case MENU_NETWAITMASTER:
2024
        G_DrawFrags();
2025
        mgametext(160,50,"Waiting for master",0,2+8+16);
2026
        mgametext(160,59,"to select level",0,2+8+16);
2027
        break;
5 Plagman 2028
 
4496 hendricks2 2029
    case MENU_NETWAITVOTES:
2030
        G_DrawFrags();
2031
        mgametext(160,90,"Waiting for votes",0,2);
2032
        break;
5 Plagman 2033
 
4496 hendricks2 2034
    case MENU_BUYDUKE:
2035
        mgametext(160,41-8,"You are playing the shareware",0,2+8+16);
2036
        mgametext(160,50-8,"version of Duke Nukem 3D.  While",0,2+8+16);
2037
        mgametext(160,59-8,"this version is really cool, you",0,2+8+16);
2038
        mgametext(160,68-8,"are missing over 75% of the total",0,2+8+16);
2039
        mgametext(160,77-8,"game, along with other great extras",0,2+8+16);
4609 terminx 2040
        mgametext(160,86-8,"which you'll get when you order",0,2+8+16);
2041
        mgametext(160,95-8,"the complete version and get",0,2+8+16);
2042
        mgametext(160,104-8,"the final three episodes.",0,2+8+16);
4496 hendricks2 2043
 
4609 terminx 2044
#ifndef DROIDMENU
2045
        mgametext(160,104+8,"Please visit Steam and purchase",0,2+8+16);
2046
                mgametext(160,113+8,"Duke Nukem 3D: Megaton Edition",0,2+8+16);
2047
#else
2048
                mgametext(160,113+8,"Please visit the Play Store",0,2+8+16);
2049
#endif
4496 hendricks2 2050
 
4609 terminx 2051
        mgametext(160,122+8,"to upgrade to the full registered",0,2+8+16);
2052
        mgametext(160,131+8,"version of Duke Nukem 3D.",0,2+8+16);
2053
 
2054
        mgametext(160,148+16,"Press any key or button...",0,2+8+16);
4496 hendricks2 2055
        break;
2056
 
3084 terminx 2057
    case MENU_CREDITS:
2058
    case MENU_CREDITS2:
2059
    case MENU_CREDITS3:
337 terminx 2060
        if (!VOLUMEALL || !PLUTOPAK)
2061
        {
4549 hendricks2 2062
            switch (cm)
335 terminx 2063
            {
3084 terminx 2064
            case MENU_CREDITS:
4496 hendricks2 2065
                m = 20;
2066
                l = 33;
5 Plagman 2067
 
4496 hendricks2 2068
                shadowminitext(m, l, "Original Concept", 12, 10+16+128); l += 7;
2069
&nbs