Subversion Repositories eduke32

Rev

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