Subversion Repositories eduke32

Rev

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

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