Subversion Repositories eduke32

Rev

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

Rev Author Line No. Line
5 Plagman 1
//-------------------------------------------------------------------------
2
/*
5611 terminx 3
Copyright (C) 2016 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"
911 terminx 24
#include "osdcmds.h"
1677 terminx 25
#include "savegame.h"
1678 terminx 26
#include "demo.h"
4387 terminx 27
#include "xxhash.h"
2728 hendricks2 28
#include "input.h"
3084 terminx 29
#include "menus.h"
5612 terminx 30
#include "cheats.h"
1707 terminx 31
 
5 Plagman 32
#include <sys/stat.h>
33
 
4993 terminx 34
#include "android/in_android.h"
35
#ifndef __ANDROID__
36
droidinput_t droidinput;
37
#endif
38
 
4686 hendricks2 39
// common positions
40
#define MENU_MARGIN_REGULAR 40
41
#define MENU_MARGIN_WIDE    32
42
#define MENU_MARGIN_CENTER  160
43
#define MENU_HEIGHT_CENTER  100
44
 
4449 helixhorne 45
int32_t g_skillSoundVoice = -1;
5 Plagman 46
 
1205 terminx 47
extern int32_t voting;
147 terminx 48
 
921 terminx 49
#define USERMAPENTRYLENGTH 25
50
 
5331 hendricks2 51
FORCE_INLINE void WithSDL2_StartTextInput()
5325 helixhorne 52
{
5331 hendricks2 53
#if defined EDUKE32_TOUCH_DEVICES && defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
5634 hendricks2 54
# if defined __ANDROID__
5625 terminx 55
    AndroidShowKeyboard(1);
5634 hendricks2 56
# else
57
    SDL_StartTextInput();
58
# endif
5325 helixhorne 59
#endif
60
}
61
 
5331 hendricks2 62
FORCE_INLINE void WithSDL2_StopTextInput()
5325 helixhorne 63
{
5331 hendricks2 64
#if defined EDUKE32_TOUCH_DEVICES && defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
5634 hendricks2 65
# if defined __ANDROID__
5625 terminx 66
    AndroidShowKeyboard(0);
5634 hendricks2 67
# else
68
    SDL_StopTextInput();
69
# endif
5325 helixhorne 70
#endif
71
}
72
 
5452 hendricks2 73
static int32_t mgametext_xbetween = -(1<<16);
74
 
75
#define mgametext(x,y,t) G_ScreenText(STARTALPHANUM, x, y, 65536, 0, 0, t, 0, 0, 2|8|16|ROTATESPRITE_FULL16, 0, 5<<16, 8<<16, mgametext_xbetween, 0, 0, 0, 0, xdim-1, ydim-1)
76
#define mgametextcenter(x,y,t) G_ScreenText(STARTALPHANUM, (MENU_MARGIN_CENTER<<16) + (x), y, 65536, 0, 0, t, 0, 0, 2|8|16|ROTATESPRITE_FULL16, 0, 5<<16, 8<<16, mgametext_xbetween, 1<<16, TEXT_XCENTER, 0, 0, xdim-1, ydim-1)
4686 hendricks2 77
#define mminitext(x,y,t,p) minitext_(x, y, t, 0, p, 2|8|16|ROTATESPRITE_FULL16)
78
#define mmenutext(x,y,t) G_ScreenText(BIGALPHANUM, x, (y) - (12<<16), 65536L, 0, 0, (const char *)OSD_StripColors(menutextbuf,t), 0, 0, 2|8|16|ROTATESPRITE_FULL16, 0, 5<<16, 16<<16, 0, 0, TEXT_BIGALPHANUM|TEXT_UPPERCASE|TEXT_LITERALESCAPE, 0, 0, xdim-1, ydim-1)
79
#define mmenutextcenter(x,y,t) G_ScreenText(BIGALPHANUM, (MENU_MARGIN_CENTER<<16) + (x), (y) - (12<<16), 65536L, 0, 0, (const char *)OSD_StripColors(menutextbuf,t), 0, 0, 2|8|16|ROTATESPRITE_FULL16, 0, 5<<16, 16<<16, 0, 0, TEXT_BIGALPHANUM|TEXT_UPPERCASE|TEXT_LITERALESCAPE|TEXT_XCENTER, 0, 0, xdim-1, ydim-1)
1037 terminx 80
 
4686 hendricks2 81
static void shadowminitext(int32_t x, int32_t y, const char *t, int32_t p)
82
{
83
    int32_t f = 0;
4496 hendricks2 84
 
4686 hendricks2 85
    if (!minitext_lowercase)
86
        f |= TEXT_UPPERCASE;
4496 hendricks2 87
 
4686 hendricks2 88
    G_ScreenTextShadow(1, 1, MINIFONT, x, y, 65536, 0, 0, t, 0, p, 2|8|16|ROTATESPRITE_FULL16, 0, 4<<16, 8<<16, 1<<16, 0, f, 0, 0, xdim-1, ydim-1);
89
}
90
static void creditsminitext(int32_t x, int32_t y, const char *t, int32_t p)
5 Plagman 91
{
4686 hendricks2 92
    int32_t f = TEXT_XCENTER;
93
 
94
    if (!minitext_lowercase)
95
        f |= TEXT_UPPERCASE;
96
 
97
    G_ScreenTextShadow(1, 1, MINIFONT, x, y, 65536, 0, 0, t, 0, p, 2|8|16|ROTATESPRITE_FULL16, 0, 4<<16, 8<<16, 1<<16, 0, f, 0, 0, xdim-1, ydim-1);
98
}
99
 
5540 terminx 100
int32_t menutext_(int32_t x, int32_t y, int32_t s, int32_t p, char const *t, int32_t bits)
4686 hendricks2 101
{
4496 hendricks2 102
    vec2_t dim;
103
    int32_t f = TEXT_BIGALPHANUM|TEXT_UPPERCASE|TEXT_LITERALESCAPE;
5 Plagman 104
 
4686 hendricks2 105
    if (!(bits & ROTATESPRITE_FULL16))
106
    {
107
        x<<=16;
108
        y<<=16;
109
    }
110
 
111
    if (x == (160<<16))
4496 hendricks2 112
        f |= TEXT_XCENTER;
3101 hendricks2 113
 
4686 hendricks2 114
    dim = G_ScreenText(BIGALPHANUM, x, y - (12<<16), 65536L, 0, 0, t, s, p, bits|ROTATESPRITE_FULL16, 0, 5<<16, 16<<16, 0, 0, f, 0, 0, xdim-1, ydim-1);
3101 hendricks2 115
 
4686 hendricks2 116
    if (!(bits & ROTATESPRITE_FULL16))
117
        x >>= 16;
118
 
4496 hendricks2 119
    return dim.x;
3101 hendricks2 120
}
3084 terminx 121
 
4496 hendricks2 122
#pragma pack(push,1)
123
static savehead_t savehead;
124
#pragma pack(pop)
125
 
4686 hendricks2 126
static void M_DrawBackground(const vec2_t origin)
3101 hendricks2 127
{
4686 hendricks2 128
    rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (100<<16), 65536L,0,MENUSCREEN,16,0,10+64);
4496 hendricks2 129
}
3101 hendricks2 130
 
4686 hendricks2 131
static void M_DrawTopBar(const vec2_t origin)
4549 hendricks2 132
{
4686 hendricks2 133
    rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (19<<16), 65536L,0,MENUBAR,16,0,10);
4549 hendricks2 134
}
3101 hendricks2 135
 
4686 hendricks2 136
static void M_DrawTopBarCaption(const char *caption, const vec2_t origin)
4496 hendricks2 137
{
4624 terminx 138
    char *s = Bstrdup(caption), p = Bstrlen(caption)-1;
139
    if (s[p] == ':') s[p] = 0;
4686 hendricks2 140
    mmenutextcenter(origin.x, origin.y + (24<<16), s);
4624 terminx 141
    Bfree(s);
5 Plagman 142
}
143
 
4496 hendricks2 144
extern int32_t g_quitDeadline;
5 Plagman 145
 
146
 
147
 
148
 
1631 terminx 149
 
2728 hendricks2 150
 
5 Plagman 151
 
2313 helixhorne 152
 
5 Plagman 153
 
2313 helixhorne 154
 
155
 
156
 
157
 
4496 hendricks2 158
/*
159
All MAKE_* macros are generally for the purpose of keeping state initialization
160
separate from actual data. Alternatively, they can serve to factor out repetitive
161
stuff and keep the important bits from getting lost to our eyes.
4506 hendricks2 162
 
163
They serve as a stand-in for C++ default value constructors, since we're using C89.
4778 hendricks2 164
 
165
Note that I prefer to include a space on the inside of the macro parentheses, since
166
they effectively stand in for curly braces as struct initializers.
4496 hendricks2 167
*/
2313 helixhorne 168
 
169
 
4496 hendricks2 170
// common font types
171
// tilenums are set after namesdyn runs
4778 hendricks2 172
static MenuFont_t MF_Null             = { -1, 10,  0,  0,     0,      0,      0,     0, 0 };
173
static MenuFont_t MF_Redfont          = { -1, 10,  0,  1, 5<<16, 15<<16,  0<<16, 0<<16, TEXT_BIGALPHANUM | TEXT_UPPERCASE };
174
static MenuFont_t MF_RedfontBlue      = { -1, 10,  1,  1, 5<<16, 15<<16,  0<<16, 0<<16, TEXT_BIGALPHANUM | TEXT_UPPERCASE };
175
static MenuFont_t MF_RedfontGreen     = { -1, 10,  8,  1, 5<<16, 15<<16,  0<<16, 0<<16, TEXT_BIGALPHANUM | TEXT_UPPERCASE };
5459 hendricks2 176
static MenuFont_t MF_Bluefont         = { -1, 10,  0, 16, 5<<16,  7<<16, -(1<<16), 0<<16, 0 };
177
static MenuFont_t MF_BluefontRed      = { -1, 10, 10, 16, 5<<16,  7<<16, -(1<<16), 0<<16, 0 };
4778 hendricks2 178
static MenuFont_t MF_Minifont         = { -1, 10,  0, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0 };
179
static MenuFont_t MF_MinifontRed      = { -1, 16, 21, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0 };
180
static MenuFont_t MF_MinifontDarkGray = { -1, 10, 13, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0 };
2313 helixhorne 181
 
182
 
5478 terminx 183
static MenuMenuFormat_t MMF_Top_Main =             { {  MENU_MARGIN_CENTER<<16, 55<<16, }, -(170<<16) };
184
static MenuMenuFormat_t MMF_Top_Episode =          { {  MENU_MARGIN_CENTER<<16, 48<<16, }, -(190<<16) };
185
static MenuMenuFormat_t MMF_Top_Skill =            { {  MENU_MARGIN_CENTER<<16, 58<<16, }, -(190<<16) };
186
static MenuMenuFormat_t MMF_Top_Options =          { {  MENU_MARGIN_CENTER<<16, 38<<16, }, -(190<<16) };
187
static MenuMenuFormat_t MMF_Top_Joystick_Network = { {  MENU_MARGIN_CENTER<<16, 70<<16, }, -(190<<16) };
188
static MenuMenuFormat_t MMF_BigOptions =           { {    MENU_MARGIN_WIDE<<16, 38<<16, }, -(190<<16) };
189
static MenuMenuFormat_t MMF_SmallOptions =         { {    MENU_MARGIN_WIDE<<16, 37<<16, },    170<<16 };
190
static MenuMenuFormat_t MMF_Macros =               { {                  26<<16, 40<<16, },    160<<16 };
191
static MenuMenuFormat_t MMF_SmallOptionsNarrow  =  { { MENU_MARGIN_REGULAR<<16, 38<<16, }, -(190<<16) };
192
static MenuMenuFormat_t MMF_KeyboardSetupFuncs =   { {                  70<<16, 34<<16, },    151<<16 };
193
static MenuMenuFormat_t MMF_MouseJoySetupBtns =    { {                  76<<16, 34<<16, },    143<<16 };
194
static MenuMenuFormat_t MMF_FuncList =             { {                 100<<16, 51<<16, },    152<<16 };
195
static MenuMenuFormat_t MMF_ColorCorrect =         { { MENU_MARGIN_REGULAR<<16, 86<<16, },    190<<16 };
196
static MenuMenuFormat_t MMF_BigSliders =           { {    MENU_MARGIN_WIDE<<16, 37<<16, },    190<<16 };
197
static MenuMenuFormat_t MMF_LoadSave =             { {                 223<<16, 48<<16, },    320<<16 };
198
static MenuMenuFormat_t MMF_NetSetup =             { {                  36<<16, 38<<16, },    190<<16 };
199
static MenuMenuFormat_t MMF_FileSelectLeft =       { {                  40<<16, 45<<16, },    162<<16 };
200
static MenuMenuFormat_t MMF_FileSelectRight =      { {                 164<<16, 45<<16, },    162<<16 };
4778 hendricks2 201
 
202
static MenuEntryFormat_t MEF_Null =             {     0,      0,        0,  20<<16, 65536 };
203
static MenuEntryFormat_t MEF_MainMenu =         { 4<<16,      0,        0, 110<<16, 65536 };
204
static MenuEntryFormat_t MEF_CenterMenu =       { 7<<16,      0,        0, 110<<16, 65536 };
205
static MenuEntryFormat_t MEF_BigOptions =       { 4<<16,      0,  190<<16,  20<<16, 65536 };
206
static MenuEntryFormat_t MEF_BigOptions_Apply = { 4<<16, 16<<16,  190<<16,  20<<16, 65536 };
5478 terminx 207
static MenuEntryFormat_t MEF_BigOptionsRt =     { 4<<16,      0,-(260<<16), 20<<16, 65536 };
4778 hendricks2 208
#if defined USE_OPENGL || !defined DROIDMENU
209
static MenuEntryFormat_t MEF_SmallOptions =     { 1<<16,      0,  216<<16,  10<<16, 32768 };
4647 hendricks2 210
#endif
5478 terminx 211
static MenuEntryFormat_t MEF_BigCheats =        { 3<<16,      0,-(260<<16), 20<<16, 65536 };
212
static MenuEntryFormat_t MEF_Cheats =           { 2<<16,      0,-(260<<16), 10<<16, 32768 };
4778 hendricks2 213
static MenuEntryFormat_t MEF_PlayerNarrow =     { 1<<16,      0,   90<<16,  10<<16, 32768 };
4856 hendricks2 214
static MenuEntryFormat_t MEF_Macros =           { 2<<16,     -1,  268<<16,  10<<16, 32768 };
4778 hendricks2 215
static MenuEntryFormat_t MEF_VideoSetup =       { 4<<16,      0,  168<<16,  20<<16, 65536 };
216
static MenuEntryFormat_t MEF_FuncList =         { 3<<16,      0,  100<<16,  10<<16, 32768 };
5478 terminx 217
static MenuEntryFormat_t MEF_ColorCorrect =     { 2<<16,      0,-(240<<16), 20<<16, 65536 };
4778 hendricks2 218
static MenuEntryFormat_t MEF_BigSliders =       { 2<<16,      0,  170<<16,  20<<16, 65536 };
4856 hendricks2 219
static MenuEntryFormat_t MEF_LoadSave =         { 7<<16,     -1,   78<<16,  20<<16, 65536 };
5034 hendricks2 220
static MenuEntryFormat_t MEF_NetSetup =         { 4<<16,      0,  112<<16,  20<<16, 65536 };
2313 helixhorne 221
 
4496 hendricks2 222
// common menu option sets
4778 hendricks2 223
#define MAKE_MENUOPTIONSET(optionNames, optionValues, features) { optionNames, optionValues, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, ARRAY_SIZE(optionNames), -1, 0, features }
224
#define MAKE_MENUOPTIONSETDYN(optionNames, optionValues, numOptions, features) { optionNames, optionValues, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, numOptions, -1, 0, features }
5034 hendricks2 225
#define MAKE_MENUOPTIONSETNULL { NULL, NULL, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, 0, -1, 0, 0 }
2313 helixhorne 226
 
5547 terminx 227
static char const *MEOSN_OffOn[] = { "Off", "On", };
4778 hendricks2 228
static MenuOptionSet_t MEOS_OffOn = MAKE_MENUOPTIONSET( MEOSN_OffOn, NULL, 0x3 );
5547 terminx 229
static char const *MEOSN_OnOff[] = { "On", "Off", };
4778 hendricks2 230
static MenuOptionSet_t MEOS_OnOff = MAKE_MENUOPTIONSET( MEOSN_OnOff, NULL, 0x3 );
5547 terminx 231
static char const *MEOSN_NoYes[] = { "No", "Yes", };
4778 hendricks2 232
static MenuOptionSet_t MEOS_NoYes = MAKE_MENUOPTIONSET( MEOSN_NoYes, NULL, 0x3 );
5547 terminx 233
static char const *MEOSN_YesNo[] = { "Yes", "No", };
4778 hendricks2 234
static MenuOptionSet_t MEOS_YesNo = MAKE_MENUOPTIONSET( MEOSN_YesNo, NULL, 0x3 );
2313 helixhorne 235
 
5 Plagman 236
 
4496 hendricks2 237
static char MenuGameFuncs[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
5547 terminx 238
static char const *MenuGameFuncNone = "  -None-";
239
static char const *MEOSN_Gamefuncs[NUMGAMEFUNCTIONS+1];
4778 hendricks2 240
static MenuOptionSet_t MEOS_Gamefuncs = MAKE_MENUOPTIONSET( MEOSN_Gamefuncs, NULL, 0x1 );
2313 helixhorne 241
 
5 Plagman 242
 
243
 
4496 hendricks2 244
/*
4778 hendricks2 245
MenuEntry_t is passed in arrays of pointers so that the callback function
4496 hendricks2 246
that is called when an entry is modified or activated can test equality of the current
4778 hendricks2 247
entry pointer directly against the known ones, instead of relying on an ID number.
5 Plagman 248
 
4778 hendricks2 249
That way, individual menu entries can be ifdef'd out painlessly.
4496 hendricks2 250
*/
2728 hendricks2 251
 
4688 hendricks2 252
static MenuLink_t MEO_NULL = { MENU_NULL, MA_None, };
4496 hendricks2 253
static const char* MenuCustom = "Custom";
2728 hendricks2 254
 
4778 hendricks2 255
#define MAKE_MENUSTRING(...) { NULL, __VA_ARGS__, }
4496 hendricks2 256
#define MAKE_MENUOPTION(...) { __VA_ARGS__, -1, }
257
#define MAKE_MENURANGE(...) { __VA_ARGS__, }
258
#define MAKE_MENUENTRY(...) { __VA_ARGS__, 0, 0, 0, }
2728 hendricks2 259
 
4778 hendricks2 260
 
261
#define MAKE_SPACER( EntryName, Height ) \
262
static MenuSpacer_t MEO_ ## EntryName = { Height };\
263
static MenuEntry_t ME_ ## EntryName = MAKE_MENUENTRY( NULL, &MF_Null, &MEF_Null, &MEO_ ## EntryName, Spacer )
264
 
265
MAKE_SPACER( Space2, 2<<16 ); // bigoptions
266
MAKE_SPACER( Space4, 4<<16 ); // usermap, smalloptions, anything else non-top
267
MAKE_SPACER( Space6, 6<<16 ); // videosetup
268
MAKE_SPACER( Space8, 8<<16 ); // colcorr, redslide
269
 
270
 
271
#define MAKE_MENU_TOP_ENTRYLINK( Title, Format, EntryName, LinkID ) \
4688 hendricks2 272
static MenuLink_t MEO_ ## EntryName = { LinkID, MA_Advance, };\
4778 hendricks2 273
static MenuEntry_t ME_ ## EntryName = MAKE_MENUENTRY( Title, &MF_Redfont, &Format, &MEO_ ## EntryName, Link )
2728 hendricks2 274
 
275
 
4778 hendricks2 276
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME, MENU_EPISODE );
5000 terminx 277
#ifdef DROIDMENU
278
MAKE_MENU_TOP_ENTRYLINK( "Resume Game", MEF_MainMenu, MAIN_RESUMEGAME, MENU_CLOSE );
279
#endif
4778 hendricks2 280
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME_INGAME, MENU_NEWVERIFY );
4688 hendricks2 281
static MenuLink_t MEO_MAIN_NEWGAME_NETWORK = { MENU_NETWORK, MA_Advance, };
4778 hendricks2 282
MAKE_MENU_TOP_ENTRYLINK( "Save Game", MEF_MainMenu, MAIN_SAVEGAME, MENU_SAVE );
283
MAKE_MENU_TOP_ENTRYLINK( "Load Game", MEF_MainMenu, MAIN_LOADGAME, MENU_LOAD );
284
MAKE_MENU_TOP_ENTRYLINK( "Options", MEF_MainMenu, MAIN_OPTIONS, MENU_OPTIONS );
4682 hendricks2 285
#ifndef DROIDMENU
4778 hendricks2 286
MAKE_MENU_TOP_ENTRYLINK( "Help", MEF_MainMenu, MAIN_HELP, MENU_STORY );
4682 hendricks2 287
#endif
4778 hendricks2 288
MAKE_MENU_TOP_ENTRYLINK( "Credits", MEF_MainMenu, MAIN_CREDITS, MENU_CREDITS );
5663 terminx 289
MAKE_MENU_TOP_ENTRYLINK( "End Game", MEF_MainMenu, MAIN_QUITTOTITLE, MENU_QUITTOTITLE );
4778 hendricks2 290
MAKE_MENU_TOP_ENTRYLINK( "Quit", MEF_MainMenu, MAIN_QUIT, MENU_QUIT );
5462 hendricks2 291
#ifndef DROIDMENU
4778 hendricks2 292
MAKE_MENU_TOP_ENTRYLINK( "Quit Game", MEF_MainMenu, MAIN_QUITGAME, MENU_QUIT );
5462 hendricks2 293
#endif
2728 hendricks2 294
 
4496 hendricks2 295
static MenuEntry_t *MEL_MAIN[] = {
296
    &ME_MAIN_NEWGAME,
5068 terminx 297
    &ME_MAIN_LOADGAME,
4496 hendricks2 298
    &ME_MAIN_OPTIONS,
4609 terminx 299
#ifndef DROIDMENU
4496 hendricks2 300
    &ME_MAIN_HELP,
5663 terminx 301
    &ME_MAIN_CREDITS,
4609 terminx 302
#endif
4496 hendricks2 303
    &ME_MAIN_QUIT,
304
};
4609 terminx 305
 
4496 hendricks2 306
static MenuEntry_t *MEL_MAIN_INGAME[] = {
5000 terminx 307
#ifdef DROIDMENU
308
    &ME_MAIN_RESUMEGAME,
309
#else
4496 hendricks2 310
    &ME_MAIN_NEWGAME_INGAME,
5000 terminx 311
#endif
4496 hendricks2 312
    &ME_MAIN_SAVEGAME,
313
    &ME_MAIN_LOADGAME,
314
    &ME_MAIN_OPTIONS,
4609 terminx 315
#ifndef DROIDMENU
4496 hendricks2 316
    &ME_MAIN_HELP,
317
    &ME_MAIN_QUITTOTITLE,
318
    &ME_MAIN_QUITGAME,
5000 terminx 319
#else
320
    &ME_MAIN_QUITTOTITLE,
321
#endif
4496 hendricks2 322
};
2728 hendricks2 323
 
4496 hendricks2 324
// Episode and Skill will be dynamically generated after CONs are parsed
4688 hendricks2 325
static MenuLink_t MEO_EPISODE = { MENU_SKILL, MA_Advance, };
326
static MenuLink_t MEO_EPISODE_SHAREWARE = { MENU_BUYDUKE, MA_Advance, };
4778 hendricks2 327
static MenuEntry_t ME_EPISODE_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_CenterMenu, &MEO_EPISODE, Link );
4496 hendricks2 328
static MenuEntry_t ME_EPISODE[MAXVOLUMES];
4688 hendricks2 329
static MenuLink_t MEO_EPISODE_USERMAP = { MENU_USERMAP, MA_Advance, };
4778 hendricks2 330
static MenuEntry_t ME_EPISODE_USERMAP = MAKE_MENUENTRY( "User Map", &MF_Redfont, &MEF_CenterMenu, &MEO_EPISODE_USERMAP, Link );
331
static MenuEntry_t *MEL_EPISODE[MAXVOLUMES+2]; // +2 for spacer and User Map
398 terminx 332
 
4778 hendricks2 333
static MenuEntry_t ME_SKILL_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_CenterMenu, &MEO_NULL, Link );
4496 hendricks2 334
static MenuEntry_t ME_SKILL[MAXSKILLS];
335
static MenuEntry_t *MEL_SKILL[MAXSKILLS];
5 Plagman 336
 
4818 hendricks2 337
#if defined STARTUP_SETUP_WINDOW && !defined DROIDMENU
4778 hendricks2 338
static MenuOption_t MEO_GAMESETUP_STARTWIN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.ForceSetup );
339
static MenuEntry_t ME_GAMESETUP_STARTWIN = MAKE_MENUENTRY( "Startup window:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_STARTWIN, Option );
4682 hendricks2 340
#endif
4609 terminx 341
 
5547 terminx 342
static char const *MEOSN_GAMESETUP_AIM_AUTO[] = { "None", "Regular", "Bullets only",
4609 terminx 343
#ifdef DROIDMENU
4688 hendricks2 344
"Extra wide"
4609 terminx 345
#endif
346
};
347
static int32_t MEOSV_GAMESETUP_AIM_AUTO[] = { 0, 1, 2,
348
#ifdef DROIDMENU
349
3,
350
#endif
351
};
352
 
4778 hendricks2 353
static MenuOptionSet_t MEOS_GAMESETUP_AIM_AUTO = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_AIM_AUTO, MEOSV_GAMESETUP_AIM_AUTO, 0x2 );
354
static MenuOption_t MEO_GAMESETUP_AIM_AUTO = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_AIM_AUTO, &ud.config.AutoAim );
355
static MenuEntry_t ME_GAMESETUP_AIM_AUTO = MAKE_MENUENTRY( "Auto aim:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_AIM_AUTO, Option );
4609 terminx 356
 
5547 terminx 357
static char const *MEOSN_GAMESETUP_WEAPSWITCH_PICKUP[] = { "Never", "If new", "By rating", };
4778 hendricks2 358
static MenuOptionSet_t MEOS_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_WEAPSWITCH_PICKUP, NULL, 0x2 );
359
static MenuOption_t MEO_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_WEAPSWITCH_PICKUP, NULL );
360
static MenuEntry_t ME_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUENTRY( "Equip pickups:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_WEAPSWITCH_PICKUP, Option );
4609 terminx 361
 
5547 terminx 362
static char const *MEOSN_DemoRec[] = { "Off", "Running", };
4778 hendricks2 363
static MenuOptionSet_t MEOS_DemoRec = MAKE_MENUOPTIONSET( MEOSN_DemoRec, NULL, 0x3 );
364
static MenuOption_t MEO_GAMESETUP_DEMOREC = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.m_recstat );
365
static MenuEntry_t ME_GAMESETUP_DEMOREC = MAKE_MENUENTRY( "Record demo:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_DEMOREC, Option );
4609 terminx 366
 
4496 hendricks2 367
#ifdef _WIN32
4778 hendricks2 368
static MenuOption_t MEO_GAMESETUP_UPDATES = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.CheckForUpdates );
369
static MenuEntry_t ME_GAMESETUP_UPDATES = MAKE_MENUENTRY( "Online updates:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_UPDATES, Option );
4496 hendricks2 370
#endif
2728 hendricks2 371
 
4778 hendricks2 372
static MenuOption_t MEO_ADULTMODE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.lockout);
373
static MenuEntry_t ME_ADULTMODE = MAKE_MENUENTRY( "Parental lock:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_ADULTMODE, Option );
4688 hendricks2 374
// static MenuLink_t MEO_ADULTMODE_PASSWORD = { MENU_ADULTPASSWORD, MA_None, };
4778 hendricks2 375
// static MenuEntry_t ME_ADULTMODE_PASSWORD = MAKE_MENUENTRY( "Enter Password", &MF_Redfont, &, &MEO_ADULTMODE_PASSWORD, Link );
4609 terminx 376
 
5025 helixhorne 377
#ifdef DROIDMENU
4993 terminx 378
static MenuOption_t MEO_GAMESETUP_CROUCHLOCK = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &droidinput.toggleCrouch);
379
static MenuEntry_t ME_GAMESETUP_CROUCHLOCK = MAKE_MENUENTRY("Crouch lock:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_CROUCHLOCK, Option);
380
 
381
static MenuOption_t MEO_GAMESETUP_QUICKSWITCH = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &droidinput.quickSelectWeapon);
382
static MenuEntry_t ME_GAMESETUP_QUICKSWITCH = MAKE_MENUENTRY("Quick weapon switch:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_QUICKSWITCH, Option);
5025 helixhorne 383
#endif
4993 terminx 384
 
5517 hendricks2 385
static MenuLink_t MEO_GAMESETUP_CHEATS = { MENU_CHEATS, MA_Advance, };
386
static MenuEntry_t ME_GAMESETUP_CHEATS = MAKE_MENUENTRY( "Cheats", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_CHEATS, Link );
387
 
4778 hendricks2 388
static MenuEntry_t *MEL_GAMESETUP[] = {
4850 hendricks2 389
    &ME_ADULTMODE,
4818 hendricks2 390
#if defined STARTUP_SETUP_WINDOW && !defined DROIDMENU
4496 hendricks2 391
    &ME_GAMESETUP_STARTWIN,
4609 terminx 392
#endif
4850 hendricks2 393
    &ME_GAMESETUP_AIM_AUTO,
394
    &ME_GAMESETUP_WEAPSWITCH_PICKUP,
5023 terminx 395
#ifdef DROIDMENU
4993 terminx 396
    &ME_GAMESETUP_QUICKSWITCH,
397
    &ME_GAMESETUP_CROUCHLOCK,
5023 terminx 398
#else
4496 hendricks2 399
    &ME_GAMESETUP_DEMOREC,
400
#ifdef _WIN32
4850 hendricks2 401
    &ME_GAMESETUP_UPDATES,
4609 terminx 402
#endif
403
#endif
5517 hendricks2 404
    &ME_GAMESETUP_CHEATS,
4496 hendricks2 405
};
2728 hendricks2 406
 
4778 hendricks2 407
MAKE_MENU_TOP_ENTRYLINK( "Game Setup", MEF_CenterMenu, OPTIONS_GAMESETUP, MENU_GAMESETUP );
408
MAKE_MENU_TOP_ENTRYLINK( "Sound Setup", MEF_CenterMenu, OPTIONS_SOUNDSETUP, MENU_SOUND );
409
MAKE_MENU_TOP_ENTRYLINK( "Display Setup", MEF_CenterMenu, OPTIONS_DISPLAYSETUP, MENU_DISPLAYSETUP );
410
MAKE_MENU_TOP_ENTRYLINK( "Player Setup", MEF_CenterMenu, OPTIONS_PLAYERSETUP, MENU_PLAYER );
5462 hendricks2 411
#ifndef DROIDMENU
4778 hendricks2 412
MAKE_MENU_TOP_ENTRYLINK( "Control Setup", MEF_CenterMenu, OPTIONS_CONTROLS, MENU_CONTROLS );
413
MAKE_MENU_TOP_ENTRYLINK( "Keyboard Setup", MEF_CenterMenu, OPTIONS_KEYBOARDSETUP, MENU_KEYBOARDSETUP );
414
MAKE_MENU_TOP_ENTRYLINK( "Mouse Setup", MEF_CenterMenu, OPTIONS_MOUSESETUP, MENU_MOUSESETUP );
5462 hendricks2 415
#endif
4778 hendricks2 416
MAKE_MENU_TOP_ENTRYLINK( "Joystick Setup", MEF_CenterMenu, OPTIONS_JOYSTICKSETUP, MENU_JOYSTICKSETUP );
4993 terminx 417
#ifdef DROIDMENU
418
MAKE_MENU_TOP_ENTRYLINK( "Touch Setup", MEF_CenterMenu, OPTIONS_TOUCHSETUP, MENU_TOUCHSETUP );
5652 terminx 419
MAKE_MENU_TOP_ENTRYLINK( "Touch Sensitivity", MEF_CenterMenu, OPTIONS_TOUCHSENS, MENU_TOUCHSENS);
420
MAKE_MENU_TOP_ENTRYLINK( "Touch Buttons", MEF_CenterMenu, OPTIONS_TOUCHBUTTONS, MENU_TOUCHBUTTONS);
4993 terminx 421
#endif
2728 hendricks2 422
 
5475 terminx 423
static int32_t newresolution, newrendermode, newfullscreen, newvsync;
5 Plagman 424
 
4496 hendricks2 425
enum resflags_t {
426
    RES_FS  = 0x1,
427
    RES_WIN = 0x2,
428
};
5 Plagman 429
 
4496 hendricks2 430
#define MAXRESOLUTIONSTRINGLENGTH 16
5 Plagman 431
 
4496 hendricks2 432
typedef struct resolution_t {
433
    int32_t xdim, ydim;
434
    int32_t flags;
435
    int32_t bppmax;
436
    char name[MAXRESOLUTIONSTRINGLENGTH];
437
} resolution_t;
2358 helixhorne 438
 
4496 hendricks2 439
resolution_t resolution[MAXVALIDMODES];
5 Plagman 440
 
5547 terminx 441
static char const *MEOSN_VIDEOSETUP_RESOLUTION[MAXVALIDMODES];
4778 hendricks2 442
static MenuOptionSet_t MEOS_VIDEOSETUP_RESOLUTION = MAKE_MENUOPTIONSETDYN( MEOSN_VIDEOSETUP_RESOLUTION, NULL, 0, 0x0 );
443
static MenuOption_t MEO_VIDEOSETUP_RESOLUTION = MAKE_MENUOPTION( &MF_Redfont, &MEOS_VIDEOSETUP_RESOLUTION, &newresolution );
444
static MenuEntry_t ME_VIDEOSETUP_RESOLUTION = MAKE_MENUENTRY( "Resolution:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_RESOLUTION, Option );
5 Plagman 445
 
4496 hendricks2 446
#ifdef USE_OPENGL
447
#ifdef POLYMER
5547 terminx 448
static char const *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", "Polymost", "Polymer", };
4496 hendricks2 449
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, REND_POLYMOST, REND_POLYMER, };
450
#else
5547 terminx 451
static char const *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", "OpenGL", };
4496 hendricks2 452
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, REND_POLYMOST, };
453
#endif
5 Plagman 454
 
4778 hendricks2 455
static MenuOptionSet_t MEOS_VIDEOSETUP_RENDERER = MAKE_MENUOPTIONSET( MEOSN_VIDEOSETUP_RENDERER, MEOSV_VIDEOSETUP_RENDERER, 0x2 );
5 Plagman 456
 
4778 hendricks2 457
static MenuOption_t MEO_VIDEOSETUP_RENDERER = MAKE_MENUOPTION( &MF_Redfont, &MEOS_VIDEOSETUP_RENDERER, &newrendermode );
458
static MenuEntry_t ME_VIDEOSETUP_RENDERER = MAKE_MENUENTRY( "Renderer:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_RENDERER, Option );
4823 hendricks2 459
#endif
460
 
4778 hendricks2 461
static MenuOption_t MEO_VIDEOSETUP_FULLSCREEN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &newfullscreen );
462
static MenuEntry_t ME_VIDEOSETUP_FULLSCREEN = MAKE_MENUENTRY( "Fullscreen:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_FULLSCREEN, Option );
5475 terminx 463
 
464
 
5547 terminx 465
static char const *MEOSN_VIDEOSETUP_VSYNC [] ={ "Adaptive", "Off", "On", };
5475 terminx 466
static int32_t MEOSV_VIDEOSETUP_VSYNC [] ={ -1, 0, 1, };
467
static MenuOptionSet_t MEOS_VIDEOSETUP_VSYNC = MAKE_MENUOPTIONSET(MEOSN_VIDEOSETUP_VSYNC, MEOSV_VIDEOSETUP_VSYNC, 0x2);
468
static MenuOption_t MEO_VIDEOSETUP_VSYNC = MAKE_MENUOPTION(&MF_Redfont, &MEOS_VIDEOSETUP_VSYNC, &newvsync);
469
static MenuEntry_t ME_VIDEOSETUP_VSYNC = MAKE_MENUENTRY("VSync:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_VSYNC, Option);
470
 
4778 hendricks2 471
static MenuEntry_t ME_VIDEOSETUP_APPLY = MAKE_MENUENTRY( "Apply Changes", &MF_Redfont, &MEF_BigOptions_Apply, &MEO_NULL, Link );
4609 terminx 472
 
473
 
4823 hendricks2 474
static MenuLink_t MEO_DISPLAYSETUP_COLORCORR = { MENU_COLCORR, MA_Advance, };
4856 hendricks2 475
static MenuEntry_t ME_DISPLAYSETUP_COLORCORR = MAKE_MENUENTRY( "Color Correction", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_COLORCORR, Link );
4609 terminx 476
static MenuOption_t MEO_DISPLAYSETUP_PIXELDOUBLING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OnOff, &ud.detail );
4823 hendricks2 477
static MenuEntry_t ME_DISPLAYSETUP_PIXELDOUBLING = MAKE_MENUENTRY( "Pixel Doubling:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_PIXELDOUBLING, Option );
4609 terminx 478
 
479
 
4496 hendricks2 480
#ifdef USE_OPENGL
4609 terminx 481
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, NULL);
482
#else
483
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &r_usenewaspect);
4496 hendricks2 484
#endif
5652 terminx 485
#ifndef DROIDMENU
4823 hendricks2 486
static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUENTRY( "Widescreen:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ASPECTRATIO, Option );
5652 terminx 487
#endif
4609 terminx 488
#ifdef POLYMER
5547 terminx 489
static char const *MEOSN_DISPLAYSETUP_ASPECTRATIO_POLYMER[] = { "Auto", "4:3", "16:10", "5:3", "16:9", "1.85:1", "2.39:1", };
4609 terminx 490
static double MEOSV_DISPLAYSETUP_ASPECTRATIO_POLYMER[] = { 0., 1.33, 1.6, 1.66, 1.78, 1.85, 2.39, };
4778 hendricks2 491
static MenuOptionSet_t MEOS_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_ASPECTRATIO_POLYMER, NULL, 0x1 );
4609 terminx 492
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_ASPECTRATIO_POLYMER, NULL);
4823 hendricks2 493
static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUENTRY( "Aspect ratio:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ASPECTRATIO_POLYMER, Option );
4609 terminx 494
#endif
5 Plagman 495
 
4609 terminx 496
 
497
#ifdef USE_OPENGL
5547 terminx 498
static char const *MEOSN_DISPLAYSETUP_TEXFILTER[] = { "Classic", "Filtered" };
4778 hendricks2 499
static MenuOptionSet_t MEOS_DISPLAYSETUP_TEXFILTER = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_TEXFILTER, NULL, 0x2 );
4609 terminx 500
int32_t menufiltermode;
501
static MenuOption_t MEO_DISPLAYSETUP_TEXFILTER = MAKE_MENUOPTION( &MF_Redfont, &MEOS_DISPLAYSETUP_TEXFILTER, &menufiltermode );
4823 hendricks2 502
static MenuEntry_t ME_DISPLAYSETUP_TEXFILTER = MAKE_MENUENTRY( "Texture Mode:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_TEXFILTER, Option );
4609 terminx 503
 
5547 terminx 504
static char const *MEOSN_DISPLAYSETUP_ANISOTROPY[] = { "None", "2x", "4x", "8x", "16x", };
4868 hendricks2 505
static int32_t MEOSV_DISPLAYSETUP_ANISOTROPY[] = { 1, 2, 4, 8, 16, };
4778 hendricks2 506
static MenuOptionSet_t MEOS_DISPLAYSETUP_ANISOTROPY = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_ANISOTROPY, MEOSV_DISPLAYSETUP_ANISOTROPY, 0x0 );
4609 terminx 507
static MenuOption_t MEO_DISPLAYSETUP_ANISOTROPY = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_ANISOTROPY, &glanisotropy);
4823 hendricks2 508
static MenuEntry_t ME_DISPLAYSETUP_ANISOTROPY = MAKE_MENUENTRY( "Anisotropy:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ANISOTROPY, Option );
4609 terminx 509
 
4993 terminx 510
#ifdef DROIDMENU
511
static MenuOption_t MEO_DISPLAYSETUP_HIDEDPAD = MAKE_MENUOPTION(&MF_Redfont, &MEOS_NoYes, &droidinput.hideStick);
512
static MenuEntry_t ME_DISPLAYSETUP_HIDEDPAD = MAKE_MENUENTRY("Hide touch d-pad:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_HIDEDPAD, Option);
513
 
514
static MenuRangeFloat_t MEO_DISPLAYSETUP_TOUCHALPHA = MAKE_MENURANGE(&droidinput.gameControlsAlpha, &MF_Redfont, 0, 1, 0, 16, 2);
515
static MenuEntry_t ME_DISPLAYSETUP_TOUCHALPHA = MAKE_MENUENTRY("UI opacity:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_TOUCHALPHA, RangeFloat);
4609 terminx 516
#endif
517
 
4993 terminx 518
#endif
519
 
4609 terminx 520
static MenuOption_t MEO_SCREENSETUP_CROSSHAIR = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.crosshair);
4778 hendricks2 521
static MenuEntry_t ME_SCREENSETUP_CROSSHAIR = MAKE_MENUENTRY( "Crosshair:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_CROSSHAIR, Option );
522
static MenuRangeInt32_t MEO_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENURANGE( &ud.crosshairscale, &MF_Redfont, 25, 100, 0, 16, 2 );
523
static MenuEntry_t ME_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENUENTRY( "Size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_CROSSHAIRSIZE, RangeInt32 );
4609 terminx 524
 
525
static int32_t vpsize;
4866 hendricks2 526
static MenuRangeInt32_t MEO_SCREENSETUP_SCREENSIZE = MAKE_MENURANGE( &vpsize, &MF_Redfont, 12, 0, 0, 4, EnforceIntervals );
4778 hendricks2 527
static MenuEntry_t ME_SCREENSETUP_SCREENSIZE = MAKE_MENUENTRY( "Screen size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_SCREENSIZE, RangeInt32 );
5054 hendricks2 528
static MenuRangeInt32_t MEO_SCREENSETUP_TEXTSIZE = MAKE_MENURANGE( &ud.textscale, &MF_Redfont, 100, 400, 0, 16, 2 );
4778 hendricks2 529
static MenuEntry_t ME_SCREENSETUP_TEXTSIZE = MAKE_MENUENTRY( "Size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_TEXTSIZE, RangeInt32 );
4609 terminx 530
static MenuOption_t MEO_SCREENSETUP_LEVELSTATS = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.levelstats);
4778 hendricks2 531
static MenuEntry_t ME_SCREENSETUP_LEVELSTATS = MAKE_MENUENTRY( "Level stats:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_LEVELSTATS, Option );
4609 terminx 532
 
533
 
534
static MenuOption_t MEO_SCREENSETUP_SHOWPICKUPMESSAGES = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.fta_on);
5121 hendricks2 535
static MenuEntry_t ME_SCREENSETUP_SHOWPICKUPMESSAGES = MAKE_MENUENTRY( "Game messages:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_SHOWPICKUPMESSAGES, Option );
4609 terminx 536
 
5547 terminx 537
static char const *MEOSN_SCREENSETUP_NEWSTATUSBAR[] = { "Classic", "New",
4609 terminx 538
#ifdef DROIDMENU
4688 hendricks2 539
"On top",
4609 terminx 540
#endif
541
};
542
 
543
static int32_t MEOSV_SCREENSETUP_NEWSTATUSBAR[] = { 0, 1,
544
#ifdef DROIDMENU
545
2,
546
#endif
547
};
548
 
4778 hendricks2 549
static MenuOptionSet_t MEOS_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUOPTIONSET( MEOSN_SCREENSETUP_NEWSTATUSBAR, MEOSV_SCREENSETUP_NEWSTATUSBAR, 0x2 );
4609 terminx 550
static MenuOption_t MEO_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUOPTION(&MF_Redfont, &MEOS_SCREENSETUP_NEWSTATUSBAR, &ud.althud);
4778 hendricks2 551
static MenuEntry_t ME_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUENTRY( "Status bar:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_NEWSTATUSBAR, Option );
4609 terminx 552
 
553
 
554
 
4778 hendricks2 555
static MenuRangeInt32_t MEO_SCREENSETUP_SBARSIZE = MAKE_MENURANGE( &ud.statusbarscale, &MF_Redfont, 36, 100, 0, 17, 2 );
556
static MenuEntry_t ME_SCREENSETUP_SBARSIZE = MAKE_MENUENTRY( "Size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_SBARSIZE, RangeInt32 );
4609 terminx 557
 
558
 
4688 hendricks2 559
static MenuLink_t MEO_DISPLAYSETUP_SCREENSETUP = { MENU_SCREENSETUP, MA_Advance, };
4993 terminx 560
static MenuEntry_t ME_DISPLAYSETUP_SCREENSETUP = MAKE_MENUENTRY( "Status and crosshair", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_SCREENSETUP, Link );
4609 terminx 561
 
562
 
4682 hendricks2 563
#ifndef DROIDMENU
4823 hendricks2 564
#ifdef USE_OPENGL
5408 terminx 565
static MenuLink_t MEO_DISPLAYSETUP_ADVANCED_GL_POLYMOST = { MENU_POLYMOST, MA_Advance, };
566
static MenuEntry_t ME_DISPLAYSETUP_ADVANCED_GL_POLYMOST = MAKE_MENUENTRY( "Polymost setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ADVANCED_GL_POLYMOST, Link );
567
 
568
#ifdef POLYMER
569
static MenuLink_t MEO_DISPLAYSETUP_ADVANCED_GL_POLYMER ={ MENU_POLYMER, MA_Advance, };
570
static MenuEntry_t ME_DISPLAYSETUP_ADVANCED_GL_POLYMER = MAKE_MENUENTRY("Polymer setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ADVANCED_GL_POLYMER, Link);
4823 hendricks2 571
#endif
5408 terminx 572
#endif
4609 terminx 573
 
4688 hendricks2 574
static MenuLink_t MEO_DISPLAYSETUP_VIDEOSETUP = { MENU_VIDEOSETUP, MA_Advance, };
4856 hendricks2 575
static MenuEntry_t ME_DISPLAYSETUP_VIDEOSETUP = MAKE_MENUENTRY( "Video mode", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_VIDEOSETUP, Link );
4682 hendricks2 576
#endif
4609 terminx 577
 
5084 hendricks2 578
 
579
static MenuLink_t MEO_ENTERCHEAT = { MENU_CHEATENTRY, MA_None, };
580
static MenuEntry_t ME_ENTERCHEAT = MAKE_MENUENTRY( "Enter Cheat Code", &MF_Redfont, &MEF_BigCheats, &MEO_ENTERCHEAT, Link );
581
 
582
static MenuLink_t MEO_CHEAT_WARP = { MENU_CHEAT_WARP, MA_None, };
583
static MenuLink_t MEO_CHEAT_SKILL = { MENU_CHEAT_SKILL, MA_None, };
584
// KEEPINSYNC game.h: enum CheatCodeFunctions
585
// KEEPINSYNC game.c: uint8_t CheatFunctionIDs[]
586
#define MAKE_MENUCHEAT( Name ) MAKE_MENUENTRY( Name, &MF_Bluefont, &MEF_Cheats, &MEO_NULL, Link )
587
static MenuEntry_t ME_CheatCodes[] = {
588
    MAKE_MENUCHEAT( "Toggle Cashman" ),
589
    MAKE_MENUCHEAT( "Toggle God Mode" ),
590
    MAKE_MENUCHEAT( "Give Everything" ),
591
    MAKE_MENUCHEAT( "Give Weapons" ),
592
    MAKE_MENUCHEAT( "Give All Items" ),
593
    MAKE_MENUCHEAT( "Give Inventory" ),
594
    MAKE_MENUCHEAT( "Give Keys" ),
595
    MAKE_MENUCHEAT( "Toggle Hyper" ),
596
    MAKE_MENUCHEAT( "Toggle 3rd-Person View" ),
597
    MAKE_MENUCHEAT( "Toggle Show All Map" ),
598
    MAKE_MENUCHEAT( "Toggle All Locks" ),
599
    MAKE_MENUCHEAT( "Toggle Clipping" ),
600
    MAKE_MENUENTRY( "Level Warp", &MF_Bluefont, &MEF_Cheats, &MEO_CHEAT_WARP, Link ),
601
    MAKE_MENUENTRY( "Change Skill", &MF_Bluefont, &MEF_Cheats, &MEO_CHEAT_SKILL, Link ),
602
    MAKE_MENUCHEAT( "Toggle Monsters" ),
603
    MAKE_MENUCHEAT( "Toggle Framerate Display" ),
604
    MAKE_MENUCHEAT( NULL ),
605
    MAKE_MENUCHEAT( NULL ),
606
    MAKE_MENUCHEAT( NULL ),
607
    MAKE_MENUCHEAT( "Toggle Coordinate Display" ),
608
    MAKE_MENUCHEAT( "Toggle Debug Data Dump" ),
609
};
610
 
4496 hendricks2 611
static MenuEntry_t *MEL_OPTIONS[] = {
612
    &ME_OPTIONS_GAMESETUP,
613
    &ME_OPTIONS_SOUNDSETUP,
4609 terminx 614
    &ME_OPTIONS_DISPLAYSETUP,
615
#ifndef DROIDMENU
4496 hendricks2 616
    &ME_OPTIONS_PLAYERSETUP,
4993 terminx 617
    &ME_OPTIONS_CONTROLS,
618
#else
5084 hendricks2 619
    &ME_OPTIONS_TOUCHSETUP,
4609 terminx 620
#endif
4496 hendricks2 621
};
5 Plagman 622
 
4609 terminx 623
static MenuEntry_t *MEL_CONTROLS[] = {
4993 terminx 624
#ifndef DROIDMENU
4850 hendricks2 625
    &ME_OPTIONS_KEYBOARDSETUP,
626
    &ME_OPTIONS_MOUSESETUP,
627
    &ME_OPTIONS_JOYSTICKSETUP,
4993 terminx 628
#else
629
    &ME_OPTIONS_TOUCHSETUP
630
#endif
4609 terminx 631
};
632
 
5084 hendricks2 633
static MenuEntry_t *MEL_CHEATS[ARRAY_SIZE(ME_CheatCodes)+1] = {
634
    &ME_ENTERCHEAT,
635
};
4609 terminx 636
 
4778 hendricks2 637
static MenuEntry_t *MEL_VIDEOSETUP[] = {
4496 hendricks2 638
    &ME_VIDEOSETUP_RESOLUTION,
4823 hendricks2 639
#ifdef USE_OPENGL
4496 hendricks2 640
    &ME_VIDEOSETUP_RENDERER,
4823 hendricks2 641
#endif
4496 hendricks2 642
    &ME_VIDEOSETUP_FULLSCREEN,
5475 terminx 643
    &ME_VIDEOSETUP_VSYNC,
4778 hendricks2 644
    &ME_Space6,
4496 hendricks2 645
    &ME_VIDEOSETUP_APPLY,
646
};
4609 terminx 647
static MenuEntry_t *MEL_DISPLAYSETUP[] = {
648
    &ME_DISPLAYSETUP_SCREENSETUP,
649
    &ME_DISPLAYSETUP_COLORCORR,
650
#ifndef DROIDMENU
4850 hendricks2 651
    &ME_DISPLAYSETUP_VIDEOSETUP,
5652 terminx 652
    &ME_DISPLAYSETUP_ASPECTRATIO,
4609 terminx 653
#endif
4850 hendricks2 654
    &ME_DISPLAYSETUP_PIXELDOUBLING,
4496 hendricks2 655
};
4609 terminx 656
 
4496 hendricks2 657
#ifdef USE_OPENGL
4609 terminx 658
static MenuEntry_t *MEL_DISPLAYSETUP_GL[] = {
4850 hendricks2 659
    &ME_DISPLAYSETUP_SCREENSETUP,
4609 terminx 660
    &ME_DISPLAYSETUP_COLORCORR,
661
#ifndef DROIDMENU
4850 hendricks2 662
    &ME_DISPLAYSETUP_VIDEOSETUP,
5652 terminx 663
    &ME_DISPLAYSETUP_ASPECTRATIO,
4609 terminx 664
#endif
4850 hendricks2 665
    &ME_DISPLAYSETUP_TEXFILTER,
5004 hendricks2 666
#ifdef DROIDMENU
4993 terminx 667
    &ME_DISPLAYSETUP_HIDEDPAD,
668
    &ME_DISPLAYSETUP_TOUCHALPHA,
5004 hendricks2 669
#endif
4609 terminx 670
#ifndef DROIDMENU
4850 hendricks2 671
    &ME_DISPLAYSETUP_ANISOTROPY,
5408 terminx 672
    &ME_DISPLAYSETUP_ADVANCED_GL_POLYMOST,
4609 terminx 673
#endif
4496 hendricks2 674
};
4609 terminx 675
 
676
#ifdef POLYMER
677
static MenuEntry_t *MEL_DISPLAYSETUP_GL_POLYMER[] = {
4850 hendricks2 678
    &ME_DISPLAYSETUP_SCREENSETUP,
679
    &ME_DISPLAYSETUP_COLORCORR,
4609 terminx 680
#ifndef DROIDMENU
4850 hendricks2 681
    &ME_DISPLAYSETUP_VIDEOSETUP,
5652 terminx 682
    &ME_DISPLAYSETUP_ASPECTRATIO_POLYMER,
4496 hendricks2 683
#endif
4850 hendricks2 684
    &ME_DISPLAYSETUP_TEXFILTER,
4609 terminx 685
#ifndef DROIDMENU
4850 hendricks2 686
    &ME_DISPLAYSETUP_ANISOTROPY,
5408 terminx 687
    &ME_DISPLAYSETUP_ADVANCED_GL_POLYMER,
4609 terminx 688
#endif
689
};
5 Plagman 690
 
4609 terminx 691
#endif
692
#endif
693
 
694
 
695
 
5547 terminx 696
static char const *MenuKeyNone = "  -";
697
static char const *MEOSN_Keys[NUMKEYS];
5 Plagman 698
 
4778 hendricks2 699
static MenuCustom2Col_t MEO_KEYBOARDSETUPFUNCS_TEMPLATE = { { NULL, NULL, }, MEOSN_Keys, &MF_MinifontRed, NUMKEYS, 54<<16, 0 };
4496 hendricks2 700
static MenuCustom2Col_t MEO_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
4778 hendricks2 701
static MenuEntry_t ME_KEYBOARDSETUPFUNCS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_FuncList, &MEO_KEYBOARDSETUPFUNCS_TEMPLATE, Custom2Col );
4496 hendricks2 702
static MenuEntry_t ME_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
703
static MenuEntry_t *MEL_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
5 Plagman 704
 
4823 hendricks2 705
static MenuLink_t MEO_KEYBOARDSETUP_KEYS = { MENU_KEYBOARDKEYS, MA_Advance, };
4778 hendricks2 706
static MenuEntry_t ME_KEYBOARDSETUP_KEYS = MAKE_MENUENTRY( "Configure Keys", &MF_Redfont, &MEF_CenterMenu, &MEO_KEYBOARDSETUP_KEYS, Link );
707
static MenuEntry_t ME_KEYBOARDSETUP_RESET = MAKE_MENUENTRY( "Reset To Defaults", &MF_Redfont, &MEF_CenterMenu, &MEO_NULL, Link );
708
static MenuEntry_t ME_KEYBOARDSETUP_RESETCLASSIC = MAKE_MENUENTRY( "Reset To Classic", &MF_Redfont, &MEF_CenterMenu, &MEO_NULL, Link );
5 Plagman 709
 
4496 hendricks2 710
static MenuEntry_t *MEL_KEYBOARDSETUP[] = {
711
    &ME_KEYBOARDSETUP_KEYS,
712
    &ME_KEYBOARDSETUP_RESET,
713
    &ME_KEYBOARDSETUP_RESETCLASSIC,
714
};
5 Plagman 715
 
716
 
4496 hendricks2 717
// There is no better way to do this than manually.
4399 hendricks2 718
 
4496 hendricks2 719
#define MENUMOUSEFUNCTIONS 12
78 terminx 720
 
5547 terminx 721
static char const *MenuMouseNames[MENUMOUSEFUNCTIONS] = {
4496 hendricks2 722
    "Button 1",
723
    "Double Button 1",
724
    "Button 2",
725
    "Double Button 2",
726
    "Button 3",
727
    "Double Button 3",
5 Plagman 728
 
4496 hendricks2 729
    "Wheel Up",
730
    "Wheel Down",
5 Plagman 731
 
4496 hendricks2 732
    "Button 4",
733
    "Double Button 4",
734
    "Button 5",
735
    "Double Button 5",
736
};
737
static int32_t MenuMouseDataIndex[MENUMOUSEFUNCTIONS][2] = {
738
    { 0, 0, },
739
    { 0, 1, },
740
    { 1, 0, },
741
    { 1, 1, },
742
    { 2, 0, },
743
    { 2, 1, },
1677 terminx 744
 
4496 hendricks2 745
    // note the mouse wheel
746
    { 4, 0, },
747
    { 5, 0, },
5 Plagman 748
 
4496 hendricks2 749
    { 3, 0, },
750
    { 3, 1, },
751
    { 6, 0, },
752
    { 6, 1, },
753
};
3084 terminx 754
 
4496 hendricks2 755
static MenuOption_t MEO_MOUSEJOYSETUPBTNS_TEMPLATE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
756
static MenuOption_t MEO_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
4778 hendricks2 757
static MenuEntry_t ME_MOUSEJOYSETUPBTNS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_FuncList, NULL, Option );
4496 hendricks2 758
static MenuEntry_t ME_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
759
static MenuEntry_t *MEL_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
3084 terminx 760
 
4823 hendricks2 761
static MenuLink_t MEO_MOUSESETUP_BTNS = { MENU_MOUSEBTNS, MA_Advance, };
4778 hendricks2 762
static MenuEntry_t ME_MOUSESETUP_BTNS = MAKE_MENUENTRY( "Button assignment", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_BTNS, Link );
763
static MenuRangeFloat_t MEO_MOUSESETUP_SENSITIVITY = MAKE_MENURANGE( &CONTROL_MouseSensitivity, &MF_Redfont, .5f, 16.f, 0.f, 32, 1 );
764
static MenuEntry_t ME_MOUSESETUP_SENSITIVITY = MAKE_MENUENTRY( "Sensitivity:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SENSITIVITY, RangeFloat );
765
static MenuOption_t MEO_MOUSESETUP_MOUSEAIMING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &g_myAimMode );
766
static MenuEntry_t ME_MOUSESETUP_MOUSEAIMING = MAKE_MENUENTRY( "Vertical aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMING, Option );
767
static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &ud.mouseflip );
768
static MenuEntry_t ME_MOUSESETUP_INVERT = MAKE_MENUENTRY( "Invert aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_INVERT, Option );
769
static MenuOption_t MEO_MOUSESETUP_SMOOTH = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.SmoothInput );
770
static MenuEntry_t ME_MOUSESETUP_SMOOTH = MAKE_MENUENTRY( "Filter input:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SMOOTH, Option );
4823 hendricks2 771
static MenuLink_t MEO_MOUSESETUP_ADVANCED = { MENU_MOUSEADVANCED, MA_Advance, };
4778 hendricks2 772
static MenuEntry_t ME_MOUSESETUP_ADVANCED = MAKE_MENUENTRY( "Advanced setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_ADVANCED, Link );
3084 terminx 773
 
4778 hendricks2 774
static MenuEntry_t *MEL_MOUSESETUP[] = {
4496 hendricks2 775
    &ME_MOUSESETUP_SENSITIVITY,
4850 hendricks2 776
    &ME_MOUSESETUP_BTNS,
4778 hendricks2 777
    &ME_Space2,
4850 hendricks2 778
    &ME_MOUSESETUP_MOUSEAIMING,
779
    &ME_MOUSESETUP_INVERT,
780
    &ME_MOUSESETUP_SMOOTH,
781
    &ME_MOUSESETUP_ADVANCED,
4609 terminx 782
};
783
 
4993 terminx 784
#ifdef DROIDMENU
5023 terminx 785
static MenuRangeFloat_t MEO_TOUCHSETUP_SENSITIVITY_MOVE = MAKE_MENURANGE(&droidinput.forward_sens, &MF_Redfont, 1.f, 9.f, 0.f, 17, 1 + EnforceIntervals);
5652 terminx 786
static MenuEntry_t ME_TOUCHSETUP_SENSITIVITY_MOVE = MAKE_MENUENTRY("Running:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_TOUCHSETUP_SENSITIVITY_MOVE, RangeFloat);
4993 terminx 787
 
5023 terminx 788
static MenuRangeFloat_t MEO_TOUCHSETUP_SENSITIVITY_STRAFE = MAKE_MENURANGE(&droidinput.strafe_sens, &MF_Redfont, 1.f, 9.f, 0.f, 17, 1 + EnforceIntervals);
5652 terminx 789
static MenuEntry_t ME_TOUCHSETUP_SENSITIVITY_STRAFE = MAKE_MENUENTRY("Strafing:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_TOUCHSETUP_SENSITIVITY_STRAFE, RangeFloat);
4993 terminx 790
 
5023 terminx 791
static MenuRangeFloat_t MEO_TOUCHSETUP_SENSITIVITY_LOOK = MAKE_MENURANGE(&droidinput.pitch_sens, &MF_Redfont, 1.f, 9.f, 0.f, 17, 1 + EnforceIntervals);
5652 terminx 792
static MenuEntry_t ME_TOUCHSETUP_SENSITIVITY_LOOK = MAKE_MENUENTRY("Looking:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_TOUCHSETUP_SENSITIVITY_LOOK, RangeFloat);
4993 terminx 793
 
5023 terminx 794
static MenuRangeFloat_t MEO_TOUCHSETUP_SENSITIVITY_TURN = MAKE_MENURANGE(&droidinput.yaw_sens, &MF_Redfont, 1.f, 9.f, 0.f, 17, 1 + EnforceIntervals);
5652 terminx 795
static MenuEntry_t ME_TOUCHSETUP_SENSITIVITY_TURN = MAKE_MENUENTRY("Turning:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_TOUCHSETUP_SENSITIVITY_TURN, RangeFloat);
4993 terminx 796
 
797
static MenuOption_t MEO_TOUCHSETUP_INVERT = MAKE_MENUOPTION(&MF_Redfont, &MEOS_NoYes, &droidinput.invertLook);
798
static MenuEntry_t ME_TOUCHSETUP_INVERT = MAKE_MENUENTRY("Invert look:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_TOUCHSETUP_INVERT, Option);
799
 
5652 terminx 800
MAKE_MENU_TOP_ENTRYLINK("Sensitivity", MEF_CenterMenu, TOUCHSENS, MENU_TOUCHSENS);
801
MAKE_MENU_TOP_ENTRYLINK("Button Setup", MEF_CenterMenu, TOUCHBUTTONS, MENU_TOUCHBUTTONS);
802
 
4993 terminx 803
static MenuEntry_t *MEL_TOUCHSETUP [] ={
5652 terminx 804
    &ME_TOUCHSENS,
805
    &ME_TOUCHBUTTONS,
806
};
807
 
808
static MenuEntry_t *MEL_TOUCHSENS [] ={
4993 terminx 809
    &ME_TOUCHSETUP_SENSITIVITY_MOVE,
810
    &ME_TOUCHSETUP_SENSITIVITY_STRAFE,
811
    &ME_TOUCHSETUP_SENSITIVITY_LOOK,
812
    &ME_TOUCHSETUP_SENSITIVITY_TURN,
813
    &ME_Space2,
814
    &ME_TOUCHSETUP_INVERT,
815
};
816
#endif
817
 
4778 hendricks2 818
MAKE_MENU_TOP_ENTRYLINK( "Edit Buttons", MEF_CenterMenu, JOYSTICK_EDITBUTTONS, MENU_JOYSTICKBTNS );
819
MAKE_MENU_TOP_ENTRYLINK( "Edit Axes", MEF_CenterMenu, JOYSTICK_EDITAXES, MENU_JOYSTICKAXES );
5 Plagman 820
 
4496 hendricks2 821
static MenuEntry_t *MEL_JOYSTICKSETUP[] = {
822
    &ME_JOYSTICK_EDITBUTTONS,
823
    &ME_JOYSTICK_EDITAXES,
824
};
5 Plagman 825
 
4496 hendricks2 826
#define MAXJOYBUTTONSTRINGLENGTH 32
5 Plagman 827
 
4826 hendricks2 828
static char MenuJoystickNames[MAXJOYBUTTONSANDHATS*2][MAXJOYBUTTONSTRINGLENGTH];
5 Plagman 829
 
4826 hendricks2 830
static MenuOption_t MEO_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
831
static MenuEntry_t ME_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
832
static MenuEntry_t *MEL_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
59 terminx 833
 
4688 hendricks2 834
static MenuLink_t MEO_JOYSTICKAXES = { MENU_JOYSTICKAXIS, MA_Advance, };
4778 hendricks2 835
static MenuEntry_t ME_JOYSTICKAXES_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXES, Link );
4496 hendricks2 836
static MenuEntry_t ME_JOYSTICKAXES[MAXJOYAXES];
837
static char MenuJoystickAxes[MAXJOYAXES][MAXJOYBUTTONSTRINGLENGTH];
59 terminx 838
 
4496 hendricks2 839
static MenuEntry_t *MEL_JOYSTICKAXES[MAXJOYAXES];
2188 helixhorne 840
 
4778 hendricks2 841
static MenuRangeInt32_t MEO_MOUSEADVANCED_SCALEX = MAKE_MENURANGE( &ud.config.MouseAnalogueScale[0], &MF_Bluefont, -262144, 262144, 65536, 65, 3 );
842
static MenuEntry_t ME_MOUSEADVANCED_SCALEX = MAKE_MENUENTRY( "X-Axis Scale", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_SCALEX, RangeInt32 );
843
static MenuRangeInt32_t MEO_MOUSEADVANCED_SCALEY = MAKE_MENURANGE( &ud.config.MouseAnalogueScale[1], &MF_Bluefont, -262144, 262144, 65536, 65, 3 );
844
static MenuEntry_t ME_MOUSEADVANCED_SCALEY = MAKE_MENUENTRY( "Y-Axis Scale", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_SCALEY, RangeInt32 );
2188 helixhorne 845
 
4609 terminx 846
static MenuOption_t MEO_MOUSEADVANCED_DAXES_UP = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[1][0] );
4778 hendricks2 847
static MenuEntry_t ME_MOUSEADVANCED_DAXES_UP = MAKE_MENUENTRY( "Digital Up", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_UP, Option );
4609 terminx 848
static MenuOption_t MEO_MOUSEADVANCED_DAXES_DOWN = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[1][1] );
4778 hendricks2 849
static MenuEntry_t ME_MOUSEADVANCED_DAXES_DOWN = MAKE_MENUENTRY( "Digital Down", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_DOWN, Option );
4609 terminx 850
static MenuOption_t MEO_MOUSEADVANCED_DAXES_LEFT = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[0][0] );
4778 hendricks2 851
static MenuEntry_t ME_MOUSEADVANCED_DAXES_LEFT = MAKE_MENUENTRY( "Digital Left", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_LEFT, Option );
4609 terminx 852
static MenuOption_t MEO_MOUSEADVANCED_DAXES_RIGHT = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[0][1] );
4778 hendricks2 853
static MenuEntry_t ME_MOUSEADVANCED_DAXES_RIGHT = MAKE_MENUENTRY( "Digital Right", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_RIGHT, Option );
2188 helixhorne 854
 
4778 hendricks2 855
static MenuEntry_t *MEL_MOUSEADVANCED[] = {
856
    &ME_MOUSEADVANCED_SCALEX,
857
    &ME_MOUSEADVANCED_SCALEY,
858
    &ME_Space8,
4496 hendricks2 859
    &ME_MOUSEADVANCED_DAXES_UP,
860
    &ME_MOUSEADVANCED_DAXES_DOWN,
861
    &ME_MOUSEADVANCED_DAXES_LEFT,
862
    &ME_MOUSEADVANCED_DAXES_RIGHT,
863
};
3084 terminx 864
 
4778 hendricks2 865
static MenuEntry_t *MEL_INTERNAL_MOUSEADVANCED_DAXES[] = {
866
    &ME_MOUSEADVANCED_DAXES_UP,
867
    &ME_MOUSEADVANCED_DAXES_DOWN,
868
    &ME_MOUSEADVANCED_DAXES_LEFT,
869
    &ME_MOUSEADVANCED_DAXES_RIGHT,
870
};
871
 
4496 hendricks2 872
static const char *MenuJoystickHatDirections[] = { "Up", "Right", "Down", "Left", };
3084 terminx 873
 
5547 terminx 874
static char const *MEOSN_JOYSTICKAXIS_ANALOG[] = { "  -None-", "Turning", "Strafing", "Looking", "Moving", };
4496 hendricks2 875
static int32_t MEOSV_JOYSTICKAXIS_ANALOG[] = { -1, analog_turning, analog_strafing, analog_lookingupanddown, analog_moving, };
4778 hendricks2 876
static MenuOptionSet_t MEOS_JOYSTICKAXIS_ANALOG = MAKE_MENUOPTIONSET( MEOSN_JOYSTICKAXIS_ANALOG, MEOSV_JOYSTICKAXIS_ANALOG, 0x0 );
4496 hendricks2 877
static MenuOption_t MEO_JOYSTICKAXIS_ANALOG = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_JOYSTICKAXIS_ANALOG, NULL );
4778 hendricks2 878
static MenuEntry_t ME_JOYSTICKAXIS_ANALOG = MAKE_MENUENTRY( "Analog", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_ANALOG, Option );
879
static MenuRangeInt32_t MEO_JOYSTICKAXIS_SCALE = MAKE_MENURANGE( NULL, &MF_Bluefont, -262144, 262144, 65536, 65, 3 );
880
static MenuEntry_t ME_JOYSTICKAXIS_SCALE = MAKE_MENUENTRY( "Scale", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_SCALE, RangeInt32 );
881
static MenuRangeInt32_t MEO_JOYSTICKAXIS_DEAD = MAKE_MENURANGE( NULL, &MF_Bluefont, 0, 1000000, 0, 33, 2 );
882
static MenuEntry_t ME_JOYSTICKAXIS_DEAD = MAKE_MENUENTRY( "Dead Zone", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DEAD, RangeInt32 );
883
static MenuRangeInt32_t MEO_JOYSTICKAXIS_SATU = MAKE_MENURANGE( NULL, &MF_Bluefont, 0, 1000000, 0, 33, 2 );
884
static MenuEntry_t ME_JOYSTICKAXIS_SATU = MAKE_MENUENTRY( "Saturation", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_SATU, RangeInt32 );
3084 terminx 885
 
4496 hendricks2 886
static MenuOption_t MEO_JOYSTICKAXIS_DIGITALNEGATIVE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
4778 hendricks2 887
static MenuEntry_t ME_JOYSTICKAXIS_DIGITALNEGATIVE = MAKE_MENUENTRY( "Digital -", &MF_BluefontRed, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DIGITALNEGATIVE, Option );
4496 hendricks2 888
static MenuOption_t MEO_JOYSTICKAXIS_DIGITALPOSITIVE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
4778 hendricks2 889
static MenuEntry_t ME_JOYSTICKAXIS_DIGITALPOSITIVE = MAKE_MENUENTRY( "Digital +", &MF_BluefontRed, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DIGITALPOSITIVE, Option );
3084 terminx 890
 
4496 hendricks2 891
static MenuEntry_t *MEL_JOYSTICKAXIS[] = {
892
    &ME_JOYSTICKAXIS_ANALOG,
893
    &ME_JOYSTICKAXIS_SCALE,
894
    &ME_JOYSTICKAXIS_DEAD,
895
    &ME_JOYSTICKAXIS_SATU,
4778 hendricks2 896
    &ME_Space8,
897
    &ME_JOYSTICKAXIS_DIGITALNEGATIVE,
898
    &ME_JOYSTICKAXIS_DIGITALPOSITIVE,
4496 hendricks2 899
};
3084 terminx 900
 
4778 hendricks2 901
static MenuEntry_t *MEL_INTERNAL_JOYSTICKAXIS_DIGITAL[] = {
4496 hendricks2 902
    &ME_JOYSTICKAXIS_DIGITALNEGATIVE,
903
    &ME_JOYSTICKAXIS_DIGITALPOSITIVE,
904
};
3084 terminx 905
 
4496 hendricks2 906
#ifdef USE_OPENGL
907
static MenuOption_t MEO_RENDERERSETUP_HIGHTILE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &usehightile );
5408 terminx 908
static MenuEntry_t ME_RENDERERSETUP_HIGHTILE = MAKE_MENUENTRY( "Truecolor textures:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_HIGHTILE, Option );
909
 
5547 terminx 910
static char const *MEOSN_RENDERERSETUP_TEXQUALITY [] ={ "Full", "Half", "Barf", };
5408 terminx 911
static MenuOptionSet_t MEOS_RENDERERSETUP_TEXQUALITY = MAKE_MENUOPTIONSET(MEOSN_RENDERERSETUP_TEXQUALITY, NULL, 0x2);
912
static MenuOption_t MEO_RENDERERSETUP_TEXQUALITY = MAKE_MENUOPTION(&MF_Bluefont, &MEOS_RENDERERSETUP_TEXQUALITY, &r_downsize);
913
static MenuEntry_t ME_RENDERERSETUP_TEXQUALITY = MAKE_MENUENTRY("GL texture quality:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_TEXQUALITY, Option);
914
 
915
 
4496 hendricks2 916
static MenuOption_t MEO_RENDERERSETUP_PRECACHE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.config.useprecache );
5408 terminx 917
static MenuEntry_t ME_RENDERERSETUP_PRECACHE = MAKE_MENUENTRY( "Pre-load map textures:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_PRECACHE, Option );
5526 hendricks2 918
# ifndef EDUKE32_GLES
5547 terminx 919
static char const *MEOSN_RENDERERSETUP_TEXCACHE[] = { "Off", "On", "Compr.", };
4778 hendricks2 920
static MenuOptionSet_t MEOS_RENDERERSETUP_TEXCACHE = MAKE_MENUOPTIONSET( MEOSN_RENDERERSETUP_TEXCACHE, NULL, 0x2 );
4496 hendricks2 921
static MenuOption_t MEO_RENDERERSETUP_TEXCACHE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_RENDERERSETUP_TEXCACHE, &glusetexcache );
5408 terminx 922
static MenuEntry_t ME_RENDERERSETUP_TEXCACHE = MAKE_MENUENTRY( "On-disk texture cache:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_TEXCACHE, Option );
5526 hendricks2 923
# endif
924
# ifdef USE_GLEXT
4496 hendricks2 925
static MenuOption_t MEO_RENDERERSETUP_DETAILTEX = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &r_detailmapping );
4778 hendricks2 926
static MenuEntry_t ME_RENDERERSETUP_DETAILTEX = MAKE_MENUENTRY( "Detail textures:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_DETAILTEX, Option );
5408 terminx 927
static MenuOption_t MEO_RENDERERSETUP_GLOWTEX = MAKE_MENUOPTION(&MF_Bluefont, &MEOS_NoYes, &r_glowmapping);
928
static MenuEntry_t ME_RENDERERSETUP_GLOWTEX = MAKE_MENUENTRY("Glow textures:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_GLOWTEX, Option);
5526 hendricks2 929
# endif
4496 hendricks2 930
static MenuOption_t MEO_RENDERERSETUP_MODELS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &usemodels );
5408 terminx 931
static MenuEntry_t ME_RENDERERSETUP_MODELS = MAKE_MENUENTRY( "Use 3d models:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_MODELS, Option );
4496 hendricks2 932
#endif
5408 terminx 933
 
5406 terminx 934
#ifdef POLYMER
5547 terminx 935
static char const *MEOSN_POLYMER_LIGHTS [] ={ "Off", "Full", "Map only", };
5408 terminx 936
static MenuOptionSet_t MEOS_POLYMER_LIGHTS = MAKE_MENUOPTIONSET(MEOSN_POLYMER_LIGHTS, NULL, 0x2);
937
static MenuOption_t MEO_POLYMER_LIGHTS = MAKE_MENUOPTION(&MF_Bluefont, &MEOS_POLYMER_LIGHTS, &pr_lighting);
938
static MenuEntry_t ME_POLYMER_LIGHTS = MAKE_MENUENTRY("Dynamic lights:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_POLYMER_LIGHTS, Option);
939
 
940
static MenuRangeInt32_t MEO_POLYMER_LIGHTPASSES = MAKE_MENURANGE(&r_pr_maxlightpasses, &MF_Bluefont, 1, 10, 1, 10, 1);
941
static MenuEntry_t ME_POLYMER_LIGHTPASSES = MAKE_MENUENTRY("Lights per surface:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_POLYMER_LIGHTPASSES, RangeInt32);
942
 
943
static MenuOption_t MEO_POLYMER_SHADOWS = MAKE_MENUOPTION(&MF_Bluefont, &MEOS_OffOn, &pr_shadows);
944
static MenuEntry_t ME_POLYMER_SHADOWS = MAKE_MENUENTRY("Dynamic shadows:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_POLYMER_SHADOWS, Option);
945
 
946
static MenuRangeInt32_t MEO_POLYMER_SHADOWCOUNT = MAKE_MENURANGE(&pr_shadowcount, &MF_Bluefont, 1, 10, 1, 10, 1);
947
static MenuEntry_t ME_POLYMER_SHADOWCOUNT = MAKE_MENUENTRY("Shadows per surface:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_POLYMER_SHADOWCOUNT, RangeInt32);
948
 
5406 terminx 949
#endif
3084 terminx 950
 
4496 hendricks2 951
#ifdef USE_OPENGL
5408 terminx 952
static MenuEntry_t *MEL_RENDERERSETUP_POLYMOST[] = {
4496 hendricks2 953
    &ME_RENDERERSETUP_HIGHTILE,
954
    &ME_RENDERERSETUP_TEXQUALITY,
955
    &ME_RENDERERSETUP_PRECACHE,
5526 hendricks2 956
# ifndef EDUKE32_GLES
4496 hendricks2 957
    &ME_RENDERERSETUP_TEXCACHE,
5526 hendricks2 958
# endif
959
# ifdef USE_GLEXT
4496 hendricks2 960
    &ME_RENDERERSETUP_DETAILTEX,
5408 terminx 961
    &ME_RENDERERSETUP_GLOWTEX,
5526 hendricks2 962
# endif
4778 hendricks2 963
    &ME_Space4,
4496 hendricks2 964
    &ME_RENDERERSETUP_MODELS,
5408 terminx 965
};
966
 
5406 terminx 967
#ifdef POLYMER
5408 terminx 968
static MenuEntry_t *MEL_RENDERERSETUP_POLYMER [] ={
969
    &ME_RENDERERSETUP_HIGHTILE,
970
    &ME_RENDERERSETUP_TEXQUALITY,
971
    &ME_RENDERERSETUP_PRECACHE,
5526 hendricks2 972
# ifndef EDUKE32_GLES
5408 terminx 973
    &ME_RENDERERSETUP_TEXCACHE,
5526 hendricks2 974
# endif
975
# ifdef USE_GLEXT
5408 terminx 976
    &ME_RENDERERSETUP_DETAILTEX,
977
    &ME_RENDERERSETUP_GLOWTEX,
5526 hendricks2 978
# endif
5406 terminx 979
    &ME_Space4,
5408 terminx 980
    &ME_RENDERERSETUP_MODELS,
981
    &ME_Space4,
982
    &ME_POLYMER_LIGHTS,
983
    &ME_POLYMER_LIGHTPASSES,
984
    &ME_POLYMER_SHADOWS,
985
    &ME_POLYMER_SHADOWCOUNT,
4496 hendricks2 986
};
987
#endif
5408 terminx 988
#endif
3084 terminx 989
 
4609 terminx 990
#ifdef DROIDMENU
4778 hendricks2 991
static MenuRangeFloat_t MEO_COLCORR_GAMMA = MAKE_MENURANGE( &vid_gamma, &MF_Bluefont, 1.f, 2.5f, 0.f, 39, 1 );
4609 terminx 992
#else
4778 hendricks2 993
static MenuRangeFloat_t MEO_COLCORR_GAMMA = MAKE_MENURANGE( &vid_gamma, &MF_Bluefont, 0.2f, 4.f, 0.f, 39, 1 );
4609 terminx 994
#endif
4778 hendricks2 995
static MenuEntry_t ME_COLCORR_GAMMA = MAKE_MENUENTRY( "Gamma:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_GAMMA, RangeFloat );
996
static MenuRangeFloat_t MEO_COLCORR_CONTRAST = MAKE_MENURANGE( &vid_contrast, &MF_Bluefont, 0.1f, 2.7f, 0.f, 53, 1 );
997
static MenuEntry_t ME_COLCORR_CONTRAST = MAKE_MENUENTRY( "Contrast:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_CONTRAST, RangeFloat );
998
static MenuRangeFloat_t MEO_COLCORR_BRIGHTNESS = MAKE_MENURANGE( &vid_brightness, &MF_Bluefont, -0.8f, 0.8f, 0.f, 33, 1 );
999
static MenuEntry_t ME_COLCORR_BRIGHTNESS = MAKE_MENUENTRY( "Brightness:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_BRIGHTNESS, RangeFloat );
1000
static MenuEntry_t ME_COLCORR_RESET = MAKE_MENUENTRY( "Reset To Defaults", &MF_Redfont, &MEF_ColorCorrect, &MEO_NULL, Link );
4993 terminx 1001
#ifdef DROIDMENU
1002
#define MINVIS 1.f
1003
#else
1004
#define MINVIS 0.125f
1005
#endif
1006
static MenuRangeFloat_t MEO_COLCORR_AMBIENT = MAKE_MENURANGE( &r_ambientlight, &MF_Bluefont, MINVIS, 4.f, 0.f, 32, 1 );
4778 hendricks2 1007
static MenuEntry_t ME_COLCORR_AMBIENT = MAKE_MENUENTRY( "Visibility:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_AMBIENT, RangeFloat );
3084 terminx 1008
 
4496 hendricks2 1009
static MenuEntry_t *MEL_COLCORR[] = {
1010
    &ME_COLCORR_GAMMA,
4609 terminx 1011
#ifndef DROIDMENU
4496 hendricks2 1012
    &ME_COLCORR_CONTRAST,
1013
    &ME_COLCORR_BRIGHTNESS,
4609 terminx 1014
#endif
4850 hendricks2 1015
    &ME_COLCORR_AMBIENT,
4778 hendricks2 1016
    &ME_Space8,
4496 hendricks2 1017
    &ME_COLCORR_RESET,
1018
};
3084 terminx 1019
 
4778 hendricks2 1020
static MenuEntry_t *MEL_SCREENSETUP[] = {
4682 hendricks2 1021
#ifndef DROIDMENU
4850 hendricks2 1022
    &ME_SCREENSETUP_SCREENSIZE,
4682 hendricks2 1023
#endif
4609 terminx 1024
 
4850 hendricks2 1025
    &ME_SCREENSETUP_NEWSTATUSBAR,
1026
    &ME_SCREENSETUP_SBARSIZE,
4609 terminx 1027
 
4850 hendricks2 1028
    &ME_SCREENSETUP_CROSSHAIR,
1029
    &ME_SCREENSETUP_CROSSHAIRSIZE,
4609 terminx 1030
 
4850 hendricks2 1031
    &ME_SCREENSETUP_LEVELSTATS,
1032
    &ME_SCREENSETUP_TEXTSIZE,
4609 terminx 1033
 
4850 hendricks2 1034
    &ME_SCREENSETUP_SHOWPICKUPMESSAGES,
4609 terminx 1035
};
1036
 
4496 hendricks2 1037
// Save and load will be filled in before every viewing of the save/load screen.
4688 hendricks2 1038
static MenuLink_t MEO_LOAD = { MENU_NULL, MA_None, };
1039
static MenuLink_t MEO_LOAD_VALID = { MENU_LOADVERIFY, MA_None, };
4778 hendricks2 1040
static MenuEntry_t ME_LOAD_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_MinifontRed, &MEF_LoadSave, &MEO_LOAD, Link );
4496 hendricks2 1041
static MenuEntry_t ME_LOAD[MAXSAVEGAMES];
1042
static MenuEntry_t *MEL_LOAD[MAXSAVEGAMES];
3084 terminx 1043
 
4778 hendricks2 1044
static MenuString_t MEO_SAVE_TEMPLATE = MAKE_MENUSTRING( NULL, &MF_MinifontRed, MAXSAVEGAMENAME, 0 );
4496 hendricks2 1045
static MenuString_t MEO_SAVE[MAXSAVEGAMES];
4778 hendricks2 1046
static MenuEntry_t ME_SAVE_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_MinifontRed, &MEF_LoadSave, &MEO_SAVE_TEMPLATE, String );
4496 hendricks2 1047
static MenuEntry_t ME_SAVE[MAXSAVEGAMES];
1048
static MenuEntry_t *MEL_SAVE[MAXSAVEGAMES];
3084 terminx 1049
 
5272 terminx 1050
static int32_t soundrate, soundvoices;
4778 hendricks2 1051
static MenuOption_t MEO_SOUND = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.SoundToggle );
1052
static MenuEntry_t ME_SOUND = MAKE_MENUENTRY( "Sound:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND, Option );
4609 terminx 1053
 
4778 hendricks2 1054
static MenuOption_t MEO_SOUND_MUSIC = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.MusicToggle );
1055
static MenuEntry_t ME_SOUND_MUSIC = MAKE_MENUENTRY( "Music:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_MUSIC, Option );
4609 terminx 1056
 
4778 hendricks2 1057
static MenuRangeInt32_t MEO_SOUND_VOLUME_MASTER = MAKE_MENURANGE( &ud.config.MasterVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
1058
static MenuEntry_t ME_SOUND_VOLUME_MASTER = MAKE_MENUENTRY( "Volume:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_VOLUME_MASTER, RangeInt32 );
4609 terminx 1059
 
4778 hendricks2 1060
static MenuRangeInt32_t MEO_SOUND_VOLUME_EFFECTS = MAKE_MENURANGE( &ud.config.FXVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
1061
static MenuEntry_t ME_SOUND_VOLUME_EFFECTS = MAKE_MENUENTRY( "Effects:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_VOLUME_EFFECTS, RangeInt32 );
4609 terminx 1062
 
4778 hendricks2 1063
static MenuRangeInt32_t MEO_SOUND_VOLUME_MUSIC = MAKE_MENURANGE( &ud.config.MusicVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
1064
static MenuEntry_t ME_SOUND_VOLUME_MUSIC = MAKE_MENUENTRY( "Music:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_VOLUME_MUSIC, RangeInt32 );
4609 terminx 1065
 
4778 hendricks2 1066
static MenuOption_t MEO_SOUND_DUKETALK = MAKE_MENUOPTION(&MF_Redfont, &MEOS_NoYes, NULL);
1067
static MenuEntry_t ME_SOUND_DUKETALK = MAKE_MENUENTRY( "Duke talk:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_DUKETALK, Option );
4609 terminx 1068
 
5547 terminx 1069
static char const *MEOSN_SOUND_SAMPLINGRATE[] = { "22050Hz", "44100Hz", "48000Hz", };
4609 terminx 1070
static int32_t MEOSV_SOUND_SAMPLINGRATE[] = { 22050, 44100, 48000, };
4778 hendricks2 1071
static MenuOptionSet_t MEOS_SOUND_SAMPLINGRATE = MAKE_MENUOPTIONSET( MEOSN_SOUND_SAMPLINGRATE, MEOSV_SOUND_SAMPLINGRATE, 0x3 );
1072
static MenuOption_t MEO_SOUND_SAMPLINGRATE = MAKE_MENUOPTION( &MF_Redfont, &MEOS_SOUND_SAMPLINGRATE, &soundrate );
1073
static MenuEntry_t ME_SOUND_SAMPLINGRATE = MAKE_MENUENTRY( "Sample rate:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_SAMPLINGRATE, Option );
4609 terminx 1074
 
4778 hendricks2 1075
static MenuRangeInt32_t MEO_SOUND_NUMVOICES = MAKE_MENURANGE( &soundvoices, &MF_Redfont, 16, 256, 0, 16, 1 );
1076
static MenuEntry_t ME_SOUND_NUMVOICES = MAKE_MENUENTRY( "Voices:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_NUMVOICES, RangeInt32 );
4609 terminx 1077
 
4778 hendricks2 1078
static MenuEntry_t ME_SOUND_RESTART = MAKE_MENUENTRY( "Restart sound system", &MF_Redfont, &MEF_BigOptionsRt, &MEO_NULL, Link );
4609 terminx 1079
 
4682 hendricks2 1080
#ifndef DROIDMENU
4688 hendricks2 1081
static MenuLink_t MEO_ADVSOUND = { MENU_ADVSOUND, MA_Advance, };
4778 hendricks2 1082
static MenuEntry_t ME_SOUND_ADVSOUND = MAKE_MENUENTRY( "Advanced", &MF_Redfont, &MEF_BigOptionsRt, &MEO_ADVSOUND, Link );
4645 hendricks2 1083
#endif
4609 terminx 1084
 
4778 hendricks2 1085
static MenuEntry_t *MEL_SOUND[] = {
4496 hendricks2 1086
    &ME_SOUND,
1087
    &ME_SOUND_MUSIC,
4850 hendricks2 1088
    &ME_SOUND_VOLUME_MASTER,
1089
    &ME_SOUND_VOLUME_EFFECTS,
1090
    &ME_SOUND_VOLUME_MUSIC,
4496 hendricks2 1091
    &ME_SOUND_DUKETALK,
4609 terminx 1092
#ifndef DROIDMENU
4850 hendricks2 1093
    &ME_SOUND_ADVSOUND,
4609 terminx 1094
#endif
4496 hendricks2 1095
};
3084 terminx 1096
 
4778 hendricks2 1097
static MenuEntry_t *MEL_ADVSOUND[] = {
4850 hendricks2 1098
    &ME_SOUND_SAMPLINGRATE,
4778 hendricks2 1099
    &ME_Space2,
4850 hendricks2 1100
    &ME_SOUND_NUMVOICES,
4778 hendricks2 1101
    &ME_Space2,
4850 hendricks2 1102
    &ME_SOUND_RESTART,
4609 terminx 1103
};
1104
 
4778 hendricks2 1105
MAKE_MENU_TOP_ENTRYLINK( "Player Setup", MEF_CenterMenu, NETWORK_PLAYERSETUP, MENU_PLAYER );
1106
MAKE_MENU_TOP_ENTRYLINK( "Join Game", MEF_CenterMenu, NETWORK_JOINGAME, MENU_NETJOIN );
1107
MAKE_MENU_TOP_ENTRYLINK( "Host Game", MEF_CenterMenu, NETWORK_HOSTGAME, MENU_NETHOST );
4399 hendricks2 1108
 
4496 hendricks2 1109
static MenuEntry_t *MEL_NETWORK[] = {
1110
    &ME_NETWORK_PLAYERSETUP,
1111
    &ME_NETWORK_JOINGAME,
1112
    &ME_NETWORK_HOSTGAME,
1113
};
4399 hendricks2 1114
 
4778 hendricks2 1115
static MenuString_t MEO_PLAYER_NAME = MAKE_MENUSTRING( szPlayerName, &MF_Bluefont, MAXPLAYERNAME, 0 );
1116
static MenuEntry_t ME_PLAYER_NAME = MAKE_MENUENTRY( "Name", &MF_BluefontRed, &MEF_PlayerNarrow, &MEO_PLAYER_NAME, String );
5547 terminx 1117
static char const *MEOSN_PLAYER_COLOR[] = { "Auto", "Blue", "Red", "Green", "Gray", "Dark gray", "Dark green", "Brown", "Dark blue", "Bright red", "Yellow", };
4822 hendricks2 1118
static int32_t MEOSV_PLAYER_COLOR[] = { 0, 9, 10, 11, 12, 13, 14, 15, 16, 21, 23, };
4778 hendricks2 1119
static MenuOptionSet_t MEOS_PLAYER_COLOR = MAKE_MENUOPTIONSET( MEOSN_PLAYER_COLOR, MEOSV_PLAYER_COLOR, 0x2 );
4496 hendricks2 1120
static MenuOption_t MEO_PLAYER_COLOR = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_PLAYER_COLOR, &ud.color );
4778 hendricks2 1121
static MenuEntry_t ME_PLAYER_COLOR = MAKE_MENUENTRY( "Color", &MF_BluefontRed, &MEF_PlayerNarrow, &MEO_PLAYER_COLOR, Option );
5547 terminx 1122
static char const *MEOSN_PLAYER_TEAM[] = { "Blue", "Red", "Green", "Gray", };
4778 hendricks2 1123
static MenuOptionSet_t MEOS_PLAYER_TEAM = MAKE_MENUOPTIONSET( MEOSN_PLAYER_TEAM, NULL, 0x2 );
4496 hendricks2 1124
static MenuOption_t MEO_PLAYER_TEAM = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_PLAYER_TEAM, &ud.team );
4778 hendricks2 1125
static MenuEntry_t ME_PLAYER_TEAM = MAKE_MENUENTRY( "Team", &MF_BluefontRed, &MEF_PlayerNarrow, &MEO_PLAYER_TEAM, Option );
4682 hendricks2 1126
#ifndef DROIDMENU
4688 hendricks2 1127
static MenuLink_t MEO_PLAYER_MACROS = { MENU_MACROS, MA_Advance, };
4778 hendricks2 1128
static MenuEntry_t ME_PLAYER_MACROS = MAKE_MENUENTRY( "Multiplayer macros", &MF_BluefontRed, &MEF_SmallOptions, &MEO_PLAYER_MACROS, Link );
4682 hendricks2 1129
#endif
5 Plagman 1130
 
4778 hendricks2 1131
static MenuEntry_t *MEL_PLAYER[] = {
4496 hendricks2 1132
    &ME_PLAYER_NAME,
4778 hendricks2 1133
    &ME_Space4,
4496 hendricks2 1134
    &ME_PLAYER_COLOR,
4778 hendricks2 1135
    &ME_Space4,
4496 hendricks2 1136
    &ME_PLAYER_TEAM,
4682 hendricks2 1137
#ifndef DROIDMENU
4778 hendricks2 1138
    &ME_Space8,
4496 hendricks2 1139
    &ME_PLAYER_MACROS,
4778 hendricks2 1140
#endif
4496 hendricks2 1141
};
5 Plagman 1142
 
4778 hendricks2 1143
static MenuString_t MEO_MACROS_TEMPLATE = MAKE_MENUSTRING( NULL, &MF_Bluefont, MAXRIDECULELENGTH, 0 );
4496 hendricks2 1144
static MenuString_t MEO_MACROS[MAXSAVEGAMES];
4778 hendricks2 1145
static MenuEntry_t ME_MACROS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Bluefont, &MEF_Macros, &MEO_MACROS_TEMPLATE, String );
4496 hendricks2 1146
static MenuEntry_t ME_MACROS[MAXRIDECULE];
1147
static MenuEntry_t *MEL_MACROS[MAXRIDECULE];
5 Plagman 1148
 
5547 terminx 1149
static char const *MenuUserMap = "User Map";
1150
static char const *MenuSkillNone = "None";
5 Plagman 1151
 
5547 terminx 1152
static char const *MEOSN_NetGametypes[MAXGAMETYPES];
1153
static char const *MEOSN_NetEpisodes[MAXVOLUMES+1];
5033 hendricks2 1154
static int32_t MEOSV_NetEpisodes[MAXVOLUMES+1];
5547 terminx 1155
static char const *MEOSN_NetLevels[MAXVOLUMES][MAXLEVELS];
1156
static char const *MEOSN_NetSkills[MAXSKILLS+1];
5 Plagman 1157
 
4823 hendricks2 1158
static MenuLink_t MEO_NETHOST_OPTIONS = { MENU_NETOPTIONS, MA_Advance, };
4778 hendricks2 1159
static MenuEntry_t ME_NETHOST_OPTIONS = MAKE_MENUENTRY( "Game Options", &MF_Redfont, &MEF_VideoSetup, &MEO_NETHOST_OPTIONS, Link );
1160
static MenuEntry_t ME_NETHOST_LAUNCH = MAKE_MENUENTRY( "Launch Game", &MF_Redfont, &MEF_VideoSetup, &MEO_NULL, Link );
5 Plagman 1161
 
4496 hendricks2 1162
static MenuEntry_t *MEL_NETHOST[] = {
1163
    &ME_NETHOST_OPTIONS,
1164
    &ME_NETHOST_LAUNCH,
1165
};
471 terminx 1166
 
4778 hendricks2 1167
static MenuOptionSet_t MEOS_NETOPTIONS_GAMETYPE = MAKE_MENUOPTIONSET( MEOSN_NetGametypes, NULL, 0x0 );
4496 hendricks2 1168
static MenuOption_t MEO_NETOPTIONS_GAMETYPE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_GAMETYPE, &ud.m_coop );
4778 hendricks2 1169
static MenuEntry_t ME_NETOPTIONS_GAMETYPE = MAKE_MENUENTRY( "Game Type", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_GAMETYPE, Option );
5033 hendricks2 1170
static MenuOptionSet_t MEOS_NETOPTIONS_EPISODE = MAKE_MENUOPTIONSET( MEOSN_NetEpisodes, MEOSV_NetEpisodes, 0x0 );
1171
static int32_t NetEpisode;
1172
static MenuOption_t MEO_NETOPTIONS_EPISODE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_EPISODE, &NetEpisode );
4778 hendricks2 1173
static MenuEntry_t ME_NETOPTIONS_EPISODE = MAKE_MENUENTRY( "Episode", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_EPISODE, Option );
5034 hendricks2 1174
static MenuOptionSet_t MEOS_NETOPTIONS_LEVEL_TEMPLATE = MAKE_MENUOPTIONSETNULL;
4496 hendricks2 1175
static MenuOptionSet_t MEOS_NETOPTIONS_LEVEL[MAXVOLUMES];
1176
static MenuOption_t MEO_NETOPTIONS_LEVEL = MAKE_MENUOPTION( &MF_Bluefont, NULL, &ud.m_level_number );
4778 hendricks2 1177
static MenuEntry_t ME_NETOPTIONS_LEVEL = MAKE_MENUENTRY( "Level", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_LEVEL, Option );
4823 hendricks2 1178
static MenuLink_t MEO_NETOPTIONS_USERMAP = { MENU_NETUSERMAP, MA_Advance, };
4778 hendricks2 1179
static MenuEntry_t ME_NETOPTIONS_USERMAP = MAKE_MENUENTRY( "User Map", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_USERMAP, Link );
1180
static MenuOptionSet_t MEOS_NETOPTIONS_MONSTERS = MAKE_MENUOPTIONSET( MEOSN_NetSkills, NULL, 0x0 );
4496 hendricks2 1181
static MenuOption_t MEO_NETOPTIONS_MONSTERS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_MONSTERS, NULL );
4778 hendricks2 1182
static MenuEntry_t ME_NETOPTIONS_MONSTERS = MAKE_MENUENTRY( "Monsters", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MONSTERS, Option );
4496 hendricks2 1183
static MenuOption_t MEO_NETOPTIONS_MARKERS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.m_marker );
4778 hendricks2 1184
static MenuEntry_t ME_NETOPTIONS_MARKERS = MAKE_MENUENTRY( "Markers", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MARKERS, Option );
1185
static MenuEntry_t ME_NETOPTIONS_MARKERS_DISABLED = MAKE_MENUENTRY( "Markers", &MF_RedfontBlue, &MEF_NetSetup, NULL, Dummy );
4496 hendricks2 1186
static MenuOption_t MEO_NETOPTIONS_MAPEXITS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OnOff, &ud.m_noexits );
4778 hendricks2 1187
static MenuEntry_t ME_NETOPTIONS_MAPEXITS = MAKE_MENUENTRY( "Map Exits", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MAPEXITS, Option );
4496 hendricks2 1188
static MenuOption_t MEO_NETOPTIONS_FRFIRE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.m_ffire );
4778 hendricks2 1189
static MenuEntry_t ME_NETOPTIONS_FRFIRE = MAKE_MENUENTRY( "Fr. Fire", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_FRFIRE, Option );
1190
static MenuEntry_t ME_NETOPTIONS_ACCEPT = MAKE_MENUENTRY( "Accept", &MF_RedfontGreen, &MEF_NetSetup, &MEO_NULL, Link );
471 terminx 1191
 
4496 hendricks2 1192
static MenuEntry_t *MEL_NETOPTIONS[] = {
1193
    &ME_NETOPTIONS_GAMETYPE,
1194
    &ME_NETOPTIONS_EPISODE,
1195
    &ME_NETOPTIONS_LEVEL,
1196
    &ME_NETOPTIONS_MONSTERS,
1197
    &ME_NETOPTIONS_MARKERS,
1198
    &ME_NETOPTIONS_MAPEXITS,
1199
    &ME_NETOPTIONS_ACCEPT,
1200
};
5 Plagman 1201
 
4496 hendricks2 1202
static char MenuServer[BMAX_PATH] = "localhost";
4778 hendricks2 1203
static MenuString_t MEO_NETJOIN_SERVER = MAKE_MENUSTRING( MenuServer, &MF_Bluefont, BMAX_PATH, 0 );
1204
static MenuEntry_t ME_NETJOIN_SERVER = MAKE_MENUENTRY( "Server", &MF_Redfont, &MEF_VideoSetup, &MEO_NETJOIN_SERVER, String );
4496 hendricks2 1205
#define MAXPORTSTRINGLENGTH 6 // unsigned 16-bit integer
1206
static char MenuPort[MAXPORTSTRINGLENGTH] = "19014";
4778 hendricks2 1207
static MenuString_t MEO_NETJOIN_PORT = MAKE_MENUSTRING( MenuPort, &MF_Bluefont, MAXPORTSTRINGLENGTH, INPUT_NUMERIC );
1208
static MenuEntry_t ME_NETJOIN_PORT = MAKE_MENUENTRY( "Port", &MF_Redfont, &MEF_VideoSetup, &MEO_NETJOIN_PORT, String );
1209
static MenuEntry_t ME_NETJOIN_CONNECT = MAKE_MENUENTRY( "Connect", &MF_RedfontGreen, &MEF_VideoSetup, &MEO_NULL, Link );
471 terminx 1210
 
4496 hendricks2 1211
static MenuEntry_t *MEL_NETJOIN[] = {
1212
    &ME_NETJOIN_SERVER,
1213
    &ME_NETJOIN_PORT,
1214
    &ME_NETJOIN_CONNECT,
1215
};
5 Plagman 1216
 
1217
 
4496 hendricks2 1218
#define NoTitle NULL
91 terminx 1219
 
4778 hendricks2 1220
#define MAKE_MENUMENU(Title, Format, Entries) { Title, Format, Entries, ARRAY_SIZE(Entries), 0, 0, 0, 0 }
91 terminx 1221
 
4778 hendricks2 1222
static MenuMenu_t M_MAIN = MAKE_MENUMENU( NoTitle, &MMF_Top_Main, MEL_MAIN );
1223
static MenuMenu_t M_MAIN_INGAME = MAKE_MENUMENU( NoTitle, &MMF_Top_Main, MEL_MAIN_INGAME );
1224
static MenuMenu_t M_EPISODE = MAKE_MENUMENU( "Select An Episode", &MMF_Top_Episode, MEL_EPISODE );
1225
static MenuMenu_t M_SKILL = MAKE_MENUMENU( "Select Skill", &MMF_Top_Skill, MEL_SKILL );
1226
static MenuMenu_t M_GAMESETUP = MAKE_MENUMENU( "Game Setup", &MMF_BigOptions, MEL_GAMESETUP );
1227
static MenuMenu_t M_OPTIONS = MAKE_MENUMENU( "Options", &MMF_Top_Options, MEL_OPTIONS );
1228
static MenuMenu_t M_VIDEOSETUP = MAKE_MENUMENU( "Video Mode", &MMF_BigOptions, MEL_VIDEOSETUP );
1229
static MenuMenu_t M_KEYBOARDSETUP = MAKE_MENUMENU( "Keyboard Setup", &MMF_Top_Options, MEL_KEYBOARDSETUP );
1230
static MenuMenu_t M_CONTROLS = MAKE_MENUMENU( "Control Setup", &MMF_Top_Options, MEL_CONTROLS );
5084 hendricks2 1231
static MenuMenu_t M_CHEATS = MAKE_MENUMENU( "Cheats", &MMF_SmallOptions, MEL_CHEATS );
4778 hendricks2 1232
static MenuMenu_t M_MOUSESETUP = MAKE_MENUMENU( "Mouse Setup", &MMF_BigOptions, MEL_MOUSESETUP );
4993 terminx 1233
#ifdef DROIDMENU
5652 terminx 1234
static MenuMenu_t M_TOUCHSETUP = MAKE_MENUMENU( "Touch Setup", &MMF_Top_Options, MEL_TOUCHSETUP );
1235
static MenuMenu_t M_TOUCHSENS = MAKE_MENUMENU( "Sensitivity", &MMF_BigOptions, MEL_TOUCHSENS);
5661 terminx 1236
static MenuPanel_t M_TOUCHBUTTONS ={ "Button Setup", MENU_TOUCHSETUP, MA_Return, MENU_TOUCHSETUP, MA_Advance, };
4993 terminx 1237
#endif
4778 hendricks2 1238
static MenuMenu_t M_JOYSTICKSETUP = MAKE_MENUMENU( "Joystick Setup", &MMF_Top_Joystick_Network, MEL_JOYSTICKSETUP );
1239
static MenuMenu_t M_JOYSTICKBTNS = MAKE_MENUMENU( "Joystick Buttons", &MMF_MouseJoySetupBtns, MEL_JOYSTICKBTNS );
1240
static MenuMenu_t M_JOYSTICKAXES = MAKE_MENUMENU( "Joystick Axes", &MMF_BigSliders, MEL_JOYSTICKAXES );
1241
static MenuMenu_t M_KEYBOARDKEYS = MAKE_MENUMENU( "Keyboard Keys", &MMF_KeyboardSetupFuncs, MEL_KEYBOARDSETUPFUNCS );
1242
static MenuMenu_t M_MOUSEBTNS = MAKE_MENUMENU( "Mouse Buttons", &MMF_MouseJoySetupBtns, MEL_MOUSESETUPBTNS );
1243
static MenuMenu_t M_MOUSEADVANCED = MAKE_MENUMENU( "Advanced Mouse", &MMF_BigSliders, MEL_MOUSEADVANCED );
1244
static MenuMenu_t M_JOYSTICKAXIS = MAKE_MENUMENU( NULL, &MMF_BigSliders, MEL_JOYSTICKAXIS );
4609 terminx 1245
#ifdef USE_OPENGL
5408 terminx 1246
static MenuMenu_t M_RENDERERSETUP_POLYMOST = MAKE_MENUMENU( "Polymost Setup", &MMF_SmallOptions, MEL_RENDERERSETUP_POLYMOST );
5424 helixhorne 1247
# ifdef POLYMER
5408 terminx 1248
static MenuMenu_t M_RENDERERSETUP_POLYMER = MAKE_MENUMENU("Polymer Setup", &MMF_SmallOptions, MEL_RENDERERSETUP_POLYMER );
5424 helixhorne 1249
# endif
4609 terminx 1250
#endif
4778 hendricks2 1251
static MenuMenu_t M_COLCORR = MAKE_MENUMENU( "Color Correction", &MMF_ColorCorrect, MEL_COLCORR );
4993 terminx 1252
static MenuMenu_t M_SCREENSETUP = MAKE_MENUMENU( "Status and crosshair", &MMF_BigOptions, MEL_SCREENSETUP );
4778 hendricks2 1253
static MenuMenu_t M_DISPLAYSETUP = MAKE_MENUMENU( "Display Setup", &MMF_BigOptions, MEL_DISPLAYSETUP );
1254
static MenuMenu_t M_LOAD = MAKE_MENUMENU( "Load Game", &MMF_LoadSave, MEL_LOAD );
1255
static MenuMenu_t M_SAVE = MAKE_MENUMENU( "Save Game", &MMF_LoadSave, MEL_SAVE );
1256
static MenuMenu_t M_SOUND = MAKE_MENUMENU( "Sound Setup", &MMF_BigOptions, MEL_SOUND );
4823 hendricks2 1257
static MenuMenu_t M_ADVSOUND = MAKE_MENUMENU( "Advanced Sound", &MMF_BigOptions, MEL_ADVSOUND );
4778 hendricks2 1258
static MenuMenu_t M_NETWORK = MAKE_MENUMENU( "Network Game", &MMF_Top_Joystick_Network, MEL_NETWORK );
1259
static MenuMenu_t M_PLAYER = MAKE_MENUMENU( "Player Setup", &MMF_SmallOptions, MEL_PLAYER );
1260
static MenuMenu_t M_MACROS = MAKE_MENUMENU( "Multiplayer Macros", &MMF_Macros, MEL_MACROS );
1261
static MenuMenu_t M_NETHOST = MAKE_MENUMENU( "Host Network Game", &MMF_SmallOptionsNarrow, MEL_NETHOST );
1262
static MenuMenu_t M_NETOPTIONS = MAKE_MENUMENU( "Net Game Options", &MMF_NetSetup, MEL_NETOPTIONS );
1263
static MenuMenu_t M_NETJOIN = MAKE_MENUMENU( "Join Network Game", &MMF_SmallOptionsNarrow, MEL_NETJOIN );
88 terminx 1264
 
4609 terminx 1265
#ifdef DROIDMENU
4688 hendricks2 1266
static MenuPanel_t M_STORY = { NoTitle, MENU_STORY, MA_Return, MENU_STORY, MA_Advance, };
4609 terminx 1267
#else
4688 hendricks2 1268
static MenuPanel_t M_STORY = { NoTitle, MENU_F1HELP, MA_Return, MENU_F1HELP, MA_Advance, };
4609 terminx 1269
#endif
1270
 
4688 hendricks2 1271
static MenuPanel_t M_F1HELP = { NoTitle, MENU_STORY, MA_Return, MENU_STORY, MA_Advance, };
4496 hendricks2 1272
static const char* MenuCredits = "Credits";
4688 hendricks2 1273
static MenuPanel_t M_CREDITS = { NoTitle, MENU_CREDITS5, MA_Return, MENU_CREDITS2, MA_Advance, };
1274
static MenuPanel_t M_CREDITS2 = { NoTitle, MENU_CREDITS, MA_Return, MENU_CREDITS3, MA_Advance, };
1275
static MenuPanel_t M_CREDITS3 = { NoTitle, MENU_CREDITS2, MA_Return, MENU_CREDITS4, MA_Advance, };
4609 terminx 1276
#ifdef DROIDMENU
5023 terminx 1277
static MenuPanel_t M_CREDITS4 = { "Hail to the King", MENU_CREDITS3, MA_Return, MENU_CREDITS5, MA_Advance, };
4609 terminx 1278
#else
4688 hendricks2 1279
static MenuPanel_t M_CREDITS4 = { "About EDuke32", MENU_CREDITS3, MA_Return, MENU_CREDITS5, MA_Advance, };
4609 terminx 1280
#endif
4688 hendricks2 1281
static MenuPanel_t M_CREDITS5 = { "About EDuke32", MENU_CREDITS4, MA_Return, MENU_CREDITS, MA_Advance, };
5 Plagman 1282
 
4686 hendricks2 1283
#define CURSOR_CENTER_2LINE { MENU_MARGIN_CENTER<<16, 120<<16, }
1284
#define CURSOR_CENTER_3LINE { MENU_MARGIN_CENTER<<16, 129<<16, }
4496 hendricks2 1285
#define CURSOR_BOTTOMRIGHT { 304<<16, 186<<16, }
5 Plagman 1286
 
4688 hendricks2 1287
static MenuVerify_t M_QUIT = { CURSOR_CENTER_2LINE, MENU_CLOSE, MA_None, };
1288
static MenuVerify_t M_QUITTOTITLE = { CURSOR_CENTER_2LINE, MENU_CLOSE, MA_None, };
1289
static MenuVerify_t M_LOADVERIFY = { CURSOR_CENTER_3LINE, MENU_CLOSE, MA_None, };
1290
static MenuVerify_t M_NEWVERIFY = { CURSOR_CENTER_2LINE, MENU_EPISODE, MA_Advance, };
1291
static MenuVerify_t M_SAVEVERIFY = { CURSOR_CENTER_2LINE, MENU_SAVE, MA_None, };
1292
static MenuVerify_t M_RESETPLAYER = { CURSOR_CENTER_3LINE, MENU_CLOSE, MA_None, };
5 Plagman 1293
 
4688 hendricks2 1294
static MenuMessage_t M_NETWAITMASTER = { CURSOR_BOTTOMRIGHT, MENU_NULL, MA_None, };
1295
static MenuMessage_t M_NETWAITVOTES = { CURSOR_BOTTOMRIGHT, MENU_NULL, MA_None, };
1296
static MenuMessage_t M_BUYDUKE = { CURSOR_BOTTOMRIGHT, MENU_EPISODE, MA_Return, };
5 Plagman 1297
 
5083 hendricks2 1298
static MenuTextForm_t M_ADULTPASSWORD = { NULL, "Enter Password:", MAXPWLOCKOUT, MTF_Password };
5084 hendricks2 1299
static MenuTextForm_t M_CHEATENTRY = { NULL, "Enter Cheat Code:", MAXCHEATLEN, 0 };
1300
static MenuTextForm_t M_CHEAT_WARP = { NULL, "Enter Warp #:", 3, 0 };
1301
static MenuTextForm_t M_CHEAT_SKILL = { NULL, "Enter Skill #:", 1, 0 };
5 Plagman 1302
 
4851 hendricks2 1303
#define MAKE_MENUFILESELECT(a, b, c) { a, { &MMF_FileSelectLeft, &MMF_FileSelectRight }, { &MF_Minifont, &MF_MinifontRed }, b, c, { NULL, NULL }, { 0, 0 }, { 3<<16, 3<<16 }, FNLIST_INITIALIZER, 0 }
337 terminx 1304
 
4851 hendricks2 1305
static MenuFileSelect_t M_USERMAP = MAKE_MENUFILESELECT( "Select A User Map", "*.map", boardfilename );
337 terminx 1306
 
4496 hendricks2 1307
// MUST be in ascending order of MenuID enum values due to binary search
1308
static Menu_t Menus[] = {
4778 hendricks2 1309
    { &M_MAIN, MENU_MAIN, MENU_CLOSE, MA_None, Menu },
1310
    { &M_MAIN_INGAME, MENU_MAIN_INGAME, MENU_CLOSE, MA_None, Menu },
1311
    { &M_EPISODE, MENU_EPISODE, MENU_MAIN, MA_Return, Menu },
1312
    { &M_USERMAP, MENU_USERMAP, MENU_EPISODE, MA_Return, FileSelect },
1313
    { &M_SKILL, MENU_SKILL, MENU_EPISODE, MA_Return, Menu },
1314
    { &M_GAMESETUP, MENU_GAMESETUP, MENU_OPTIONS, MA_Return, Menu },
1315
    { &M_OPTIONS, MENU_OPTIONS, MENU_MAIN, MA_Return, Menu },
1316
    { &M_VIDEOSETUP, MENU_VIDEOSETUP, MENU_DISPLAYSETUP, MA_Return, Menu },
1317
    { &M_KEYBOARDSETUP, MENU_KEYBOARDSETUP, MENU_CONTROLS, MA_Return, Menu },
1318
    { &M_MOUSESETUP, MENU_MOUSESETUP, MENU_CONTROLS, MA_Return, Menu },
1319
    { &M_JOYSTICKSETUP, MENU_JOYSTICKSETUP, MENU_CONTROLS, MA_Return, Menu },
1320
    { &M_JOYSTICKBTNS, MENU_JOYSTICKBTNS, MENU_JOYSTICKSETUP, MA_Return, Menu },
1321
    { &M_JOYSTICKAXES, MENU_JOYSTICKAXES, MENU_JOYSTICKSETUP, MA_Return, Menu },
1322
    { &M_KEYBOARDKEYS, MENU_KEYBOARDKEYS, MENU_KEYBOARDSETUP, MA_Return, Menu },
1323
    { &M_MOUSEBTNS, MENU_MOUSEBTNS, MENU_MOUSESETUP, MA_Return, Menu },
1324
    { &M_MOUSEADVANCED, MENU_MOUSEADVANCED, MENU_MOUSESETUP, MA_Return, Menu },
1325
    { &M_JOYSTICKAXIS, MENU_JOYSTICKAXIS, MENU_JOYSTICKAXES, MA_Return, Menu },
4993 terminx 1326
#ifdef DROIDMENU
1327
    { &M_TOUCHSETUP, MENU_TOUCHSETUP, MENU_OPTIONS, MA_Return, Menu },
5652 terminx 1328
    { &M_TOUCHSENS, MENU_TOUCHSENS, MENU_TOUCHSETUP, MA_Return, Menu },
5661 terminx 1329
    { &M_TOUCHBUTTONS, MENU_TOUCHBUTTONS, MENU_TOUCHSETUP, MA_Return, Panel },
4993 terminx 1330
#endif
4778 hendricks2 1331
    { &M_CONTROLS, MENU_CONTROLS, MENU_OPTIONS, MA_Return, Menu },
4609 terminx 1332
#ifdef USE_OPENGL
5408 terminx 1333
    { &M_RENDERERSETUP_POLYMOST, MENU_POLYMOST, MENU_DISPLAYSETUP, MA_Return, Menu },
4609 terminx 1334
#endif
4778 hendricks2 1335
    { &M_COLCORR, MENU_COLCORR, MENU_DISPLAYSETUP, MA_Return, Menu },
1336
    { &M_COLCORR, MENU_COLCORR_INGAME, MENU_CLOSE, MA_Return, Menu },
1337
    { &M_SCREENSETUP, MENU_SCREENSETUP, MENU_DISPLAYSETUP, MA_Return, Menu },
1338
    { &M_DISPLAYSETUP, MENU_DISPLAYSETUP, MENU_OPTIONS, MA_Return, Menu },
5408 terminx 1339
#ifdef POLYMER
5424 helixhorne 1340
    { &M_RENDERERSETUP_POLYMER, MENU_POLYMER, MENU_DISPLAYSETUP, MA_Return, Menu },
5408 terminx 1341
#endif
4778 hendricks2 1342
    { &M_LOAD, MENU_LOAD, MENU_MAIN, MA_Return, Menu },
1343
    { &M_SAVE, MENU_SAVE, MENU_MAIN, MA_Return, Menu },
1344
    { &M_STORY, MENU_STORY, MENU_MAIN, MA_Return, Panel },
1345
    { &M_F1HELP, MENU_F1HELP, MENU_MAIN, MA_Return, Panel },
1346
    { &M_QUIT, MENU_QUIT, MENU_PREVIOUS, MA_Return, Verify },
1347
    { &M_QUITTOTITLE, MENU_QUITTOTITLE, MENU_PREVIOUS, MA_Return, Verify },
1348
    { &M_QUIT, MENU_QUIT_INGAME, MENU_CLOSE, MA_None, Verify },
1349
    { &M_NETHOST, MENU_NETSETUP, MENU_MAIN, MA_Return, Menu },
1350
    { &M_NETWAITMASTER, MENU_NETWAITMASTER, MENU_MAIN, MA_Return, Message },
1351
    { &M_NETWAITVOTES, MENU_NETWAITVOTES, MENU_MAIN, MA_Return, Message },
1352
    { &M_SOUND, MENU_SOUND, MENU_OPTIONS, MA_Return, Menu },
1353
    { &M_SOUND, MENU_SOUND_INGAME, MENU_CLOSE, MA_Return, Menu },
1354
    { &M_ADVSOUND, MENU_ADVSOUND, MENU_SOUND, MA_Return, Menu },
5517 hendricks2 1355
    { &M_CHEATS, MENU_CHEATS, MENU_GAMESETUP, MA_Return, Menu },
5084 hendricks2 1356
    { &M_CHEATENTRY, MENU_CHEATENTRY, MENU_CHEATS, MA_None, TextForm },
1357
    { &M_CHEAT_WARP, MENU_CHEAT_WARP, MENU_CHEATS, MA_None, TextForm },
1358
    { &M_CHEAT_SKILL, MENU_CHEAT_SKILL, MENU_CHEATS, MA_None, TextForm },
4778 hendricks2 1359
    { &M_CREDITS, MENU_CREDITS, MENU_MAIN, MA_Return, Panel },
1360
    { &M_CREDITS2, MENU_CREDITS2, MENU_MAIN, MA_Return, Panel },
1361
    { &M_CREDITS3, MENU_CREDITS3, MENU_MAIN, MA_Return, Panel },
1362
    { &M_CREDITS4, MENU_CREDITS4, MENU_MAIN, MA_Return, Panel },
1363
    { &M_CREDITS5, MENU_CREDITS5, MENU_MAIN, MA_Return, Panel },
1364
    { &M_LOADVERIFY, MENU_LOADVERIFY, MENU_LOAD, MA_None, Verify },
1365
    { &M_NEWVERIFY, MENU_NEWVERIFY, MENU_MAIN, MA_Return, Verify },
1366
    { &M_SAVEVERIFY, MENU_SAVEVERIFY, MENU_SAVE, MA_None, Verify },
5083 hendricks2 1367
    { &M_ADULTPASSWORD, MENU_ADULTPASSWORD, MENU_GAMESETUP, MA_None, TextForm },
4778 hendricks2 1368
    { &M_RESETPLAYER, MENU_RESETPLAYER, MENU_CLOSE, MA_None, Verify },
1369
    { &M_BUYDUKE, MENU_BUYDUKE, MENU_EPISODE, MA_Return, Message },
1370
    { &M_NETWORK, MENU_NETWORK, MENU_MAIN, MA_Return, Menu },
1371
    { &M_PLAYER, MENU_PLAYER, MENU_OPTIONS, MA_Return, Menu },
1372
    { &M_MACROS, MENU_MACROS, MENU_PLAYER, MA_Return, Menu },
1373
    { &M_NETHOST, MENU_NETHOST, MENU_NETWORK, MA_Return, Menu },
1374
    { &M_NETOPTIONS, MENU_NETOPTIONS, MENU_NETWORK, MA_Return, Menu },
1375
    { &M_USERMAP, MENU_NETUSERMAP, MENU_NETOPTIONS, MA_Return, FileSelect },
1376
    { &M_NETJOIN, MENU_NETJOIN, MENU_NETWORK, MA_Return, Menu },
4496 hendricks2 1377
};
337 terminx 1378
 
4496 hendricks2 1379
static const size_t numMenus = ARRAY_SIZE(Menus);
337 terminx 1380
 
4496 hendricks2 1381
Menu_t *m_currentMenu = &Menus[0];
1382
static Menu_t *m_previousMenu = &Menus[0];
5 Plagman 1383
 
4496 hendricks2 1384
MenuID_t g_currentMenu;
1385
static MenuID_t g_previousMenu;
337 terminx 1386
 
4778 hendricks2 1387
#define MenuMenu_ChangeEntryList(m, el)\
4496 hendricks2 1388
    do {\
4778 hendricks2 1389
        m.entrylist = el;\
1390
        m.numEntries = ARRAY_SIZE(el);\
4496 hendricks2 1391
    } while (0)
5 Plagman 1392
 
4855 hendricks2 1393
static void MenuEntry_DisableOnCondition(MenuEntry_t * const entry, const int32_t condition)
1394
{
1395
    if (condition)
1396
        entry->flags |= Disabled;
1397
    else
1398
        entry->flags &= ~Disabled;
1399
}
5 Plagman 1400
 
4496 hendricks2 1401
/*
1402
This function prepares data after ART and CON have been processed.
1403
It also initializes some data in loops rather than statically at compile time.
1404
*/
1405
void M_Init(void)
1406
{
1407
    int32_t i, j, k;
5 Plagman 1408
 
4496 hendricks2 1409
    // prepare menu fonts
4778 hendricks2 1410
    MF_Redfont.tilenum = MF_RedfontBlue.tilenum = MF_RedfontGreen.tilenum = BIGALPHANUM;
4496 hendricks2 1411
    MF_Bluefont.tilenum = MF_BluefontRed.tilenum = STARTALPHANUM;
5452 hendricks2 1412
    if (NAM_WW2GI)
1413
        mgametext_xbetween = MF_Bluefont.xbetween = MF_BluefontRed.xbetween = 0;
4496 hendricks2 1414
    MF_Minifont.tilenum = MF_MinifontRed.tilenum = MF_MinifontDarkGray.tilenum = MINIFONT;
1415
    if (!minitext_lowercase)
1416
    {
1417
        MF_Minifont.textflags |= TEXT_UPPERCASE;
1418
        MF_MinifontRed.textflags |= TEXT_UPPERCASE;
1419
        MF_MinifontDarkGray.textflags |= TEXT_UPPERCASE;
1420
    }
5 Plagman 1421
 
4496 hendricks2 1422
    // prepare gamefuncs and keys
1423
    for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
1424
    {
1425
        Bstrcpy(MenuGameFuncs[i], gamefunctions[i]);
5 Plagman 1426
 
4496 hendricks2 1427
        for (j = 0; j < MAXGAMEFUNCLEN; ++j)
1428
            if (MenuGameFuncs[i][j] == '_')
1429
                MenuGameFuncs[i][j] = ' ';
5 Plagman 1430
 
4496 hendricks2 1431
        MEOSN_Gamefuncs[i] = MenuGameFuncs[i];
1432
    }
1433
    MEOSN_Gamefuncs[NUMGAMEFUNCTIONS] = MenuGameFuncNone;
1434
    for (i = 0; i < NUMKEYS; ++i)
1435
        MEOSN_Keys[i] = key_names[i];
1436
    MEOSN_Keys[NUMKEYS-1] = MenuKeyNone;
5 Plagman 1437
 
1438
 
4496 hendricks2 1439
    // prepare episodes
5033 hendricks2 1440
    k = 0;
4778 hendricks2 1441
    for (i = 0; i < g_numVolumes; ++i)
4496 hendricks2 1442
    {
1443
        if (EpisodeNames[i][0])
337 terminx 1444
        {
5033 hendricks2 1445
            if (!(EpisodeFlags[i] & EF_HIDEFROMSP))
1446
            {
1447
                MEL_EPISODE[i] = &ME_EPISODE[i];
1448
                ME_EPISODE[i] = ME_EPISODE_TEMPLATE;
1449
                ME_EPISODE[i].name = EpisodeNames[i];
1450
            }
4496 hendricks2 1451
 
5041 hendricks2 1452
            // if (!(EpisodeFlags[i] & EF_HIDEFROMMP))
5033 hendricks2 1453
            {
1454
                MEOSN_NetEpisodes[k] = EpisodeNames[i];
1455
                MEOSV_NetEpisodes[k] = i;
4496 hendricks2 1456
 
5033 hendricks2 1457
                k++;
1458
            }
337 terminx 1459
        }
5 Plagman 1460
 
4496 hendricks2 1461
        // prepare levels
5034 hendricks2 1462
        MEOS_NETOPTIONS_LEVEL[i] = MEOS_NETOPTIONS_LEVEL_TEMPLATE;
4496 hendricks2 1463
        for (j = 0; j < MAXLEVELS; ++j)
337 terminx 1464
        {
4496 hendricks2 1465
            MEOSN_NetLevels[i][j] = MapInfo[MAXLEVELS*i+j].name;
1466
            if (MapInfo[i*MAXLEVELS+j].filename != NULL)
1467
                MEOS_NETOPTIONS_LEVEL[i].numOptions = j+1;
337 terminx 1468
        }
4496 hendricks2 1469
        MEOS_NETOPTIONS_LEVEL[i].optionNames = MEOSN_NetLevels[i];
1470
    }
5033 hendricks2 1471
    M_EPISODE.numEntries = g_numVolumes+2;
4778 hendricks2 1472
    MEL_EPISODE[g_numVolumes] = &ME_Space4;
1473
    MEL_EPISODE[g_numVolumes+1] = &ME_EPISODE_USERMAP;
5033 hendricks2 1474
    MEOS_NETOPTIONS_EPISODE.numOptions = k + 1;
1475
    MEOSN_NetEpisodes[k] = MenuUserMap;
1476
    MEOSV_NetEpisodes[k] = MAXVOLUMES;
1477
    NetEpisode = MEOSV_NetEpisodes[0];
4778 hendricks2 1478
    MMF_Top_Episode.pos.y = (48-(g_numVolumes*2))<<16;
4977 hendricks2 1479
    if (g_numSkills == 0)
1480
        MEO_EPISODE.linkID = MENU_NULL;
5 Plagman 1481
 
4496 hendricks2 1482
    // prepare skills
1483
    k = -1;
1484
    for (i = 0; i < g_numSkills && SkillNames[i][0]; ++i)
1485
    {
1486
        MEL_SKILL[i] = &ME_SKILL[i];
1487
        ME_SKILL[i] = ME_SKILL_TEMPLATE;
1488
        ME_SKILL[i].name = SkillNames[i];
5 Plagman 1489
 
4496 hendricks2 1490
        MEOSN_NetSkills[i] = SkillNames[i];
5 Plagman 1491
 
4496 hendricks2 1492
        k = i;
1493
    }
1494
    ++k;
4778 hendricks2 1495
    M_SKILL.numEntries = g_numSkills; // k;
4496 hendricks2 1496
    MEOS_NETOPTIONS_MONSTERS.numOptions = g_numSkills + 1; // k+1;
1497
    MEOSN_NetSkills[g_numSkills] = MenuSkillNone;
4778 hendricks2 1498
    MMF_Top_Skill.pos.y = (58 + (4-g_numSkills)*6)<<16;
1499
    M_SKILL.currentEntry = 1;
5 Plagman 1500
 
4496 hendricks2 1501
    // prepare multiplayer gametypes
1502
    k = -1;
1503
    for (i = 0; i < MAXGAMETYPES; ++i)
1504
        if (GametypeNames[i][0])
1505
        {
1506
            MEOSN_NetGametypes[i] = GametypeNames[i];
1507
            k = i;
1508
        }
1509
    ++k;
1510
    MEOS_NETOPTIONS_GAMETYPE.numOptions = k;
5452 hendricks2 1511
    if (NAM_WW2GI)
1512
        ME_NETOPTIONS_MONSTERS.name = "Enemies";
5 Plagman 1513
 
4496 hendricks2 1514
    // prepare savegames
1515
    for (i = 0; i < MAXSAVEGAMES; ++i)
1516
    {
1517
        MEL_LOAD[i] = &ME_LOAD[i];
1518
        MEL_SAVE[i] = &ME_SAVE[i];
1519
        ME_LOAD[i] = ME_LOAD_TEMPLATE;
1520
        ME_SAVE[i] = ME_SAVE_TEMPLATE;
1521
        ME_SAVE[i].entry = &MEO_SAVE[i];
1522
        MEO_SAVE[i] = MEO_SAVE_TEMPLATE;
5 Plagman 1523
 
4496 hendricks2 1524
        ME_LOAD[i].name = ud.savegame[i];
1525
        MEO_SAVE[i].variable = ud.savegame[i];
1526
    }
5 Plagman 1527
 
4496 hendricks2 1528
    // prepare text chat macros
1529
    for (i = 0; i < MAXRIDECULE; ++i)
1530
    {
1531
        MEL_MACROS[i] = &ME_MACROS[i];
1532
        ME_MACROS[i] = ME_MACROS_TEMPLATE;
1533
        ME_MACROS[i].entry = &MEO_MACROS[i];
1534
        MEO_MACROS[i] = MEO_MACROS_TEMPLATE;
5 Plagman 1535
 
4496 hendricks2 1536
        MEO_MACROS[i].variable = ud.ridecule[i];
1537
    }
1538
 
1539
    // prepare input
1540
    for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
1541
    {
1542
        MEL_KEYBOARDSETUPFUNCS[i] = &ME_KEYBOARDSETUPFUNCS[i];
1543
        ME_KEYBOARDSETUPFUNCS[i] = ME_KEYBOARDSETUPFUNCS_TEMPLATE;
1544
        ME_KEYBOARDSETUPFUNCS[i].name = MenuGameFuncs[i];
1545
        ME_KEYBOARDSETUPFUNCS[i].entry = &MEO_KEYBOARDSETUPFUNCS[i];
1546
        MEO_KEYBOARDSETUPFUNCS[i] = MEO_KEYBOARDSETUPFUNCS_TEMPLATE;
1547
        MEO_KEYBOARDSETUPFUNCS[i].column[0] = &ud.config.KeyboardKeys[i][0];
1548
        MEO_KEYBOARDSETUPFUNCS[i].column[1] = &ud.config.KeyboardKeys[i][1];
1549
    }
1550
    for (i = 0; i < MENUMOUSEFUNCTIONS; ++i)
1551
    {
1552
        MEL_MOUSESETUPBTNS[i] = &ME_MOUSESETUPBTNS[i];
1553
        ME_MOUSESETUPBTNS[i] = ME_MOUSEJOYSETUPBTNS_TEMPLATE;
1554
        ME_MOUSESETUPBTNS[i].name = MenuMouseNames[i];
1555
        ME_MOUSESETUPBTNS[i].entry = &MEO_MOUSESETUPBTNS[i];
1556
        MEO_MOUSESETUPBTNS[i] = MEO_MOUSEJOYSETUPBTNS_TEMPLATE;
1557
        MEO_MOUSESETUPBTNS[i].data = &ud.config.MouseFunctions[MenuMouseDataIndex[i][0]][MenuMouseDataIndex[i][1]];
1558
    }
4828 hendricks2 1559
    for (i = 0; i < 2*joynumbuttons + 8*joynumhats; ++i)
4496 hendricks2 1560
    {
1561
        if (i < 2*joynumbuttons)
337 terminx 1562
        {
4496 hendricks2 1563
            if (i & 1)
1564
                Bsnprintf(MenuJoystickNames[i], MAXJOYBUTTONSTRINGLENGTH, "Double %s", getjoyname(1, i>>1));
1565
            else
1566
                Bstrncpy(MenuJoystickNames[i], getjoyname(1, i>>1), MAXJOYBUTTONSTRINGLENGTH);
337 terminx 1567
        }
1568
        else
1569
        {
4496 hendricks2 1570
            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 1571
        }
5 Plagman 1572
 
4496 hendricks2 1573
        MEL_JOYSTICKBTNS[i] = &ME_JOYSTICKBTNS[i];
1574
        ME_JOYSTICKBTNS[i] = ME_MOUSEJOYSETUPBTNS_TEMPLATE;
1575
        ME_JOYSTICKBTNS[i].name = MenuJoystickNames[i];
1576
        ME_JOYSTICKBTNS[i].entry = &MEO_JOYSTICKBTNS[i];
1577
        MEO_JOYSTICKBTNS[i] = MEO_MOUSEJOYSETUPBTNS_TEMPLATE;
1578
        MEO_JOYSTICKBTNS[i].data = &ud.config.JoystickFunctions[i>>1][i&1];
4399 hendricks2 1579
    }
4828 hendricks2 1580
    M_JOYSTICKBTNS.numEntries = 2*joynumbuttons + 8*joynumhats;
4496 hendricks2 1581
    for (i = 0; i < joynumaxes; ++i)
1582
    {
1583
        ME_JOYSTICKAXES[i] = ME_JOYSTICKAXES_TEMPLATE;
1584
        Bstrncpy(MenuJoystickAxes[i], getjoyname(0, i), MAXJOYBUTTONSTRINGLENGTH);
1585
        ME_JOYSTICKAXES[i].name = MenuJoystickAxes[i];
1586
        MEL_JOYSTICKAXES[i] = &ME_JOYSTICKAXES[i];
1587
    }
4778 hendricks2 1588
    M_JOYSTICKAXES.numEntries = joynumaxes;
5 Plagman 1589
 
4496 hendricks2 1590
    // prepare video setup
1591
    for (i = 0; i < validmodecnt; ++i)
1592
    {
1593
        int32_t *const r = &MEOS_VIDEOSETUP_RESOLUTION.numOptions;
5 Plagman 1594
 
4496 hendricks2 1595
        for (j = 0; j < *r; ++j)
337 terminx 1596
        {
4496 hendricks2 1597
            if (validmode[i].xdim == resolution[j].xdim && validmode[i].ydim == resolution[j].ydim)
335 terminx 1598
            {
4496 hendricks2 1599
                resolution[j].flags |= validmode[i].fs ? RES_FS : RES_WIN;
1600
                if (validmode[i].bpp > resolution[j].bppmax)
1601
                    resolution[j].bppmax = validmode[i].bpp;
1602
                break;
335 terminx 1603
            }
337 terminx 1604
        }
4496 hendricks2 1605
 
1606
        if (j == *r) // no match found
337 terminx 1607
        {
4496 hendricks2 1608
            resolution[j].xdim = validmode[i].xdim;
1609
            resolution[j].ydim = validmode[i].ydim;
1610
            resolution[j].bppmax = validmode[i].bpp;
1611
            resolution[j].flags = validmode[i].fs ? RES_FS : RES_WIN;
1612
            Bsnprintf(resolution[j].name, MAXRESOLUTIONSTRINGLENGTH, "%d x %d", resolution[j].xdim, resolution[j].ydim);
1613
            MEOSN_VIDEOSETUP_RESOLUTION[j] = resolution[j].name;
1614
            ++*r;
1615
        }
1616
    }
337 terminx 1617
 
5452 hendricks2 1618
    // prepare sound setup
1619
    if (WW2GI)
1620
        ME_SOUND_DUKETALK.name = "GI talk:";
1621
    else if (NAM)
1622
        ME_SOUND_DUKETALK.name = "Grunt talk:";
1623
 
4496 hendricks2 1624
    // prepare shareware
1625
    if (VOLUMEONE)
1626
    {
1627
        // blue out episodes beyond the first
4778 hendricks2 1628
        for (i = 1; i < g_numVolumes; ++i)
337 terminx 1629
        {
4496 hendricks2 1630
            if (MEL_EPISODE[i])
335 terminx 1631
            {
4496 hendricks2 1632
                ME_EPISODE[i].font = &MF_RedfontBlue;
1633
                ME_EPISODE[i].entry = &MEO_EPISODE_SHAREWARE;
5 Plagman 1634
            }
337 terminx 1635
        }
4778 hendricks2 1636
        M_EPISODE.numEntries = g_numVolumes; // remove User Map (and spacer)
4496 hendricks2 1637
        MEOS_NETOPTIONS_EPISODE.numOptions = 1;
4855 hendricks2 1638
        MenuEntry_DisableOnCondition(&ME_NETOPTIONS_EPISODE, 1);
4496 hendricks2 1639
    }
5 Plagman 1640
 
4496 hendricks2 1641
    // prepare pre-Atomic
1642
    if (!VOLUMEALL || !PLUTOPAK)
1643
    {
1644
        // prepare credits
1645
        M_CREDITS.title = M_CREDITS2.title = M_CREDITS3.title = MenuCredits;
1646
    }
1647
}
5 Plagman 1648
 
4686 hendricks2 1649
static void M_RunMenu(Menu_t *cm, vec2_t origin);
5 Plagman 1650
 
1651
 
1652
 
4496 hendricks2 1653
/*
1654
At present, no true difference is planned between M_PreMenu() and M_PreMenuDraw().
1655
They are separate for purposes of organization.
1656
*/
5 Plagman 1657
 
4496 hendricks2 1658
static void M_PreMenu(MenuID_t cm)
1659
{
1660
    int32_t i;
1661
    DukePlayer_t *ps = g_player[myconnectindex].ps;
5 Plagman 1662
 
4496 hendricks2 1663
    switch (cm)
1664
    {
1665
    case MENU_MAIN_INGAME:
4855 hendricks2 1666
        MenuEntry_DisableOnCondition(&ME_MAIN_SAVEGAME, ud.recstat == 2);
1667
        MenuEntry_DisableOnCondition(&ME_MAIN_QUITTOTITLE, g_netServer || numplayers > 1);
4496 hendricks2 1668
    case MENU_MAIN:
1669
        if ((g_netServer || ud.multimode > 1) && ud.recstat != 2)
1670
        {
1671
            ME_MAIN_NEWGAME.entry = &MEO_MAIN_NEWGAME_NETWORK;
1672
            ME_MAIN_NEWGAME_INGAME.entry = &MEO_MAIN_NEWGAME_NETWORK;
1673
        }
1674
        else
1675
        {
1676
            ME_MAIN_NEWGAME.entry = &MEO_MAIN_NEWGAME;
1677
            ME_MAIN_NEWGAME_INGAME.entry = &MEO_MAIN_NEWGAME_INGAME;
1678
        }
1679
        break;
4399 hendricks2 1680
 
4496 hendricks2 1681
    case MENU_GAMESETUP:
1682
        MEO_GAMESETUP_DEMOREC.options = (ps->gm&MODE_GAME) ? &MEOS_DemoRec : &MEOS_OffOn;
4855 hendricks2 1683
        MenuEntry_DisableOnCondition(&ME_GAMESETUP_DEMOREC, (ps->gm&MODE_GAME) && ud.m_recstat != 1);
4496 hendricks2 1684
        break;
5 Plagman 1685
 
4496 hendricks2 1686
#ifdef USE_OPENGL
4850 hendricks2 1687
    case MENU_DISPLAYSETUP:
4496 hendricks2 1688
        if (getrendermode() == REND_CLASSIC)
4778 hendricks2 1689
            MenuMenu_ChangeEntryList(M_DISPLAYSETUP, MEL_DISPLAYSETUP);
4496 hendricks2 1690
#ifdef POLYMER
1691
        else if (getrendermode() == REND_POLYMER)
4778 hendricks2 1692
            MenuMenu_ChangeEntryList(M_DISPLAYSETUP, MEL_DISPLAYSETUP_GL_POLYMER);
4496 hendricks2 1693
#endif
1694
        else
4778 hendricks2 1695
            MenuMenu_ChangeEntryList(M_DISPLAYSETUP, MEL_DISPLAYSETUP_GL);
5 Plagman 1696
 
4976 hendricks2 1697
        vpsize = ud.screen_size + 4*(ud.screen_size>=8 && ud.statusbarmode==0);
1698
 
4496 hendricks2 1699
        if (getrendermode() != REND_CLASSIC)
4869 hendricks2 1700
        {
4609 terminx 1701
            for (i = (int32_t) ARRAY_SIZE(MEOSV_DISPLAYSETUP_ANISOTROPY) - 1; i >= 0; --i)
5 Plagman 1702
            {
4609 terminx 1703
                if (MEOSV_DISPLAYSETUP_ANISOTROPY[i] <= glinfo.maxanisotropy)
4496 hendricks2 1704
                {
4609 terminx 1705
                    MEOS_DISPLAYSETUP_ANISOTROPY.numOptions = i + 1;
4496 hendricks2 1706
                    break;
1707
                }
337 terminx 1708
            }
4869 hendricks2 1709
        }
4850 hendricks2 1710
        break;
5 Plagman 1711
 
5408 terminx 1712
    case MENU_POLYMER:
1713
    case MENU_POLYMOST:
4855 hendricks2 1714
        MenuEntry_DisableOnCondition(&ME_RENDERERSETUP_TEXQUALITY, !usehightile);
1715
        MenuEntry_DisableOnCondition(&ME_RENDERERSETUP_PRECACHE, !usehightile);
5526 hendricks2 1716
# ifndef EDUKE32_GLES
4855 hendricks2 1717
        MenuEntry_DisableOnCondition(&ME_RENDERERSETUP_TEXCACHE, !(glusetexcompr && usehightile));
5526 hendricks2 1718
# endif
1719
# ifdef USE_GLEXT
4855 hendricks2 1720
        MenuEntry_DisableOnCondition(&ME_RENDERERSETUP_DETAILTEX, !usehightile);
5409 terminx 1721
        MenuEntry_DisableOnCondition(&ME_RENDERERSETUP_GLOWTEX, !usehightile);
5526 hendricks2 1722
# endif
4496 hendricks2 1723
        break;
1724
#endif
5 Plagman 1725
 
4496 hendricks2 1726
    case MENU_VIDEOSETUP:
4836 helixhorne 1727
    {
1728
        const int32_t nr = newresolution;
1729
 
4855 hendricks2 1730
        MenuEntry_DisableOnCondition(&ME_VIDEOSETUP_APPLY,
1731
             (xdim == resolution[nr].xdim && ydim == resolution[nr].ydim &&
5515 hendricks2 1732
              getrendermode() == newrendermode && fullscreen == newfullscreen
1733
#ifdef USE_OPENGL
1734
              && vsync == newvsync
1735
#endif
1736
             )
4836 helixhorne 1737
             || (newfullscreen ? !(resolution[nr].flags & RES_FS) : !(resolution[nr].flags & RES_WIN))
1738
             || (newrendermode != REND_CLASSIC && resolution[nr].bppmax <= 8));
4496 hendricks2 1739
        break;
4836 helixhorne 1740
    }
5 Plagman 1741
 
4496 hendricks2 1742
    case MENU_SOUND:
4676 terminx 1743
    case MENU_SOUND_INGAME:
4850 hendricks2 1744
    case MENU_ADVSOUND:
4986 terminx 1745
        MenuEntry_DisableOnCondition(&ME_SOUND_VOLUME_MASTER, !ud.config.SoundToggle && !ud.config.MusicToggle);
1746
        MenuEntry_DisableOnCondition(&ME_SOUND_VOLUME_EFFECTS, !ud.config.SoundToggle);
1747
        MenuEntry_DisableOnCondition(&ME_SOUND_VOLUME_MUSIC, !ud.config.MusicToggle);
1748
        MenuEntry_DisableOnCondition(&ME_SOUND_DUKETALK, !ud.config.SoundToggle);
1749
        MenuEntry_DisableOnCondition(&ME_SOUND_SAMPLINGRATE, !ud.config.SoundToggle && !ud.config.MusicToggle);
1750
        MenuEntry_DisableOnCondition(&ME_SOUND_NUMVOICES, !ud.config.SoundToggle);
1751
        MenuEntry_DisableOnCondition(&ME_SOUND_RESTART, soundrate == ud.config.MixRate &&
5272 terminx 1752
                                                        soundvoices == ud.config.NumVoices);
4496 hendricks2 1753
        break;
1754
 
1755
    case MENU_MOUSESETUP:
4855 hendricks2 1756
        MenuEntry_DisableOnCondition(&ME_MOUSESETUP_MOUSEAIMING, ud.mouseaiming);
4496 hendricks2 1757
        break;
1758
 
1759
    case MENU_NETOPTIONS:
5033 hendricks2 1760
        if (MEOSV_NetEpisodes[MEO_NETOPTIONS_EPISODE.currentOption] == MAXVOLUMES)
4496 hendricks2 1761
            MEL_NETOPTIONS[2] = &ME_NETOPTIONS_USERMAP;
1762
        else
337 terminx 1763
        {
4496 hendricks2 1764
            MEL_NETOPTIONS[2] = &ME_NETOPTIONS_LEVEL;
5033 hendricks2 1765
            MEO_NETOPTIONS_LEVEL.options = &MEOS_NETOPTIONS_LEVEL[MEOSV_NetEpisodes[MEO_NETOPTIONS_EPISODE.currentOption]];
4496 hendricks2 1766
        }
1767
        MEL_NETOPTIONS[4] = (GametypeFlags[ud.m_coop] & GAMETYPE_MARKEROPTION) ? &ME_NETOPTIONS_MARKERS : &ME_NETOPTIONS_MARKERS_DISABLED;
1768
        MEL_NETOPTIONS[5] = (GametypeFlags[ud.m_coop] & (GAMETYPE_PLAYERSFRIENDLY|GAMETYPE_TDM)) ? &ME_NETOPTIONS_FRFIRE : &ME_NETOPTIONS_MAPEXITS;
1769
        break;
2728 hendricks2 1770
 
4496 hendricks2 1771
    case MENU_OPTIONS:
4855 hendricks2 1772
        MenuEntry_DisableOnCondition(&ME_OPTIONS_PLAYERSETUP, ud.recstat == 1);
1773
        MenuEntry_DisableOnCondition(&ME_OPTIONS_JOYSTICKSETUP, CONTROL_JoyPresent == 0);
4496 hendricks2 1774
        break;
337 terminx 1775
 
4496 hendricks2 1776
    case MENU_LOAD:
1777
        for (i = 0; i < MAXSAVEGAMES; ++i)
1778
        {
4609 terminx 1779
            ME_LOAD[i].entry = (ud.savegame[i][0] /*&& !g_oldverSavegame[i]*/) ? &MEO_LOAD_VALID : &MEO_LOAD;
4496 hendricks2 1780
            ME_LOAD[i].font = g_oldverSavegame[i] ? &MF_MinifontDarkGray : &MF_MinifontRed;
337 terminx 1781
        }
4496 hendricks2 1782
        break;
5 Plagman 1783
 
4496 hendricks2 1784
    case MENU_SAVE:
1785
        for (i = 0; i < MAXSAVEGAMES; ++i)
1786
            MEO_SAVE[i].font = (g_oldverSavegame[i] && MEO_SAVE[i].editfield == NULL) ? &MF_MinifontDarkGray : &MF_MinifontRed;
337 terminx 1787
        break;
1788
 
5084 hendricks2 1789
    case MENU_CHEATS:
1790
    case MENU_CHEATENTRY:
1791
    case MENU_CHEAT_WARP:
1792
    case MENU_CHEAT_SKILL:
1793
    {
1794
        const int32_t menucheatsdisabled = numplayers != 1 || !(g_player[myconnectindex].ps->gm & MODE_GAME);
1795
 
1796
        for (i = 0; i < NUMCHEATFUNCS; i++)
1797
        {
5451 hendricks2 1798
            uint32_t cheatmask = cl_cheatmask & (1<<i);
1799
 
1800
            // KEEPINSYNC: NAM_WW2GI_CHEATS
1801
            if (NAM_WW2GI)
1802
            {
1803
                switch (i)
1804
                {
1805
                case CHEATFUNC_CASHMAN:
1806
                case CHEATFUNC_GIVEALLITEMS:
1807
                case CHEATFUNC_QUOTEBETA:
1808
                case CHEATFUNC_MONSTERS:
1809
                case CHEATFUNC_QUOTEALLEN:
1810
                case CHEATFUNC_GIVEKEYS:
1811
                    cheatmask = 0;
1812
                    break;
1813
                }
1814
            }
1815
            if (WW2GI)
1816
            {
1817
                switch (i)
1818
                {
1819
                case CHEATFUNC_HYPER:
1820
                    cheatmask = 0;
1821
                    break;
1822
                }
1823
            }
1824
 
5084 hendricks2 1825
            // only show cheats that have been typed in before
5451 hendricks2 1826
            MEL_CHEATS[i+1] = cheatmask ? &ME_CheatCodes[i] : NULL;
5084 hendricks2 1827
 
1828
            // disable outside of a single-player game
1829
            MenuEntry_DisableOnCondition(&ME_CheatCodes[i], menucheatsdisabled);
1830
        }
1831
 
5136 hendricks2 1832
        // refresh display names of quote cheats
1833
        if (!DUKEBETA)
1834
        {
1835
            ME_CheatCodes[CHEATFUNC_QUOTEBETA].name = ScriptQuotes[QUOTE_CHEAT_BETA];
5451 hendricks2 1836
            ME_CheatCodes[CHEATFUNC_QUOTETODD].name = NAM ? g_NAMMattCheatQuote : ScriptQuotes[QUOTE_CHEAT_TODD];
5136 hendricks2 1837
            ME_CheatCodes[CHEATFUNC_QUOTEALLEN].name = ScriptQuotes[QUOTE_CHEAT_ALLEN];
1838
        }
5665 terminx 1839
 
1840
        MenuEntry_DisableOnCondition(&ME_ENTERCHEAT, (cl_cheatmask == UINT32_MAX));
1841
 
5084 hendricks2 1842
        break;
1843
    }
1844
 
4496 hendricks2 1845
    default:
1846
        break;
1847
    }
1848
}
337 terminx 1849
 
4549 hendricks2 1850
 
4686 hendricks2 1851
static void M_PreMenuDrawBackground(MenuID_t cm, const vec2_t origin)
4549 hendricks2 1852
{
1853
    switch (cm)
1854
    {
1855
    case MENU_CREDITS:
1856
    case MENU_CREDITS2:
1857
    case MENU_CREDITS3:
1858
        if (!VOLUMEALL || !PLUTOPAK)
4686 hendricks2 1859
            M_DrawBackground(origin);
4549 hendricks2 1860
        else
4688 hendricks2 1861
            rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (100<<16), 65536L,0,2504+cm-MENU_CREDITS,0,0,10+64);
4549 hendricks2 1862
        break;
1863
 
1864
    case MENU_LOAD:
1865
    case MENU_SAVE:
1866
    case MENU_CREDITS4:
1867
    case MENU_CREDITS5:
4686 hendricks2 1868
        M_DrawBackground(origin);
4549 hendricks2 1869
        break;
1870
 
1871
    case MENU_STORY:
4686 hendricks2 1872
        rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (100<<16), 65536L,0,TEXTSTORY,0,0,10+64);
4549 hendricks2 1873
        break;
1874
 
1875
    case MENU_F1HELP:
4686 hendricks2 1876
        rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (100<<16), 65536L,0,F1HELP,0,0,10+64);
4549 hendricks2 1877
        break;
1878
    }
1879
}
1880
 
1881
 
4778 hendricks2 1882
static void M_PreMenuDraw(MenuID_t cm, MenuEntry_t *entry, const vec2_t origin)
4496 hendricks2 1883
{
1884
    int32_t i, j, l = 0, m;
5 Plagman 1885
 
4496 hendricks2 1886
    switch (cm)
1887
    {
1888
    case MENU_MAIN_INGAME:
1889
        l += 4;
1890
    case MENU_MAIN:
4686 hendricks2 1891
        rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + ((28+l)<<16), 65536L,0,INGAMEDUKETHREEDEE,0,0,10);
4496 hendricks2 1892
        if (PLUTOPAK)   // JBF 20030804
4686 hendricks2 1893
            rotatesprite_fs(origin.x + ((MENU_MARGIN_CENTER+100)<<16), origin.y + (36<<16), 65536L,0,PLUTOPAKSPRITE+2,(sintable[(totalclock<<4)&2047]>>11),0,2+8);
4496 hendricks2 1894
        break;
5 Plagman 1895
 
4496 hendricks2 1896
    case MENU_PLAYER:
4686 hendricks2 1897
        rotatesprite_fs(origin.x + (260<<16), origin.y + ((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 1898
        break;
1899
 
1900
    case MENU_MACROS:
4686 hendricks2 1901
        mgametextcenter(origin.x, origin.y + (144<<16), "Activate in-game with Shift-F#");
4496 hendricks2 1902
        break;
1903
 
1904
    case MENU_COLCORR:
1905
    case MENU_COLCORR_INGAME:
4686 hendricks2 1906
        // center panel
1907
        rotatesprite_fs(origin.x + (120<<16), origin.y + (32<<16), 16384, 0, 3290, 0, 0, 2|8|16);
1908
        rotatesprite_fs(origin.x + (160<<16) - (tilesiz[BOTTOMSTATUSBAR].x<<13), origin.y + (82<<16) - (tilesiz[BOTTOMSTATUSBAR].y<<14), 16384, 0, BOTTOMSTATUSBAR, 0, 0, 2|8|16);
1909
 
1910
        // left panel
1911
        rotatesprite_fs(origin.x + (40<<16), origin.y + (32<<16), 16384, 0, BONUSSCREEN, 0, 0, 2|8|16);
1912
 
1913
        // right panel
1914
        rotatesprite_fs(origin.x + (200<<16), origin.y + (32<<16), 16384, 0, LOADSCREEN, 0, 0, 2|8|16);
4496 hendricks2 1915
        break;
1916
 
1917
    case MENU_NETSETUP:
1918
    case MENU_NETHOST:
4686 hendricks2 1919
        mminitext(origin.x + (90<<16), origin.y + (90<<16), "Game Type", 2);
1920
        mminitext(origin.x + (90<<16), origin.y + ((90+8)<<16), "Episode", 2);
1921
        mminitext(origin.x + (90<<16), origin.y + ((90+8+8)<<16), "Level", 2);
5452 hendricks2 1922
        mminitext(origin.x + (90<<16), origin.y + ((90+8+8+8)<<16), ME_NETOPTIONS_MONSTERS.name, 2);
4496 hendricks2 1923
        if (ud.m_coop == 0)
4686 hendricks2 1924
            mminitext(origin.x + (90<<16), origin.y + ((90+8+8+8+8)<<16), "Markers", 2);
4496 hendricks2 1925
        else if (ud.m_coop == 1)
4686 hendricks2 1926
            mminitext(origin.x + (90<<16), origin.y + ((90+8+8+8+8)<<16), "Friendly Fire", 2);
1927
        mminitext(origin.x + (90<<16), origin.y + ((90+8+8+8+8+8)<<16), "User Map", 2);
4496 hendricks2 1928
 
4686 hendricks2 1929
        mminitext(origin.x + ((90+60)<<16), origin.y + (90<<16), GametypeNames[ud.m_coop], 0);
4496 hendricks2 1930
 
4686 hendricks2 1931
        mminitext(origin.x + ((90+60)<<16), origin.y + ((90+8)<<16), EpisodeNames[ud.m_volume_number], 0);
1932
        mminitext(origin.x + ((90+60)<<16), origin.y + ((90+8+8)<<16), MapInfo[MAXLEVELS*ud.m_volume_number+ud.m_level_number].name, 0);
4496 hendricks2 1933
        if (ud.m_monsters_off == 0 || ud.m_player_skill > 0)
4686 hendricks2 1934
            mminitext(origin.x + ((90+60)<<16), origin.y + ((90+8+8+8)<<16), SkillNames[ud.m_player_skill], 0);
1935
        else mminitext(origin.x + ((90+60)<<16), origin.y + ((90+8+8+8)<<16), "None", 0);
4496 hendricks2 1936
        if (ud.m_coop == 0)
337 terminx 1937
        {
4686 hendricks2 1938
            if (ud.m_marker) mminitext(origin.x + ((90+60)<<16), origin.y + ((90+8+8+8+8)<<16), "On", 0);
1939
            else mminitext(origin.x + ((90+60)<<16), origin.y + ((90+8+8+8+8)<<16), "Off", 0);
337 terminx 1940
        }
4496 hendricks2 1941
        else if (ud.m_coop == 1)
337 terminx 1942
        {
4686 hendricks2 1943
            if (ud.m_ffire) mminitext(origin.x + ((90+60)<<16), origin.y + ((90+8+8+8+8)<<16), "On", 0);
1944
            else mminitext(origin.x + ((90+60)<<16), origin.y + ((90+8+8+8+8)<<16), "Off", 0);
4496 hendricks2 1945
        }
1946
        break;
4467 hendricks2 1947
 
4496 hendricks2 1948
    case MENU_KEYBOARDKEYS:
4914 hendricks2 1949
        mgametextcenter(origin.x, origin.y + (156<<16), "Up/Down = Select Action\n"
1950
                                                        "Left/Right = Select List\n"
1951
                                                        "Enter = Modify   Delete = Clear");
4496 hendricks2 1952
        break;
335 terminx 1953
 
4496 hendricks2 1954
    case MENU_MOUSESETUP:
1955
        if (entry == &ME_MOUSESETUP_MOUSEAIMING)
1956
        {
4855 hendricks2 1957
            if (entry->flags & Disabled)
337 terminx 1958
            {
4914 hendricks2 1959
                mgametextcenter(origin.x, origin.y + (167<<16), "Set mouse aim type to toggle on/off\n"
1960
                                                                "in the Player Setup menu to enable");
337 terminx 1961
            }
1962
        }
4496 hendricks2 1963
        break;
5 Plagman 1964
 
4496 hendricks2 1965
    case MENU_MOUSEBTNS:
4914 hendricks2 1966
        mgametextcenter(origin.x, origin.y + (169<<16