Subversion Repositories eduke32

Rev

Rev 8778 | 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
 
8760 terminx 23
#include "menus.h"
24
 
25
#include "al_midi.h"
7186 terminx 26
#include "cheats.h"
8114 terminx 27
#include "communityapi.h"
6074 hendricks2 28
#include "compat.h"
7186 terminx 29
#include "demo.h"
5 Plagman 30
#include "duke3d.h"
8760 terminx 31
#include "in_android.h"
7186 terminx 32
#include "input.h"
911 terminx 33
#include "osdcmds.h"
1677 terminx 34
#include "savegame.h"
4387 terminx 35
#include "xxhash.h"
8760 terminx 36
#include "music.h"
8789 hendricks2 37
#include "sbar.h"
1707 terminx 38
 
4993 terminx 39
#ifndef __ANDROID__
40
droidinput_t droidinput;
41
#endif
42
 
4686 hendricks2 43
// common positions
44
#define MENU_MARGIN_REGULAR 40
45
#define MENU_MARGIN_WIDE    32
46
#define MENU_MARGIN_CENTER  160
47
#define MENU_HEIGHT_CENTER  100
48
 
921 terminx 49
#define USERMAPENTRYLENGTH 25
50
 
6665 hendricks2 51
static FORCE_INLINE void Menu_StartTextInput()
5325 helixhorne 52
{
6665 hendricks2 53
    KB_FlushKeyboardQueue();
54
    KB_ClearKeysDown();
5331 hendricks2 55
#if defined EDUKE32_TOUCH_DEVICES && defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
5634 hendricks2 56
# if defined __ANDROID__
5625 terminx 57
    AndroidShowKeyboard(1);
5634 hendricks2 58
# else
59
    SDL_StartTextInput();
60
# endif
5325 helixhorne 61
#endif
62
}
63
 
6665 hendricks2 64
static FORCE_INLINE void Menu_StopTextInput()
5325 helixhorne 65
{
5331 hendricks2 66
#if defined EDUKE32_TOUCH_DEVICES && defined SDL_MAJOR_VERSION && SDL_MAJOR_VERSION > 1
5634 hendricks2 67
# if defined __ANDROID__
5625 terminx 68
    AndroidShowKeyboard(0);
5634 hendricks2 69
# else
70
    SDL_StopTextInput();
71
# endif
5325 helixhorne 72
#endif
73
}
74
 
6463 hendricks2 75
static FORCE_INLINE void rotatesprite_ybounds(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, int8_t dashade, char dapalnum, int32_t dastat, int32_t ydim_upper, int32_t ydim_lower)
76
{
77
    rotatesprite_(sx, sy, z, a, picnum, dashade, dapalnum, dastat, 0, 0, 0, ydim_upper, xdim-1, ydim_lower);
78
}
79
 
6212 hendricks2 80
static void mgametext(int32_t x, int32_t y, char const * t)
81
{
8653 hendricks2 82
    G_ScreenText(MF_Bluefont.tilenum, x, y, MF_Bluefont.zoom, 0, 0, t, 0, MF_Bluefont.pal, 2|8|16, 0, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags, 0, 0, xdim-1, ydim-1);
6212 hendricks2 83
}
6613 hendricks2 84
 
7901 hendricks2 85
static vec2_t mgametextcenterat(int32_t x, int32_t y, char const * t, int32_t f = 0)
86
{
8653 hendricks2 87
    return G_ScreenText(MF_Bluefont.tilenum, x, y, MF_Bluefont.zoom, 0, 0, t, 0, MF_Bluefont.pal, 2|8|16, 0, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags|f|TEXT_XCENTER, 0, 0, xdim-1, ydim-1);
7901 hendricks2 88
}
6212 hendricks2 89
static vec2_t mgametextcenter(int32_t x, int32_t y, char const * t, int32_t f = 0)
90
{
7901 hendricks2 91
    return mgametextcenterat((MENU_MARGIN_CENTER<<16) + x, y, t, f);
6212 hendricks2 92
}
5452 hendricks2 93
 
4686 hendricks2 94
#define mminitext(x,y,t,p) minitext_(x, y, t, 0, p, 2|8|16|ROTATESPRITE_FULL16)
6208 hendricks2 95
#define mmenutext menutext
1037 terminx 96
 
6190 hendricks2 97
#ifndef EDUKE32_STANDALONE
4686 hendricks2 98
static void shadowminitext(int32_t x, int32_t y, const char *t, int32_t p)
99
{
100
    int32_t f = 0;
4496 hendricks2 101
 
4686 hendricks2 102
    if (!minitext_lowercase)
103
        f |= TEXT_UPPERCASE;
4496 hendricks2 104
 
8653 hendricks2 105
    G_ScreenTextShadow(1, 1, 4, MINIFONT, x, y, 65536, 0, 0, t, 0, p, 2|8|16, 0, 4<<16, 8<<16, 1<<16, 0, f, 0, 0, xdim-1, ydim-1);
4686 hendricks2 106
}
6190 hendricks2 107
#endif
4686 hendricks2 108
static void creditsminitext(int32_t x, int32_t y, const char *t, int32_t p)
5 Plagman 109
{
4686 hendricks2 110
    int32_t f = TEXT_XCENTER;
111
 
112
    if (!minitext_lowercase)
113
        f |= TEXT_UPPERCASE;
114
 
8653 hendricks2 115
    G_ScreenTextShadow(1, 1, 4, MINIFONT, x, y, 65536, 0, 0, t, 0, p, 2|8|16, 0, 4<<16, 8<<16, 1<<16, 0, f, 0, 0, xdim-1, ydim-1);
4686 hendricks2 116
}
117
 
4496 hendricks2 118
#pragma pack(push,1)
119
static savehead_t savehead;
120
#pragma pack(pop)
121
 
5923 terminx 122
static void Menu_DrawBackground(const vec2_t origin)
3101 hendricks2 123
{
4686 hendricks2 124
    rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (100<<16), 65536L,0,MENUSCREEN,16,0,10+64);
4496 hendricks2 125
}
3101 hendricks2 126
 
5923 terminx 127
static void Menu_DrawTopBar(const vec2_t origin)
4549 hendricks2 128
{
6555 hendricks2 129
    if ((G_GetLogoFlags() & LOGO_NOTITLEBAR) == 0)
130
        rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (19<<16), MF_Redfont.cursorScale, 0,MENUBAR,16,0,10);
4549 hendricks2 131
}
3101 hendricks2 132
 
5923 terminx 133
static void Menu_DrawTopBarCaption(const char *caption, const vec2_t origin)
4496 hendricks2 134
{
6613 hendricks2 135
    static char t[64];
136
    size_t const srclen = strlen(caption);
137
    size_t const dstlen = min(srclen, ARRAY_SIZE(t)-1);
138
    memcpy(t, caption, dstlen);
139
    t[dstlen] = '\0';
140
    char *p = &t[dstlen-1];
141
    if (*p == ':')
142
        *p = '\0';
7322 terminx 143
    captionmenutext(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (24<<16) + ((15>>1)<<16), t);
5 Plagman 144
}
145
 
6463 hendricks2 146
static FORCE_INLINE int32_t Menu_CursorShade(void)
147
{
8050 pogokeen 148
    return VM_OnEventWithReturn(EVENT_MENUCURSORSHADE, -1, myconnectindex, 4-(sintable[((int32_t) totalclock<<4)&2047]>>11));
6463 hendricks2 149
}
150
static void Menu_DrawCursorCommon(int32_t x, int32_t y, int32_t z, int32_t picnum, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1)
151
{
152
    rotatesprite_(x, y, z, 0, picnum, Menu_CursorShade(), 0, 2|8, 0, 0, 0, ydim_upper, xdim-1, ydim_lower);
153
}
154
static void Menu_DrawCursorLeft(int32_t x, int32_t y, int32_t z)
155
{
7808 terminx 156
    if (FURY) return;
8050 pogokeen 157
    Menu_DrawCursorCommon(x, y, z, VM_OnEventWithReturn(EVENT_MENUCURSORLEFT, -1, myconnectindex, SPINNINGNUKEICON+(((int32_t) totalclock>>3)%7)));
6463 hendricks2 158
}
159
static void Menu_DrawCursorRight(int32_t x, int32_t y, int32_t z)
160
{
7808 terminx 161
    if (FURY) return;
8050 pogokeen 162
    Menu_DrawCursorCommon(x, y, z, VM_OnEventWithReturn(EVENT_MENUCURSORRIGHT, -1, myconnectindex, SPINNINGNUKEICON+6-((6+((int32_t) totalclock>>3))%7)));
6463 hendricks2 163
}
7694 terminx 164
static void Menu_DrawCursorTextTile(int32_t x, int32_t y, int32_t h, int32_t picnum, vec2_16_t const & siz, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1)
6464 hendricks2 165
{
7322 terminx 166
    vec2_t const adjsiz = { (siz.x>>1)<<16, siz.y<<16 };
6464 hendricks2 167
    Menu_DrawCursorCommon(x + scale(adjsiz.x, h, adjsiz.y), y, divscale16(h, adjsiz.y), picnum, ydim_upper, ydim_lower);
168
}
6463 hendricks2 169
static void Menu_DrawCursorText(int32_t x, int32_t y, int32_t h, int32_t ydim_upper = 0, int32_t ydim_lower = ydim-1)
170
{
7694 terminx 171
    vec2_16_t const & siz = tilesiz[SPINNINGNUKEICON];
6464 hendricks2 172
 
7808 terminx 173
    if (FURY || siz.x == 0)
6464 hendricks2 174
    {
175
        Menu_DrawCursorTextTile(x, y, h, SMALLFNTCURSOR, tilesiz[SMALLFNTCURSOR], ydim_upper, ydim_lower);
176
        return;
177
    }
178
 
8050 pogokeen 179
    Menu_DrawCursorTextTile(x, y, h, SPINNINGNUKEICON+(((int32_t) totalclock>>3)%7), siz, ydim_upper, ydim_lower);
6463 hendricks2 180
}
181
 
7070 terminx 182
 
7114 terminx 183
static uint16_t g_oldSaveCnt;
5 Plagman 184
 
185
 
186
 
187
 
4496 hendricks2 188
/*
189
All MAKE_* macros are generally for the purpose of keeping state initialization
190
separate from actual data. Alternatively, they can serve to factor out repetitive
191
stuff and keep the important bits from getting lost to our eyes.
4506 hendricks2 192
 
7930 hendricks2 193
They serve as a stand-in for C++ default value constructors, since this was written
194
when the codebase still used C89.
4778 hendricks2 195
 
196
Note that I prefer to include a space on the inside of the macro parentheses, since
197
they effectively stand in for curly braces as struct initializers.
4496 hendricks2 198
*/
2313 helixhorne 199
 
200
 
7930 hendricks2 201
MenuGameplayStemEntry g_MenuGameplayEntries[MAXMENUGAMEPLAYENTRIES];
202
 
4496 hendricks2 203
// common font types
204
// tilenums are set after namesdyn runs
2313 helixhorne 205
 
6613 hendricks2 206
//                                      emptychar x,y       between x,y         zoom                cursorLeft          cursorCenter        cursorScale         textflags
207
//                                      tilenum             shade_deselected    shade_disabled      pal                 pal_selected        pal_deselected      pal_disabled
208
MenuFont_t MF_Redfont =               { { 5<<16, 15<<16 },  { 0, 0 },           65536,              20<<16,             110<<16,            65536,              TEXT_BIGALPHANUM | TEXT_UPPERCASE,
209
                                        -1,                 10,                 0,                  0,                  0,                  0,                  1,
210
                                        0,                  0,                  1 };
211
MenuFont_t MF_Bluefont =              { { 5<<16, 7<<16 },   { 0, 0 },           65536,              10<<16,             110<<16,            32768,              0,
212
                                        -1,                 10,                 0,                  0,                  10,                 10,                 16,
213
                                        0,                  0,                  16 };
214
MenuFont_t MF_Minifont =              { { 4<<16, 5<<16 },   { 1<<16, 1<<16 },   65536,              10<<16,             110<<16,            32768,              0,
215
                                        -1,                 10,                 0,                  0,                  2,                  2,                  0,
216
                                        0,                  0,                  16 };
2313 helixhorne 217
 
6613 hendricks2 218
 
5478 terminx 219
static MenuMenuFormat_t MMF_Top_Main =             { {  MENU_MARGIN_CENTER<<16, 55<<16, }, -(170<<16) };
220
static MenuMenuFormat_t MMF_Top_Episode =          { {  MENU_MARGIN_CENTER<<16, 48<<16, }, -(190<<16) };
7930 hendricks2 221
static MenuMenuFormat_t MMF_Top_NewGameCustom =    { {  MENU_MARGIN_CENTER<<16, 48<<16, }, -(190<<16) };
222
static MenuMenuFormat_t MMF_Top_NewGameCustomSub = { {  MENU_MARGIN_CENTER<<16, 48<<16, }, -(190<<16) };
5478 terminx 223
static MenuMenuFormat_t MMF_Top_Skill =            { {  MENU_MARGIN_CENTER<<16, 58<<16, }, -(190<<16) };
224
static MenuMenuFormat_t MMF_Top_Options =          { {  MENU_MARGIN_CENTER<<16, 38<<16, }, -(190<<16) };
225
static MenuMenuFormat_t MMF_Top_Joystick_Network = { {  MENU_MARGIN_CENTER<<16, 70<<16, }, -(190<<16) };
226
static MenuMenuFormat_t MMF_BigOptions =           { {    MENU_MARGIN_WIDE<<16, 38<<16, }, -(190<<16) };
227
static MenuMenuFormat_t MMF_SmallOptions =         { {    MENU_MARGIN_WIDE<<16, 37<<16, },    170<<16 };
228
static MenuMenuFormat_t MMF_Macros =               { {                  26<<16, 40<<16, },    160<<16 };
229
static MenuMenuFormat_t MMF_SmallOptionsNarrow  =  { { MENU_MARGIN_REGULAR<<16, 38<<16, }, -(190<<16) };
6680 hendricks2 230
static MenuMenuFormat_t MMF_KeyboardSetupFuncs =   { {                  50<<16, 34<<16, },    151<<16 };
5478 terminx 231
static MenuMenuFormat_t MMF_MouseJoySetupBtns =    { {                  76<<16, 34<<16, },    143<<16 };
232
static MenuMenuFormat_t MMF_FuncList =             { {                 100<<16, 51<<16, },    152<<16 };
233
static MenuMenuFormat_t MMF_ColorCorrect =         { { MENU_MARGIN_REGULAR<<16, 86<<16, },    190<<16 };
234
static MenuMenuFormat_t MMF_BigSliders =           { {    MENU_MARGIN_WIDE<<16, 37<<16, },    190<<16 };
6569 hendricks2 235
static MenuMenuFormat_t MMF_LoadSave =             { {                 200<<16, 49<<16, },    145<<16 };
5478 terminx 236
static MenuMenuFormat_t MMF_NetSetup =             { {                  36<<16, 38<<16, },    190<<16 };
237
static MenuMenuFormat_t MMF_FileSelectLeft =       { {                  40<<16, 45<<16, },    162<<16 };
238
static MenuMenuFormat_t MMF_FileSelectRight =      { {                 164<<16, 45<<16, },    162<<16 };
4778 hendricks2 239
 
6203 hendricks2 240
static MenuEntryFormat_t MEF_Null =             {     0,      0,          0 };
241
static MenuEntryFormat_t MEF_MainMenu =         { 4<<16,      0,          0 };
6289 hendricks2 242
static MenuEntryFormat_t MEF_OptionsMenu =      { 7<<16,      0,          0 };
8017 terminx 243
static MenuEntryFormat_t MEF_LeftMenu =         { 7<<16,      0,    120<<16 };
6203 hendricks2 244
static MenuEntryFormat_t MEF_CenterMenu =       { 7<<16,      0,          0 };
6650 hendricks2 245
static MenuEntryFormat_t MEF_BigOptions_Apply = { 4<<16, 16<<16, -(260<<16) };
6203 hendricks2 246
static MenuEntryFormat_t MEF_BigOptionsRt =     { 4<<16,      0, -(260<<16) };
7968 hendricks2 247
static MenuEntryFormat_t MEF_BigOptionsRtSections = { 3<<16,      0, -(260<<16) };
6013 terminx 248
#if defined USE_OPENGL || !defined EDUKE32_ANDROID_MENU
6680 hendricks2 249
static MenuEntryFormat_t MEF_SmallOptions =     { 1<<16,      0, -(260<<16) };
4647 hendricks2 250
#endif
6203 hendricks2 251
static MenuEntryFormat_t MEF_BigCheats =        { 3<<16,      0, -(260<<16) };
252
static MenuEntryFormat_t MEF_Cheats =           { 2<<16,      0, -(260<<16) };
253
static MenuEntryFormat_t MEF_PlayerNarrow =     { 1<<16,      0,     90<<16 };
254
static MenuEntryFormat_t MEF_Macros =           { 2<<16,     -1,    268<<16 };
255
static MenuEntryFormat_t MEF_VideoSetup =       { 4<<16,      0,    168<<16 };
6207 hendricks2 256
static MenuEntryFormat_t MEF_VideoSetup_Apply = { 4<<16, 16<<16,    168<<16 };
6680 hendricks2 257
static MenuEntryFormat_t MEF_KBFuncList =       { 3<<16,      0, -(225<<16) };
258
static MenuEntryFormat_t MEF_FuncList =         { 3<<16,      0, -(170<<16) };
6203 hendricks2 259
static MenuEntryFormat_t MEF_ColorCorrect =     { 2<<16,      0, -(240<<16) };
6680 hendricks2 260
static MenuEntryFormat_t MEF_BigSliders =       { 2<<16,      0, -(260<<16) };
6569 hendricks2 261
static MenuEntryFormat_t MEF_LoadSave =         { 2<<16,     -1,     78<<16 };
6203 hendricks2 262
static MenuEntryFormat_t MEF_NetSetup =         { 4<<16,      0,    112<<16 };
6207 hendricks2 263
static MenuEntryFormat_t MEF_NetSetup_Confirm = { 4<<16, 16<<16,    112<<16 };
2313 helixhorne 264
 
4496 hendricks2 265
// common menu option sets
4778 hendricks2 266
#define MAKE_MENUOPTIONSET(optionNames, optionValues, features) { optionNames, optionValues, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, ARRAY_SIZE(optionNames), -1, 0, features }
267
#define MAKE_MENUOPTIONSETDYN(optionNames, optionValues, numOptions, features) { optionNames, optionValues, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, numOptions, -1, 0, features }
5034 hendricks2 268
#define MAKE_MENUOPTIONSETNULL { NULL, NULL, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, 0, -1, 0, 0 }
2313 helixhorne 269
 
5547 terminx 270
static char const *MEOSN_OffOn[] = { "Off", "On", };
4778 hendricks2 271
static MenuOptionSet_t MEOS_OffOn = MAKE_MENUOPTIONSET( MEOSN_OffOn, NULL, 0x3 );
5547 terminx 272
static char const *MEOSN_OnOff[] = { "On", "Off", };
4778 hendricks2 273
static MenuOptionSet_t MEOS_OnOff = MAKE_MENUOPTIONSET( MEOSN_OnOff, NULL, 0x3 );
5547 terminx 274
static char const *MEOSN_NoYes[] = { "No", "Yes", };
4778 hendricks2 275
static MenuOptionSet_t MEOS_NoYes = MAKE_MENUOPTIONSET( MEOSN_NoYes, NULL, 0x3 );
5547 terminx 276
static char const *MEOSN_YesNo[] = { "Yes", "No", };
4778 hendricks2 277
static MenuOptionSet_t MEOS_YesNo = MAKE_MENUOPTIONSET( MEOSN_YesNo, NULL, 0x3 );
2313 helixhorne 278
 
5 Plagman 279
 
4496 hendricks2 280
static char MenuGameFuncs[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
5547 terminx 281
static char const *MenuGameFuncNone = "  -None-";
282
static char const *MEOSN_Gamefuncs[NUMGAMEFUNCTIONS+1];
6185 hendricks2 283
static int32_t MEOSV_Gamefuncs[NUMGAMEFUNCTIONS+1];
284
static MenuOptionSet_t MEOS_Gamefuncs = MAKE_MENUOPTIONSET( MEOSN_Gamefuncs, MEOSV_Gamefuncs, 0x1 );
2313 helixhorne 285
 
5 Plagman 286
 
287
 
4496 hendricks2 288
/*
4778 hendricks2 289
MenuEntry_t is passed in arrays of pointers so that the callback function
4496 hendricks2 290
that is called when an entry is modified or activated can test equality of the current
4778 hendricks2 291
entry pointer directly against the known ones, instead of relying on an ID number.
5 Plagman 292
 
4778 hendricks2 293
That way, individual menu entries can be ifdef'd out painlessly.
4496 hendricks2 294
*/
2728 hendricks2 295
 
4688 hendricks2 296
static MenuLink_t MEO_NULL = { MENU_NULL, MA_None, };
4496 hendricks2 297
static const char* MenuCustom = "Custom";
2728 hendricks2 298
 
4778 hendricks2 299
#define MAKE_MENUSTRING(...) { NULL, __VA_ARGS__, }
4496 hendricks2 300
#define MAKE_MENUOPTION(...) { __VA_ARGS__, -1, }
301
#define MAKE_MENURANGE(...) { __VA_ARGS__, }
302
#define MAKE_MENUENTRY(...) { __VA_ARGS__, 0, 0, 0, }
2728 hendricks2 303
 
4778 hendricks2 304
 
305
#define MAKE_SPACER( EntryName, Height ) \
6198 hendricks2 306
static MenuSpacer_t MEO_ ## EntryName = { Height };
4778 hendricks2 307
 
308
MAKE_SPACER( Space2, 2<<16 ); // bigoptions
309
MAKE_SPACER( Space4, 4<<16 ); // usermap, smalloptions, anything else non-top
310
MAKE_SPACER( Space6, 6<<16 ); // videosetup
311
MAKE_SPACER( Space8, 8<<16 ); // colcorr, redslide
312
 
6198 hendricks2 313
static MenuEntry_t ME_Space2_Redfont = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_Null, &MEO_Space2, Spacer );
314
static MenuEntry_t ME_Space4_Bluefont = MAKE_MENUENTRY( NULL, &MF_Bluefont, &MEF_Null, &MEO_Space4, Spacer );
8027 hendricks2 315
static MenuEntry_t ME_Space4_Redfont = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_Null, &MEO_Space4, Spacer );
8569 terminx 316
#ifndef EDUKE32_RETAIL_MENU
6198 hendricks2 317
static MenuEntry_t ME_Space8_Bluefont = MAKE_MENUENTRY( NULL, &MF_Bluefont, &MEF_Null, &MEO_Space8, Spacer );
318
#endif
6415 terminx 319
static MenuEntry_t ME_Space6_Redfont = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_Null, &MEO_Space6, Spacer );
6198 hendricks2 320
static MenuEntry_t ME_Space8_Redfont = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_Null, &MEO_Space8, Spacer );
4778 hendricks2 321
 
322
#define MAKE_MENU_TOP_ENTRYLINK( Title, Format, EntryName, LinkID ) \
4688 hendricks2 323
static MenuLink_t MEO_ ## EntryName = { LinkID, MA_Advance, };\
4778 hendricks2 324
static MenuEntry_t ME_ ## EntryName = MAKE_MENUENTRY( Title, &MF_Redfont, &Format, &MEO_ ## EntryName, Link )
2728 hendricks2 325
 
6329 hendricks2 326
static char const s_NewGame[] = "New Game";
327
static char const s_SaveGame[] = "Save Game";
328
static char const s_LoadGame[] = "Load Game";
329
static char const s_Continue[] = "Continue";
330
static char const s_Options[] = "Options";
331
static char const s_Credits[] = "Credits";
2728 hendricks2 332
 
6329 hendricks2 333
MAKE_MENU_TOP_ENTRYLINK( s_NewGame, MEF_MainMenu, MAIN_NEWGAME, MENU_EPISODE );
8569 terminx 334
#ifdef EDUKE32_RETAIL_MENU
5000 terminx 335
MAKE_MENU_TOP_ENTRYLINK( "Resume Game", MEF_MainMenu, MAIN_RESUMEGAME, MENU_CLOSE );
336
#endif
6329 hendricks2 337
MAKE_MENU_TOP_ENTRYLINK( s_NewGame, MEF_MainMenu, MAIN_NEWGAME_INGAME, MENU_NEWVERIFY );
4688 hendricks2 338
static MenuLink_t MEO_MAIN_NEWGAME_NETWORK = { MENU_NETWORK, MA_Advance, };
6329 hendricks2 339
MAKE_MENU_TOP_ENTRYLINK( s_SaveGame, MEF_MainMenu, MAIN_SAVEGAME, MENU_SAVE );
340
MAKE_MENU_TOP_ENTRYLINK( s_LoadGame, MEF_MainMenu, MAIN_LOADGAME, MENU_LOAD );
341
MAKE_MENU_TOP_ENTRYLINK( s_Options, MEF_MainMenu, MAIN_OPTIONS, MENU_OPTIONS );
6754 terminx 342
#ifdef EDUKE32_STANDALONE
343
MAKE_MENU_TOP_ENTRYLINK( "Read me!", MEF_MainMenu, MAIN_HELP, MENU_STORY );
344
#else
345
MAKE_MENU_TOP_ENTRYLINK("Help", MEF_MainMenu, MAIN_HELP, MENU_STORY);
346
#endif
8569 terminx 347
#ifndef EDUKE32_RETAIL_MENU
6329 hendricks2 348
MAKE_MENU_TOP_ENTRYLINK( s_Credits, MEF_MainMenu, MAIN_CREDITS, MENU_CREDITS );
4682 hendricks2 349
#endif
5663 terminx 350
MAKE_MENU_TOP_ENTRYLINK( "End Game", MEF_MainMenu, MAIN_QUITTOTITLE, MENU_QUITTOTITLE );
4778 hendricks2 351
MAKE_MENU_TOP_ENTRYLINK( "Quit", MEF_MainMenu, MAIN_QUIT, MENU_QUIT );
8569 terminx 352
#ifndef EDUKE32_RETAIL_MENU
4778 hendricks2 353
MAKE_MENU_TOP_ENTRYLINK( "Quit Game", MEF_MainMenu, MAIN_QUITGAME, MENU_QUIT );
5462 hendricks2 354
#endif
2728 hendricks2 355
 
4496 hendricks2 356
static MenuEntry_t *MEL_MAIN[] = {
357
    &ME_MAIN_NEWGAME,
5068 terminx 358
    &ME_MAIN_LOADGAME,
4496 hendricks2 359
    &ME_MAIN_OPTIONS,
6466 hendricks2 360
    &ME_MAIN_HELP,
8569 terminx 361
#ifndef EDUKE32_RETAIL_MENU
5663 terminx 362
    &ME_MAIN_CREDITS,
4609 terminx 363
#endif
4496 hendricks2 364
    &ME_MAIN_QUIT,
365
};
4609 terminx 366
 
4496 hendricks2 367
static MenuEntry_t *MEL_MAIN_INGAME[] = {
8569 terminx 368
#ifdef EDUKE32_RETAIL_MENU
5000 terminx 369
    &ME_MAIN_RESUMEGAME,
370
#else
4496 hendricks2 371
    &ME_MAIN_NEWGAME_INGAME,
5000 terminx 372
#endif
4496 hendricks2 373
    &ME_MAIN_SAVEGAME,
374
    &ME_MAIN_LOADGAME,
375
    &ME_MAIN_OPTIONS,
376
    &ME_MAIN_HELP,
377
    &ME_MAIN_QUITTOTITLE,
8569 terminx 378
#ifndef EDUKE32_RETAIL_MENU
4496 hendricks2 379
    &ME_MAIN_QUITGAME,
5000 terminx 380
#endif
4496 hendricks2 381
};
2728 hendricks2 382
 
4496 hendricks2 383
// Episode and Skill will be dynamically generated after CONs are parsed
4688 hendricks2 384
static MenuLink_t MEO_EPISODE = { MENU_SKILL, MA_Advance, };
385
static MenuLink_t MEO_EPISODE_SHAREWARE = { MENU_BUYDUKE, MA_Advance, };
4778 hendricks2 386
static MenuEntry_t ME_EPISODE_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_CenterMenu, &MEO_EPISODE, Link );
4496 hendricks2 387
static MenuEntry_t ME_EPISODE[MAXVOLUMES];
4688 hendricks2 388
static MenuLink_t MEO_EPISODE_USERMAP = { MENU_USERMAP, MA_Advance, };
4778 hendricks2 389
static MenuEntry_t ME_EPISODE_USERMAP = MAKE_MENUENTRY( "User Map", &MF_Redfont, &MEF_CenterMenu, &MEO_EPISODE_USERMAP, Link );
390
static MenuEntry_t *MEL_EPISODE[MAXVOLUMES+2]; // +2 for spacer and User Map
398 terminx 391
 
7930 hendricks2 392
static MenuLink_t MEO_NEWGAMECUSTOM_TEMPLATE = { MENU_NEWGAMECUSTOMSUB, MA_Advance, };
393
static MenuLink_t MEO_NEWGAMECUSTOM[MAXMENUGAMEPLAYENTRIES];
394
static MenuLink_t MEO_NEWGAMECUSTOMSUB_TEMPLATE = { MENU_SKILL, MA_Advance, };
395
static MenuLink_t MEO_NEWGAMECUSTOMSUB[MAXMENUGAMEPLAYENTRIES][MAXMENUGAMEPLAYENTRIES];
396
MenuEntry_t ME_NEWGAMECUSTOMENTRIES[MAXMENUGAMEPLAYENTRIES];
397
MenuEntry_t ME_NEWGAMECUSTOMSUBENTRIES[MAXMENUGAMEPLAYENTRIES][MAXMENUGAMEPLAYENTRIES];
398
static MenuEntry_t *MEL_NEWGAMECUSTOM[MAXMENUGAMEPLAYENTRIES];
399
static MenuEntry_t *MEL_NEWGAMECUSTOMSUB[MAXMENUGAMEPLAYENTRIES];
400
 
4778 hendricks2 401
static MenuEntry_t ME_SKILL_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_CenterMenu, &MEO_NULL, Link );
4496 hendricks2 402
static MenuEntry_t ME_SKILL[MAXSKILLS];
403
static MenuEntry_t *MEL_SKILL[MAXSKILLS];
5 Plagman 404
 
8569 terminx 405
#ifdef EDUKE32_RETAIL_MENU
6742 hendricks2 406
static MenuLink_t MEO_GAMESETUP_SAVESETUP = { MENU_SAVESETUP, MA_Advance, };
407
static MenuEntry_t ME_GAMESETUP_SAVESETUP = MAKE_MENUENTRY( "Save setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_SAVESETUP, Link );
408
#endif
409
 
8569 terminx 410
#if defined STARTUP_SETUP_WINDOW && !defined EDUKE32_RETAIL_MENU
7219 terminx 411
static MenuOption_t MEO_GAMESETUP_STARTWIN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.setup.forcesetup );
4778 hendricks2 412
static MenuEntry_t ME_GAMESETUP_STARTWIN = MAKE_MENUENTRY( "Startup window:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_STARTWIN, Option );
4682 hendricks2 413
#endif
4609 terminx 414
 
6409 terminx 415
static char const *MEOSN_GAMESETUP_AIM_AUTO[] = { "Never", "Always", "Hitscan only",
6013 terminx 416
#ifdef EDUKE32_ANDROID_MENU
4688 hendricks2 417
"Extra wide"
4609 terminx 418
#endif
419
};
420
static int32_t MEOSV_GAMESETUP_AIM_AUTO[] = { 0, 1, 2,
6013 terminx 421
#ifdef EDUKE32_ANDROID_MENU
4609 terminx 422
3,
423
#endif
424
};
425
 
4778 hendricks2 426
static MenuOptionSet_t MEOS_GAMESETUP_AIM_AUTO = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_AIM_AUTO, MEOSV_GAMESETUP_AIM_AUTO, 0x2 );
427
static MenuOption_t MEO_GAMESETUP_AIM_AUTO = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_AIM_AUTO, &ud.config.AutoAim );
428
static MenuEntry_t ME_GAMESETUP_AIM_AUTO = MAKE_MENUENTRY( "Auto aim:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_AIM_AUTO, Option );
4609 terminx 429
 
8021 terminx 430
static MenuOption_t MEO_GAMESETUP_ALWAYS_RUN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.auto_run);
431
static MenuEntry_t ME_GAMESETUP_ALWAYS_RUN = MAKE_MENUENTRY( "Always run:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_ALWAYS_RUN, Option );
432
 
8038 hendricks2 433
static char const *MEOSN_GAMESETUP_WEAPSWITCH_PICKUP[] = { "Never", "If new", /*"If favored",*/ };
4778 hendricks2 434
static MenuOptionSet_t MEOS_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_WEAPSWITCH_PICKUP, NULL, 0x2 );
435
static MenuOption_t MEO_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_WEAPSWITCH_PICKUP, NULL );
436
static MenuEntry_t ME_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUENTRY( "Equip pickups:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_WEAPSWITCH_PICKUP, Option );
4609 terminx 437
 
5547 terminx 438
static char const *MEOSN_DemoRec[] = { "Off", "Running", };
4778 hendricks2 439
static MenuOptionSet_t MEOS_DemoRec = MAKE_MENUOPTIONSET( MEOSN_DemoRec, NULL, 0x3 );
440
static MenuOption_t MEO_GAMESETUP_DEMOREC = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.m_recstat );
441
static MenuEntry_t ME_GAMESETUP_DEMOREC = MAKE_MENUENTRY( "Record demo:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_DEMOREC, Option );
4609 terminx 442
 
4496 hendricks2 443
#ifdef _WIN32
4778 hendricks2 444
static MenuOption_t MEO_GAMESETUP_UPDATES = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.CheckForUpdates );
445
static MenuEntry_t ME_GAMESETUP_UPDATES = MAKE_MENUENTRY( "Online updates:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_UPDATES, Option );
4496 hendricks2 446
#endif
2728 hendricks2 447
 
4778 hendricks2 448
static MenuOption_t MEO_ADULTMODE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.lockout);
449
static MenuEntry_t ME_ADULTMODE = MAKE_MENUENTRY( "Parental lock:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_ADULTMODE, Option );
4688 hendricks2 450
// static MenuLink_t MEO_ADULTMODE_PASSWORD = { MENU_ADULTPASSWORD, MA_None, };
4778 hendricks2 451
// static MenuEntry_t ME_ADULTMODE_PASSWORD = MAKE_MENUENTRY( "Enter Password", &MF_Redfont, &, &MEO_ADULTMODE_PASSWORD, Link );
4609 terminx 452
 
6013 terminx 453
#ifdef EDUKE32_ANDROID_MENU
4993 terminx 454
static MenuOption_t MEO_GAMESETUP_CROUCHLOCK = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &droidinput.toggleCrouch);
455
static MenuEntry_t ME_GAMESETUP_CROUCHLOCK = MAKE_MENUENTRY("Crouch lock:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_CROUCHLOCK, Option);
456
 
457
static MenuOption_t MEO_GAMESETUP_QUICKSWITCH = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &droidinput.quickSelectWeapon);
458
static MenuEntry_t ME_GAMESETUP_QUICKSWITCH = MAKE_MENUENTRY("Quick weapon switch:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_QUICKSWITCH, Option);
5025 helixhorne 459
#endif
4993 terminx 460
 
8569 terminx 461
#if defined(EDUKE32_ANDROID_MENU) || !defined(EDUKE32_RETAIL_MENU)
5517 hendricks2 462
static MenuLink_t MEO_GAMESETUP_CHEATS = { MENU_CHEATS, MA_Advance, };
463
static MenuEntry_t ME_GAMESETUP_CHEATS = MAKE_MENUENTRY( "Cheats", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_CHEATS, Link );
464
 
4778 hendricks2 465
static MenuEntry_t *MEL_GAMESETUP[] = {
4850 hendricks2 466
    &ME_ADULTMODE,
8569 terminx 467
#if defined STARTUP_SETUP_WINDOW && !defined EDUKE32_RETAIL_MENU
4496 hendricks2 468
    &ME_GAMESETUP_STARTWIN,
4609 terminx 469
#endif
8023 hendricks2 470
#ifndef EDUKE32_ANDROID_MENU
4496 hendricks2 471
    &ME_GAMESETUP_DEMOREC,
472
#ifdef _WIN32
4850 hendricks2 473
    &ME_GAMESETUP_UPDATES,
4609 terminx 474
#endif
475
#endif
5517 hendricks2 476
    &ME_GAMESETUP_CHEATS,
4496 hendricks2 477
};
6411 terminx 478
#endif
2728 hendricks2 479
 
8569 terminx 480
#ifndef EDUKE32_RETAIL_MENU
6289 hendricks2 481
MAKE_MENU_TOP_ENTRYLINK( "Game Setup", MEF_OptionsMenu, OPTIONS_GAMESETUP, MENU_GAMESETUP );
6409 terminx 482
#endif
6289 hendricks2 483
MAKE_MENU_TOP_ENTRYLINK( "Sound Setup", MEF_OptionsMenu, OPTIONS_SOUNDSETUP, MENU_SOUND );
484
MAKE_MENU_TOP_ENTRYLINK( "Display Setup", MEF_OptionsMenu, OPTIONS_DISPLAYSETUP, MENU_DISPLAYSETUP );
485
MAKE_MENU_TOP_ENTRYLINK( "Player Setup", MEF_OptionsMenu, OPTIONS_PLAYERSETUP, MENU_PLAYER );
6013 terminx 486
#ifndef EDUKE32_ANDROID_MENU
6289 hendricks2 487
MAKE_MENU_TOP_ENTRYLINK( "Control Setup", MEF_OptionsMenu, OPTIONS_CONTROLS, MENU_CONTROLS );
488
 
7968 hendricks2 489
MAKE_MENU_TOP_ENTRYLINK( "Keyboard Setup", MEF_BigOptionsRtSections, OPTIONS_KEYBOARDSETUP, MENU_KEYBOARDSETUP );
490
MAKE_MENU_TOP_ENTRYLINK( "Mouse Setup", MEF_BigOptionsRtSections, OPTIONS_MOUSESETUP, MENU_MOUSESETUP );
5462 hendricks2 491
#endif
7972 hendricks2 492
MAKE_MENU_TOP_ENTRYLINK( "Gamepad Setup", MEF_BigOptionsRtSections, OPTIONS_JOYSTICKSETUP, MENU_JOYSTICKSETUP );
6013 terminx 493
#ifdef EDUKE32_ANDROID_MENU
7968 hendricks2 494
MAKE_MENU_TOP_ENTRYLINK( "Touch Setup", MEF_BigOptionsRtSections, OPTIONS_TOUCHSETUP, MENU_TOUCHSETUP );
4993 terminx 495
#endif
8569 terminx 496
#ifdef EDUKE32_RETAIL_MENU
6411 terminx 497
MAKE_MENU_TOP_ENTRYLINK("Cheats", MEF_OptionsMenu, OPTIONS_CHEATS, MENU_CHEATS);
498
#endif
2728 hendricks2 499
 
8084 terminx 500
static int32_t newresolution, newrendermode, newfullscreen, newvsync, newborderless;
5 Plagman 501
 
4496 hendricks2 502
enum resflags_t {
503
    RES_FS  = 0x1,
504
    RES_WIN = 0x2,
505
};
5 Plagman 506
 
6697 pogokeen 507
#define MAXRESOLUTIONSTRINGLENGTH 19
5 Plagman 508
 
4496 hendricks2 509
typedef struct resolution_t {
510
    int32_t xdim, ydim;
511
    int32_t flags;
512
    int32_t bppmax;
513
    char name[MAXRESOLUTIONSTRINGLENGTH];
514
} resolution_t;
2358 helixhorne 515
 
4496 hendricks2 516
resolution_t resolution[MAXVALIDMODES];
5 Plagman 517
 
5547 terminx 518
static char const *MEOSN_VIDEOSETUP_RESOLUTION[MAXVALIDMODES];
4778 hendricks2 519
static MenuOptionSet_t MEOS_VIDEOSETUP_RESOLUTION = MAKE_MENUOPTIONSETDYN( MEOSN_VIDEOSETUP_RESOLUTION, NULL, 0, 0x0 );
520
static MenuOption_t MEO_VIDEOSETUP_RESOLUTION = MAKE_MENUOPTION( &MF_Redfont, &MEOS_VIDEOSETUP_RESOLUTION, &newresolution );
521
static MenuEntry_t ME_VIDEOSETUP_RESOLUTION = MAKE_MENUENTRY( "Resolution:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_RESOLUTION, Option );
5 Plagman 522
 
4496 hendricks2 523
#ifdef USE_OPENGL
524
#ifdef POLYMER
5547 terminx 525
static char const *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", "Polymost", "Polymer", };
4496 hendricks2 526
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, REND_POLYMOST, REND_POLYMER, };
527
#else
5547 terminx 528
static char const *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", "OpenGL", };
4496 hendricks2 529
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, REND_POLYMOST, };
530
#endif
5 Plagman 531
 
4778 hendricks2 532
static MenuOptionSet_t MEOS_VIDEOSETUP_RENDERER = MAKE_MENUOPTIONSET( MEOSN_VIDEOSETUP_RENDERER, MEOSV_VIDEOSETUP_RENDERER, 0x2 );
5 Plagman 533
 
4778 hendricks2 534
static MenuOption_t MEO_VIDEOSETUP_RENDERER = MAKE_MENUOPTION( &MF_Redfont, &MEOS_VIDEOSETUP_RENDERER, &newrendermode );
535
static MenuEntry_t ME_VIDEOSETUP_RENDERER = MAKE_MENUENTRY( "Renderer:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_RENDERER, Option );
4823 hendricks2 536
#endif
537
 
8084 terminx 538
static MenuOption_t MEO_VIDEOSETUP_FULLSCREEN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &newfullscreen );
539
static MenuEntry_t ME_VIDEOSETUP_FULLSCREEN = MAKE_MENUENTRY( "Windowed:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_FULLSCREEN, Option );
5475 terminx 540
 
8084 terminx 541
static char const *MEOSN_VIDEOSETUP_BORDERLESS [] = { "No", "Yes", "Auto", };
542
static int32_t MEOSV_VIDEOSETUP_BORDERLESS [] = { 0, 1, 2, };
543
static MenuOptionSet_t MEOS_VIDEOSETUP_BORDERLESS = MAKE_MENUOPTIONSET(MEOSN_VIDEOSETUP_BORDERLESS, MEOSV_VIDEOSETUP_BORDERLESS, 0x2);
544
static MenuOption_t MEO_VIDEOSETUP_BORDERLESS = MAKE_MENUOPTION(&MF_Redfont, &MEOS_VIDEOSETUP_BORDERLESS, &newborderless);
545
static MenuEntry_t ME_VIDEOSETUP_BORDERLESS = MAKE_MENUENTRY("Borderless:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_BORDERLESS, Option);
5475 terminx 546
 
8612 terminx 547
static char const *MEOSN_VIDEOSETUP_VSYNC[] = { "Adaptive", "Off", "On",
548
#if defined _WIN32 && SDL_MAJOR_VERSION == 2
549
                                                "KMT",
550
#endif
551
};
552
 
553
static int32_t MEOSV_VIDEOSETUP_VSYNC[] = { -1, 0, 1,
554
#if defined _WIN32 && SDL_MAJOR_VERSION == 2
555
                                             2,
556
#endif
557
};
558
 
5475 terminx 559
static MenuOptionSet_t MEOS_VIDEOSETUP_VSYNC = MAKE_MENUOPTIONSET(MEOSN_VIDEOSETUP_VSYNC, MEOSV_VIDEOSETUP_VSYNC, 0x2);
560
static MenuOption_t MEO_VIDEOSETUP_VSYNC = MAKE_MENUOPTION(&MF_Redfont, &MEOS_VIDEOSETUP_VSYNC, &newvsync);
561
static MenuEntry_t ME_VIDEOSETUP_VSYNC = MAKE_MENUENTRY("VSync:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_VSYNC, Option);
562
 
8084 terminx 563
 
564
 
8613 terminx 565
static char const *MEOSN_VIDEOSETUP_FRAMELIMIT [] = { "Auto", "None", "30 fps", "60 fps", "75 fps", "100 fps", "120 fps", "144 fps", "165 fps", "240 fps" };
566
static int32_t MEOSV_VIDEOSETUP_FRAMELIMIT [] = { -1, 0, 30, 60, 75, 100, 120, 144, 165, 240 };
7287 terminx 567
static MenuOptionSet_t MEOS_VIDEOSETUP_FRAMELIMIT = MAKE_MENUOPTIONSET(MEOSN_VIDEOSETUP_FRAMELIMIT, MEOSV_VIDEOSETUP_FRAMELIMIT, 0x0);
5922 terminx 568
static MenuOption_t MEO_VIDEOSETUP_FRAMELIMIT= MAKE_MENUOPTION(&MF_Redfont, &MEOS_VIDEOSETUP_FRAMELIMIT, &r_maxfps);
569
static MenuEntry_t ME_VIDEOSETUP_FRAMELIMIT = MAKE_MENUENTRY("Framerate limit:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_FRAMELIMIT, Option);
570
 
7287 terminx 571
static MenuRangeInt32_t MEO_VIDEOSETUP_FRAMELIMITOFFSET = MAKE_MENURANGE( &r_maxfpsoffset, &MF_Redfont, -10, 10, 0, 21, 1 );
572
static MenuEntry_t ME_VIDEOSETUP_FRAMELIMITOFFSET = MAKE_MENUENTRY( "FPS offset:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_FRAMELIMITOFFSET, RangeInt32 );
5922 terminx 573
 
4778 hendricks2 574
static MenuEntry_t ME_VIDEOSETUP_APPLY = MAKE_MENUENTRY( "Apply Changes", &MF_Redfont, &MEF_BigOptions_Apply, &MEO_NULL, Link );
4609 terminx 575
 
576
 
4823 hendricks2 577
static MenuLink_t MEO_DISPLAYSETUP_COLORCORR = { MENU_COLCORR, MA_Advance, };
4856 hendricks2 578
static MenuEntry_t ME_DISPLAYSETUP_COLORCORR = MAKE_MENUENTRY( "Color Correction", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_COLORCORR, Link );
5884 terminx 579
 
580
 
7287 terminx 581
static char const *MEOSN_DISPLAYSETUP_UPSCALING[] = { "None", "2x" };
582
static int32_t MEOSV_DISPLAYSETUP_UPSCALING[] = { 1, 2 };
6939 pogokeen 583
static MenuOptionSet_t MEOS_DISPLAYSETUP_UPSCALING = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_UPSCALING, MEOSV_DISPLAYSETUP_UPSCALING, 0x0 );
584
static MenuOption_t MEO_DISPLAYSETUP_UPSCALING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_DISPLAYSETUP_UPSCALING, &ud.detail );
585
static MenuEntry_t ME_DISPLAYSETUP_UPSCALING = MAKE_MENUENTRY( "Upscaling:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_UPSCALING, Option );
4609 terminx 586
 
587
 
6013 terminx 588
#ifndef EDUKE32_ANDROID_MENU
4609 terminx 589
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &r_usenewaspect);
4823 hendricks2 590
static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUENTRY( "Widescreen:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ASPECTRATIO, Option );
5652 terminx 591
#endif
5 Plagman 592
 
7961 hendricks2 593
static MenuOption_t MEO_DISPLAYSETUP_VOXELS = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &usevoxels);
594
static MenuEntry_t ME_DISPLAYSETUP_VOXELS = MAKE_MENUENTRY( "Voxels:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_VOXELS, Option );
595
 
7348 terminx 596
static MenuRangeInt32_t MEO_DISPLAYSETUP_FOV = MAKE_MENURANGE( &ud.fov, &MF_Redfont, 70, 120, 0, 11, 1 );
7329 terminx 597
static MenuEntry_t ME_DISPLAYSETUP_FOV = MAKE_MENUENTRY( "FOV:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_FOV, RangeInt32 );
598
 
599
 
4609 terminx 600
#ifdef USE_OPENGL
6940 pogokeen 601
# if !(defined EDUKE32_STANDALONE) || defined POLYMER
6822 pogokeen 602
//POGOTODO: allow filtering again in standalone once indexed colour textures support filtering
7420 terminx 603
#ifdef TEXFILTER_MENU_OPTIONS
5547 terminx 604
static char const *MEOSN_DISPLAYSETUP_TEXFILTER[] = { "Classic", "Filtered" };
5878 hendricks2 605
static int32_t MEOSV_DISPLAYSETUP_TEXFILTER[] = { TEXFILTER_OFF, TEXFILTER_ON };
606
static MenuOptionSet_t MEOS_DISPLAYSETUP_TEXFILTER = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_TEXFILTER, MEOSV_DISPLAYSETUP_TEXFILTER, 0x2 );
607
static MenuOption_t MEO_DISPLAYSETUP_TEXFILTER = MAKE_MENUOPTION( &MF_Redfont, &MEOS_DISPLAYSETUP_TEXFILTER, &gltexfiltermode );
4823 hendricks2 608
static MenuEntry_t ME_DISPLAYSETUP_TEXFILTER = MAKE_MENUENTRY( "Texture Mode:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_TEXFILTER, Option );
4609 terminx 609
 
6194 hendricks2 610
static char const *MEOSN_DISPLAYSETUP_ANISOTROPY[] = { "Max", "None", "2x", "4x", "8x", "16x", };
611
static int32_t MEOSV_DISPLAYSETUP_ANISOTROPY[] = { 0, 1, 2, 4, 8, 16, };
4778 hendricks2 612
static MenuOptionSet_t MEOS_DISPLAYSETUP_ANISOTROPY = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_ANISOTROPY, MEOSV_DISPLAYSETUP_ANISOTROPY, 0x0 );
4609 terminx 613
static MenuOption_t MEO_DISPLAYSETUP_ANISOTROPY = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_ANISOTROPY, &glanisotropy);
4823 hendricks2 614
static MenuEntry_t ME_DISPLAYSETUP_ANISOTROPY = MAKE_MENUENTRY( "Anisotropy:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ANISOTROPY, Option );
7420 terminx 615
#endif
6940 pogokeen 616
# endif
4609 terminx 617
 
6940 pogokeen 618
# ifdef EDUKE32_ANDROID_MENU
4993 terminx 619
static MenuOption_t MEO_DISPLAYSETUP_HIDEDPAD = MAKE_MENUOPTION(&MF_Redfont, &MEOS_NoYes, &droidinput.hideStick);
6194 hendricks2 620
static MenuEntry_t ME_DISPLAYSETUP_HIDEDPAD = MAKE_MENUENTRY("Hide touch D-pad:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_HIDEDPAD, Option);
4993 terminx 621
 
622
static MenuRangeFloat_t MEO_DISPLAYSETUP_TOUCHALPHA = MAKE_MENURANGE(&droidinput.gameControlsAlpha, &MF_Redfont, 0, 1, 0, 16, 2);
623
static MenuEntry_t ME_DISPLAYSETUP_TOUCHALPHA = MAKE_MENUENTRY("UI opacity:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_TOUCHALPHA, RangeFloat);
6940 pogokeen 624
# endif
4609 terminx 625
 
4993 terminx 626
#endif
627
 
6522 hendricks2 628
static char const s_Scale[] = "Scale:";
629
 
4609 terminx 630
static MenuOption_t MEO_SCREENSETUP_CROSSHAIR = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.crosshair);
6289 hendricks2 631
static MenuEntry_t ME_SCREENSETUP_CROSSHAIR = MAKE_MENUENTRY( "Crosshair:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SCREENSETUP_CROSSHAIR, Option );
4778 hendricks2 632
static MenuRangeInt32_t MEO_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENURANGE( &ud.crosshairscale, &MF_Redfont, 25, 100, 0, 16, 2 );
6522 hendricks2 633
static MenuEntry_t ME_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENUENTRY( s_Scale, &MF_Redfont, &MEF_BigOptions_Apply, &MEO_SCREENSETUP_CROSSHAIRSIZE, RangeInt32 );
4609 terminx 634
 
635
static int32_t vpsize;
6587 hendricks2 636
static MenuRangeInt32_t MEO_SCREENSETUP_SCREENSIZE = MAKE_MENURANGE( &vpsize, &MF_Redfont, 0, 0, 0, 1, EnforceIntervals );
7984 hendricks2 637
static MenuOption_t MEO_SCREENSETUP_SCREENSIZE_TWO = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &vpsize );
6650 hendricks2 638
static MenuEntry_t ME_SCREENSETUP_SCREENSIZE = MAKE_MENUENTRY( "Status bar:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SCREENSETUP_SCREENSIZE, RangeInt32 );
5054 hendricks2 639
static MenuRangeInt32_t MEO_SCREENSETUP_TEXTSIZE = MAKE_MENURANGE( &ud.textscale, &MF_Redfont, 100, 400, 0, 16, 2 );
6522 hendricks2 640
static MenuEntry_t ME_SCREENSETUP_TEXTSIZE = MAKE_MENUENTRY( s_Scale, &MF_Redfont, &MEF_BigOptions_Apply, &MEO_SCREENSETUP_TEXTSIZE, RangeInt32 );
4609 terminx 641
static MenuOption_t MEO_SCREENSETUP_LEVELSTATS = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.levelstats);
6289 hendricks2 642
static MenuEntry_t ME_SCREENSETUP_LEVELSTATS = MAKE_MENUENTRY( "Level stats:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SCREENSETUP_LEVELSTATS, Option );
4609 terminx 643
 
644
 
645
static MenuOption_t MEO_SCREENSETUP_SHOWPICKUPMESSAGES = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.fta_on);
6289 hendricks2 646
static MenuEntry_t ME_SCREENSETUP_SHOWPICKUPMESSAGES = MAKE_MENUENTRY( "Game messages:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SCREENSETUP_SHOWPICKUPMESSAGES, Option );
4609 terminx 647
 
648
 
649
 
6588 hendricks2 650
#ifdef EDUKE32_ANDROID_MENU
651
static char const *MEOSN_SCREENSETUP_STATUSBARONTOP[] = { "Bottom", "Top" };
6680 hendricks2 652
static int32_t MEOSV_SCREENSETUP_STATUSBARONTOP[] = { 0, 1 };
6588 hendricks2 653
static MenuOptionSet_t MEOS_SCREENSETUP_STATUSBARONTOP = MAKE_MENUOPTIONSET( MEOSN_SCREENSETUP_STATUSBARONTOP, MEOSV_SCREENSETUP_STATUSBARONTOP, 0x2 );
654
static MenuOption_t MEO_SCREENSETUP_STATUSBARONTOP = MAKE_MENUOPTION(&MF_Redfont, &MEOS_SCREENSETUP_STATUSBARONTOP, &ud.hudontop);
655
static MenuEntry_t ME_SCREENSETUP_STATUSBARONTOP = MAKE_MENUENTRY( "Status bar:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SCREENSETUP_STATUSBARONTOP, Option );
656
#endif
657
 
8071 terminx 658
static MenuRangeInt32_t MEO_SCREENSETUP_SBARSIZE = MAKE_MENURANGE( &ud.statusbarscale, &MF_Redfont, 50, 100, 0, 10, 2 );
6522 hendricks2 659
static MenuEntry_t ME_SCREENSETUP_SBARSIZE = MAKE_MENUENTRY( s_Scale, &MF_Redfont, &MEF_BigOptions_Apply, &MEO_SCREENSETUP_SBARSIZE, RangeInt32 );
4609 terminx 660
 
661
 
4688 hendricks2 662
static MenuLink_t MEO_DISPLAYSETUP_SCREENSETUP = { MENU_SCREENSETUP, MA_Advance, };
6289 hendricks2 663
static MenuEntry_t ME_DISPLAYSETUP_SCREENSETUP = MAKE_MENUENTRY( "HUD setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_SCREENSETUP, Link );
4609 terminx 664
 
665
 
8569 terminx 666
#ifndef EDUKE32_RETAIL_MENU
4823 hendricks2 667
#ifdef USE_OPENGL
5408 terminx 668
static MenuLink_t MEO_DISPLAYSETUP_ADVANCED_GL_POLYMOST = { MENU_POLYMOST, MA_Advance, };
669
static MenuEntry_t ME_DISPLAYSETUP_ADVANCED_GL_POLYMOST = MAKE_MENUENTRY( "Polymost setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ADVANCED_GL_POLYMOST, Link );
670
 
671
#ifdef POLYMER
6061 hendricks2 672
static MenuLink_t MEO_DISPLAYSETUP_ADVANCED_GL_POLYMER = { MENU_POLYMER, MA_Advance, };
5408 terminx 673
static MenuEntry_t ME_DISPLAYSETUP_ADVANCED_GL_POLYMER = MAKE_MENUENTRY("Polymer setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ADVANCED_GL_POLYMER, Link);
4823 hendricks2 674
#endif
5408 terminx 675
#endif
6013 terminx 676
#endif
4609 terminx 677
 
6013 terminx 678
#ifndef EDUKE32_ANDROID_MENU
4688 hendricks2 679
static MenuLink_t MEO_DISPLAYSETUP_VIDEOSETUP = { MENU_VIDEOSETUP, MA_Advance, };
4856 hendricks2 680
static MenuEntry_t ME_DISPLAYSETUP_VIDEOSETUP = MAKE_MENUENTRY( "Video mode", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_VIDEOSETUP, Link );
4682 hendricks2 681
#endif
4609 terminx 682
 
5084 hendricks2 683
 
684
static MenuLink_t MEO_ENTERCHEAT = { MENU_CHEATENTRY, MA_None, };
685
static MenuEntry_t ME_ENTERCHEAT = MAKE_MENUENTRY( "Enter Cheat Code", &MF_Redfont, &MEF_BigCheats, &MEO_ENTERCHEAT, Link );
686
 
687
static MenuLink_t MEO_CHEAT_WARP = { MENU_CHEAT_WARP, MA_None, };
688
static MenuLink_t MEO_CHEAT_SKILL = { MENU_CHEAT_SKILL, MA_None, };
7895 hendricks2 689
// KEEPINSYNC cheats.h: enum CheatCodeFunctions
690
// KEEPINSYNC cheats.cpp: uint8_t CheatFunctionIDs[]
5084 hendricks2 691
#define MAKE_MENUCHEAT( Name ) MAKE_MENUENTRY( Name, &MF_Bluefont, &MEF_Cheats, &MEO_NULL, Link )
692
static MenuEntry_t ME_CheatCodes[] = {
7895 hendricks2 693
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_CASHMAN] ),
694
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_CORNHOLIO] ),
695
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_STUFF] ),
696
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_WEAPONS] ),
697
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_ITEMS] ),
698
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_INVENTORY] ),
699
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_KEYS] ),
700
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_HYPER] ),
701
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_VIEW] ),
702
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_SHOWMAP] ),
703
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_UNLOCK] ),
704
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_CLIP] ),
705
    MAKE_MENUENTRY( CheatDescriptions[CHEAT_SCOTTY], &MF_Bluefont, &MEF_Cheats, &MEO_CHEAT_WARP, Link ),
706
    MAKE_MENUENTRY( CheatDescriptions[CHEAT_SKILL], &MF_Bluefont, &MEF_Cheats, &MEO_CHEAT_SKILL, Link ),
707
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_MONSTERS] ),
708
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_RATE] ),
709
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_BETA] ),
710
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_TODD] ),
711
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_ALLEN] ),
712
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_COORDS] ),
713
    MAKE_MENUCHEAT( CheatDescriptions[CHEAT_DEBUG] ),
5084 hendricks2 714
};
715
 
4496 hendricks2 716
static MenuEntry_t *MEL_OPTIONS[] = {
8569 terminx 717
#ifndef EDUKE32_RETAIL_MENU
4496 hendricks2 718
    &ME_OPTIONS_GAMESETUP,
6409 terminx 719
#endif
6411 terminx 720
    &ME_OPTIONS_DISPLAYSETUP,
4496 hendricks2 721
    &ME_OPTIONS_SOUNDSETUP,
6013 terminx 722
#ifndef EDUKE32_ANDROID_MENU
8569 terminx 723
#ifndef EDUKE32_RETAIL_MENU
4496 hendricks2 724
    &ME_OPTIONS_PLAYERSETUP,
6013 terminx 725
#endif
4993 terminx 726
    &ME_OPTIONS_CONTROLS,
727
#else
5084 hendricks2 728
    &ME_OPTIONS_TOUCHSETUP,
4609 terminx 729
#endif
8569 terminx 730
#ifdef EDUKE32_RETAIL_MENU
6742 hendricks2 731
    &ME_GAMESETUP_SAVESETUP,
6411 terminx 732
    &ME_OPTIONS_CHEATS
6409 terminx 733
#endif
4496 hendricks2 734
};
5 Plagman 735
 
4609 terminx 736
static MenuEntry_t *MEL_CONTROLS[] = {
6013 terminx 737
#ifndef EDUKE32_ANDROID_MENU
4850 hendricks2 738
    &ME_OPTIONS_KEYBOARDSETUP,
739
    &ME_OPTIONS_MOUSESETUP,
740
    &ME_OPTIONS_JOYSTICKSETUP,
4993 terminx 741
#else
7968 hendricks2 742
    &ME_OPTIONS_TOUCHSETUP,
4993 terminx 743
#endif
7968 hendricks2 744
    &ME_Space6_Redfont,
7959 hendricks2 745
    &ME_GAMESETUP_AIM_AUTO,
8021 terminx 746
    &ME_GAMESETUP_ALWAYS_RUN,
8023 hendricks2 747
    &ME_GAMESETUP_WEAPSWITCH_PICKUP,
748
#ifdef EDUKE32_ANDROID_MENU
749
    &ME_GAMESETUP_QUICKSWITCH,
750
    &ME_GAMESETUP_CROUCHLOCK,
751
#endif
4609 terminx 752
};
753
 
5084 hendricks2 754
static MenuEntry_t *MEL_CHEATS[ARRAY_SIZE(ME_CheatCodes)+1] = {
755
    &ME_ENTERCHEAT,
756
};
4609 terminx 757
 
4778 hendricks2 758
static MenuEntry_t *MEL_VIDEOSETUP[] = {
4496 hendricks2 759
    &ME_VIDEOSETUP_RESOLUTION,
4823 hendricks2 760
#ifdef USE_OPENGL
4496 hendricks2 761
    &ME_VIDEOSETUP_RENDERER,
4823 hendricks2 762
#endif
4496 hendricks2 763
    &ME_VIDEOSETUP_FULLSCREEN,
8084 terminx 764
    &ME_VIDEOSETUP_BORDERLESS,
5475 terminx 765
    &ME_VIDEOSETUP_VSYNC,
5922 terminx 766
    &ME_VIDEOSETUP_FRAMELIMIT,
7287 terminx 767
    &ME_VIDEOSETUP_FRAMELIMITOFFSET,
8027 hendricks2 768
    &ME_Space4_Redfont,
4496 hendricks2 769
    &ME_VIDEOSETUP_APPLY,
770
};
4609 terminx 771
static MenuEntry_t *MEL_DISPLAYSETUP[] = {
772
    &ME_DISPLAYSETUP_SCREENSETUP,
773
    &ME_DISPLAYSETUP_COLORCORR,
6013 terminx 774
#ifndef EDUKE32_ANDROID_MENU
4850 hendricks2 775
    &ME_DISPLAYSETUP_VIDEOSETUP,
5652 terminx 776
    &ME_DISPLAYSETUP_ASPECTRATIO,
7961 hendricks2 777
    &ME_DISPLAYSETUP_VOXELS,
7329 terminx 778
    &ME_DISPLAYSETUP_FOV,
4609 terminx 779
#endif
6939 pogokeen 780
    &ME_DISPLAYSETUP_UPSCALING,
4496 hendricks2 781
};
4609 terminx 782
 
4496 hendricks2 783
#ifdef USE_OPENGL
4609 terminx 784
static MenuEntry_t *MEL_DISPLAYSETUP_GL[] = {
4850 hendricks2 785
    &ME_DISPLAYSETUP_SCREENSETUP,
4609 terminx 786
    &ME_DISPLAYSETUP_COLORCORR,
6013 terminx 787
#ifndef EDUKE32_ANDROID_MENU
4850 hendricks2 788
    &ME_DISPLAYSETUP_VIDEOSETUP,
5652 terminx 789
    &ME_DISPLAYSETUP_ASPECTRATIO,
7961 hendricks2 790
    &ME_DISPLAYSETUP_VOXELS,
7329 terminx 791
    &ME_DISPLAYSETUP_FOV,
4609 terminx 792
#endif
6940 pogokeen 793
#ifndef EDUKE32_STANDALONE
7420 terminx 794
# ifdef TEXFILTER_MENU_OPTIONS
4850 hendricks2 795
    &ME_DISPLAYSETUP_TEXFILTER,
7420 terminx 796
# endif
6940 pogokeen 797
#endif
6013 terminx 798
#ifdef EDUKE32_ANDROID_MENU
4993 terminx 799
    &ME_DISPLAYSETUP_HIDEDPAD,
800
    &ME_DISPLAYSETUP_TOUCHALPHA,
6013 terminx 801
#else
6940 pogokeen 802
# ifndef EDUKE32_STANDALONE
7420 terminx 803
#  ifdef TEXFILTER_MENU_OPTIONS
6013 terminx 804
    &ME_DISPLAYSETUP_ANISOTROPY,
7420 terminx 805
#  endif
6940 pogokeen 806
# endif
8569 terminx 807
# ifndef EDUKE32_RETAIL_MENU
5408 terminx 808
    &ME_DISPLAYSETUP_ADVANCED_GL_POLYMOST,
6940 pogokeen 809
# endif
4609 terminx 810
#endif
4496 hendricks2 811
};
4609 terminx 812
 
813
#ifdef POLYMER
814
static MenuEntry_t *MEL_DISPLAYSETUP_GL_POLYMER[] = {
4850 hendricks2 815
    &ME_DISPLAYSETUP_SCREENSETUP,
816
    &ME_DISPLAYSETUP_COLORCORR,
6013 terminx 817
#ifndef EDUKE32_ANDROID_MENU
4850 hendricks2 818
    &ME_DISPLAYSETUP_VIDEOSETUP,
7329 terminx 819
    &ME_DISPLAYSETUP_FOV,
7961 hendricks2 820
    &ME_DISPLAYSETUP_VOXELS,
4496 hendricks2 821
#endif
7420 terminx 822
#ifdef TEXFILTER_MENU_OPTIONS
4850 hendricks2 823
    &ME_DISPLAYSETUP_TEXFILTER,
824
    &ME_DISPLAYSETUP_ANISOTROPY,
7420 terminx 825
#endif
8569 terminx 826
#ifndef EDUKE32_RETAIL_MENU
5408 terminx 827
    &ME_DISPLAYSETUP_ADVANCED_GL_POLYMER,
4609 terminx 828
#endif
829
};
5 Plagman 830
 
4609 terminx 831
#endif
832
#endif
833
 
834
 
835
 
8303 hendricks2 836
static char const MenuKeyNone[] = "  -";
5547 terminx 837
static char const *MEOSN_Keys[NUMKEYS];
5 Plagman 838
 
6613 hendricks2 839
static MenuCustom2Col_t MEO_KEYBOARDSETUPFUNCS_TEMPLATE = { { NULL, NULL, }, MEOSN_Keys, &MF_Minifont, NUMKEYS, 54<<16, 0 };
4496 hendricks2 840
static MenuCustom2Col_t MEO_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
6680 hendricks2 841
static MenuEntry_t ME_KEYBOARDSETUPFUNCS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_KBFuncList, &MEO_KEYBOARDSETUPFUNCS_TEMPLATE, Custom2Col );
4496 hendricks2 842
static MenuEntry_t ME_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
843
static MenuEntry_t *MEL_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
5 Plagman 844
 
4823 hendricks2 845
static MenuLink_t MEO_KEYBOARDSETUP_KEYS = { MENU_KEYBOARDKEYS, MA_Advance, };
4778 hendricks2 846
static MenuEntry_t ME_KEYBOARDSETUP_KEYS = MAKE_MENUENTRY( "Configure Keys", &MF_Redfont, &MEF_CenterMenu, &MEO_KEYBOARDSETUP_KEYS, Link );
7971 hendricks2 847
static MenuLink_t MEO_KEYBOARDSETUP_RESET = { MENU_KEYSRESETVERIFY, MA_None, };
848
static MenuEntry_t ME_KEYBOARDSETUP_RESET = MAKE_MENUENTRY( "Reset To Defaults", &MF_Redfont, &MEF_CenterMenu, &MEO_KEYBOARDSETUP_RESET, Link );
849
static MenuLink_t MEO_KEYBOARDSETUP_RESETCLASSIC = { MENU_KEYSCLASSICVERIFY, MA_None, };
850
static MenuEntry_t ME_KEYBOARDSETUP_RESETCLASSIC = MAKE_MENUENTRY( "Reset To Classic", &MF_Redfont, &MEF_CenterMenu, &MEO_KEYBOARDSETUP_RESETCLASSIC, Link );
5 Plagman 851
 
4496 hendricks2 852
static MenuEntry_t *MEL_KEYBOARDSETUP[] = {
853
    &ME_KEYBOARDSETUP_KEYS,
854
    &ME_KEYBOARDSETUP_RESET,
855
    &ME_KEYBOARDSETUP_RESETCLASSIC,
856
};
5 Plagman 857
 
858
 
4496 hendricks2 859
// There is no better way to do this than manually.
4399 hendricks2 860
 
4496 hendricks2 861
#define MENUMOUSEFUNCTIONS 12
78 terminx 862
 
5547 terminx 863
static char const *MenuMouseNames[MENUMOUSEFUNCTIONS] = {
4496 hendricks2 864
    "Button 1",
865
    "Double Button 1",
866
    "Button 2",
867
    "Double Button 2",
868
    "Button 3",
869
    "Double Button 3",
5 Plagman 870
 
4496 hendricks2 871
    "Wheel Up",
872
    "Wheel Down",
5 Plagman 873
 
4496 hendricks2 874
    "Button 4",
875
    "Double Button 4",
876
    "Button 5",
877
    "Double Button 5",
878
};
879
static int32_t MenuMouseDataIndex[MENUMOUSEFUNCTIONS][2] = {
880
    { 0, 0, },
881
    { 0, 1, },
882
    { 1, 0, },
883
    { 1, 1, },
884
    { 2, 0, },
885
    { 2, 1, },
1677 terminx 886
 
4496 hendricks2 887
    // note the mouse wheel
888
    { 4, 0, },
889
    { 5, 0, },
5 Plagman 890
 
4496 hendricks2 891
    { 3, 0, },
892
    { 3, 1, },
893
    { 6, 0, },
894
    { 6, 1, },
895
};
3084 terminx 896
 
4496 hendricks2 897
static MenuOption_t MEO_MOUSEJOYSETUPBTNS_TEMPLATE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
898
static MenuOption_t MEO_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
4778 hendricks2 899
static MenuEntry_t ME_MOUSEJOYSETUPBTNS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_FuncList, NULL, Option );
4496 hendricks2 900
static MenuEntry_t ME_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
901
static MenuEntry_t *MEL_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
3084 terminx 902
 
4823 hendricks2 903
static MenuLink_t MEO_MOUSESETUP_BTNS = { MENU_MOUSEBTNS, MA_Advance, };
4778 hendricks2 904
static MenuEntry_t ME_MOUSESETUP_BTNS = MAKE_MENUENTRY( "Button assignment", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_BTNS, Link );
8538 terminx 905
static MenuRangeFloat_t MEO_MOUSESETUP_SENSITIVITY = MAKE_MENURANGE( &CONTROL_MouseSensitivity, &MF_Redfont, .1f, 10.f, 0.f, 100, 1 );
4778 hendricks2 906
static MenuEntry_t ME_MOUSESETUP_SENSITIVITY = MAKE_MENUENTRY( "Sensitivity:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SENSITIVITY, RangeFloat );
6022 terminx 907
 
8569 terminx 908
#ifndef EDUKE32_RETAIL_MENU
6061 hendricks2 909
static char const *MEOSN_MOUSESETUP_AIM_TYPE [] = { "Toggle", "Hold" };
6022 terminx 910
static MenuOptionSet_t MEOS_MOUSESETUP_AIM_TYPE = MAKE_MENUOPTIONSET(MEOSN_MOUSESETUP_AIM_TYPE, NULL, 0x2);
911
static MenuOption_t MEO_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_MOUSESETUP_AIM_TYPE, &ud.mouseaiming);
912
static MenuEntry_t ME_MOUSESETUP_MOUSEAIMINGTYPE = MAKE_MENUENTRY("Aiming type:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMINGTYPE, Option);
4778 hendricks2 913
static MenuOption_t MEO_MOUSESETUP_MOUSEAIMING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &g_myAimMode );
914
static MenuEntry_t ME_MOUSESETUP_MOUSEAIMING = MAKE_MENUENTRY( "Vertical aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMING, Option );
6409 terminx 915
#endif
4778 hendricks2 916
static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &ud.mouseflip );
917
static MenuEntry_t ME_MOUSESETUP_INVERT = MAKE_MENUENTRY( "Invert aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_INVERT, Option );
8536 terminx 918
 
8776 terminx 919
static MenuRangeInt32_t MEO_MOUSESETUP_SCALEX = MAKE_MENURANGE(&CONTROL_MouseAxesScale[0], &MF_Redfont, 512, 65536, 65536, 128, 3 | EnforceIntervals);
920
static MenuEntry_t ME_MOUSESETUP_SCALEX = MAKE_MENUENTRY("X-Scale:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SCALEX, RangeInt32);
921
static MenuRangeInt32_t MEO_MOUSESETUP_SCALEY = MAKE_MENURANGE(&CONTROL_MouseAxesScale[1], &MF_Redfont, 512, 65536, 65536, 128, 3 | EnforceIntervals);
922
static MenuEntry_t ME_MOUSESETUP_SCALEY = MAKE_MENUENTRY("Y-Scale:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SCALEY, RangeInt32);
3084 terminx 923
 
4778 hendricks2 924
static MenuEntry_t *MEL_MOUSESETUP[] = {
6409 terminx 925
    &ME_MOUSESETUP_BTNS,
4496 hendricks2 926
    &ME_MOUSESETUP_SENSITIVITY,
8776 terminx 927
    &ME_MOUSESETUP_SCALEX,
928
    &ME_MOUSESETUP_SCALEY,
6198 hendricks2 929
    &ME_Space2_Redfont,
6409 terminx 930
    &ME_MOUSESETUP_INVERT,
8569 terminx 931
#ifndef EDUKE32_RETAIL_MENU
6022 terminx 932
    &ME_MOUSESETUP_MOUSEAIMINGTYPE,
4850 hendricks2 933
    &ME_MOUSESETUP_MOUSEAIMING,
6409 terminx 934
#endif
4609 terminx 935
};
936
 
6013 terminx 937
#ifdef EDUKE32_ANDROID_MENU
5023 terminx 938
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 939
static MenuEntry_t ME_TOUCHSETUP_SENSITIVITY_MOVE = MAKE_MENUENTRY("Running:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_TOUCHSETUP_SENSITIVITY_MOVE, RangeFloat);
4993 terminx 940
 
5023 terminx 941
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 942
static MenuEntry_t ME_TOUCHSETUP_SENSITIVITY_STRAFE = MAKE_MENUENTRY("Strafing:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_TOUCHSETUP_SENSITIVITY_STRAFE, RangeFloat);
4993 terminx 943
 
5023 terminx 944
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 945
static MenuEntry_t ME_TOUCHSETUP_SENSITIVITY_LOOK = MAKE_MENUENTRY("Looking:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_TOUCHSETUP_SENSITIVITY_LOOK, RangeFloat);
4993 terminx 946
 
5023 terminx 947
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 948
static MenuEntry_t ME_TOUCHSETUP_SENSITIVITY_TURN = MAKE_MENUENTRY("Turning:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_TOUCHSETUP_SENSITIVITY_TURN, RangeFloat);
4993 terminx 949
 
950
static MenuOption_t MEO_TOUCHSETUP_INVERT = MAKE_MENUOPTION(&MF_Redfont, &MEOS_NoYes, &droidinput.invertLook);
951
static MenuEntry_t ME_TOUCHSETUP_INVERT = MAKE_MENUENTRY("Invert look:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_TOUCHSETUP_INVERT, Option);
952
 
5652 terminx 953
MAKE_MENU_TOP_ENTRYLINK("Sensitivity", MEF_CenterMenu, TOUCHSENS, MENU_TOUCHSENS);
954
MAKE_MENU_TOP_ENTRYLINK("Button Setup", MEF_CenterMenu, TOUCHBUTTONS, MENU_TOUCHBUTTONS);
955
 
6061 hendricks2 956
static MenuEntry_t *MEL_TOUCHSETUP [] = {
5652 terminx 957
    &ME_TOUCHSENS,
958
    &ME_TOUCHBUTTONS,
959
};
960
 
6061 hendricks2 961
static MenuEntry_t *MEL_TOUCHSENS [] = {
4993 terminx 962
    &ME_TOUCHSETUP_SENSITIVITY_MOVE,
963
    &ME_TOUCHSETUP_SENSITIVITY_STRAFE,
964
    &ME_TOUCHSETUP_SENSITIVITY_LOOK,
965
    &ME_TOUCHSETUP_SENSITIVITY_TURN,
6198 hendricks2 966
    &ME_Space2_Redfont,
4993 terminx 967
    &ME_TOUCHSETUP_INVERT,
968
};
969
#endif
970
 
7982 hendricks2 971
static MenuOption_t MEO_JOYSTICK_ENABLE = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.setup.usejoystick );
972
static MenuEntry_t ME_JOYSTICK_ENABLE = MAKE_MENUENTRY( "Enable Gamepad:", &MF_Redfont, &MEF_BigOptionsRtSections, &MEO_JOYSTICK_ENABLE, Option );
973
 
7968 hendricks2 974
MAKE_MENU_TOP_ENTRYLINK( "Edit Buttons", MEF_BigOptionsRtSections, JOYSTICK_EDITBUTTONS, MENU_JOYSTICKBTNS );
975
MAKE_MENU_TOP_ENTRYLINK( "Edit Axes", MEF_BigOptionsRtSections, JOYSTICK_EDITAXES, MENU_JOYSTICKAXES );
5 Plagman 976
 
7971 hendricks2 977
static MenuLink_t MEO_JOYSTICK_DEFAULTS_STANDARD = { MENU_JOYSTANDARDVERIFY, MA_None, };
978
static MenuEntry_t ME_JOYSTICK_DEFAULTS_STANDARD = MAKE_MENUENTRY( "Use Standard Layout", &MF_Redfont, &MEF_BigOptionsRtSections, &MEO_JOYSTICK_DEFAULTS_STANDARD, Link );
979
static MenuLink_t MEO_JOYSTICK_DEFAULTS_PRO = { MENU_JOYPROVERIFY, MA_None, };
980
static MenuEntry_t ME_JOYSTICK_DEFAULTS_PRO = MAKE_MENUENTRY( "Use Pro Layout", &MF_Redfont, &MEF_BigOptionsRtSections, &MEO_JOYSTICK_DEFAULTS_PRO, Link );
981
static MenuLink_t MEO_JOYSTICK_DEFAULTS_CLEAR = { MENU_JOYCLEARVERIFY, MA_None, };
982
static MenuEntry_t ME_JOYSTICK_DEFAULTS_CLEAR = MAKE_MENUENTRY( "Clear All Settings", &MF_Redfont, &MEF_BigOptionsRtSections, &MEO_JOYSTICK_DEFAULTS_CLEAR, Link );
7968 hendricks2 983
 
4496 hendricks2 984
static MenuEntry_t *MEL_JOYSTICKSETUP[] = {
7982 hendricks2 985
    &ME_JOYSTICK_ENABLE,
986
    &ME_Space6_Redfont,
4496 hendricks2 987
    &ME_JOYSTICK_EDITBUTTONS,
988
    &ME_JOYSTICK_EDITAXES,
7968 hendricks2 989
    &ME_Space6_Redfont,
990
    &ME_JOYSTICK_DEFAULTS_STANDARD,
991
    &ME_JOYSTICK_DEFAULTS_PRO,
992
    &ME_JOYSTICK_DEFAULTS_CLEAR,
4496 hendricks2 993
};
5 Plagman 994
 
4496 hendricks2 995
#define MAXJOYBUTTONSTRINGLENGTH 32
5 Plagman 996
 
4826 hendricks2 997
static char MenuJoystickNames[MAXJOYBUTTONSANDHATS*2][MAXJOYBUTTONSTRINGLENGTH];
5 Plagman 998
 
4826 hendricks2 999
static MenuOption_t MEO_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
1000
static MenuEntry_t ME_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
1001
static MenuEntry_t *MEL_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
59 terminx 1002
 
4688 hendricks2 1003
static MenuLink_t MEO_JOYSTICKAXES = { MENU_JOYSTICKAXIS, MA_Advance, };
4778 hendricks2 1004
static MenuEntry_t ME_JOYSTICKAXES_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXES, Link );
4496 hendricks2 1005
static MenuEntry_t ME_JOYSTICKAXES[MAXJOYAXES];
1006
static char MenuJoystickAxes[MAXJOYAXES][MAXJOYBUTTONSTRINGLENGTH];
59 terminx 1007
 
4496 hendricks2 1008
static MenuEntry_t *MEL_JOYSTICKAXES[MAXJOYAXES];
2188 helixhorne 1009
 
4496 hendricks2 1010
static const char *MenuJoystickHatDirections[] = { "Up", "Right", "Down", "Left", };
3084 terminx 1011
 
5547 terminx 1012
static char const *MEOSN_JOYSTICKAXIS_ANALOG[] = { "  -None-", "Turning", "Strafing", "Looking", "Moving", };
4496 hendricks2 1013
static int32_t MEOSV_JOYSTICKAXIS_ANALOG[] = { -1, analog_turning, analog_strafing, analog_lookingupanddown, analog_moving, };
4778 hendricks2 1014
static MenuOptionSet_t MEOS_JOYSTICKAXIS_ANALOG = MAKE_MENUOPTIONSET( MEOSN_JOYSTICKAXIS_ANALOG, MEOSV_JOYSTICKAXIS_ANALOG, 0x0 );
4496 hendricks2 1015
static MenuOption_t MEO_JOYSTICKAXIS_ANALOG = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_JOYSTICKAXIS_ANALOG, NULL );
4778 hendricks2 1016
static MenuEntry_t ME_JOYSTICKAXIS_ANALOG = MAKE_MENUENTRY( "Analog", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_ANALOG, Option );
7945 hendricks2 1017
static MenuRangeInt32_t MEO_JOYSTICKAXIS_SCALE = MAKE_MENURANGE( NULL, &MF_Bluefont, -262144, 262144, 65536, 161, 3 );
4778 hendricks2 1018
static MenuEntry_t ME_JOYSTICKAXIS_SCALE = MAKE_MENUENTRY( "Scale", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_SCALE, RangeInt32 );
7986 hendricks2 1019
static MenuOption_t MEO_JOYSTICKAXIS_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, NULL );
1020
static MenuEntry_t ME_JOYSTICKAXIS_INVERT = MAKE_MENUENTRY( "Invert", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_INVERT, Option );
7945 hendricks2 1021
static MenuRangeInt32_t MEO_JOYSTICKAXIS_DEAD = MAKE_MENURANGE( NULL, &MF_Bluefont, 0, 10000, 0, 101, 2 );
4778 hendricks2 1022
static MenuEntry_t ME_JOYSTICKAXIS_DEAD = MAKE_MENUENTRY( "Dead Zone", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DEAD, RangeInt32 );
7945 hendricks2 1023
static MenuRangeInt32_t MEO_JOYSTICKAXIS_SATU = MAKE_MENURANGE( NULL, &MF_Bluefont, 0, 10000, 0, 101, 2 );
4778 hendricks2 1024
static MenuEntry_t ME_JOYSTICKAXIS_SATU = MAKE_MENUENTRY( "Saturation", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_SATU, RangeInt32 );
3084 terminx 1025
 
4496 hendricks2 1026
static MenuOption_t MEO_JOYSTICKAXIS_DIGITALNEGATIVE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
6613 hendricks2 1027
static MenuEntry_t ME_JOYSTICKAXIS_DIGITALNEGATIVE = MAKE_MENUENTRY( "Digital -", &MF_Bluefont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DIGITALNEGATIVE, Option );
4496 hendricks2 1028
static MenuOption_t MEO_JOYSTICKAXIS_DIGITALPOSITIVE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
6613 hendricks2 1029
static MenuEntry_t ME_JOYSTICKAXIS_DIGITALPOSITIVE = MAKE_MENUENTRY( "Digital +", &MF_Bluefont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DIGITALPOSITIVE, Option );
3084 terminx 1030
 
4496 hendricks2 1031
static MenuEntry_t *MEL_JOYSTICKAXIS[] = {
1032
    &ME_JOYSTICKAXIS_ANALOG,
1033
    &ME_JOYSTICKAXIS_SCALE,
7986 hendricks2 1034
    &ME_JOYSTICKAXIS_INVERT,
4496 hendricks2 1035
    &ME_JOYSTICKAXIS_DEAD,
1036
    &ME_JOYSTICKAXIS_SATU,
6198 hendricks2 1037
    &ME_Space8_Redfont,
4778 hendricks2 1038
    &ME_JOYSTICKAXIS_DIGITALNEGATIVE,
1039
    &ME_JOYSTICKAXIS_DIGITALPOSITIVE,
4496 hendricks2 1040
};
3084 terminx 1041
 
4778 hendricks2 1042
static MenuEntry_t *MEL_INTERNAL_JOYSTICKAXIS_DIGITAL[] = {
4496 hendricks2 1043
    &ME_JOYSTICKAXIS_DIGITALNEGATIVE,
1044
    &ME_JOYSTICKAXIS_DIGITALPOSITIVE,
1045
};
3084 terminx 1046
 
4496 hendricks2 1047
#ifdef USE_OPENGL
1048
static MenuOption_t MEO_RENDERERSETUP_HIGHTILE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &usehightile );
6613 hendricks2 1049
static MenuEntry_t ME_RENDERERSETUP_HIGHTILE = MAKE_MENUENTRY( "True color textures:", &MF_Bluefont, &MEF_SmallOptions, &MEO_RENDERERSETUP_HIGHTILE, Option );
5408 terminx 1050
 
6061 hendricks2 1051
static char const *MEOSN_RENDERERSETUP_TEXQUALITY [] = { "Full", "Half", "Barf", };
5408 terminx 1052
static MenuOptionSet_t MEOS_RENDERERSETUP_TEXQUALITY = MAKE_MENUOPTIONSET(MEOSN_RENDERERSETUP_TEXQUALITY, NULL, 0x2);
1053
static MenuOption_t MEO_RENDERERSETUP_TEXQUALITY = MAKE_MENUOPTION(&MF_Bluefont, &MEOS_RENDERERSETUP_TEXQUALITY, &r_downsize);
6613 hendricks2 1054
static MenuEntry_t ME_RENDERERSETUP_TEXQUALITY = MAKE_MENUENTRY("GL texture quality:", &MF_Bluefont, &MEF_SmallOptions, &MEO_RENDERERSETUP_TEXQUALITY, Option);
5408 terminx 1055
 
1056
 
4496 hendricks2 1057
static MenuOption_t MEO_RENDERERSETUP_PRECACHE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.config.useprecache );
6613 hendricks2 1058
static MenuEntry_t ME_RENDERERSETUP_PRECACHE = MAKE_MENUENTRY( "Pre-load map textures:", &MF_Bluefont, &MEF_SmallOptions, &MEO_RENDERERSETUP_PRECACHE, Option );
5526 hendricks2 1059
# ifndef EDUKE32_GLES
5547 terminx 1060
static char const *MEOSN_RENDERERSETUP_TEXCACHE[] = { "Off", "On", "Compr.", };
4778 hendricks2 1061
static MenuOptionSet_t MEOS_RENDERERSETUP_TEXCACHE = MAKE_MENUOPTIONSET( MEOSN_RENDERERSETUP_TEXCACHE, NULL, 0x2 );
4496 hendricks2 1062
static MenuOption_t MEO_RENDERERSETUP_TEXCACHE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_RENDERERSETUP_TEXCACHE, &glusetexcache );
6613 hendricks2 1063
static MenuEntry_t ME_RENDERERSETUP_TEXCACHE = MAKE_MENUENTRY( "On-disk texture cache:", &MF_Bluefont, &MEF_SmallOptions, &MEO_RENDERERSETUP_TEXCACHE, Option );
5526 hendricks2 1064
# endif
1065
# ifdef USE_GLEXT
4496 hendricks2 1066
static MenuOption_t MEO_RENDERERSETUP_DETAILTEX = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &r_detailmapping );
6613 hendricks2 1067
static MenuEntry_t ME_RENDERERSETUP_DETAILTEX = MAKE_MENUENTRY( "Detail textures:", &MF_Bluefont, &MEF_SmallOptions, &MEO_RENDERERSETUP_DETAILTEX, Option );
5408 terminx 1068
static MenuOption_t MEO_RENDERERSETUP_GLOWTEX = MAKE_MENUOPTION(&MF_Bluefont, &MEOS_NoYes, &r_glowmapping);
6613 hendricks2 1069
static MenuEntry_t ME_RENDERERSETUP_GLOWTEX = MAKE_MENUENTRY("Glow textures:", &MF_Bluefont, &MEF_SmallOptions, &MEO_RENDERERSETUP_GLOWTEX, Option);
5526 hendricks2 1070
# endif
4496 hendricks2 1071
static MenuOption_t MEO_RENDERERSETUP_MODELS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &usemodels );
6613 hendricks2 1072
static MenuEntry_t ME_RENDERERSETUP_MODELS = MAKE_MENUENTRY( "3D models:", &MF_Bluefont, &MEF_SmallOptions, &MEO_RENDERERSETUP_MODELS, Option );
4496 hendricks2 1073
#endif
5408 terminx 1074
 
5406 terminx 1075
#ifdef POLYMER
6061 hendricks2 1076
static char const *MEOSN_POLYMER_LIGHTS [] = { "Off", "Full", "Map only", };
5408 terminx 1077
static MenuOptionSet_t MEOS_POLYMER_LIGHTS = MAKE_MENUOPTIONSET(MEOSN_POLYMER_LIGHTS, NULL, 0x2);
1078
static MenuOption_t MEO_POLYMER_LIGHTS = MAKE_MENUOPTION(&MF_Bluefont, &MEOS_POLYMER_LIGHTS, &pr_lighting);
6613 hendricks2 1079
static MenuEntry_t ME_POLYMER_LIGHTS = MAKE_MENUENTRY("Dynamic lights:", &MF_Bluefont, &MEF_SmallOptions, &MEO_POLYMER_LIGHTS, Option);
5408 terminx 1080
 
1081
static MenuRangeInt32_t MEO_POLYMER_LIGHTPASSES = MAKE_MENURANGE(&r_pr_maxlightpasses, &MF_Bluefont, 1, 10, 1, 10, 1);
6613 hendricks2 1082
static MenuEntry_t ME_POLYMER_LIGHTPASSES = MAKE_MENUENTRY("Lights per surface:", &MF_Bluefont, &MEF_SmallOptions, &MEO_POLYMER_LIGHTPASSES, RangeInt32);
5408 terminx 1083
 
1084
static MenuOption_t MEO_POLYMER_SHADOWS = MAKE_MENUOPTION(&MF_Bluefont, &MEOS_OffOn, &pr_shadows);
6613 hendricks2 1085
static MenuEntry_t ME_POLYMER_SHADOWS = MAKE_MENUENTRY("Dynamic shadows:", &MF_Bluefont, &MEF_SmallOptions, &MEO_POLYMER_SHADOWS, Option);
5408 terminx 1086
 
1087
static MenuRangeInt32_t MEO_POLYMER_SHADOWCOUNT = MAKE_MENURANGE(&pr_shadowcount, &MF_Bluefont, 1, 10, 1, 10, 1);
6613 hendricks2 1088
static MenuEntry_t ME_POLYMER_SHADOWCOUNT = MAKE_MENUENTRY("Shadows per surface:", &MF_Bluefont, &MEF_SmallOptions, &MEO_POLYMER_SHADOWCOUNT, RangeInt32);
5408 terminx 1089
 
5406 terminx 1090
#endif
3084 terminx 1091
 
4496 hendricks2 1092
#ifdef USE_OPENGL
5408 terminx 1093
static MenuEntry_t *MEL_RENDERERSETUP_POLYMOST[] = {
4496 hendricks2 1094
    &ME_RENDERERSETUP_HIGHTILE,
1095
    &ME_RENDERERSETUP_TEXQUALITY,
1096
    &ME_RENDERERSETUP_PRECACHE,
5526 hendricks2 1097
# ifndef EDUKE32_GLES
4496 hendricks2 1098
    &ME_RENDERERSETUP_TEXCACHE,
5526 hendricks2 1099
# endif
1100
# ifdef USE_GLEXT
4496 hendricks2 1101
    &ME_RENDERERSETUP_DETAILTEX,
5408 terminx 1102
    &ME_RENDERERSETUP_GLOWTEX,
5526 hendricks2 1103
# endif
6198 hendricks2 1104
    &ME_Space4_Bluefont,
4496 hendricks2 1105
    &ME_RENDERERSETUP_MODELS,
5408 terminx 1106
};
1107
 
5406 terminx 1108
#ifdef POLYMER
6061 hendricks2 1109
static MenuEntry_t *MEL_RENDERERSETUP_POLYMER [] = {
5408 terminx 1110
    &ME_RENDERERSETUP_HIGHTILE,
1111
    &ME_RENDERERSETUP_TEXQUALITY,
1112
    &ME_RENDERERSETUP_PRECACHE,
5526 hendricks2 1113
# ifndef EDUKE32_GLES
5408 terminx 1114
    &ME_RENDERERSETUP_TEXCACHE,
5526 hendricks2 1115
# endif
1116
# ifdef USE_GLEXT
5408 terminx 1117
    &ME_RENDERERSETUP_DETAILTEX,
1118
    &ME_RENDERERSETUP_GLOWTEX,
5526 hendricks2 1119
# endif
6198 hendricks2 1120
    &ME_Space4_Bluefont,
5408 terminx 1121
    &ME_RENDERERSETUP_MODELS,
6198 hendricks2 1122
    &ME_Space4_Bluefont,
5408 terminx 1123
    &ME_POLYMER_LIGHTS,
1124
    &ME_POLYMER_LIGHTPASSES,
1125
    &ME_POLYMER_SHADOWS,
1126
    &ME_POLYMER_SHADOWCOUNT,
4496 hendricks2 1127
};
1128
#endif
5408 terminx 1129
#endif
3084 terminx 1130
 
6013 terminx 1131
#ifdef EDUKE32_ANDROID_MENU
6828 terminx 1132
static MenuRangeFloat_t MEO_COLCORR_GAMMA = MAKE_MENURANGE( &g_videoGamma, &MF_Bluefont, 1.f, 2.5f, 0.f, 39, 1 );
4609 terminx 1133
#else
7312 hendricks2 1134
static MenuRangeFloat_t MEO_COLCORR_GAMMA = MAKE_MENURANGE( &g_videoGamma, &MF_Bluefont, 0.3f, 4.f, 0.f, 75, 1 );
4609 terminx 1135
#endif
4778 hendricks2 1136
static MenuEntry_t ME_COLCORR_GAMMA = MAKE_MENUENTRY( "Gamma:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_GAMMA, RangeFloat );
6828 terminx 1137
static MenuRangeFloat_t MEO_COLCORR_CONTRAST = MAKE_MENURANGE( &g_videoContrast, &MF_Bluefont, 0.1f, 2.7f, 0.f, 53, 1 );
4778 hendricks2 1138
static MenuEntry_t ME_COLCORR_CONTRAST = MAKE_MENUENTRY( "Contrast:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_CONTRAST, RangeFloat );
6828 terminx 1139
static MenuRangeFloat_t MEO_COLCORR_BRIGHTNESS = MAKE_MENURANGE( &g_videoBrightness, &MF_Bluefont, -0.8f, 0.8f, 0.f, 33, 1 );
4778 hendricks2 1140
static MenuEntry_t ME_COLCORR_BRIGHTNESS = MAKE_MENUENTRY( "Brightness:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_BRIGHTNESS, RangeFloat );
7971 hendricks2 1141
static MenuLink_t MEO_COLCORR_RESET = { MENU_COLCORRRESETVERIFY, MA_None, };
1142
static MenuEntry_t ME_COLCORR_RESET = MAKE_MENUENTRY( "Reset To Defaults", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_RESET, Link );
6013 terminx 1143
#ifdef EDUKE32_ANDROID_MENU
4993 terminx 1144
#define MINVIS 1.f
1145
#else
1146
#define MINVIS 0.125f
1147
#endif
8569 terminx 1148
#ifndef EDUKE32_RETAIL_MENU
4993 terminx 1149
static MenuRangeFloat_t MEO_COLCORR_AMBIENT = MAKE_MENURANGE( &r_ambientlight, &MF_Bluefont, MINVIS, 4.f, 0.f, 32, 1 );
4778 hendricks2 1150
static MenuEntry_t ME_COLCORR_AMBIENT = MAKE_MENUENTRY( "Visibility:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_AMBIENT, RangeFloat );
6335 terminx 1151
#endif
4496 hendricks2 1152
static MenuEntry_t *MEL_COLCORR[] = {
1153
    &ME_COLCORR_GAMMA,
6013 terminx 1154
#ifndef EDUKE32_ANDROID_MENU
4496 hendricks2 1155
    &ME_COLCORR_CONTRAST,
1156
    &ME_COLCORR_BRIGHTNESS,
4609 terminx 1157
#endif
8569 terminx 1158
#ifndef EDUKE32_RETAIL_MENU
4850 hendricks2 1159
    &ME_COLCORR_AMBIENT,
6335 terminx 1160
#endif
6198 hendricks2 1161
    &ME_Space8_Redfont,
4496 hendricks2 1162
    &ME_COLCORR_RESET,
1163
};
3084 terminx 1164
 
4778 hendricks2 1165
static MenuEntry_t *MEL_SCREENSETUP[] = {
6588 hendricks2 1166
#ifdef EDUKE32_ANDROID_MENU
1167
    &ME_SCREENSETUP_STATUSBARONTOP,
1168
#endif
6650 hendricks2 1169
    &ME_SCREENSETUP_SCREENSIZE,
4850 hendricks2 1170
    &ME_SCREENSETUP_SBARSIZE,
4609 terminx 1171
 
4850 hendricks2 1172
    &ME_SCREENSETUP_CROSSHAIR,
1173
    &ME_SCREENSETUP_CROSSHAIRSIZE,
4609 terminx 1174
 
4850 hendricks2 1175
    &ME_SCREENSETUP_LEVELSTATS,
1176
    &ME_SCREENSETUP_TEXTSIZE,
4609 terminx 1177
 
4850 hendricks2 1178
    &ME_SCREENSETUP_SHOWPICKUPMESSAGES,
4609 terminx 1179
};
1180
 
4496 hendricks2 1181
// Save and load will be filled in before every viewing of the save/load screen.
6329 hendricks2 1182
static MenuLink_t MEO_LOAD = { MENU_LOADVERIFY, MA_None, };
6613 hendricks2 1183
static MenuEntry_t ME_LOAD_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_LoadSave, &MEO_LOAD, Link );
1184
static MenuEntry_t ME_LOAD_EMPTY = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_LoadSave, nullptr, Dummy );
6569 hendricks2 1185
static MenuEntry_t *ME_LOAD;
1186
static MenuEntry_t **MEL_LOAD;
3084 terminx 1187
 
6569 hendricks2 1188
static char const s_NewSaveGame[] = "(New Save Game)";
6613 hendricks2 1189
static MenuString_t MEO_SAVE_TEMPLATE = MAKE_MENUSTRING( NULL, &MF_Minifont, MAXSAVEGAMENAME, 0 );
1190
static MenuString_t MEO_SAVE_NEW = MAKE_MENUSTRING( NULL, &MF_Minifont, MAXSAVEGAMENAME, 0 );
6569 hendricks2 1191
static MenuString_t *MEO_SAVE;
6613 hendricks2 1192
static MenuEntry_t ME_SAVE_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_LoadSave, &MEO_SAVE_TEMPLATE, String );
1193
static MenuEntry_t ME_SAVE_NEW = MAKE_MENUENTRY( s_NewSaveGame, &MF_Minifont, &MEF_LoadSave, &MEO_SAVE_NEW, String );
6569 hendricks2 1194
static MenuEntry_t *ME_SAVE;
1195
static MenuEntry_t **MEL_SAVE;
3084 terminx 1196
 
8760 terminx 1197
static int32_t soundrate, soundvoices, musicdevice, opl3stereo;
1198
static char sf2bankfile[BMAX_PATH];
4778 hendricks2 1199
static MenuOption_t MEO_SOUND = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.SoundToggle );
1200
static MenuEntry_t ME_SOUND = MAKE_MENUENTRY( "Sound:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND, Option );
4609 terminx 1201
 
4778 hendricks2 1202
static MenuOption_t MEO_SOUND_MUSIC = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.MusicToggle );
1203
static MenuEntry_t ME_SOUND_MUSIC = MAKE_MENUENTRY( "Music:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_MUSIC, Option );
4609 terminx 1204
 
8013 hendricks2 1205
static char const s_Volume[] = "Volume:";
1206
 
7122 terminx 1207
static MenuRangeInt32_t MEO_SOUND_VOLUME_FX = MAKE_MENURANGE( &ud.config.FXVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
8013 hendricks2 1208
static MenuEntry_t ME_SOUND_VOLUME_FX = MAKE_MENUENTRY( s_Volume, &MF_Redfont, &MEF_BigOptions_Apply, &MEO_SOUND_VOLUME_FX, RangeInt32 );
4609 terminx 1209
 
4778 hendricks2 1210
static MenuRangeInt32_t MEO_SOUND_VOLUME_MUSIC = MAKE_MENURANGE( &ud.config.MusicVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
8013 hendricks2 1211
static MenuEntry_t ME_SOUND_VOLUME_MUSIC = MAKE_MENUENTRY( s_Volume, &MF_Redfont, &MEF_BigOptions_Apply, &MEO_SOUND_VOLUME_MUSIC, RangeInt32 );
4609 terminx 1212
 
7402 terminx 1213
#ifndef EDUKE32_STANDALONE
4778 hendricks2 1214
static MenuOption_t MEO_SOUND_DUKETALK = MAKE_MENUOPTION(&MF_Redfont, &MEOS_NoYes, NULL);
1215
static MenuEntry_t ME_SOUND_DUKETALK = MAKE_MENUENTRY( "Duke talk:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_DUKETALK, Option );
6013 terminx 1216
#else
8026 hendricks2 1217
static MenuOption_t MEO_SOUND_DUKETALK = MAKE_MENUOPTION(&MF_Redfont, &MEOS_YesNo, NULL);
1218
static MenuEntry_t ME_SOUND_DUKETALK = MAKE_MENUENTRY("Silent protagonist:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_DUKETALK, Option);
6013 terminx 1219
#endif
4609 terminx 1220
 
5547 terminx 1221
static char const *MEOSN_SOUND_SAMPLINGRATE[] = { "22050Hz", "44100Hz", "48000Hz", };
4609 terminx 1222
static int32_t MEOSV_SOUND_SAMPLINGRATE[] = { 22050, 44100, 48000, };
4778 hendricks2 1223
static MenuOptionSet_t MEOS_SOUND_SAMPLINGRATE = MAKE_MENUOPTIONSET( MEOSN_SOUND_SAMPLINGRATE, MEOSV_SOUND_SAMPLINGRATE, 0x3 );
1224
static MenuOption_t MEO_SOUND_SAMPLINGRATE = MAKE_MENUOPTION( &MF_Redfont, &MEOS_SOUND_SAMPLINGRATE, &soundrate );
1225
static MenuEntry_t ME_SOUND_SAMPLINGRATE = MAKE_MENUENTRY( "Sample rate:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_SAMPLINGRATE, Option );
4609 terminx 1226
 
8569 terminx 1227
#ifndef EDUKE32_RETAIL_MENU
8760 terminx 1228
static MenuOption_t MEO_SOUND_OPL3STEREO = MAKE_MENUOPTION(&MF_Redfont, &MEOS_NoYes, &opl3stereo);
1229
static MenuEntry_t ME_SOUND_OPL3STEREO = MAKE_MENUENTRY( "OPL3 stereo mode:", &MF_Redfont, &MEF_BigOptionsRtSections, &MEO_SOUND_OPL3STEREO, Option );
1230
 
8234 terminx 1231
static MenuRangeInt32_t MEO_SOUND_NUMVOICES = MAKE_MENURANGE( &soundvoices, &MF_Redfont, 16, 128, 0, 8, 1 );
4778 hendricks2 1232
static MenuEntry_t ME_SOUND_NUMVOICES = MAKE_MENUENTRY( "Voices:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_NUMVOICES, RangeInt32 );
4609 terminx 1233
 
8258 hendricks2 1234
static char const *MEOSN_SOUND_MIDIDRIVER[] = {
8381 terminx 1235
    "OPL3 emu.",
8218 terminx 1236
#ifdef _WIN32
8381 terminx 1237
    "Windows MME",
8218 terminx 1238
#endif
8760 terminx 1239
    ".sf2 synth",
8218 terminx 1240
};
8258 hendricks2 1241
static int32_t MEOSV_SOUND_MIDIDRIVER[] = {
8219 terminx 1242
    ASS_OPL3,
8218 terminx 1243
#ifdef _WIN32
1244
    ASS_WinMM,
1245
#endif
8752 terminx 1246
    ASS_SF2,
8218 terminx 1247
};
1248
 
8258 hendricks2 1249
static MenuOptionSet_t MEOS_SOUND_MIDIDRIVER = MAKE_MENUOPTIONSET( MEOSN_SOUND_MIDIDRIVER, MEOSV_SOUND_MIDIDRIVER, 0x2 );
1250
static MenuOption_t MEO_SOUND_MIDIDRIVER = MAKE_MENUOPTION( &MF_Redfont, &MEOS_SOUND_MIDIDRIVER, &musicdevice );
1251
static MenuEntry_t ME_SOUND_MIDIDRIVER = MAKE_MENUENTRY( "MIDI driver:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_MIDIDRIVER, Option );
8218 terminx 1252
 
8760 terminx 1253
static MenuLink_t MEO_SOUND_DEVSETUP = { MENU_SOUND_DEVSETUP, MA_Advance, };
1254
static MenuEntry_t ME_SOUND_DEVSETUP = MAKE_MENUENTRY( "Device configuration", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_DEVSETUP, Link );
1255
 
1256
static MenuLink_t MEO_SOUND_SF2 = { MENU_SOUND_SF2, MA_Advance, };
1257
static MenuEntry_t ME_SOUND_SF2 = MAKE_MENUENTRY( sf2bankfile, &MF_Redfont, &MEF_BigOptionsRtSections, &MEO_SOUND_SF2, Link );
4645 hendricks2 1258
#endif
4609 terminx 1259
 
8764 terminx 1260
static MenuEntry_t ME_SOUND_RESTART = MAKE_MENUENTRY( "Apply Changes", &MF_Redfont, &MEF_BigOptions_Apply, &MEO_NULL, Link );
1261
 
4778 hendricks2 1262
static MenuEntry_t *MEL_SOUND[] = {
4496 hendricks2 1263
    &ME_SOUND,
8013 hendricks2 1264
    &ME_SOUND_VOLUME_FX,
4496 hendricks2 1265
    &ME_SOUND_MUSIC,
4850 hendricks2 1266
    &ME_SOUND_VOLUME_MUSIC,
4496 hendricks2 1267
    &ME_SOUND_DUKETALK,
8569 terminx 1268
#ifndef EDUKE32_RETAIL_MENU
8760 terminx 1269
    &ME_Space4_Redfont,
1270
    &ME_SOUND_DEVSETUP,
4609 terminx 1271
#endif
4496 hendricks2 1272
};
3084 terminx 1273
 
8760 terminx 1274
static MenuEntry_t *MEL_SOUND_DEVSETUP[] = {
4850 hendricks2 1275
    &ME_SOUND_SAMPLINGRATE,
8569 terminx 1276
#ifndef EDUKE32_RETAIL_MENU
4850 hendricks2 1277
    &ME_SOUND_NUMVOICES,
8760 terminx 1278
    &ME_SOUND_MIDIDRIVER,
1279
    &ME_SOUND_OPL3STEREO,
1280
    &ME_SOUND_SF2,
6380 terminx 1281
#endif
8760 terminx 1282
    &ME_Space4_Redfont,
4850 hendricks2 1283
    &ME_SOUND_RESTART,
4609 terminx 1284
};
1285
 
6742 hendricks2 1286
 
1287
static MenuOption_t MEO_SAVESETUP_AUTOSAVE = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.autosave );
7790 terminx 1288
static MenuEntry_t ME_SAVESETUP_AUTOSAVE = MAKE_MENUENTRY( "Checkpoints:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SAVESETUP_AUTOSAVE, Option );
6742 hendricks2 1289
 
6748 hendricks2 1290
static MenuOption_t MEO_SAVESETUP_AUTOSAVEDELETION = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.autosavedeletion );
1291
static MenuEntry_t ME_SAVESETUP_AUTOSAVEDELETION = MAKE_MENUENTRY( "Auto-Delete:", &MF_Redfont, &MEF_BigOptions_Apply, &MEO_SAVESETUP_AUTOSAVEDELETION, Option );
1292
static MenuRangeInt32_t MEO_SAVESETUP_MAXAUTOSAVES = MAKE_MENURANGE( &ud.maxautosaves, &MF_Redfont, 1, 10, 0, 10, 1 );
1293
static MenuEntry_t ME_SAVESETUP_MAXAUTOSAVES = MAKE_MENUENTRY( "Limit:", &MF_Redfont, &MEF_BigOptions_Apply, &MEO_SAVESETUP_MAXAUTOSAVES, RangeInt32 );
1294
 
6749 hendricks2 1295
static MenuEntry_t ME_SAVESETUP_CLEANUP = MAKE_MENUENTRY( "Clean Up Saves", &MF_Redfont, &MEF_BigOptionsRt, &MEO_NULL, Link );
1296
 
8114 terminx 1297
#ifdef EDUKE32_STANDALONE
1298
static MenuEntry_t ME_SAVESETUP_RESETSTATS = MAKE_MENUENTRY( "Reset Stats/Achievements", &MF_Redfont, &MEF_BigOptionsRt, &MEO_NULL, Link );
1299
#endif
1300
 
6742 hendricks2 1301
static MenuEntry_t *MEL_SAVESETUP[] = {
1302
    &ME_SAVESETUP_AUTOSAVE,
6748 hendricks2 1303
    &ME_SAVESETUP_AUTOSAVEDELETION,
1304
    &ME_SAVESETUP_MAXAUTOSAVES,
6749 hendricks2 1305
    &ME_SAVESETUP_CLEANUP,
8114 terminx 1306
#ifdef EDUKE32_STANDALONE
1307
    &ME_SAVESETUP_RESETSTATS,
1308
#endif
6742 hendricks2 1309
};
1310
 
1311
 
4778 hendricks2 1312
MAKE_MENU_TOP_ENTRYLINK( "Player Setup", MEF_CenterMenu, NETWORK_PLAYERSETUP, MENU_PLAYER );
1313
MAKE_MENU_TOP_ENTRYLINK( "Join Game", MEF_CenterMenu, NETWORK_JOINGAME, MENU_NETJOIN );
1314
MAKE_MENU_TOP_ENTRYLINK( "Host Game", MEF_CenterMenu, NETWORK_HOSTGAME, MENU_NETHOST );
4399 hendricks2 1315
 
4496 hendricks2 1316
static MenuEntry_t *MEL_NETWORK[] = {
1317
    &ME_NETWORK_PLAYERSETUP,
1318
    &ME_NETWORK_JOINGAME,
1319
    &ME_NETWORK_HOSTGAME,
1320
};
4399 hendricks2 1321
 
4778 hendricks2 1322
static MenuString_t MEO_PLAYER_NAME = MAKE_MENUSTRING( szPlayerName, &MF_Bluefont, MAXPLAYERNAME, 0 );
6613 hendricks2 1323
static MenuEntry_t ME_PLAYER_NAME = MAKE_MENUENTRY( "Name", &MF_Bluefont, &MEF_PlayerNarrow, &MEO_PLAYER_NAME, String );
5547 terminx 1324
static char const *MEOSN_PLAYER_COLOR[] = { "Auto", "Blue", "Red", "Green", "Gray", "Dark gray", "Dark green", "Brown", "Dark blue", "Bright red", "Yellow", };
4822 hendricks2 1325
static int32_t MEOSV_PLAYER_COLOR[] = { 0, 9, 10, 11, 12, 13, 14, 15, 16, 21, 23, };
4778 hendricks2 1326
static MenuOptionSet_t MEOS_PLAYER_COLOR = MAKE_MENUOPTIONSET( MEOSN_PLAYER_COLOR, MEOSV_PLAYER_COLOR, 0x2 );
4496 hendricks2 1327
static MenuOption_t MEO_PLAYER_COLOR = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_PLAYER_COLOR, &ud.color );
6613 hendricks2 1328
static MenuEntry_t ME_PLAYER_COLOR = MAKE_MENUENTRY( "Color", &MF_Bluefont, &MEF_PlayerNarrow, &MEO_PLAYER_COLOR, Option );
5547 terminx 1329
static char const *MEOSN_PLAYER_TEAM[] = { "Blue", "Red", "Green", "Gray", };
4778 hendricks2 1330
static MenuOptionSet_t MEOS_PLAYER_TEAM = MAKE_MENUOPTIONSET( MEOSN_PLAYER_TEAM, NULL, 0x2 );
4496 hendricks2 1331
static MenuOption_t MEO_PLAYER_TEAM = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_PLAYER_TEAM, &ud.team );
6613 hendricks2 1332
static MenuEntry_t ME_PLAYER_TEAM = MAKE_MENUENTRY( "Team", &MF_Bluefont, &MEF_PlayerNarrow, &MEO_PLAYER_TEAM, Option );
8569 terminx 1333
#ifndef EDUKE32_RETAIL_MENU
4688 hendricks2 1334
static MenuLink_t MEO_PLAYER_MACROS = { MENU_MACROS, MA_Advance, };
6613 hendricks2 1335
static MenuEntry_t ME_PLAYER_MACROS = MAKE_MENUENTRY( "Multiplayer macros", &MF_Bluefont, &MEF_SmallOptions, &MEO_PLAYER_MACROS, Link );
4682 hendricks2 1336
#endif
5 Plagman 1337
 
4778 hendricks2 1338
static MenuEntry_t *MEL_PLAYER[] = {
4496 hendricks2 1339
    &ME_PLAYER_NAME,
6198 hendricks2 1340
    &ME_Space4_Bluefont,
4496 hendricks2 1341
    &ME_PLAYER_COLOR,
6198 hendricks2 1342
    &ME_Space4_Bluefont,
4496 hendricks2 1343
    &ME_PLAYER_TEAM,
8569 terminx 1344
#ifndef EDUKE32_RETAIL_MENU
6198 hendricks2 1345
    &ME_Space8_Bluefont,
4496 hendricks2 1346
    &ME_PLAYER_MACROS,
4778 hendricks2 1347
#endif
4496 hendricks2 1348
};
5 Plagman 1349
 
4778 hendricks2 1350
static MenuString_t MEO_MACROS_TEMPLATE = MAKE_MENUSTRING( NULL, &MF_Bluefont, MAXRIDECULELENGTH, 0 );
6569 hendricks2 1351
static MenuString_t MEO_MACROS[10];
4778 hendricks2 1352
static MenuEntry_t ME_MACROS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Bluefont, &MEF_Macros, &MEO_MACROS_TEMPLATE, String );
4496 hendricks2 1353
static MenuEntry_t ME_MACROS[MAXRIDECULE];
1354
static MenuEntry_t *MEL_MACROS[MAXRIDECULE];
5 Plagman 1355
 
5547 terminx 1356
static char const *MenuUserMap = "User Map";
1357
static char const *MenuSkillNone = "None";
5 Plagman 1358
 
5547 terminx 1359
static char const *MEOSN_NetGametypes[MAXGAMETYPES];
1360
static char const *MEOSN_NetEpisodes[MAXVOLUMES+1];
5033 hendricks2 1361
static int32_t MEOSV_NetEpisodes[MAXVOLUMES+1];
5547 terminx 1362
static char const *MEOSN_NetLevels[MAXVOLUMES][MAXLEVELS];
1363
static char const *MEOSN_NetSkills[MAXSKILLS+1];
5 Plagman 1364
 
4823 hendricks2 1365
static MenuLink_t MEO_NETHOST_OPTIONS = { MENU_NETOPTIONS, MA_Advance, };
4778 hendricks2 1366
static MenuEntry_t ME_NETHOST_OPTIONS = MAKE_MENUENTRY( "Game Options", &MF_Redfont, &MEF_VideoSetup, &MEO_NETHOST_OPTIONS, Link );
1367
static MenuEntry_t ME_NETHOST_LAUNCH = MAKE_MENUENTRY( "Launch Game", &MF_Redfont, &MEF_VideoSetup, &MEO_NULL, Link );
5 Plagman 1368
 
4496 hendricks2 1369
static MenuEntry_t *MEL_NETHOST[] = {
1370
    &ME_NETHOST_OPTIONS,
1371
    &ME_NETHOST_LAUNCH,
1372
};
471 terminx 1373
 
4778 hendricks2 1374
static MenuOptionSet_t MEOS_NETOPTIONS_GAMETYPE = MAKE_MENUOPTIONSET( MEOSN_NetGametypes, NULL, 0x0 );
4496 hendricks2 1375
static MenuOption_t MEO_NETOPTIONS_GAMETYPE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_GAMETYPE, &ud.m_coop );
4778 hendricks2 1376
static MenuEntry_t ME_NETOPTIONS_GAMETYPE = MAKE_MENUENTRY( "Game Type", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_GAMETYPE, Option );
5033 hendricks2 1377
static MenuOptionSet_t MEOS_NETOPTIONS_EPISODE = MAKE_MENUOPTIONSET( MEOSN_NetEpisodes, MEOSV_NetEpisodes, 0x0 );
1378
static int32_t NetEpisode;
1379
static MenuOption_t MEO_NETOPTIONS_EPISODE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_EPISODE, &NetEpisode );
4778 hendricks2 1380
static MenuEntry_t ME_NETOPTIONS_EPISODE = MAKE_MENUENTRY( "Episode", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_EPISODE, Option );
5034 hendricks2 1381
static MenuOptionSet_t MEOS_NETOPTIONS_LEVEL_TEMPLATE = MAKE_MENUOPTIONSETNULL;
4496 hendricks2 1382
static MenuOptionSet_t MEOS_NETOPTIONS_LEVEL[MAXVOLUMES];
1383
static MenuOption_t MEO_NETOPTIONS_LEVEL = MAKE_MENUOPTION( &MF_Bluefont, NULL, &ud.m_level_number );
4778 hendricks2 1384
static MenuEntry_t ME_NETOPTIONS_LEVEL = MAKE_MENUENTRY( "Level", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_LEVEL, Option );
4823 hendricks2 1385
static MenuLink_t MEO_NETOPTIONS_USERMAP = { MENU_NETUSERMAP, MA_Advance, };
4778 hendricks2 1386
static MenuEntry_t ME_NETOPTIONS_USERMAP = MAKE_MENUENTRY( "User Map", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_USERMAP, Link );
1387
static MenuOptionSet_t MEOS_NETOPTIONS_MONSTERS = MAKE_MENUOPTIONSET( MEOSN_NetSkills, NULL, 0x0 );
4496 hendricks2 1388
static MenuOption_t MEO_NETOPTIONS_MONSTERS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_MONSTERS, NULL );
4778 hendricks2 1389
static MenuEntry_t ME_NETOPTIONS_MONSTERS = MAKE_MENUENTRY( "Monsters", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MONSTERS, Option );
4496 hendricks2 1390
static MenuOption_t MEO_NETOPTIONS_MARKERS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.m_marker );
4778 hendricks2 1391
static MenuEntry_t ME_NETOPTIONS_MARKERS = MAKE_MENUENTRY( "Markers", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MARKERS, Option );
4496 hendricks2 1392
static MenuOption_t MEO_NETOPTIONS_MAPEXITS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OnOff, &ud.m_noexits );
4778 hendricks2 1393
static MenuEntry_t ME_NETOPTIONS_MAPEXITS = MAKE_MENUENTRY( "Map Exits", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MAPEXITS, Option );
4496 hendricks2 1394
static MenuOption_t MEO_NETOPTIONS_FRFIRE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.m_ffire );
4778 hendricks2 1395
static MenuEntry_t ME_NETOPTIONS_FRFIRE = MAKE_MENUENTRY( "Fr. Fire", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_FRFIRE, Option );
7242 seventyfiv 1396
static MenuEntry_t ME_NETOPTIONS_ACCEPT = MAKE_MENUENTRY( "Accept", &MF_Redfont, &MEF_NetSetup_Confirm, &MEO_NETWORK_HOSTGAME, Link );
471 terminx 1397
 
4496 hendricks2 1398
static MenuEntry_t *MEL_NETOPTIONS[] = {
1399
    &ME_NETOPTIONS_GAMETYPE,
1400
    &ME_NETOPTIONS_EPISODE,
1401
    &ME_NETOPTIONS_LEVEL,
1402
    &ME_NETOPTIONS_MONSTERS,
1403
    &ME_NETOPTIONS_MARKERS,
1404
    &ME_NETOPTIONS_MAPEXITS,
1405
    &ME_NETOPTIONS_ACCEPT,
1406
};
5 Plagman 1407
 
4496 hendricks2 1408
static char MenuServer[BMAX_PATH] = "localhost";
4778 hendricks2 1409
static MenuString_t MEO_NETJOIN_SERVER = MAKE_MENUSTRING( MenuServer, &MF_Bluefont, BMAX_PATH, 0 );
1410
static MenuEntry_t ME_NETJOIN_SERVER = MAKE_MENUENTRY( "Server", &MF_Redfont, &MEF_VideoSetup, &MEO_NETJOIN_SERVER, String );
4496 hendricks2 1411
#define MAXPORTSTRINGLENGTH 6 // unsigned 16-bit integer
1412
static char MenuPort[MAXPORTSTRINGLENGTH] = "19014";
4778 hendricks2 1413
static MenuString_t MEO_NETJOIN_PORT = MAKE_MENUSTRING( MenuPort, &MF_Bluefont, MAXPORTSTRINGLENGTH, INPUT_NUMERIC );
1414
static MenuEntry_t ME_NETJOIN_PORT = MAKE_MENUENTRY( "Port", &MF_Redfont, &MEF_VideoSetup, &MEO_NETJOIN_PORT, String );
6207 hendricks2 1415
static MenuEntry_t ME_NETJOIN_CONNECT = MAKE_MENUENTRY( "Connect", &MF_Redfont, &MEF_VideoSetup_Apply, &MEO_NULL, Link );
471 terminx 1416
 
4496 hendricks2 1417
static MenuEntry_t *MEL_NETJOIN[] = {
1418
    &ME_NETJOIN_SERVER,
1419
    &ME_NETJOIN_PORT,
1420
    &ME_NETJOIN_CONNECT,
1421
};
5 Plagman 1422
 
1423
 
4496 hendricks2 1424
#define NoTitle NULL
91 terminx 1425
 
5693 hendricks2 1426
#define MAKE_MENUMENU(Title, Format, Entries) { Title, Format, Entries, ARRAY_SIZE(Entries), 0, 0, 0 }
6569 hendricks2 1427
#define MAKE_MENUMENU_CUSTOMSIZE(Title, Format, Entries) { Title, Format, Entries, 0, 0, 0, 0 }
91 terminx 1428
 
4778 hendricks2 1429
static MenuMenu_t M_MAIN = MAKE_MENUMENU( NoTitle, &MMF_Top_Main, MEL_MAIN );
1430
static MenuMenu_t M_MAIN_INGAME = MAKE_MENUMENU( NoTitle, &MMF_Top_Main, MEL_MAIN_INGAME );
1431
static MenuMenu_t M_EPISODE = MAKE_MENUMENU( "Select An Episode", &MMF_Top_Episode, MEL_EPISODE );
1432
static MenuMenu_t M_SKILL = MAKE_MENUMENU( "Select Skill", &MMF_Top_Skill, MEL_SKILL );
7930 hendricks2 1433
static MenuMenu_t M_NEWGAMECUSTOM = MAKE_MENUMENU( s_NewGame, &MMF_Top_NewGameCustom, MEL_NEWGAMECUSTOM );
1434
static MenuMenu_t M_NEWGAMECUSTOMSUB = MAKE_MENUMENU( s_NewGame, &MMF_Top_NewGameCustomSub, MEL_NEWGAMECUSTOMSUB );
8569 terminx 1435
#ifndef EDUKE32_RETAIL_MENU
4778 hendricks2 1436
static MenuMenu_t M_GAMESETUP = MAKE_MENUMENU( "Game Setup", &MMF_BigOptions, MEL_GAMESETUP );
6411 terminx 1437
#endif
6329 hendricks2 1438
static MenuMenu_t M_OPTIONS = MAKE_MENUMENU( s_Options, &MMF_Top_Options, MEL_OPTIONS );
4778 hendricks2 1439
static MenuMenu_t M_VIDEOSETUP = MAKE_MENUMENU( "Video Mode", &MMF_BigOptions, MEL_VIDEOSETUP );
1440
static MenuMenu_t M_KEYBOARDSETUP = MAKE_MENUMENU( "Keyboard Setup", &MMF_Top_Options, MEL_KEYBOARDSETUP );
7959 hendricks2 1441
static MenuMenu_t M_CONTROLS = MAKE_MENUMENU( "Control Setup", &MMF_BigOptions, MEL_CONTROLS );
5084 hendricks2 1442
static MenuMenu_t M_CHEATS = MAKE_MENUMENU( "Cheats", &MMF_SmallOptions, MEL_CHEATS );
4778 hendricks2 1443
static MenuMenu_t M_MOUSESETUP = MAKE_MENUMENU( "Mouse Setup", &MMF_BigOptions, MEL_MOUSESETUP );
6013 terminx 1444
#ifdef EDUKE32_ANDROID_MENU
5652 terminx 1445
static MenuMenu_t M_TOUCHSETUP = MAKE_MENUMENU( "Touch Setup", &MMF_Top_Options, MEL_TOUCHSETUP );
1446
static MenuMenu_t M_TOUCHSENS = MAKE_MENUMENU( "Sensitivity", &MMF_BigOptions, MEL_TOUCHSENS);
6061 hendricks2 1447
static MenuPanel_t M_TOUCHBUTTONS = { "Button Setup", MENU_TOUCHSETUP, MA_Return, MENU_TOUCHSETUP, MA_Advance, };
4993 terminx 1448
#endif
7972 hendricks2 1449
static MenuMenu_t M_JOYSTICKSETUP = MAKE_MENUMENU( "Gamepad Setup", &MMF_BigOptions, MEL_JOYSTICKSETUP );
1450
static MenuMenu_t M_JOYSTICKBTNS = MAKE_MENUMENU( "Gamepad Buttons", &MMF_MouseJoySetupBtns, MEL_JOYSTICKBTNS );
1451
static MenuMenu_t M_JOYSTICKAXES = MAKE_MENUMENU( "Gamepad Axes", &MMF_BigSliders, MEL_JOYSTICKAXES );
6324 terminx 1452
static MenuMenu_t M_KEYBOARDKEYS = MAKE_MENUMENU( "Key Configuration", &MMF_KeyboardSetupFuncs, MEL_KEYBOARDSETUPFUNCS );
4778 hendricks2 1453
static MenuMenu_t M_MOUSEBTNS = MAKE_MENUMENU( "Mouse Buttons", &MMF_MouseJoySetupBtns, MEL_MOUSESETUPBTNS );
1454
static MenuMenu_t M_JOYSTICKAXIS = MAKE_MENUMENU( NULL, &MMF_BigSliders, MEL_JOYSTICKAXIS );
4609 terminx 1455
#ifdef USE_OPENGL
5408 terminx 1456
static MenuMenu_t M_RENDERERSETUP_POLYMOST = MAKE_MENUMENU( "Polymost Setup", &MMF_SmallOptions, MEL_RENDERERSETUP_POLYMOST );
5424 helixhorne 1457
# ifdef POLYMER
5408 terminx 1458
static MenuMenu_t M_RENDERERSETUP_POLYMER = MAKE_MENUMENU("Polymer Setup", &MMF_SmallOptions, MEL_RENDERERSETUP_POLYMER );
5424 helixhorne 1459
# endif
4609 terminx 1460
#endif
4778 hendricks2 1461
static MenuMenu_t M_COLCORR = MAKE_MENUMENU( "Color Correction", &MMF_ColorCorrect, MEL_COLCORR );
6289 hendricks2 1462
static MenuMenu_t M_SCREENSETUP = MAKE_MENUMENU( "HUD Setup", &MMF_BigOptions, MEL_SCREENSETUP );
4778 hendricks2 1463
static MenuMenu_t M_DISPLAYSETUP = MAKE_MENUMENU( "Display Setup", &MMF_BigOptions, MEL_DISPLAYSETUP );
6569 hendricks2 1464
static MenuMenu_t M_LOAD = MAKE_MENUMENU_CUSTOMSIZE( s_LoadGame, &MMF_LoadSave, MEL_LOAD );
1465
static MenuMenu_t M_SAVE = MAKE_MENUMENU_CUSTOMSIZE( s_SaveGame, &MMF_LoadSave, MEL_SAVE );
4778 hendricks2 1466
static MenuMenu_t M_SOUND = MAKE_MENUMENU( "Sound Setup", &MMF_BigOptions, MEL_SOUND );
8760 terminx 1467
static MenuMenu_t M_SOUND_DEVSETUP = MAKE_MENUMENU( "Device Configuration", &MMF_BigOptions, MEL_SOUND_DEVSETUP );
6742 hendricks2 1468
static MenuMenu_t M_SAVESETUP = MAKE_MENUMENU( "Save Setup", &MMF_BigOptions, MEL_SAVESETUP );
4778 hendricks2 1469
static MenuMenu_t M_NETWORK = MAKE_MENUMENU( "Network Game", &MMF_Top_Joystick_Network, MEL_NETWORK );
1470
static MenuMenu_t M_PLAYER = MAKE_MENUMENU( "Player Setup", &MMF_SmallOptions, MEL_PLAYER );
1471
static MenuMenu_t M_MACROS = MAKE_MENUMENU( "Multiplayer Macros", &MMF_Macros, MEL_MACROS );
1472
static MenuMenu_t M_NETHOST = MAKE_MENUMENU( "Host Network Game", &MMF_SmallOptionsNarrow, MEL_NETHOST );
1473
static MenuMenu_t M_NETOPTIONS = MAKE_MENUMENU( "Net Game Options", &MMF_NetSetup, MEL_NETOPTIONS );
1474
static MenuMenu_t M_NETJOIN = MAKE_MENUMENU( "Join Network Game", &MMF_SmallOptionsNarrow, MEL_NETJOIN );
88 terminx 1475
 
8569 terminx 1476
#ifdef EDUKE32_RETAIL_MENU
4688 hendricks2 1477
static MenuPanel_t M_STORY = { NoTitle, MENU_STORY, MA_Return, MENU_STORY, MA_Advance, };
4609 terminx 1478
#else
4688 hendricks2 1479
static MenuPanel_t M_STORY = { NoTitle, MENU_F1HELP, MA_Return, MENU_F1HELP, MA_Advance, };
4609 terminx 1480
#endif
1481
 
4688 hendricks2 1482
static MenuPanel_t M_F1HELP = { NoTitle, MENU_STORY, MA_Return, MENU_STORY, MA_Advance, };
1483
static MenuPanel_t M_CREDITS = { NoTitle, MENU_CREDITS5, MA_Return, MENU_CREDITS2, MA_Advance, };
1484
static MenuPanel_t M_CREDITS2 = { NoTitle, MENU_CREDITS, MA_Return, MENU_CREDITS3, MA_Advance, };
1485
static MenuPanel_t M_CREDITS3 = { NoTitle, MENU_CREDITS2, MA_Return, MENU_CREDITS4, MA_Advance, };
6013 terminx 1486
static MenuPanel_t M_CREDITS4 = { "About " APPNAME, MENU_CREDITS3, MA_Return, MENU_CREDITS5, MA_Advance, };
1487
static MenuPanel_t M_CREDITS5 = { "About " APPNAME, MENU_CREDITS4, MA_Return, MENU_CREDITS, MA_Advance, };
5 Plagman 1488
 
4686 hendricks2 1489
#define CURSOR_CENTER_2LINE { MENU_MARGIN_CENTER<<16, 120<<16, }
1490
#define CURSOR_CENTER_3LINE { MENU_MARGIN_CENTER<<16, 129<<16, }
4496 hendricks2 1491
#define CURSOR_BOTTOMRIGHT { 304<<16, 186<<16, }
5 Plagman 1492
 
6756 hendricks2 1493
static MenuVerify_t M_SAVECLEANVERIFY = { CURSOR_CENTER_3LINE, MENU_SAVESETUP, MA_None, };
8114 terminx 1494
static MenuVerify_t M_RESETSTATSVERIFY = { CURSOR_CENTER_3LINE, MENU_SAVESETUP, MA_None, };
4688 hendricks2 1495
static MenuVerify_t M_QUIT = { CURSOR_CENTER_2LINE, MENU_CLOSE, MA_None, };
1496
static MenuVerify_t M_QUITTOTITLE = { CURSOR_CENTER_2LINE, MENU_CLOSE, MA_None, };
1497
static MenuVerify_t M_LOADVERIFY = { CURSOR_CENTER_3LINE, MENU_CLOSE, MA_None, };
6756 hendricks2 1498
static MenuVerify_t M_LOADDELVERIFY = { CURSOR_CENTER_3LINE, MENU_LOAD, MA_None, };
4688 hendricks2 1499
static MenuVerify_t M_NEWVERIFY = { CURSOR_CENTER_2LINE, MENU_EPISODE, MA_Advance, };
1500
static MenuVerify_t M_SAVEVERIFY = { CURSOR_CENTER_2LINE, MENU_SAVE, MA_None, };
6750 hendricks2 1501
static MenuVerify_t M_SAVEDELVERIFY = { CURSOR_CENTER_3LINE, MENU_SAVE, MA_None, };
4688 hendricks2 1502
static MenuVerify_t M_RESETPLAYER = { CURSOR_CENTER_3LINE, MENU_CLOSE, MA_None, };
5 Plagman 1503
 
7971 hendricks2 1504
static MenuVerify_t M_COLCORRRESETVERIFY = { CURSOR_CENTER_2LINE, MENU_COLCORR, MA_None, };
1505
static MenuVerify_t M_KEYSRESETVERIFY = { CURSOR_CENTER_2LINE, MENU_KEYBOARDSETUP, MA_None, };
1506
static MenuVerify_t M_KEYSCLASSICVERIFY = { CURSOR_CENTER_2LINE, MENU_KEYBOARDSETUP, MA_None, };
1507
static MenuVerify_t M_JOYSTANDARDVERIFY = { CURSOR_CENTER_2LINE, MENU_JOYSTICKSETUP, MA_None, };
1508
static MenuVerify_t M_JOYPROVERIFY = { CURSOR_CENTER_2LINE, MENU_JOYSTICKSETUP, MA_None, };
1509
static MenuVerify_t M_JOYCLEARVERIFY = { CURSOR_CENTER_2LINE, MENU_JOYSTICKSETUP, MA_None, };
1510
 
4688 hendricks2 1511
static MenuMessage_t M_NETWAITMASTER = { CURSOR_BOTTOMRIGHT, MENU_NULL, MA_None, };
1512
static MenuMessage_t M_NETWAITVOTES = { CURSOR_BOTTOMRIGHT, MENU_NULL, MA_None, };
1513
static MenuMessage_t M_BUYDUKE = { CURSOR_BOTTOMRIGHT, MENU_EPISODE, MA_Return, };
5 Plagman 1514
 
5083 hendricks2 1515
static MenuTextForm_t M_ADULTPASSWORD = { NULL, "Enter Password:", MAXPWLOCKOUT, MTF_Password };
5084 hendricks2 1516
static MenuTextForm_t M_CHEATENTRY = { NULL, "Enter Cheat Code:", MAXCHEATLEN, 0 };
1517
static MenuTextForm_t M_CHEAT_WARP = { NULL, "Enter Warp #:", 3, 0 };
1518
static MenuTextForm_t M_CHEAT_SKILL = { NULL, "Enter Skill #:", 1, 0 };
5 Plagman 1519
 
7999 hendricks2 1520
#define MAKE_MENUFILESELECT(a, dir, b, c) { a, { &MMF_FileSelectLeft, &MMF_FileSelectRight }, { &MF_Minifont, &MF_Minifont }, dir, b, c, { NULL, NULL }, { 0, 0 }, { 3<<16, 3<<16 }, FNLIST_INITIALIZER, 0 }
337 terminx 1521
 
7999 hendricks2 1522
static MenuFileSelect_t M_USERMAP = MAKE_MENUFILESELECT( "Select A User Map", "./usermaps/", "*.map", boardfilename );
337 terminx 1523
 
8760 terminx 1524
static MenuFileSelect_t M_SOUND_SF2 = MAKE_MENUFILESELECT( "Select Sound Bank", "./", "*.sf2", sf2bankfile);
1525
 
4496 hendricks2 1526
// MUST be in ascending order of MenuID enum values due to binary search
1527
static Menu_t Menus[] = {
4778 hendricks2 1528
    { &M_MAIN, MENU_MAIN, MENU_CLOSE, MA_None, Menu },
1529
    { &M_MAIN_INGAME, MENU_MAIN_INGAME, MENU_CLOSE, MA_None, Menu },
1530
    { &M_EPISODE, MENU_EPISODE, MENU_MAIN, MA_Return, Menu },
8501 hendricks2 1531
    { &M_USERMAP, MENU_USERMAP, MENU_EPISODE, MA_Return, FileSelect },
7930 hendricks2 1532
    { &M_NEWGAMECUSTOM, MENU_NEWGAMECUSTOM, MENU_MAIN, MA_Return, Menu },
1533
    { &M_NEWGAMECUSTOMSUB, MENU_NEWGAMECUSTOMSUB, MENU_NEWGAMECUSTOM, MA_Return, Menu },
1534
    { &M_SKILL, MENU_SKILL, MENU_PREVIOUS, MA_Return, Menu },
8569 terminx 1535
#ifndef EDUKE32_RETAIL_MENU
4778 hendricks2 1536
    { &M_GAMESETUP, MENU_GAMESETUP, MENU_OPTIONS, MA_Return, Menu },
6411 terminx 1537
#endif
4778 hendricks2 1538
    { &M_OPTIONS, MENU_OPTIONS, MENU_MAIN, MA_Return, Menu },
1539
    { &M_VIDEOSETUP, MENU_VIDEOSETUP, MENU_DISPLAYSETUP, MA_Return, Menu },
1540
    { &M_KEYBOARDSETUP, MENU_KEYBOARDSETUP, MENU_CONTROLS, MA_Return, Menu },
1541
    { &M_MOUSESETUP, MENU_MOUSESETUP, MENU_CONTROLS, MA_Return, Menu },
1542
    { &M_JOYSTICKSETUP, MENU_JOYSTICKSETUP, MENU_CONTROLS, MA_Return, Menu },
1543
    { &M_JOYSTICKBTNS, MENU_JOYSTICKBTNS, MENU_JOYSTICKSETUP, MA_Return, Menu },
1544
    { &M_JOYSTICKAXES, MENU_JOYSTICKAXES, MENU_JOYSTICKSETUP, MA_Return, Menu },
1545
    { &M_KEYBOARDKEYS, MENU_KEYBOARDKEYS, MENU_KEYBOARDSETUP, MA_Return, Menu },
1546
    { &M_MOUSEBTNS, MENU_MOUSEBTNS, MENU_MOUSESETUP, MA_Return, Menu },
1547
    { &M_JOYSTICKAXIS, MENU_JOYSTICKAXIS, MENU_JOYSTICKAXES, MA_Return, Menu },
6013 terminx 1548
#ifdef EDUKE32_ANDROID_MENU
4993 terminx 1549
    { &M_TOUCHSETUP, MENU_TOUCHSETUP, MENU_OPTIONS, MA_Return, Menu },
5652 terminx 1550
    { &M_TOUCHSENS, MENU_TOUCHSENS, MENU_TOUCHSETUP, MA_Return, Menu },
5661 terminx 1551
    { &M_TOUCHBUTTONS, MENU_TOUCHBUTTONS, MENU_TOUCHSETUP, MA_Return, Panel },
4993 terminx 1552
#endif
4778 hendricks2 1553
    { &M_CONTROLS, MENU_CONTROLS, MENU_OPTIONS, MA_Return, Menu },
4609 terminx 1554
#ifdef USE_OPENGL
5408 terminx 1555
    { &M_RENDERERSETUP_POLYMOST, MENU_POLYMOST, MENU_DISPLAYSETUP, MA_Return, Menu },
4609 terminx 1556
#endif
4778 hendricks2 1557
    { &M_COLCORR, MENU_COLCORR, MENU_DISPLAYSETUP, MA_Return, Menu },
1558
    { &M_COLCORR, MENU_COLCORR_INGAME, MENU_CLOSE, MA_Return, Menu },
1559
    { &M_SCREENSETUP, MENU_SCREENSETUP, MENU_DISPLAYSETUP, MA_Return, Menu },
1560
    { &M_DISPLAYSETUP, MENU_DISPLAYSETUP, MENU_OPTIONS, MA_Return, Menu },
5408 terminx 1561
#ifdef POLYMER
5424 helixhorne 1562
    { &M_RENDERERSETUP_POLYMER, MENU_POLYMER, MENU_DISPLAYSETUP, MA_Return, Menu },
5408 terminx 1563
#endif
4778 hendricks2 1564
    { &M_LOAD, MENU_LOAD, MENU_MAIN, MA_Return, Menu },
1565
    { &M_SAVE, MENU_SAVE, MENU_MAIN, MA_Return, Menu },
1566
    { &M_STORY, MENU_STORY, MENU_MAIN, MA_Return, Panel },
1567
    { &M_F1HELP, MENU_F1HELP, MENU_MAIN, MA_Return, Panel },
1568
    { &M_QUIT, MENU_QUIT, MENU_PREVIOUS, MA_Return, Verify },
1569
    { &M_QUITTOTITLE, MENU_QUITTOTITLE, MENU_PREVIOUS, MA_Return, Verify },
1570
    { &M_QUIT, MENU_QUIT_INGAME, MENU_CLOSE, MA_None, Verify },
1571
    { &M_NETHOST, MENU_NETSETUP, MENU_MAIN, MA_Return, Menu },
1572
    { &M_NETWAITMASTER, MENU_NETWAITMASTER, MENU_MAIN, MA_Return, Message },
1573
    { &M_NETWAITVOTES, MENU_NETWAITVOTES, MENU_MAIN, MA_Return, Message },
1574
    { &M_SOUND, MENU_SOUND, MENU_OPTIONS, MA_Return, Menu },
1575
    { &M_SOUND, MENU_SOUND_INGAME, MENU_CLOSE, MA_Return, Menu },
8760 terminx 1576
    { &M_SOUND_DEVSETUP, MENU_SOUND_DEVSETUP, MENU_SOUND, MA_Return, Menu },
8764 terminx 1577
#ifndef EDUKE32_RETAIL_MENU
8760 terminx 1578
    { &M_SOUND_SF2, MENU_SOUND_SF2, MENU_SOUND_DEVSETUP, MA_Return, FileSelect },
8764 terminx 1579
#endif
6742 hendricks2 1580
    { &M_SAVESETUP, MENU_SAVESETUP, MENU_OPTIONS, MA_Return, Menu },
6750 hendricks2 1581
    { &M_SAVECLEANVERIFY, MENU_SAVECLEANVERIFY, MENU_SAVESETUP, MA_None, Verify },
8114 terminx 1582
    { &M_RESETSTATSVERIFY, MENU_RESETSTATSVERIFY, MENU_SAVESETUP, MA_None, Verify },
8569 terminx 1583
#ifdef EDUKE32_RETAIL_MENU
6409 terminx 1584
    { &M_CHEATS, MENU_CHEATS, MENU_OPTIONS, MA_Return, Menu },
1585
#else
5517 hendricks2 1586
    { &M_CHEATS, MENU_CHEATS, MENU_GAMESETUP, MA_Return, Menu },
6409 terminx 1587
#endif
5084 hendricks2 1588
    { &M_CHEATENTRY, MENU_CHEATENTRY, MENU_CHEATS, MA_None, TextForm },
1589
    { &M_CHEAT_WARP, MENU_CHEAT_WARP, MENU_CHEATS, MA_None, TextForm },
1590
    { &M_CHEAT_SKILL, MENU_CHEAT_SKILL, MENU_CHEATS, MA_None, TextForm },
4778 hendricks2 1591
    { &M_CREDITS, MENU_CREDITS, MENU_MAIN, MA_Return, Panel },
1592
    { &M_CREDITS2, MENU_CREDITS2, MENU_MAIN, MA_Return, Panel },
1593
    { &M_CREDITS3, MENU_CREDITS3, MENU_MAIN, MA_Return, Panel },
1594
    { &M_CREDITS4, MENU_CREDITS4, MENU_MAIN, MA_Return, Panel },
1595
    { &M_CREDITS5, MENU_CREDITS5, MENU_MAIN, MA_Return, Panel },
1596
    { &M_LOADVERIFY, MENU_LOADVERIFY, MENU_LOAD, MA_None, Verify },
6750 hendricks2 1597
    { &M_LOADDELVERIFY, MENU_LOADDELVERIFY, MENU_LOAD, MA_None, Verify },
1598
    { &M_NEWVERIFY, MENU_NEWVERIFY, MENU_PREVIOUS, MA_Return, Verify },
4778 hendricks2 1599
    { &M_SAVEVERIFY, MENU_SAVEVERIFY, MENU_SAVE, MA_None, Verify },
6750 hendricks2 1600
    { &M_SAVEDELVERIFY, MENU_SAVEDELVERIFY, MENU_SAVE, MA_None, Verify },
7971 hendricks2 1601
    { &M_COLCORRRESETVERIFY, MENU_COLCORRRESETVERIFY, MENU_COLCORR, MA_None, Verify },
1602
    { &M_KEYSRESETVERIFY, MENU_KEYSRESETVERIFY, MENU_KEYBOARDSETUP, MA_None, Verify },
1603
    { &M_KEYSCLASSICVERIFY, MENU_KEYSCLASSICVERIFY, MENU_KEYBOARDSETUP, MA_None, Verify },
1604
    { &M_JOYSTANDARDVERIFY, MENU_JOYSTANDARDVERIFY, MENU_JOYSTICKSETUP, MA_None, Verify },
1605
    { &M_JOYPROVERIFY, MENU_JOYPROVERIFY, MENU_JOYSTICKSETUP, MA_None, Verify },
1606
    { &M_JOYCLEARVERIFY, MENU_JOYCLEARVERIFY, MENU_JOYSTICKSETUP, MA_None, Verify },
5083 hendricks2 1607
    { &M_ADULTPASSWORD, MENU_ADULTPASSWORD, MENU_GAMESETUP, MA_None, TextForm },
4778 hendricks2 1608
    { &M_RESETPLAYER, MENU_RESETPLAYER, MENU_CLOSE, MA_None, Verify },
1609
    { &M_BUYDUKE, MENU_BUYDUKE, MENU_EPISODE, MA_Return, Message },
1610
    { &M_NETWORK, MENU_NETWORK, MENU_MAIN, MA_Return, Menu },
1611
    { &M_PLAYER, MENU_PLAYER, MENU_OPTIONS, MA_Return, Menu },
1612
    { &M_MACROS, MENU_MACROS, MENU_PLAYER, MA_Return, Menu },
1613
    { &M_NETHOST, MENU_NETHOST, MENU_NETWORK, MA_Return, Menu },
1614
    { &M_NETOPTIONS, MENU_NETOPTIONS, MENU_NETWORK, MA_Return, Menu },
1615
    { &M_USERMAP, MENU_NETUSERMAP, MENU_NETOPTIONS, MA_Return, FileSelect },
1616
    { &M_NETJOIN, MENU_NETJOIN, MENU_NETWORK, MA_Return, Menu },
4496 hendricks2 1617
};
337 terminx 1618
 
7114 terminx 1619
static CONSTEXPR const uint16_t numMenus = ARRAY_SIZE(Menus);
337 terminx 1620
 
4496 hendricks2 1621
Menu_t *m_currentMenu = &Menus[0];
1622
static Menu_t *m_previousMenu = &Menus[0];
6289 hendricks2 1623
static Menu_t * m_parentMenu;
5 Plagman 1624
 
4496 hendricks2 1625
MenuID_t g_currentMenu;
1626
static MenuID_t g_previousMenu;
337 terminx 1627
 
4778 hendricks2 1628
#define MenuMenu_ChangeEntryList(m, el)\
4496 hendricks2 1629
    do {\
4778 hendricks2 1630
        m.entrylist = el;\
1631
        m.numEntries = ARRAY_SIZE(el);\
4496 hendricks2 1632
    } while (0)
5 Plagman 1633
 
4855 hendricks2 1634
static void MenuEntry_DisableOnCondition(MenuEntry_t * const entry, const int32_t condition)
1635
{
1636
    if (condition)
6204 hendricks2 1637
        entry->flags |= MEF_Disabled;
4855 hendricks2 1638
    else
6204 hendricks2 1639
        entry->flags &= ~MEF_Disabled;
4855 hendricks2 1640
}
6329 hendricks2 1641
static void MenuEntry_LookDisabledOnCondition(MenuEntry_t * const entry, const int32_t condition)
1642
{
1643
    if (condition)
1644
        entry->flags |= MEF_LookDisabled;
1645
    else
1646
        entry->flags &= ~MEF_LookDisabled;
1647
}
6676 hendricks2 1648
static void MenuEntry_HideOnCondition(MenuEntry_t * const entry, const int32_t condition)
1649
{
1650
    if (condition)
1651
        entry->flags |= MEF_Hidden;
1652
    else
1653
        entry->flags &= ~MEF_Hidden;
1654
}
5 Plagman 1655
 
8499 hendricks2 1656
static int32_t M_RunMenu_Menu(Menu_t *cm, MenuMenu_t *menu, MenuEntry_t *currentry, int32_t state, vec2_t origin, int actually_draw = 1);
6569 hendricks2 1657
static void Menu_EntryFocus(/*MenuEntry_t *entry*/);
1658
 
1659
static MenuEntry_t *Menu_AdjustForCurrentEntryAssignment(MenuMenu_t *menu)
1660
{
1661
    MenuEntry_t *currentry = menu->entrylist[menu->currentEntry];
1662
 
1663
    Menu_EntryFocus(/*currentry*/);
1664
 
1665
    if (currentry->ybottom - menu->scrollPos > klabs(menu->format->bottomcutoff))
1666
        menu->scrollPos = currentry->ybottom - klabs(menu->format->bottomcutoff);
1667
    else if (currentry->ytop - menu->scrollPos < menu->format->pos.y)
1668
        menu->scrollPos = currentry->ytop - menu->format->pos.y;
1669
 
1670
    return currentry;
1671
}
1672
 
1673
static MenuEntry_t *Menu_AdjustForCurrentEntryAssignmentBlind(MenuMenu_t *menu)
1674
{
8499 hendricks2 1675
    M_RunMenu_Menu(nullptr, menu, nullptr, 0, { 0, 0 }, 0);
6569 hendricks2 1676
    return Menu_AdjustForCurrentEntryAssignment(menu);
1677
}
1678
 
6751 hendricks2 1679
static int32_t SELECTDIR_z = 65536;
1680
 
7930 hendricks2 1681
void Menu_PopulateNewGameCustom(void)
1682
{
1683
    M_NEWGAMECUSTOM.title = s_NewGame;
1684
 
1685
    int e = 0;
1686
    for (MenuGameplayStemEntry const & stem : g_MenuGameplayEntries)
1687
    {
1688
        MenuGameplayEntry const & entry = stem.entry;
1689
        if (!entry.isValid())
1690
            break;
1691
 
1692
        MEL_NEWGAMECUSTOM[e] = &ME_NEWGAMECUSTOMENTRIES[e];
1693
 
1694
        ++e;
1695
    }
1696
    M_NEWGAMECUSTOM.numEntries = e;
1697
    MMF_Top_NewGameCustom.pos.y = (58 + (3-e)*6)<<16;
1698
}
1699
 
1700
void Menu_PopulateNewGameCustomSub(int e)
1701
{
1702
    if ((unsigned)e >= MAXMENUGAMEPLAYENTRIES)
1703
        return;
1704
 
1705
    MenuGameplayStemEntry const & stem = g_MenuGameplayEntries[e];
1706
    MenuGameplayEntry const & entry = stem.entry;
1707
    if (!entry.isValid())
1708
        return;
1709
 
1710
    M_NEWGAMECUSTOMSUB.title = entry.name;
1711
 
1712
    int s = 0;
1713
    for (MenuGameplayEntry const & subentry : stem.subentries)
1714
    {
1715
        if (!subentry.isValid())
1716
            break;
1717
 
1718
        MEL_NEWGAMECUSTOMSUB[s] = &ME_NEWGAMECUSTOMSUBENTRIES[e][s];
1719
 
1720
        ++s;
1721
    }
1722
    M_NEWGAMECUSTOMSUB.numEntries = s;
1723
    MMF_Top_NewGameCustomSub.pos.y = (58 + (3-s)*6)<<16;
1724
}
1725
 
4496 hendricks2 1726
/*
1727
This function prepares data after ART and CON have been processed.
1728
It also initializes some data in loops rather than statically at compile time.
1729
*/
5923 terminx 1730
void Menu_Init(void)
4496 hendricks2 1731
{
1732
    int32_t i, j, k;
5 Plagman 1733
 
8017 terminx 1734
    if (FURY)
1735
    {
1736
        MMF_Top_Skill.pos.x = (320<<15);
1737
        ME_SKILL_TEMPLATE.format = &MEF_LeftMenu;
1738
    }
1739
 
4496 hendricks2 1740
    // prepare menu fonts
6613 hendricks2 1741
    // check if tilenum is -1 in case it was set in EVENT_SETDEFAULTS
1742
    if ((unsigned)MF_Redfont.tilenum >= MAXTILES) MF_Redfont.tilenum = BIGALPHANUM;
1743
    if ((unsigned)MF_Bluefont.tilenum >= MAXTILES) MF_Bluefont.tilenum = STARTALPHANUM;
1744
    if ((unsigned)MF_Minifont.tilenum >= MAXTILES) MF_Minifont.tilenum = MINIFONT;
1745
    MF_Redfont.emptychar.y = tilesiz[MF_Redfont.tilenum].y<<16;
1746
    MF_Bluefont.emptychar.y = tilesiz[MF_Bluefont.tilenum].y<<16;
1747
    MF_Minifont.emptychar.y = tilesiz[MF_Minifont.tilenum].y<<16;
4496 hendricks2 1748
    if (!minitext_lowercase)
1749
        MF_Minifont.textflags |= TEXT_UPPERCASE;
5 Plagman 1750
 
4496 hendricks2 1751
    // prepare gamefuncs and keys
6185 hendricks2 1752
    MEOSN_Gamefuncs[0] = MenuGameFuncNone;
1753
    MEOSV_Gamefuncs[0] = -1;
1754
    k = 1;
4496 hendricks2 1755
    for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
1756
    {
1757
        Bstrcpy(MenuGameFuncs[i], gamefunctions[i]);
5 Plagman 1758
 
4496 hendricks2 1759
        for (j = 0; j < MAXGAMEFUNCLEN; ++j)
1760
            if (MenuGameFuncs[i][j] == '_')
1761
                MenuGameFuncs[i][j] = ' ';
5 Plagman 1762
 
6185 hendricks2 1763
        if (gamefunctions[i][0] != '\0')
1764
        {
1765
            MEOSN_Gamefuncs[k] = MenuGameFuncs[i];
1766
            MEOSV_Gamefuncs[k] = i;
1767
            ++k;
1768
        }
4496 hendricks2 1769
    }
6185 hendricks2 1770
    MEOS_Gamefuncs.numOptions = k;
1771
 
8303 hendricks2 1772
    for (i = 1; i < NUMKEYS-1; ++i)
6827 terminx 1773
        MEOSN_Keys[i] = g_keyNameTable[i];
8303 hendricks2 1774
    MEOSN_Keys[0] = MenuKeyNone;
4496 hendricks2 1775
    MEOSN_Keys[NUMKEYS-1] = MenuKeyNone;
5 Plagman 1776
 
1777
 
4496 hendricks2 1778
    // prepare episodes
5033 hendricks2 1779
    k = 0;
5835 terminx 1780
    for (i = 0; i < g_volumeCnt; ++i)
4496 hendricks2 1781
    {
5835 terminx 1782
        if (g_volumeNames[i][0])
337 terminx 1783
        {
5835 terminx 1784
            if (!(g_volumeFlags[i] & EF_HIDEFROMSP))
5033 hendricks2 1785
            {
1786
                MEL_EPISODE[i] = &ME_EPISODE[i];
1787
                ME_EPISODE[i] = ME_EPISODE_TEMPLATE;
5835 terminx 1788
                ME_EPISODE[i].name = g_volumeNames[i];
5033 hendricks2 1789
            }
4496 hendricks2 1790
 
5041 hendricks2 1791
            // if (!(EpisodeFlags[i] & EF_HIDEFROMMP))
5033 hendricks2 1792
            {
5835 terminx 1793
                MEOSN_NetEpisodes[k] = g_volumeNames[i];
5033 hendricks2 1794
                MEOSV_NetEpisodes[k] = i;
4496 hendricks2 1795
 
5033 hendricks2 1796
                k++;
1797
            }
337 terminx 1798
        }
5 Plagman 1799
 
4496 hendricks2 1800
        // prepare levels
5034 hendricks2 1801
        MEOS_NETOPTIONS_LEVEL[i] = MEOS_NETOPTIONS_LEVEL_TEMPLATE;
4496 hendricks2 1802
        for (j = 0; j < MAXLEVELS; ++j)
337 terminx 1803
        {
5835 terminx 1804
            MEOSN_NetLevels[i][j] = g_mapInfo[MAXLEVELS*i+j].name;
1805
            if (g_mapInfo[i*MAXLEVELS+j].filename != NULL)
4496 hendricks2 1806
                MEOS_NETOPTIONS_LEVEL[i].numOptions = j+1;
337 terminx 1807
        }
4496 hendricks2 1808
        MEOS_NETOPTIONS_LEVEL[i].optionNames = MEOSN_NetLevels[i];
1809
    }
5835 terminx 1810
    M_EPISODE.numEntries = g_volumeCnt+2;
8569 terminx 1811
#if 1 //ifndef EDUKE32_SIMPLE_MENU
6198 hendricks2 1812
    MEL_EPISODE[g_volumeCnt] = &ME_Space4_Redfont;
5835 terminx 1813
    MEL_EPISODE[g_volumeCnt+1] = &ME_EPISODE_USERMAP;
5033 hendricks2 1814
    MEOSN_NetEpisodes[k] = MenuUserMap;
1815
    MEOSV_NetEpisodes[k] = MAXVOLUMES;
6415 terminx 1816
#else
1817
    M_EPISODE.numEntries = g_volumeCnt;
1818
    k--;
1819
#endif
1820
    MEOS_NETOPTIONS_EPISODE.numOptions = k + 1;
5033 hendricks2 1821
    NetEpisode = MEOSV_NetEpisodes[0];
6193 hendricks2 1822
    MMF_Top_Episode.pos.y = (58 + (3-k)*6)<<16;
5835 terminx 1823
    if (g_skillCnt == 0)
4977 hendricks2 1824
        MEO_EPISODE.linkID = MENU_NULL;
6596 hendricks2 1825
    M_EPISODE.currentEntry = ud.default_volume;
5 Plagman 1826
 
7930 hendricks2 1827
    // prepare new game custom :O
1828
    if (g_MenuGameplayEntries[0].entry.isValid())
1829
    {
1830
        MEO_MAIN_NEWGAME.linkID = M_NEWVERIFY.linkID = MENU_NEWGAMECUSTOM;
1831
 
1832
        int e = 0;
1833
        for (MenuGameplayStemEntry const & stem : g_MenuGameplayEntries)
1834
        {
1835
            MenuGameplayEntry const & entry = stem.entry;
1836
            if (!entry.isValid())
1837
                break;
1838
 
1839
            MenuEntry_t & e_me = ME_NEWGAMECUSTOMENTRIES[e];
1840
            e_me = ME_EPISODE_TEMPLATE;
1841
            MenuLink_t & e_meo = MEO_NEWGAMECUSTOM[e];
1842
            e_meo = MEO_NEWGAMECUSTOM_TEMPLATE;
1843
            e_me.entry = &e_meo;
1844
 
1845
            e_me.name = entry.name;
1846
            if (entry.flags & MGE_Locked)
1847
                e_me.flags |= MEF_Disabled;
1848
            if (entry.flags & MGE_Hidden)
1849
                e_me.flags |= MEF_Hidden;
1850
 
1851
            int s = 0;
1852
            for (MenuGameplayEntry const & subentry : stem.subentries)
1853
            {
1854
                if (!subentry.isValid())
1855
                    break;
1856
 
1857
                MenuEntry_t & s_me = ME_NEWGAMECUSTOMSUBENTRIES[e][s];
1858
                s_me = ME_EPISODE_TEMPLATE;
1859
                MenuLink_t & s_meo = MEO_NEWGAMECUSTOMSUB[e][s];
1860
                s_meo = MEO_NEWGAMECUSTOMSUB_TEMPLATE;
1861
                s_me.entry = &s_meo;
1862
 
1863
                s_me.name = subentry.name;
1864
                if (subentry.flags & MGE_Locked)
1865
                    s_me.flags |= MEF_Disabled;
1866
                if (subentry.flags & MGE_Hidden)
1867
                    s_me.flags |= MEF_Hidden;
1868
 
1869
                ++s;
1870
            }
1871
 
7998 hendricks2 1872
            if (entry.flags & MGE_UserContent)
1873
                e_meo.linkID = MENU_USERMAP;
1874
            else if (s == 0)
7930 hendricks2 1875
                e_meo.linkID = MENU_SKILL;
1876
 
1877
            ++e;
1878
        }
1879
 
1880
        Menu_PopulateNewGameCustom();
1881
    }
1882
 
4496 hendricks2 1883
    // prepare skills
1884
    k = -1;
5835 terminx 1885
    for (i = 0; i < g_skillCnt && g_skillNames[i][0]; ++i)
4496 hendricks2 1886
    {
1887
        MEL_SKILL[i] = &ME_SKILL[i];
1888
        ME_SKILL[i] = ME_SKILL_TEMPLATE;
5835 terminx 1889
        ME_SKILL[i].name = g_skillNames[i];
5 Plagman 1890
 
5835 terminx 1891
        MEOSN_NetSkills[i] = g_skillNames[i];
5 Plagman 1892
 
4496 hendricks2 1893
        k = i;
1894
    }
1895
    ++k;
5835 terminx 1896
    M_SKILL.numEntries = g_skillCnt; // k;
1897
    MEOS_NETOPTIONS_MONSTERS.numOptions = g_skillCnt + 1; // k+1;
1898
    MEOSN_NetSkills[g_skillCnt] = MenuSkillNone;
1899
    MMF_Top_Skill.pos.y = (58 + (4-g_skillCnt)*6)<<16;
6596 hendricks2 1900
    M_SKILL.currentEntry = ud.default_skill;
6569 hendricks2 1901
    Menu_AdjustForCurrentEntryAssignmentBlind(&M_SKILL);
5 Plagman 1902
 
4496 hendricks2 1903
    // prepare multiplayer gametypes
1904
    k = -1;
1905
    for (i = 0; i < MAXGAMETYPES; ++i)
5835 terminx 1906
        if (g_gametypeNames[i][0])
4496 hendricks2 1907
        {
5835 terminx 1908
            MEOSN_NetGametypes[i] = g_gametypeNames[i];
4496 hendricks2 1909
            k = i;
1910
        }
1911
    ++k;
1912
    MEOS_NETOPTIONS_GAMETYPE.numOptions = k;
5452 hendricks2 1913
    if (NAM_WW2GI)
1914
        ME_NETOPTIONS_MONSTERS.name = "Enemies";
5 Plagman 1915
 
6676 hendricks2 1916
    // prepare cheats
1917
    for (i = 0; i < NUMCHEATFUNCS; ++i)
1918
        MEL_CHEATS[i+1] = &ME_CheatCodes[i];
1919
 
4496 hendricks2 1920
    // prepare text chat macros
1921
    for (i = 0; i < MAXRIDECULE; ++i)
1922
    {
1923
        MEL_MACROS[i] = &ME_MACROS[i];
1924
        ME_MACROS[i] = ME_MACROS_TEMPLATE;
1925
        ME_MACROS[i].entry = &MEO_MACROS[i];
1926
        MEO_MACROS[i] = MEO_MACROS_TEMPLATE;
5 Plagman 1927
 
4496 hendricks2 1928
        MEO_MACROS[i].variable = ud.ridecule[i];
1929
    }
1930
 
1931
    // prepare input
1932
    for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
1933
    {
6185 hendricks2 1934
        if (MenuGameFuncs[i][0] == '\0')
6350 hendricks2 1935
        {
1936
            MEL_KEYBOARDSETUPFUNCS[i] = NULL;
6185 hendricks2 1937
            continue;
6350 hendricks2 1938
        }
6185 hendricks2 1939
 
6350 hendricks2 1940
        MEL_KEYBOARDSETUPFUNCS[i] = &ME_KEYBOARDSETUPFUNCS[i];
1941
        ME_KEYBOARDSETUPFUNCS[i] = ME_KEYBOARDSETUPFUNCS_TEMPLATE;
1942
        ME_KEYBOARDSETUPFUNCS[i].name = MenuGameFuncs[i];
1943
        ME_KEYBOARDSETUPFUNCS[i].entry = &MEO_KEYBOARDSETUPFUNCS[i];
1944
        MEO_KEYBOARDSETUPFUNCS[i] = MEO_KEYBOARDSETUPFUNCS_TEMPLATE;
1945
        MEO_KEYBOARDSETUPFUNCS[i].column[0] = &ud.config.KeyboardKeys[i][0];
1946
        MEO_KEYBOARDSETUPFUNCS[i].column[1] = &ud.config.KeyboardKeys[i][1];
4496 hendricks2 1947
    }
6350 hendricks2 1948
    M_KEYBOARDKEYS.numEntries = NUMGAMEFUNCTIONS;
4496 hendricks2 1949
    for (i = 0; i < MENUMOUSEFUNCTIONS; ++i)
1950
    {
1951
        MEL_MOUSESETUPBTNS[i] = &ME_MOUSESETUPBTNS[i];
1952
        ME_MOUSESETUPBTNS[i] = ME_MOUSEJOYSETUPBTNS_TEMPLATE;
1953
        ME_MOUSESETUPBTNS[i].name = MenuMouseNames[i];
1954
        ME_MOUSESETUPBTNS[i].entry = &MEO_MOUSESETUPBTNS[i];
1955
        MEO_MOUSESETUPBTNS[i] = MEO_MOUSEJOYSETUPBTNS_TEMPLATE;
1956
        MEO_MOUSESETUPBTNS[i].data = &ud.config.MouseFunctions[MenuMouseDataIndex[i][0]][MenuMouseDataIndex[i][1]];
1957
    }
6827 terminx 1958
    for (i = 0; i < 2*joystick.numButtons + 8*joystick.numHats; ++i)
4496 hendricks2 1959
    {
6827 terminx 1960
        if (i < 2*joystick.numButtons)
337 terminx 1961
        {
4496 hendricks2 1962
            if (i & 1)
6827 terminx 1963
                Bsnprintf(MenuJoystickNames[i], MAXJOYBUTTONSTRINGLENGTH, "Double %s", joyGetName(1, i>>1));
4496 hendricks2 1964
            else
6827 terminx 1965
                Bstrncpy(MenuJoystickNames[i], joyGetName(1, i>>1), MAXJOYBUTTONSTRINGLENGTH);
337 terminx 1966
        }
1967
        else
1968
        {
6827 terminx 1969
            Bsnprintf(MenuJoystickNames[i], MAXJOYBUTTONSTRINGLENGTH, (i & 1) ? "Double Hat %d %s" : "Hat %d %s", ((i - 2*joystick.numButtons)>>3), MenuJoystickHatDirections[((i - 2*joystick.numButtons)>>1) % 4]);
337 terminx 1970
        }
5 Plagman 1971
 
4496 hendricks2 1972
        MEL_JOYSTICKBTNS[i] = &ME_JOYSTICKBTNS[i];
1973
        ME_JOYSTICKBTNS[i] = ME_MOUSEJOYSETUPBTNS_TEMPLATE;
1974
        ME_JOYSTICKBTNS[i].name = MenuJoystickNames[i];
1975
        ME_JOYSTICKBTNS[i].entry = &MEO_JOYSTICKBTNS[i];
1976
        MEO_JOYSTICKBTNS[i] = MEO_MOUSEJOYSETUPBTNS_TEMPLATE;
1977
        MEO_JOYSTICKBTNS[i].data = &ud.config.JoystickFunctions[i>>1][i&1];
4399 hendricks2 1978
    }
6827 terminx 1979
    M_JOYSTICKBTNS.numEntries = 2*joystick.numButtons + 8*joystick.numHats;
1980
    for (i = 0; i < joystick.numAxes; ++i)
4496 hendricks2 1981
    {
1982
        ME_JOYSTICKAXES[i] = ME_JOYSTICKAXES_TEMPLATE;
6827 terminx 1983
        Bstrncpy(MenuJoystickAxes[i], joyGetName(0, i), MAXJOYBUTTONSTRINGLENGTH);
4496 hendricks2 1984
        ME_JOYSTICKAXES[i].name = MenuJoystickAxes[i];
1985
        MEL_JOYSTICKAXES[i] = &ME_JOYSTICKAXES[i];
1986
    }
6827 terminx 1987
    M_JOYSTICKAXES.numEntries = joystick.numAxes;
5 Plagman 1988
 
5452 hendricks2 1989
    // prepare sound setup
6289 hendricks2 1990
#ifndef EDUKE32_STANDALONE
5452 hendricks2 1991
    if (WW2GI)
1992
        ME_SOUND_DUKETALK.name = "GI talk:";
1993
    else if (NAM)
1994
        ME_SOUND_DUKETALK.name = "Grunt talk:";
6289 hendricks2 1995
#endif
5452 hendricks2 1996
 
7808 terminx 1997
    if (FURY)
6289 hendricks2 1998
    {
1999
        MF_Redfont.between.x = 2<<16;
6377 hendricks2 2000
        MF_Redfont.cursorScale = 32768;
2001
        MF_Redfont.zoom = 16384;
6613 hendricks2 2002
        MF_Bluefont.zoom = 16384;
6289 hendricks2 2003
 
6329 hendricks2 2004
        // hack; should swap out pointers
2005
        MF_Minifont = MF_Bluefont;
2006
 
6289 hendricks2 2007
        MMF_Top_Main.pos.x = 40<<16;
2008
        MMF_Top_Main.pos.y = 130<<16;
2009
        MMF_Top_Main.bottomcutoff = 190<<16;
2010
        M_OPTIONS.format = &MMF_Top_Main;
2011
 
2012
        MEF_MainMenu.width = MEF_OptionsMenu.width = -(160<<16);
6335 terminx 2013
        MEF_MainMenu.marginBottom = 7<<16;
6289 hendricks2 2014
 
2015
        M_OPTIONS.title = NoTitle;
6751 hendricks2 2016
 
2017
        SELECTDIR_z = 16384;
6289 hendricks2 2018
    }
2019
 
4496 hendricks2 2020
    // prepare shareware
2021
    if (VOLUMEONE)
2022
    {
2023
        // blue out episodes beyond the first
5835 terminx 2024
        for (i = 1; i < g_volumeCnt; ++i)
337 terminx 2025
        {
4496 hendricks2 2026
            if (MEL_EPISODE[i])
335 terminx 2027
            {
4496 hendricks2 2028
                ME_EPISODE[i].entry = &MEO_EPISODE_SHAREWARE;
6206 hendricks2 2029
                ME_EPISODE[i].flags |= MEF_LookDisabled;
5 Plagman 2030
            }
337 terminx 2031
        }
5835 terminx 2032
        M_EPISODE.numEntries = g_volumeCnt; // remove User Map (and spacer)
4496 hendricks2 2033
        MEOS_NETOPTIONS_EPISODE.numOptions = 1;
4855 hendricks2 2034
        MenuEntry_DisableOnCondition(&ME_NETOPTIONS_EPISODE, 1);
4496 hendricks2 2035
    }
5 Plagman 2036
 
4496 hendricks2 2037
    // prepare pre-Atomic
2038
    if (!VOLUMEALL || !PLUTOPAK)
2039
    {
2040
        // prepare credits
6329 hendricks2 2041
        M_CREDITS.title = M_CREDITS2.title = M_CREDITS3.title = s_Credits;
4496 hendricks2 2042
    }
6612 hendricks2 2043
 
6676 hendricks2 2044
    MenuEntry_HideOnCondition(&ME_MAIN_HELP, G_GetLogoFlags() & LOGO_NOHELP);
8569 terminx 2045
#ifndef EDUKE32_RETAIL_MENU
6676 hendricks2 2046
    MenuEntry_HideOnCondition(&ME_MAIN_CREDITS, G_GetLogoFlags() & LOGO_NOCREDITS);
6612 hendricks2 2047
#endif
4496 hendricks2 2048
}
5 Plagman 2049
 
5923 terminx 2050
static void Menu_Run(Menu_t *cm, vec2_t origin);
5 Plagman 2051
 
2052
 
6569 hendricks2 2053
static void Menu_BlackRectangle(int32_t x, int32_t y, int32_t width, int32_t height, int32_t orientation);
5 Plagman 2054
 
4496 hendricks2 2055
/*
5923 terminx 2056
At present, no true difference is planned between Menu_Pre() and Menu_PreDraw().
4496 hendricks2 2057
They are separate for purposes of organization.
2058
*/
5 Plagman 2059
 
5923 terminx 2060
static void Menu_Pre(MenuID_t cm)
4496 hendricks2 2061
{
2062
    int32_t i;
7776 terminx 2063
    auto ps = g_player[myconnectindex].ps;
5 Plagman 2064
 
4496 hendricks2 2065
    switch (cm)
2066
    {
2067
    case MENU_MAIN_INGAME:
4855 hendricks2 2068
        MenuEntry_DisableOnCondition(&ME_MAIN_SAVEGAME, ud.recstat == 2);
2069
        MenuEntry_DisableOnCondition(&ME_MAIN_QUITTOTITLE, g_netServer || numplayers > 1);
6370 terminx 2070
        fallthrough__;
4496 hendricks2 2071
    case MENU_MAIN:
2072
        if ((g_netServer || ud.multimode > 1) && ud.recstat != 2)
2073
        {
2074
            ME_MAIN_NEWGAME.entry = &MEO_MAIN_NEWGAME_NETWORK;
2075
            ME_MAIN_NEWGAME_INGAME.entry = &MEO_MAIN_NEWGAME_NETWORK;
2076
        }
2077
        else
2078
        {
2079
            ME_MAIN_NEWGAME.entry = &MEO_MAIN_NEWGAME;
2080
            ME_MAIN_NEWGAME_INGAME.entry = &MEO_MAIN_NEWGAME_INGAME;
2081
        }
2082
        break;
4399 hendricks2 2083
 
4496 hendricks2 2084
    case MENU_GAMESETUP:
2085
        MEO_GAMESETUP_DEMOREC.options = (ps->gm&MODE_GAME) ? &MEOS_DemoRec : &MEOS_OffOn;
4855 hendricks2 2086
        MenuEntry_DisableOnCondition(&ME_GAMESETUP_DEMOREC, (ps->gm&MODE_GAME) && ud.m_recstat != 1);
4496 hendricks2 2087
        break;
5 Plagman 2088
 
7961 hendricks2 2089
    case MENU_DISPLAYSETUP:
2090
        MenuEntry_HideOnCondition(&ME_DISPLAYSETUP_VOXELS, !g_haveVoxels);
4496 hendricks2 2091
#ifdef USE_OPENGL
6829 terminx 2092
        if (videoGetRenderMode() == REND_CLASSIC)
4778 hendricks2 2093
            MenuMenu_ChangeEntryList(M_DISPLAYSETUP, MEL_DISPLAYSETUP);
4496 hendricks2 2094
#ifdef POLYMER
6829 terminx 2095
        else if (videoGetRenderMode() == REND_POLYMER)
4778 hendricks2 2096
            MenuMenu_ChangeEntryList(M_DISPLAYSETUP, MEL_DISPLAYSETUP_GL_POLYMER);
4496 hendricks2 2097
#endif
2098
        else
4778 hendricks2 2099
            MenuMenu_ChangeEntryList(M_DISPLAYSETUP, MEL_DISPLAYSETUP_GL);
5 Plagman 2100
 
6587 hendricks2 2101
        MEO_SCREENSETUP_SCREENSIZE.steps = !(ud.statusbarflags & STATUSBAR_NONONE) +
2102
                                           !(ud.statusbarflags & STATUSBAR_NOMODERN) +
2103
                                           !(ud.statusbarflags & STATUSBAR_NOMINI) * (ud.statusbarrange + 1) +
2104
                                           !(ud.statusbarflags & STATUSBAR_NOOVERLAY) +
2105
                                           !(ud.statusbarflags & STATUSBAR_NOFULL) +
2106
                                           !(ud.statusbarflags & STATUSBAR_NOSHRINK) * 14;
6650 hendricks2 2107
        MEO_SCREENSETUP_SCREENSIZE.max = MEO_SCREENSETUP_SCREENSIZE.steps - 1;
7984 hendricks2 2108
        if (MEO_SCREENSETUP_SCREENSIZE.steps <= 2 && !(ud.statusbarflags & STATUSBAR_NONONE))
2109
        {
2110
            ME_SCREENSETUP_SCREENSIZE.entry = &MEO_SCREENSETUP_SCREENSIZE_TWO;
2111
            ME_SCREENSETUP_SCREENSIZE.type = Option;
2112
        }
2113
        else
2114
        {
2115
            ME_SCREENSETUP_SCREENSIZE.entry = &MEO_SCREENSETUP_SCREENSIZE;
2116
            ME_SCREENSETUP_SCREENSIZE.type = RangeInt32;
2117
        }
2118
        MenuEntry_HideOnCondition(&ME_SCREENSETUP_SCREENSIZE, (MEO_SCREENSETUP_SCREENSIZE.steps < 2));
4976 hendricks2 2119
 
6587 hendricks2 2120
        vpsize = !(ud.statusbarflags & STATUSBAR_NONONE) +
2121
                 (ud.screen_size >= 4 && !(ud.statusbarflags & STATUSBAR_NOMODERN)) +
2122
                 (ud.screen_size >= 4 && ud.althud == 0 && !(ud.statusbarflags & STATUSBAR_NOMINI)) * (ud.statusbarcustom + 1) +
2123
                 (ud.screen_size >= 8 && !(ud.statusbarflags & STATUSBAR_NOOVERLAY)) +
2124
                 (ud.screen_size >= 8 && ud.statusbarmode == 0 && !(ud.statusbarflags & STATUSBAR_NOFULL)) +
2125
                 (ud.screen_size > 8 && !(ud.statusbarflags & STATUSBAR_NOSHRINK)) * ((ud.screen_size - 8) >> 2)
2126
                 -1;
2127
 
6940 pogokeen 2128
#ifndef EDUKE32_STANDALONE
7420 terminx 2129
#ifdef TEXFILTER_MENU_OPTIONS
6829 terminx 2130
        if (videoGetRenderMode() != REND_CLASSIC)
4869 hendricks2 2131
        {
6776 pogokeen 2132
            //POGOTODO: allow setting anisotropy again while r_useindexedcolortextures is set when support is added down the line
7420 terminx 2133
            // don't allow setting anisotropy while in POLYMOST and r_useindexedcolortextures is enabled
6829 terminx 2134
            MenuEntry_DisableOnCondition(&ME_DISPLAYSETUP_ANISOTROPY, videoGetRenderMode() == REND_POLYMOST && r_useindexedcolortextures);
6776 pogokeen 2135
 
4609 terminx 2136
            for (i = (int32_t) ARRAY_SIZE(MEOSV_DISPLAYSETUP_ANISOTROPY) - 1; i >= 0; --i)
5 Plagman 2137
            {
4609 terminx 2138
                if (MEOSV_DISPLAYSETUP_ANISOTROPY[i] <= glinfo.maxanisotropy)
4496 hendricks2 2139
                {
4609 terminx 2140
                    MEOS_DISPLAYSETUP_ANISOTROPY.numOptions = i + 1;
4496 hendricks2 2141
                    break;
2142
                }
337 terminx 2143
            }
4869 hendricks2 2144
        }
6940 pogokeen 2145
#endif
7420 terminx 2146
#endif
4850 hendricks2 2147
        break;
5 Plagman 2148
 
5408 terminx 2149
    case MENU_POLYMER:
2150
    case MENU_POLYMOST:
4855 hendricks2 2151
        MenuEntry_DisableOnCondition(&ME_RENDERERSETUP_TEXQUALITY, !usehightile);