Subversion Repositories eduke32

Rev

Rev 4624 | Details | Compare with Previous | Last modification | View Log | RSS feed

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