Subversion Repositories eduke32

Rev

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

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