Subversion Repositories eduke32

Rev

Rev 4951 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4951 Rev 4966
1
//-------------------------------------------------------------------------
1
//-------------------------------------------------------------------------
2
/*
2
/*
3
Copyright (C) 2010 EDuke32 developers and contributors
3
Copyright (C) 2010 EDuke32 developers and contributors
4

4

5
This file is part of EDuke32.
5
This file is part of EDuke32.
6

6

7
EDuke32 is free software; you can redistribute it and/or
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
8
modify it under the terms of the GNU General Public License version 2
9
as published by the Free Software Foundation.
9
as published by the Free Software Foundation.
10

10

11
This program is distributed in the hope that it will be useful,
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14

14

15
See the GNU General Public License for more details.
15
See the GNU General Public License for more details.
16

16

17
You should have received a copy of the GNU General Public License
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
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
*/
20
*/
21
//-------------------------------------------------------------------------
21
//-------------------------------------------------------------------------
22
22
23
#include "duke3d.h"
23
#include "duke3d.h"
24
#include "renderlayer.h"
24
#include "renderlayer.h"
25
#include "net.h"
25
#include "net.h"
26
#include "player.h"
26
#include "player.h"
27
#include "mouse.h"
27
#include "mouse.h"
28
#include "joystick.h"
28
#include "joystick.h"
29
#include "osd.h"
29
#include "osd.h"
30
#include "osdcmds.h"
30
#include "osdcmds.h"
31
#include "gamedef.h"
31
#include "gamedef.h"
32
#include "gameexec.h"
32
#include "gameexec.h"
33
#include "savegame.h"
33
#include "savegame.h"
34
#include "premap.h"
34
#include "premap.h"
35
#include "demo.h"
35
#include "demo.h"
36
#include "xxhash.h"
36
#include "xxhash.h"
37
#include "common.h"
37
#include "common.h"
38
#include "common_game.h"
38
#include "common_game.h"
39
#include "input.h"
39
#include "input.h"
40
#include "menus.h"
40
#include "menus.h"
41
41
42
#include <sys/stat.h>
42
#include <sys/stat.h>
43
43
44
// common positions
44
// common positions
45
#define MENU_MARGIN_REGULAR 40
45
#define MENU_MARGIN_REGULAR 40
46
#define MENU_MARGIN_WIDE    32
46
#define MENU_MARGIN_WIDE    32
47
#define MENU_MARGIN_CENTER  160
47
#define MENU_MARGIN_CENTER  160
48
#define MENU_HEIGHT_CENTER  100
48
#define MENU_HEIGHT_CENTER  100
49
49
50
int32_t g_skillSoundVoice = -1;
50
int32_t g_skillSoundVoice = -1;
51
51
52
extern int32_t voting;
52
extern int32_t voting;
53
53
54
#define USERMAPENTRYLENGTH 25
54
#define USERMAPENTRYLENGTH 25
55
55
56
#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 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)
57
#define mgametextcenter(x,y,t) G_ScreenText(STARTALPHANUM, (MENU_MARGIN_CENTER<<16) + (x), y, 65536, 0, 0, t, 0, 0, 2|8|16|ROTATESPRITE_FULL16, 0, (5<<16), (8<<16), (-1<<16), (1<<16), TEXT_GAMETEXTNUMHACK|TEXT_XCENTER, 0, 0, xdim-1, ydim-1)
57
#define mgametextcenter(x,y,t) G_ScreenText(STARTALPHANUM, (MENU_MARGIN_CENTER<<16) + (x), y, 65536, 0, 0, t, 0, 0, 2|8|16|ROTATESPRITE_FULL16, 0, (5<<16), (8<<16), (-1<<16), (1<<16), TEXT_GAMETEXTNUMHACK|TEXT_XCENTER, 0, 0, xdim-1, ydim-1)
58
#define mminitext(x,y,t,p) minitext_(x, y, t, 0, p, 2|8|16|ROTATESPRITE_FULL16)
58
#define mminitext(x,y,t,p) minitext_(x, y, t, 0, p, 2|8|16|ROTATESPRITE_FULL16)
59
#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 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)
60
#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)
60
#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)
61
61
62
static void shadowminitext(int32_t x, int32_t y, const char *t, int32_t p)
62
static void shadowminitext(int32_t x, int32_t y, const char *t, int32_t p)
63
{
63
{
64
    int32_t f = 0;
64
    int32_t f = 0;
65
65
66
    if (!minitext_lowercase)
66
    if (!minitext_lowercase)
67
        f |= TEXT_UPPERCASE;
67
        f |= TEXT_UPPERCASE;
68
68
69
    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
    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);
70
}
70
}
71
static void creditsminitext(int32_t x, int32_t y, const char *t, int32_t p)
71
static void creditsminitext(int32_t x, int32_t y, const char *t, int32_t p)
72
{
72
{
73
    int32_t f = TEXT_XCENTER;
73
    int32_t f = TEXT_XCENTER;
74
74
75
    if (!minitext_lowercase)
75
    if (!minitext_lowercase)
76
        f |= TEXT_UPPERCASE;
76
        f |= TEXT_UPPERCASE;
77
77
78
    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
    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);
79
}
79
}
80
80
81
int32_t menutext_(int32_t x, int32_t y, int32_t s, int32_t p, char *t, int32_t bits)
81
int32_t menutext_(int32_t x, int32_t y, int32_t s, int32_t p, char *t, int32_t bits)
82
{
82
{
83
    vec2_t dim;
83
    vec2_t dim;
84
    int32_t f = TEXT_BIGALPHANUM|TEXT_UPPERCASE|TEXT_LITERALESCAPE;
84
    int32_t f = TEXT_BIGALPHANUM|TEXT_UPPERCASE|TEXT_LITERALESCAPE;
85
85
86
    if (!(bits & ROTATESPRITE_FULL16))
86
    if (!(bits & ROTATESPRITE_FULL16))
87
    {
87
    {
88
        x<<=16;
88
        x<<=16;
89
        y<<=16;
89
        y<<=16;
90
    }
90
    }
91
91
92
    if (x == (160<<16))
92
    if (x == (160<<16))
93
        f |= TEXT_XCENTER;
93
        f |= TEXT_XCENTER;
94
94
95
    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);
95
    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);
96
96
97
    if (!(bits & ROTATESPRITE_FULL16))
97
    if (!(bits & ROTATESPRITE_FULL16))
98
        x >>= 16;
98
        x >>= 16;
99
99
100
    return dim.x;
100
    return dim.x;
101
}
101
}
102
102
103
#pragma pack(push,1)
103
#pragma pack(push,1)
104
static savehead_t savehead;
104
static savehead_t savehead;
105
#pragma pack(pop)
105
#pragma pack(pop)
106
106
107
static void M_DrawBackground(const vec2_t origin)
107
static void M_DrawBackground(const vec2_t origin)
108
{
108
{
109
    rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (100<<16), 65536L,0,MENUSCREEN,16,0,10+64);
109
    rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (100<<16), 65536L,0,MENUSCREEN,16,0,10+64);
110
}
110
}
111
111
112
static void M_DrawTopBar(const vec2_t origin)
112
static void M_DrawTopBar(const vec2_t origin)
113
{
113
{
114
    rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (19<<16), 65536L,0,MENUBAR,16,0,10);
114
    rotatesprite_fs(origin.x + (MENU_MARGIN_CENTER<<16), origin.y + (19<<16), 65536L,0,MENUBAR,16,0,10);
115
}
115
}
116
116
117
static void M_DrawTopBarCaption(const char *caption, const vec2_t origin)
117
static void M_DrawTopBarCaption(const char *caption, const vec2_t origin)
118
{
118
{
119
    char *s = Bstrdup(caption), p = Bstrlen(caption)-1;
119
    char *s = Bstrdup(caption), p = Bstrlen(caption)-1;
120
    if (s[p] == ':') s[p] = 0;
120
    if (s[p] == ':') s[p] = 0;
121
    mmenutextcenter(origin.x, origin.y + (24<<16), s);
121
    mmenutextcenter(origin.x, origin.y + (24<<16), s);
122
    Bfree(s);
122
    Bfree(s);
123
}
123
}
124
124
125
extern int32_t g_quitDeadline;
125
extern int32_t g_quitDeadline;
126
126
127
127
128
128
129
129
130
130
131
131
132
132
133
133
134
134
135
135
136
136
137
137
138
138
139
/*
139
/*
140
All MAKE_* macros are generally for the purpose of keeping state initialization
140
All MAKE_* macros are generally for the purpose of keeping state initialization
141
separate from actual data. Alternatively, they can serve to factor out repetitive
141
separate from actual data. Alternatively, they can serve to factor out repetitive
142
stuff and keep the important bits from getting lost to our eyes.
142
stuff and keep the important bits from getting lost to our eyes.
143

143

144
They serve as a stand-in for C++ default value constructors, since we're using C89.
144
They serve as a stand-in for C++ default value constructors, since we're using C89.
145

145

146
Note that I prefer to include a space on the inside of the macro parentheses, since
146
Note that I prefer to include a space on the inside of the macro parentheses, since
147
they effectively stand in for curly braces as struct initializers.
147
they effectively stand in for curly braces as struct initializers.
148
*/
148
*/
149
149
150
150
151
// common font types
151
// common font types
152
// tilenums are set after namesdyn runs
152
// tilenums are set after namesdyn runs
153
static MenuFont_t MF_Null             = { -1, 10,  0,  0,     0,      0,      0,     0, 0 };
153
static MenuFont_t MF_Null             = { -1, 10,  0,  0,     0,      0,      0,     0, 0 };
154
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_Redfont          = { -1, 10,  0,  1, 5<<16, 15<<16,  0<<16, 0<<16, TEXT_BIGALPHANUM | TEXT_UPPERCASE };
155
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_RedfontBlue      = { -1, 10,  1,  1, 5<<16, 15<<16,  0<<16, 0<<16, TEXT_BIGALPHANUM | TEXT_UPPERCASE };
156
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_RedfontGreen     = { -1, 10,  8,  1, 5<<16, 15<<16,  0<<16, 0<<16, TEXT_BIGALPHANUM | TEXT_UPPERCASE };
157
static MenuFont_t MF_Bluefont         = { -1, 10,  0, 16, 5<<16,  7<<16, -1<<16, 0<<16, 0 };
157
static MenuFont_t MF_Bluefont         = { -1, 10,  0, 16, 5<<16,  7<<16, -1<<16, 0<<16, 0 };
158
static MenuFont_t MF_BluefontRed      = { -1, 10, 10, 16, 5<<16,  7<<16, -1<<16, 0<<16, 0 };
158
static MenuFont_t MF_BluefontRed      = { -1, 10, 10, 16, 5<<16,  7<<16, -1<<16, 0<<16, 0 };
159
static MenuFont_t MF_Minifont         = { -1, 10,  0, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0 };
159
static MenuFont_t MF_Minifont         = { -1, 10,  0, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0 };
160
static MenuFont_t MF_MinifontRed      = { -1, 16, 21, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0 };
160
static MenuFont_t MF_MinifontRed      = { -1, 16, 21, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0 };
161
static MenuFont_t MF_MinifontDarkGray = { -1, 10, 13, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0 };
161
static MenuFont_t MF_MinifontDarkGray = { -1, 10, 13, 16, 4<<16,  5<<16,  1<<16, 1<<16, 0 };
162
162
163
163
164
static MenuMenuFormat_t MMF_Top_Main =             { {  MENU_MARGIN_CENTER<<16, 55<<16, }, -170<<16 };
164
static MenuMenuFormat_t MMF_Top_Main =             { {  MENU_MARGIN_CENTER<<16, 55<<16, }, -170<<16 };
165
static MenuMenuFormat_t MMF_Top_Episode =          { {  MENU_MARGIN_CENTER<<16, 48<<16, }, -190<<16 };
165
static MenuMenuFormat_t MMF_Top_Episode =          { {  MENU_MARGIN_CENTER<<16, 48<<16, }, -190<<16 };
166
static MenuMenuFormat_t MMF_Top_Skill =            { {  MENU_MARGIN_CENTER<<16, 58<<16, }, -190<<16 };
166
static MenuMenuFormat_t MMF_Top_Skill =            { {  MENU_MARGIN_CENTER<<16, 58<<16, }, -190<<16 };
167
static MenuMenuFormat_t MMF_Top_Options =          { {  MENU_MARGIN_CENTER<<16, 38<<16, }, -190<<16 };
167
static MenuMenuFormat_t MMF_Top_Options =          { {  MENU_MARGIN_CENTER<<16, 38<<16, }, -190<<16 };
168
static MenuMenuFormat_t MMF_Top_Joystick_Network = { {  MENU_MARGIN_CENTER<<16, 70<<16, }, -190<<16 };
168
static MenuMenuFormat_t MMF_Top_Joystick_Network = { {  MENU_MARGIN_CENTER<<16, 70<<16, }, -190<<16 };
169
static MenuMenuFormat_t MMF_BigOptions =           { {    MENU_MARGIN_WIDE<<16, 38<<16, }, -190<<16 };
169
static MenuMenuFormat_t MMF_BigOptions =           { {    MENU_MARGIN_WIDE<<16, 38<<16, }, -190<<16 };
170
static MenuMenuFormat_t MMF_SmallOptions =         { {    MENU_MARGIN_WIDE<<16, 37<<16, },  160<<16 };
170
static MenuMenuFormat_t MMF_SmallOptions =         { {    MENU_MARGIN_WIDE<<16, 37<<16, },  160<<16 };
171
static MenuMenuFormat_t MMF_Macros =               { {                  26<<16, 40<<16, },  160<<16 };
171
static MenuMenuFormat_t MMF_Macros =               { {                  26<<16, 40<<16, },  160<<16 };
172
static MenuMenuFormat_t MMF_SmallOptionsNarrow  =  { { MENU_MARGIN_REGULAR<<16, 38<<16, }, -190<<16 };
172
static MenuMenuFormat_t MMF_SmallOptionsNarrow  =  { { MENU_MARGIN_REGULAR<<16, 38<<16, }, -190<<16 };
173
static MenuMenuFormat_t MMF_KeyboardSetupFuncs =   { {                  70<<16, 34<<16, },  151<<16 };
173
static MenuMenuFormat_t MMF_KeyboardSetupFuncs =   { {                  70<<16, 34<<16, },  151<<16 };
174
static MenuMenuFormat_t MMF_MouseJoySetupBtns =    { {                  76<<16, 34<<16, },  143<<16 };
174
static MenuMenuFormat_t MMF_MouseJoySetupBtns =    { {                  76<<16, 34<<16, },  143<<16 };
175
static MenuMenuFormat_t MMF_FuncList =             { {                 100<<16, 51<<16, },  152<<16 };
175
static MenuMenuFormat_t MMF_FuncList =             { {                 100<<16, 51<<16, },  152<<16 };
176
static MenuMenuFormat_t MMF_ColorCorrect =         { { MENU_MARGIN_REGULAR<<16, 86<<16, },  190<<16 };
176
static MenuMenuFormat_t MMF_ColorCorrect =         { { MENU_MARGIN_REGULAR<<16, 86<<16, },  190<<16 };
177
static MenuMenuFormat_t MMF_BigSliders =           { {    MENU_MARGIN_WIDE<<16, 37<<16, },  190<<16 };
177
static MenuMenuFormat_t MMF_BigSliders =           { {    MENU_MARGIN_WIDE<<16, 37<<16, },  190<<16 };
178
static MenuMenuFormat_t MMF_LoadSave =             { {                 223<<16, 48<<16, },  320<<16 };
178
static MenuMenuFormat_t MMF_LoadSave =             { {                 223<<16, 48<<16, },  320<<16 };
179
static MenuMenuFormat_t MMF_NetSetup =             { {                  36<<16, 38<<16, },  190<<16 };
179
static MenuMenuFormat_t MMF_NetSetup =             { {                  36<<16, 38<<16, },  190<<16 };
180
static MenuMenuFormat_t MMF_FileSelectLeft =       { {                  40<<16, 45<<16, },  162<<16 };
180
static MenuMenuFormat_t MMF_FileSelectLeft =       { {                  40<<16, 45<<16, },  162<<16 };
181
static MenuMenuFormat_t MMF_FileSelectRight =      { {                 164<<16, 45<<16, },  162<<16 };
181
static MenuMenuFormat_t MMF_FileSelectRight =      { {                 164<<16, 45<<16, },  162<<16 };
182
182
183
static MenuEntryFormat_t MEF_Null =             {     0,      0,        0,  20<<16, 65536 };
183
static MenuEntryFormat_t MEF_Null =             {     0,      0,        0,  20<<16, 65536 };
184
static MenuEntryFormat_t MEF_MainMenu =         { 4<<16,      0,        0, 110<<16, 65536 };
184
static MenuEntryFormat_t MEF_MainMenu =         { 4<<16,      0,        0, 110<<16, 65536 };
185
static MenuEntryFormat_t MEF_CenterMenu =       { 7<<16,      0,        0, 110<<16, 65536 };
185
static MenuEntryFormat_t MEF_CenterMenu =       { 7<<16,      0,        0, 110<<16, 65536 };
186
static MenuEntryFormat_t MEF_BigOptions =       { 4<<16,      0,  190<<16,  20<<16, 65536 };
186
static MenuEntryFormat_t MEF_BigOptions =       { 4<<16,      0,  190<<16,  20<<16, 65536 };
187
static MenuEntryFormat_t MEF_BigOptions_Apply = { 4<<16, 16<<16,  190<<16,  20<<16, 65536 };
187
static MenuEntryFormat_t MEF_BigOptions_Apply = { 4<<16, 16<<16,  190<<16,  20<<16, 65536 };
188
static MenuEntryFormat_t MEF_BigOptionsRt =     { 4<<16,      0, -260<<16,  20<<16, 65536 };
188
static MenuEntryFormat_t MEF_BigOptionsRt =     { 4<<16,      0, -260<<16,  20<<16, 65536 };
189
#if defined USE_OPENGL || !defined DROIDMENU
189
#if defined USE_OPENGL || !defined DROIDMENU
190
static MenuEntryFormat_t MEF_SmallOptions =     { 1<<16,      0,  216<<16,  10<<16, 32768 };
190
static MenuEntryFormat_t MEF_SmallOptions =     { 1<<16,      0,  216<<16,  10<<16, 32768 };
191
#endif
191
#endif
192
static MenuEntryFormat_t MEF_PlayerNarrow =     { 1<<16,      0,   90<<16,  10<<16, 32768 };
192
static MenuEntryFormat_t MEF_PlayerNarrow =     { 1<<16,      0,   90<<16,  10<<16, 32768 };
193
static MenuEntryFormat_t MEF_Macros =           { 2<<16,     -1,  268<<16,  10<<16, 32768 };
193
static MenuEntryFormat_t MEF_Macros =           { 2<<16,     -1,  268<<16,  10<<16, 32768 };
194
static MenuEntryFormat_t MEF_VideoSetup =       { 4<<16,      0,  168<<16,  20<<16, 65536 };
194
static MenuEntryFormat_t MEF_VideoSetup =       { 4<<16,      0,  168<<16,  20<<16, 65536 };
195
static MenuEntryFormat_t MEF_FuncList =         { 3<<16,      0,  100<<16,  10<<16, 32768 };
195
static MenuEntryFormat_t MEF_FuncList =         { 3<<16,      0,  100<<16,  10<<16, 32768 };
196
static MenuEntryFormat_t MEF_ColorCorrect =     { 2<<16,      0, -240<<16,  20<<16, 65536 };
196
static MenuEntryFormat_t MEF_ColorCorrect =     { 2<<16,      0, -240<<16,  20<<16, 65536 };
197
static MenuEntryFormat_t MEF_BigSliders =       { 2<<16,      0,  170<<16,  20<<16, 65536 };
197
static MenuEntryFormat_t MEF_BigSliders =       { 2<<16,      0,  170<<16,  20<<16, 65536 };
198
static MenuEntryFormat_t MEF_LoadSave =         { 7<<16,     -1,   78<<16,  20<<16, 65536 };
198
static MenuEntryFormat_t MEF_LoadSave =         { 7<<16,     -1,   78<<16,  20<<16, 65536 };
199
static MenuEntryFormat_t MEF_NetSetup =         { 4<<16,      0,    2<<16,  20<<16, 65536 };
199
static MenuEntryFormat_t MEF_NetSetup =         { 4<<16,      0,    2<<16,  20<<16, 65536 };
200
200
201
// common menu option sets
201
// common menu option sets
202
#define MAKE_MENUOPTIONSET(optionNames, optionValues, features) { optionNames, optionValues, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, ARRAY_SIZE(optionNames), -1, 0, features }
202
#define MAKE_MENUOPTIONSET(optionNames, optionValues, features) { optionNames, optionValues, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, ARRAY_SIZE(optionNames), -1, 0, features }
203
#define MAKE_MENUOPTIONSETDYN(optionNames, optionValues, numOptions, features) { optionNames, optionValues, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, numOptions, -1, 0, features }
203
#define MAKE_MENUOPTIONSETDYN(optionNames, optionValues, numOptions, features) { optionNames, optionValues, &MMF_FuncList, &MEF_FuncList, &MF_Minifont, numOptions, -1, 0, features }
204
204
205
static char *MEOSN_OffOn[] = { "Off", "On", };
205
static char *MEOSN_OffOn[] = { "Off", "On", };
206
static MenuOptionSet_t MEOS_OffOn = MAKE_MENUOPTIONSET( MEOSN_OffOn, NULL, 0x3 );
206
static MenuOptionSet_t MEOS_OffOn = MAKE_MENUOPTIONSET( MEOSN_OffOn, NULL, 0x3 );
207
static char *MEOSN_OnOff[] = { "On", "Off", };
207
static char *MEOSN_OnOff[] = { "On", "Off", };
208
static MenuOptionSet_t MEOS_OnOff = MAKE_MENUOPTIONSET( MEOSN_OnOff, NULL, 0x3 );
208
static MenuOptionSet_t MEOS_OnOff = MAKE_MENUOPTIONSET( MEOSN_OnOff, NULL, 0x3 );
209
static char *MEOSN_NoYes[] = { "No", "Yes", };
209
static char *MEOSN_NoYes[] = { "No", "Yes", };
210
static MenuOptionSet_t MEOS_NoYes = MAKE_MENUOPTIONSET( MEOSN_NoYes, NULL, 0x3 );
210
static MenuOptionSet_t MEOS_NoYes = MAKE_MENUOPTIONSET( MEOSN_NoYes, NULL, 0x3 );
211
static char *MEOSN_YesNo[] = { "Yes", "No", };
211
static char *MEOSN_YesNo[] = { "Yes", "No", };
212
static MenuOptionSet_t MEOS_YesNo = MAKE_MENUOPTIONSET( MEOSN_YesNo, NULL, 0x3 );
212
static MenuOptionSet_t MEOS_YesNo = MAKE_MENUOPTIONSET( MEOSN_YesNo, NULL, 0x3 );
213
213
214
214
215
static char MenuGameFuncs[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
215
static char MenuGameFuncs[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
216
static char *MenuGameFuncNone = "  -None-";
216
static char *MenuGameFuncNone = "  -None-";
217
static char *MEOSN_Gamefuncs[NUMGAMEFUNCTIONS+1];
217
static char *MEOSN_Gamefuncs[NUMGAMEFUNCTIONS+1];
218
static MenuOptionSet_t MEOS_Gamefuncs = MAKE_MENUOPTIONSET( MEOSN_Gamefuncs, NULL, 0x1 );
218
static MenuOptionSet_t MEOS_Gamefuncs = MAKE_MENUOPTIONSET( MEOSN_Gamefuncs, NULL, 0x1 );
219
219
220
220
221
221
222
/*
222
/*
223
MenuEntry_t is passed in arrays of pointers so that the callback function
223
MenuEntry_t is passed in arrays of pointers so that the callback function
224
that is called when an entry is modified or activated can test equality of the current
224
that is called when an entry is modified or activated can test equality of the current
225
entry pointer directly against the known ones, instead of relying on an ID number.
225
entry pointer directly against the known ones, instead of relying on an ID number.
226

226

227
That way, individual menu entries can be ifdef'd out painlessly.
227
That way, individual menu entries can be ifdef'd out painlessly.
228
*/
228
*/
229
229
230
static MenuLink_t MEO_NULL = { MENU_NULL, MA_None, };
230
static MenuLink_t MEO_NULL = { MENU_NULL, MA_None, };
231
static const char* MenuCustom = "Custom";
231
static const char* MenuCustom = "Custom";
232
232
233
#define MAKE_MENUSTRING(...) { NULL, __VA_ARGS__, }
233
#define MAKE_MENUSTRING(...) { NULL, __VA_ARGS__, }
234
#define MAKE_MENUOPTION(...) { __VA_ARGS__, -1, }
234
#define MAKE_MENUOPTION(...) { __VA_ARGS__, -1, }
235
#define MAKE_MENURANGE(...) { __VA_ARGS__, }
235
#define MAKE_MENURANGE(...) { __VA_ARGS__, }
236
#define MAKE_MENUENTRY(...) { __VA_ARGS__, 0, 0, 0, }
236
#define MAKE_MENUENTRY(...) { __VA_ARGS__, 0, 0, 0, }
237
237
238
238
239
#define MAKE_SPACER( EntryName, Height ) \
239
#define MAKE_SPACER( EntryName, Height ) \
240
static MenuSpacer_t MEO_ ## EntryName = { Height };\
240
static MenuSpacer_t MEO_ ## EntryName = { Height };\
241
static MenuEntry_t ME_ ## EntryName = MAKE_MENUENTRY( NULL, &MF_Null, &MEF_Null, &MEO_ ## EntryName, Spacer )
241
static MenuEntry_t ME_ ## EntryName = MAKE_MENUENTRY( NULL, &MF_Null, &MEF_Null, &MEO_ ## EntryName, Spacer )
242
242
243
MAKE_SPACER( Space2, 2<<16 ); // bigoptions
243
MAKE_SPACER( Space2, 2<<16 ); // bigoptions
244
MAKE_SPACER( Space4, 4<<16 ); // usermap, smalloptions, anything else non-top
244
MAKE_SPACER( Space4, 4<<16 ); // usermap, smalloptions, anything else non-top
245
MAKE_SPACER( Space6, 6<<16 ); // videosetup
245
MAKE_SPACER( Space6, 6<<16 ); // videosetup
246
MAKE_SPACER( Space8, 8<<16 ); // colcorr, redslide
246
MAKE_SPACER( Space8, 8<<16 ); // colcorr, redslide
247
247
248
248
249
#define MAKE_MENU_TOP_ENTRYLINK( Title, Format, EntryName, LinkID ) \
249
#define MAKE_MENU_TOP_ENTRYLINK( Title, Format, EntryName, LinkID ) \
250
static MenuLink_t MEO_ ## EntryName = { LinkID, MA_Advance, };\
250
static MenuLink_t MEO_ ## EntryName = { LinkID, MA_Advance, };\
251
static MenuEntry_t ME_ ## EntryName = MAKE_MENUENTRY( Title, &MF_Redfont, &Format, &MEO_ ## EntryName, Link )
251
static MenuEntry_t ME_ ## EntryName = MAKE_MENUENTRY( Title, &MF_Redfont, &Format, &MEO_ ## EntryName, Link )
252
252
253
253
254
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME, MENU_EPISODE );
254
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME, MENU_EPISODE );
255
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME_INGAME, MENU_NEWVERIFY );
255
MAKE_MENU_TOP_ENTRYLINK( "New Game", MEF_MainMenu, MAIN_NEWGAME_INGAME, MENU_NEWVERIFY );
256
static MenuLink_t MEO_MAIN_NEWGAME_NETWORK = { MENU_NETWORK, MA_Advance, };
256
static MenuLink_t MEO_MAIN_NEWGAME_NETWORK = { MENU_NETWORK, MA_Advance, };
257
MAKE_MENU_TOP_ENTRYLINK( "Save Game", MEF_MainMenu, MAIN_SAVEGAME, MENU_SAVE );
257
MAKE_MENU_TOP_ENTRYLINK( "Save Game", MEF_MainMenu, MAIN_SAVEGAME, MENU_SAVE );
258
MAKE_MENU_TOP_ENTRYLINK( "Load Game", MEF_MainMenu, MAIN_LOADGAME, MENU_LOAD );
258
MAKE_MENU_TOP_ENTRYLINK( "Load Game", MEF_MainMenu, MAIN_LOADGAME, MENU_LOAD );
259
MAKE_MENU_TOP_ENTRYLINK( "Options", MEF_MainMenu, MAIN_OPTIONS, MENU_OPTIONS );
259
MAKE_MENU_TOP_ENTRYLINK( "Options", MEF_MainMenu, MAIN_OPTIONS, MENU_OPTIONS );
260
#ifndef DROIDMENU
260
#ifndef DROIDMENU
261
MAKE_MENU_TOP_ENTRYLINK( "Help", MEF_MainMenu, MAIN_HELP, MENU_STORY );
261
MAKE_MENU_TOP_ENTRYLINK( "Help", MEF_MainMenu, MAIN_HELP, MENU_STORY );
262
#endif
262
#endif
263
MAKE_MENU_TOP_ENTRYLINK( "Credits", MEF_MainMenu, MAIN_CREDITS, MENU_CREDITS );
263
MAKE_MENU_TOP_ENTRYLINK( "Credits", MEF_MainMenu, MAIN_CREDITS, MENU_CREDITS );
264
MAKE_MENU_TOP_ENTRYLINK( "Quit To Title", MEF_MainMenu, MAIN_QUITTOTITLE, MENU_QUITTOTITLE );
264
MAKE_MENU_TOP_ENTRYLINK( "Quit To Title", MEF_MainMenu, MAIN_QUITTOTITLE, MENU_QUITTOTITLE );
265
MAKE_MENU_TOP_ENTRYLINK( "Quit", MEF_MainMenu, MAIN_QUIT, MENU_QUIT );
265
MAKE_MENU_TOP_ENTRYLINK( "Quit", MEF_MainMenu, MAIN_QUIT, MENU_QUIT );
266
MAKE_MENU_TOP_ENTRYLINK( "Quit Game", MEF_MainMenu, MAIN_QUITGAME, MENU_QUIT );
266
MAKE_MENU_TOP_ENTRYLINK( "Quit Game", MEF_MainMenu, MAIN_QUITGAME, MENU_QUIT );
267
267
268
static MenuEntry_t *MEL_MAIN[] = {
268
static MenuEntry_t *MEL_MAIN[] = {
269
    &ME_MAIN_NEWGAME,
269
    &ME_MAIN_NEWGAME,
270
    &ME_MAIN_OPTIONS,
270
    &ME_MAIN_OPTIONS,
271
    &ME_MAIN_LOADGAME,
271
    &ME_MAIN_LOADGAME,
272
#ifndef DROIDMENU
272
#ifndef DROIDMENU
273
    &ME_MAIN_HELP,
273
    &ME_MAIN_HELP,
274
#endif
274
#endif
275
    &ME_MAIN_CREDITS,
275
    &ME_MAIN_CREDITS,
276
    &ME_MAIN_QUIT,
276
    &ME_MAIN_QUIT,
277
};
277
};
278
278
279
static MenuEntry_t *MEL_MAIN_INGAME[] = {
279
static MenuEntry_t *MEL_MAIN_INGAME[] = {
280
    &ME_MAIN_NEWGAME_INGAME,
280
    &ME_MAIN_NEWGAME_INGAME,
281
    &ME_MAIN_SAVEGAME,
281
    &ME_MAIN_SAVEGAME,
282
    &ME_MAIN_LOADGAME,
282
    &ME_MAIN_LOADGAME,
283
    &ME_MAIN_OPTIONS,
283
    &ME_MAIN_OPTIONS,
284
#ifndef DROIDMENU
284
#ifndef DROIDMENU
285
    &ME_MAIN_HELP,
285
    &ME_MAIN_HELP,
286
#endif
286
#endif
287
    &ME_MAIN_QUITTOTITLE,
287
    &ME_MAIN_QUITTOTITLE,
288
    &ME_MAIN_QUITGAME,
288
    &ME_MAIN_QUITGAME,
289
};
289
};
290
290
291
// Episode and Skill will be dynamically generated after CONs are parsed
291
// Episode and Skill will be dynamically generated after CONs are parsed
292
static MenuLink_t MEO_EPISODE = { MENU_SKILL, MA_Advance, };
292
static MenuLink_t MEO_EPISODE = { MENU_SKILL, MA_Advance, };
293
static MenuLink_t MEO_EPISODE_SHAREWARE = { MENU_BUYDUKE, MA_Advance, };
293
static MenuLink_t MEO_EPISODE_SHAREWARE = { MENU_BUYDUKE, MA_Advance, };
294
static MenuEntry_t ME_EPISODE_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_CenterMenu, &MEO_EPISODE, Link );
294
static MenuEntry_t ME_EPISODE_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_CenterMenu, &MEO_EPISODE, Link );
295
static MenuEntry_t ME_EPISODE[MAXVOLUMES];
295
static MenuEntry_t ME_EPISODE[MAXVOLUMES];
296
static MenuLink_t MEO_EPISODE_USERMAP = { MENU_USERMAP, MA_Advance, };
296
static MenuLink_t MEO_EPISODE_USERMAP = { MENU_USERMAP, MA_Advance, };
297
static MenuEntry_t ME_EPISODE_USERMAP = MAKE_MENUENTRY( "User Map", &MF_Redfont, &MEF_CenterMenu, &MEO_EPISODE_USERMAP, Link );
297
static MenuEntry_t ME_EPISODE_USERMAP = MAKE_MENUENTRY( "User Map", &MF_Redfont, &MEF_CenterMenu, &MEO_EPISODE_USERMAP, Link );
298
static MenuEntry_t *MEL_EPISODE[MAXVOLUMES+2]; // +2 for spacer and User Map
298
static MenuEntry_t *MEL_EPISODE[MAXVOLUMES+2]; // +2 for spacer and User Map
299
299
300
static MenuEntry_t ME_SKILL_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_CenterMenu, &MEO_NULL, Link );
300
static MenuEntry_t ME_SKILL_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_CenterMenu, &MEO_NULL, Link );
301
static MenuEntry_t ME_SKILL[MAXSKILLS];
301
static MenuEntry_t ME_SKILL[MAXSKILLS];
302
static MenuEntry_t *MEL_SKILL[MAXSKILLS];
302
static MenuEntry_t *MEL_SKILL[MAXSKILLS];
303
303
304
#if defined STARTUP_SETUP_WINDOW && !defined DROIDMENU
304
#if defined STARTUP_SETUP_WINDOW && !defined DROIDMENU
305
static MenuOption_t MEO_GAMESETUP_STARTWIN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.ForceSetup );
305
static MenuOption_t MEO_GAMESETUP_STARTWIN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.ForceSetup );
306
static MenuEntry_t ME_GAMESETUP_STARTWIN = MAKE_MENUENTRY( "Startup window:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_STARTWIN, Option );
306
static MenuEntry_t ME_GAMESETUP_STARTWIN = MAKE_MENUENTRY( "Startup window:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_STARTWIN, Option );
307
#endif
307
#endif
308
308
309
static char *MEOSN_GAMESETUP_AIM_AUTO[] = { "None", "Regular", "Bullets only",
309
static char *MEOSN_GAMESETUP_AIM_AUTO[] = { "None", "Regular", "Bullets only",
310
#ifdef DROIDMENU
310
#ifdef DROIDMENU
311
"Extra wide"
311
"Extra wide"
312
#endif
312
#endif
313
};
313
};
314
static int32_t MEOSV_GAMESETUP_AIM_AUTO[] = { 0, 1, 2,
314
static int32_t MEOSV_GAMESETUP_AIM_AUTO[] = { 0, 1, 2,
315
#ifdef DROIDMENU
315
#ifdef DROIDMENU
316
3,
316
3,
317
#endif
317
#endif
318
};
318
};
319
319
320
static MenuOptionSet_t MEOS_GAMESETUP_AIM_AUTO = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_AIM_AUTO, MEOSV_GAMESETUP_AIM_AUTO, 0x2 );
320
static MenuOptionSet_t MEOS_GAMESETUP_AIM_AUTO = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_AIM_AUTO, MEOSV_GAMESETUP_AIM_AUTO, 0x2 );
321
static MenuOption_t MEO_GAMESETUP_AIM_AUTO = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_AIM_AUTO, &ud.config.AutoAim );
321
static MenuOption_t MEO_GAMESETUP_AIM_AUTO = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_AIM_AUTO, &ud.config.AutoAim );
322
static MenuEntry_t ME_GAMESETUP_AIM_AUTO = MAKE_MENUENTRY( "Auto aim:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_AIM_AUTO, Option );
322
static MenuEntry_t ME_GAMESETUP_AIM_AUTO = MAKE_MENUENTRY( "Auto aim:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_AIM_AUTO, Option );
323
323
324
static char *MEOSN_GAMESETUP_WEAPSWITCH_PICKUP[] = { "Never", "If new", "By rating", };
324
static char *MEOSN_GAMESETUP_WEAPSWITCH_PICKUP[] = { "Never", "If new", "By rating", };
325
static MenuOptionSet_t MEOS_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_WEAPSWITCH_PICKUP, NULL, 0x2 );
325
static MenuOptionSet_t MEOS_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUOPTIONSET( MEOSN_GAMESETUP_WEAPSWITCH_PICKUP, NULL, 0x2 );
326
static MenuOption_t MEO_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_WEAPSWITCH_PICKUP, NULL );
326
static MenuOption_t MEO_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUOPTION( &MF_Redfont, &MEOS_GAMESETUP_WEAPSWITCH_PICKUP, NULL );
327
static MenuEntry_t ME_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUENTRY( "Equip pickups:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_WEAPSWITCH_PICKUP, Option );
327
static MenuEntry_t ME_GAMESETUP_WEAPSWITCH_PICKUP = MAKE_MENUENTRY( "Equip pickups:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_WEAPSWITCH_PICKUP, Option );
328
328
329
static char *MEOSN_DemoRec[] = { "Off", "Running", };
329
static char *MEOSN_DemoRec[] = { "Off", "Running", };
330
static MenuOptionSet_t MEOS_DemoRec = MAKE_MENUOPTIONSET( MEOSN_DemoRec, NULL, 0x3 );
330
static MenuOptionSet_t MEOS_DemoRec = MAKE_MENUOPTIONSET( MEOSN_DemoRec, NULL, 0x3 );
331
static MenuOption_t MEO_GAMESETUP_DEMOREC = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.m_recstat );
331
static MenuOption_t MEO_GAMESETUP_DEMOREC = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.m_recstat );
332
static MenuEntry_t ME_GAMESETUP_DEMOREC = MAKE_MENUENTRY( "Record demo:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_DEMOREC, Option );
332
static MenuEntry_t ME_GAMESETUP_DEMOREC = MAKE_MENUENTRY( "Record demo:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_DEMOREC, Option );
333
333
334
#ifdef _WIN32
334
#ifdef _WIN32
335
static MenuOption_t MEO_GAMESETUP_UPDATES = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.CheckForUpdates );
335
static MenuOption_t MEO_GAMESETUP_UPDATES = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.CheckForUpdates );
336
static MenuEntry_t ME_GAMESETUP_UPDATES = MAKE_MENUENTRY( "Online updates:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_UPDATES, Option );
336
static MenuEntry_t ME_GAMESETUP_UPDATES = MAKE_MENUENTRY( "Online updates:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_GAMESETUP_UPDATES, Option );
337
#endif
337
#endif
338
338
339
static MenuOption_t MEO_ADULTMODE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.lockout);
339
static MenuOption_t MEO_ADULTMODE = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.lockout);
340
static MenuEntry_t ME_ADULTMODE = MAKE_MENUENTRY( "Parental lock:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_ADULTMODE, Option );
340
static MenuEntry_t ME_ADULTMODE = MAKE_MENUENTRY( "Parental lock:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_ADULTMODE, Option );
341
// static MenuLink_t MEO_ADULTMODE_PASSWORD = { MENU_ADULTPASSWORD, MA_None, };
341
// static MenuLink_t MEO_ADULTMODE_PASSWORD = { MENU_ADULTPASSWORD, MA_None, };
342
// static MenuEntry_t ME_ADULTMODE_PASSWORD = MAKE_MENUENTRY( "Enter Password", &MF_Redfont, &, &MEO_ADULTMODE_PASSWORD, Link );
342
// static MenuEntry_t ME_ADULTMODE_PASSWORD = MAKE_MENUENTRY( "Enter Password", &MF_Redfont, &, &MEO_ADULTMODE_PASSWORD, Link );
343
343
344
static MenuEntry_t *MEL_GAMESETUP[] = {
344
static MenuEntry_t *MEL_GAMESETUP[] = {
345
    &ME_ADULTMODE,
345
    &ME_ADULTMODE,
346
#if defined STARTUP_SETUP_WINDOW && !defined DROIDMENU
346
#if defined STARTUP_SETUP_WINDOW && !defined DROIDMENU
347
    &ME_GAMESETUP_STARTWIN,
347
    &ME_GAMESETUP_STARTWIN,
348
#endif
348
#endif
349
    &ME_GAMESETUP_AIM_AUTO,
349
    &ME_GAMESETUP_AIM_AUTO,
350
    &ME_GAMESETUP_WEAPSWITCH_PICKUP,
350
    &ME_GAMESETUP_WEAPSWITCH_PICKUP,
351
#ifndef DROIDMENU
351
#ifndef DROIDMENU
352
    &ME_GAMESETUP_DEMOREC,
352
    &ME_GAMESETUP_DEMOREC,
353
#ifdef _WIN32
353
#ifdef _WIN32
354
    &ME_GAMESETUP_UPDATES,
354
    &ME_GAMESETUP_UPDATES,
355
#endif
355
#endif
356
#endif
356
#endif
357
};
357
};
358
358
359
MAKE_MENU_TOP_ENTRYLINK( "Game Setup", MEF_CenterMenu, OPTIONS_GAMESETUP, MENU_GAMESETUP );
359
MAKE_MENU_TOP_ENTRYLINK( "Game Setup", MEF_CenterMenu, OPTIONS_GAMESETUP, MENU_GAMESETUP );
360
MAKE_MENU_TOP_ENTRYLINK( "Sound Setup", MEF_CenterMenu, OPTIONS_SOUNDSETUP, MENU_SOUND );
360
MAKE_MENU_TOP_ENTRYLINK( "Sound Setup", MEF_CenterMenu, OPTIONS_SOUNDSETUP, MENU_SOUND );
361
MAKE_MENU_TOP_ENTRYLINK( "Display Setup", MEF_CenterMenu, OPTIONS_DISPLAYSETUP, MENU_DISPLAYSETUP );
361
MAKE_MENU_TOP_ENTRYLINK( "Display Setup", MEF_CenterMenu, OPTIONS_DISPLAYSETUP, MENU_DISPLAYSETUP );
362
MAKE_MENU_TOP_ENTRYLINK( "Player Setup", MEF_CenterMenu, OPTIONS_PLAYERSETUP, MENU_PLAYER );
362
MAKE_MENU_TOP_ENTRYLINK( "Player Setup", MEF_CenterMenu, OPTIONS_PLAYERSETUP, MENU_PLAYER );
363
MAKE_MENU_TOP_ENTRYLINK( "Control Setup", MEF_CenterMenu, OPTIONS_CONTROLS, MENU_CONTROLS );
363
MAKE_MENU_TOP_ENTRYLINK( "Control Setup", MEF_CenterMenu, OPTIONS_CONTROLS, MENU_CONTROLS );
364
MAKE_MENU_TOP_ENTRYLINK( "Keyboard Setup", MEF_CenterMenu, OPTIONS_KEYBOARDSETUP, MENU_KEYBOARDSETUP );
364
MAKE_MENU_TOP_ENTRYLINK( "Keyboard Setup", MEF_CenterMenu, OPTIONS_KEYBOARDSETUP, MENU_KEYBOARDSETUP );
365
MAKE_MENU_TOP_ENTRYLINK( "Mouse Setup", MEF_CenterMenu, OPTIONS_MOUSESETUP, MENU_MOUSESETUP );
365
MAKE_MENU_TOP_ENTRYLINK( "Mouse Setup", MEF_CenterMenu, OPTIONS_MOUSESETUP, MENU_MOUSESETUP );
366
MAKE_MENU_TOP_ENTRYLINK( "Joystick Setup", MEF_CenterMenu, OPTIONS_JOYSTICKSETUP, MENU_JOYSTICKSETUP );
366
MAKE_MENU_TOP_ENTRYLINK( "Joystick Setup", MEF_CenterMenu, OPTIONS_JOYSTICKSETUP, MENU_JOYSTICKSETUP );
367
367
368
368
369
static int32_t newresolution, newrendermode, newfullscreen;
369
static int32_t newresolution, newrendermode, newfullscreen;
370
370
371
enum resflags_t {
371
enum resflags_t {
372
    RES_FS  = 0x1,
372
    RES_FS  = 0x1,
373
    RES_WIN = 0x2,
373
    RES_WIN = 0x2,
374
};
374
};
375
375
376
#define MAXRESOLUTIONSTRINGLENGTH 16
376
#define MAXRESOLUTIONSTRINGLENGTH 16
377
377
378
typedef struct resolution_t {
378
typedef struct resolution_t {
379
    int32_t xdim, ydim;
379
    int32_t xdim, ydim;
380
    int32_t flags;
380
    int32_t flags;
381
    int32_t bppmax;
381
    int32_t bppmax;
382
    char name[MAXRESOLUTIONSTRINGLENGTH];
382
    char name[MAXRESOLUTIONSTRINGLENGTH];
383
} resolution_t;
383
} resolution_t;
384
384
385
resolution_t resolution[MAXVALIDMODES];
385
resolution_t resolution[MAXVALIDMODES];
386
386
387
static char *MEOSN_VIDEOSETUP_RESOLUTION[MAXVALIDMODES];
387
static char *MEOSN_VIDEOSETUP_RESOLUTION[MAXVALIDMODES];
388
static MenuOptionSet_t MEOS_VIDEOSETUP_RESOLUTION = MAKE_MENUOPTIONSETDYN( MEOSN_VIDEOSETUP_RESOLUTION, NULL, 0, 0x0 );
388
static MenuOptionSet_t MEOS_VIDEOSETUP_RESOLUTION = MAKE_MENUOPTIONSETDYN( MEOSN_VIDEOSETUP_RESOLUTION, NULL, 0, 0x0 );
389
static MenuOption_t MEO_VIDEOSETUP_RESOLUTION = MAKE_MENUOPTION( &MF_Redfont, &MEOS_VIDEOSETUP_RESOLUTION, &newresolution );
389
static MenuOption_t MEO_VIDEOSETUP_RESOLUTION = MAKE_MENUOPTION( &MF_Redfont, &MEOS_VIDEOSETUP_RESOLUTION, &newresolution );
390
static MenuEntry_t ME_VIDEOSETUP_RESOLUTION = MAKE_MENUENTRY( "Resolution:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_RESOLUTION, Option );
390
static MenuEntry_t ME_VIDEOSETUP_RESOLUTION = MAKE_MENUENTRY( "Resolution:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_RESOLUTION, Option );
391
391
392
#ifdef USE_OPENGL
392
#ifdef USE_OPENGL
393
#ifdef POLYMER
393
#ifdef POLYMER
394
static char *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", "Polymost.f", "Polymer", };
394
static char *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", "Polymost.f", "Polymer", };
395
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, REND_POLYMOST, REND_POLYMER, };
395
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, REND_POLYMOST, REND_POLYMER, };
396
#else
396
#else
397
static char *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", "OpenGL", };
397
static char *MEOSN_VIDEOSETUP_RENDERER[] = { "Classic", "OpenGL", };
398
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, REND_POLYMOST, };
398
static int32_t MEOSV_VIDEOSETUP_RENDERER[] = { REND_CLASSIC, REND_POLYMOST, };
399
#endif
399
#endif
400
400
401
static MenuOptionSet_t MEOS_VIDEOSETUP_RENDERER = MAKE_MENUOPTIONSET( MEOSN_VIDEOSETUP_RENDERER, MEOSV_VIDEOSETUP_RENDERER, 0x2 );
401
static MenuOptionSet_t MEOS_VIDEOSETUP_RENDERER = MAKE_MENUOPTIONSET( MEOSN_VIDEOSETUP_RENDERER, MEOSV_VIDEOSETUP_RENDERER, 0x2 );
402
402
403
static MenuOption_t MEO_VIDEOSETUP_RENDERER = MAKE_MENUOPTION( &MF_Redfont, &MEOS_VIDEOSETUP_RENDERER, &newrendermode );
403
static MenuOption_t MEO_VIDEOSETUP_RENDERER = MAKE_MENUOPTION( &MF_Redfont, &MEOS_VIDEOSETUP_RENDERER, &newrendermode );
404
static MenuEntry_t ME_VIDEOSETUP_RENDERER = MAKE_MENUENTRY( "Renderer:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_RENDERER, Option );
404
static MenuEntry_t ME_VIDEOSETUP_RENDERER = MAKE_MENUENTRY( "Renderer:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_RENDERER, Option );
405
#endif
405
#endif
406
406
407
static MenuOption_t MEO_VIDEOSETUP_FULLSCREEN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &newfullscreen );
407
static MenuOption_t MEO_VIDEOSETUP_FULLSCREEN = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &newfullscreen );
408
static MenuEntry_t ME_VIDEOSETUP_FULLSCREEN = MAKE_MENUENTRY( "Fullscreen:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_FULLSCREEN, Option );
408
static MenuEntry_t ME_VIDEOSETUP_FULLSCREEN = MAKE_MENUENTRY( "Fullscreen:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_VIDEOSETUP_FULLSCREEN, Option );
409
static MenuEntry_t ME_VIDEOSETUP_APPLY = MAKE_MENUENTRY( "Apply Changes", &MF_Redfont, &MEF_BigOptions_Apply, &MEO_NULL, Link );
409
static MenuEntry_t ME_VIDEOSETUP_APPLY = MAKE_MENUENTRY( "Apply Changes", &MF_Redfont, &MEF_BigOptions_Apply, &MEO_NULL, Link );
410
410
411
411
412
static MenuLink_t MEO_DISPLAYSETUP_COLORCORR = { MENU_COLCORR, MA_Advance, };
412
static MenuLink_t MEO_DISPLAYSETUP_COLORCORR = { MENU_COLCORR, MA_Advance, };
413
static MenuEntry_t ME_DISPLAYSETUP_COLORCORR = MAKE_MENUENTRY( "Color Correction", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_COLORCORR, Link );
413
static MenuEntry_t ME_DISPLAYSETUP_COLORCORR = MAKE_MENUENTRY( "Color Correction", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_COLORCORR, Link );
414
static MenuOption_t MEO_DISPLAYSETUP_PIXELDOUBLING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OnOff, &ud.detail );
414
static MenuOption_t MEO_DISPLAYSETUP_PIXELDOUBLING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OnOff, &ud.detail );
415
static MenuEntry_t ME_DISPLAYSETUP_PIXELDOUBLING = MAKE_MENUENTRY( "Pixel Doubling:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_PIXELDOUBLING, Option );
415
static MenuEntry_t ME_DISPLAYSETUP_PIXELDOUBLING = MAKE_MENUENTRY( "Pixel Doubling:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_PIXELDOUBLING, Option );
416
416
417
417
418
#ifdef USE_OPENGL
418
#ifdef USE_OPENGL
419
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, NULL);
419
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, NULL);
420
#else
420
#else
421
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &r_usenewaspect);
421
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &r_usenewaspect);
422
#endif
422
#endif
423
static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUENTRY( "Widescreen:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ASPECTRATIO, Option );
423
static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO = MAKE_MENUENTRY( "Widescreen:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ASPECTRATIO, Option );
424
#ifdef POLYMER
424
#ifdef POLYMER
425
static char *MEOSN_DISPLAYSETUP_ASPECTRATIO_POLYMER[] = { "Auto", "4:3", "16:10", "5:3", "16:9", "1.85:1", "2.39:1", };
425
static char *MEOSN_DISPLAYSETUP_ASPECTRATIO_POLYMER[] = { "Auto", "4:3", "16:10", "5:3", "16:9", "1.85:1", "2.39:1", };
426
static double MEOSV_DISPLAYSETUP_ASPECTRATIO_POLYMER[] = { 0., 1.33, 1.6, 1.66, 1.78, 1.85, 2.39, };
426
static double MEOSV_DISPLAYSETUP_ASPECTRATIO_POLYMER[] = { 0., 1.33, 1.6, 1.66, 1.78, 1.85, 2.39, };
427
static MenuOptionSet_t MEOS_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_ASPECTRATIO_POLYMER, NULL, 0x1 );
427
static MenuOptionSet_t MEOS_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_ASPECTRATIO_POLYMER, NULL, 0x1 );
428
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_ASPECTRATIO_POLYMER, NULL);
428
static MenuOption_t MEO_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_ASPECTRATIO_POLYMER, NULL);
429
static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUENTRY( "Aspect ratio:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ASPECTRATIO_POLYMER, Option );
429
static MenuEntry_t ME_DISPLAYSETUP_ASPECTRATIO_POLYMER = MAKE_MENUENTRY( "Aspect ratio:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ASPECTRATIO_POLYMER, Option );
430
#endif
430
#endif
431
431
432
432
433
#ifdef USE_OPENGL
433
#ifdef USE_OPENGL
434
static char *MEOSN_DISPLAYSETUP_TEXFILTER[] = { "Classic", "Filtered" };
434
static char *MEOSN_DISPLAYSETUP_TEXFILTER[] = { "Classic", "Filtered" };
435
static MenuOptionSet_t MEOS_DISPLAYSETUP_TEXFILTER = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_TEXFILTER, NULL, 0x2 );
435
static MenuOptionSet_t MEOS_DISPLAYSETUP_TEXFILTER = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_TEXFILTER, NULL, 0x2 );
436
int32_t menufiltermode;
436
int32_t menufiltermode;
437
static MenuOption_t MEO_DISPLAYSETUP_TEXFILTER = MAKE_MENUOPTION( &MF_Redfont, &MEOS_DISPLAYSETUP_TEXFILTER, &menufiltermode );
437
static MenuOption_t MEO_DISPLAYSETUP_TEXFILTER = MAKE_MENUOPTION( &MF_Redfont, &MEOS_DISPLAYSETUP_TEXFILTER, &menufiltermode );
438
static MenuEntry_t ME_DISPLAYSETUP_TEXFILTER = MAKE_MENUENTRY( "Texture Mode:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_TEXFILTER, Option );
438
static MenuEntry_t ME_DISPLAYSETUP_TEXFILTER = MAKE_MENUENTRY( "Texture Mode:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_TEXFILTER, Option );
439
439
440
static char *MEOSN_DISPLAYSETUP_ANISOTROPY[] = { "None", "2x", "4x", "8x", "16x", };
440
static char *MEOSN_DISPLAYSETUP_ANISOTROPY[] = { "None", "2x", "4x", "8x", "16x", };
441
static int32_t MEOSV_DISPLAYSETUP_ANISOTROPY[] = { 1, 2, 4, 8, 16, };
441
static int32_t MEOSV_DISPLAYSETUP_ANISOTROPY[] = { 1, 2, 4, 8, 16, };
442
static MenuOptionSet_t MEOS_DISPLAYSETUP_ANISOTROPY = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_ANISOTROPY, MEOSV_DISPLAYSETUP_ANISOTROPY, 0x0 );
442
static MenuOptionSet_t MEOS_DISPLAYSETUP_ANISOTROPY = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_ANISOTROPY, MEOSV_DISPLAYSETUP_ANISOTROPY, 0x0 );
443
static MenuOption_t MEO_DISPLAYSETUP_ANISOTROPY = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_ANISOTROPY, &glanisotropy);
443
static MenuOption_t MEO_DISPLAYSETUP_ANISOTROPY = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_ANISOTROPY, &glanisotropy);
444
static MenuEntry_t ME_DISPLAYSETUP_ANISOTROPY = MAKE_MENUENTRY( "Anisotropy:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ANISOTROPY, Option );
444
static MenuEntry_t ME_DISPLAYSETUP_ANISOTROPY = MAKE_MENUENTRY( "Anisotropy:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ANISOTROPY, Option );
445
static char *MEOSN_DISPLAYSETUP_VSYNC[] = { "Adaptive", "Off", "On", };
445
static char *MEOSN_DISPLAYSETUP_VSYNC[] = { "Adaptive", "Off", "On", };
446
static int32_t MEOSV_DISPLAYSETUP_VSYNC[] = { -1, 0, 1, };
446
static int32_t MEOSV_DISPLAYSETUP_VSYNC[] = { -1, 0, 1, };
447
static MenuOptionSet_t MEOS_DISPLAYSETUP_VSYNC = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_VSYNC, MEOSV_DISPLAYSETUP_VSYNC, 0x2 );
447
static MenuOptionSet_t MEOS_DISPLAYSETUP_VSYNC = MAKE_MENUOPTIONSET( MEOSN_DISPLAYSETUP_VSYNC, MEOSV_DISPLAYSETUP_VSYNC, 0x2 );
448
static MenuOption_t MEO_DISPLAYSETUP_VSYNC = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_VSYNC, &vsync);
448
static MenuOption_t MEO_DISPLAYSETUP_VSYNC = MAKE_MENUOPTION(&MF_Redfont, &MEOS_DISPLAYSETUP_VSYNC, &vsync);
449
static MenuEntry_t ME_DISPLAYSETUP_VSYNC = MAKE_MENUENTRY( "VSync:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_VSYNC, Option );
449
static MenuEntry_t ME_DISPLAYSETUP_VSYNC = MAKE_MENUENTRY( "VSync:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_VSYNC, Option );
450
450
451
#endif
451
#endif
452
452
453
static MenuOption_t MEO_SCREENSETUP_CROSSHAIR = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.crosshair);
453
static MenuOption_t MEO_SCREENSETUP_CROSSHAIR = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.crosshair);
454
static MenuEntry_t ME_SCREENSETUP_CROSSHAIR = MAKE_MENUENTRY( "Crosshair:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_CROSSHAIR, Option );
454
static MenuEntry_t ME_SCREENSETUP_CROSSHAIR = MAKE_MENUENTRY( "Crosshair:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_CROSSHAIR, Option );
455
static MenuRangeInt32_t MEO_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENURANGE( &ud.crosshairscale, &MF_Redfont, 25, 100, 0, 16, 2 );
455
static MenuRangeInt32_t MEO_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENURANGE( &ud.crosshairscale, &MF_Redfont, 25, 100, 0, 16, 2 );
456
static MenuEntry_t ME_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENUENTRY( "Size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_CROSSHAIRSIZE, RangeInt32 );
456
static MenuEntry_t ME_SCREENSETUP_CROSSHAIRSIZE = MAKE_MENUENTRY( "Size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_CROSSHAIRSIZE, RangeInt32 );
457
457
458
static int32_t vpsize;
458
static int32_t vpsize;
459
static MenuRangeInt32_t MEO_SCREENSETUP_SCREENSIZE = MAKE_MENURANGE( &vpsize, &MF_Redfont, 12, 0, 0, 4, EnforceIntervals );
459
static MenuRangeInt32_t MEO_SCREENSETUP_SCREENSIZE = MAKE_MENURANGE( &vpsize, &MF_Redfont, 12, 0, 0, 4, EnforceIntervals );
460
static MenuEntry_t ME_SCREENSETUP_SCREENSIZE = MAKE_MENUENTRY( "Screen size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_SCREENSIZE, RangeInt32 );
460
static MenuEntry_t ME_SCREENSETUP_SCREENSIZE = MAKE_MENUENTRY( "Screen size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_SCREENSIZE, RangeInt32 );
461
static MenuRangeInt32_t MEO_SCREENSETUP_TEXTSIZE = MAKE_MENURANGE( &ud.textscale, &MF_Redfont, 100, 400, 0, 7, 2 );
461
static MenuRangeInt32_t MEO_SCREENSETUP_TEXTSIZE = MAKE_MENURANGE( &ud.textscale, &MF_Redfont, 100, 400, 0, 7, 2 );
462
static MenuEntry_t ME_SCREENSETUP_TEXTSIZE = MAKE_MENUENTRY( "Size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_TEXTSIZE, RangeInt32 );
462
static MenuEntry_t ME_SCREENSETUP_TEXTSIZE = MAKE_MENUENTRY( "Size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_TEXTSIZE, RangeInt32 );
463
static MenuOption_t MEO_SCREENSETUP_LEVELSTATS = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.levelstats);
463
static MenuOption_t MEO_SCREENSETUP_LEVELSTATS = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.levelstats);
464
static MenuEntry_t ME_SCREENSETUP_LEVELSTATS = MAKE_MENUENTRY( "Level stats:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_LEVELSTATS, Option );
464
static MenuEntry_t ME_SCREENSETUP_LEVELSTATS = MAKE_MENUENTRY( "Level stats:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_LEVELSTATS, Option );
465
465
466
466
467
static MenuOption_t MEO_SCREENSETUP_SHOWPICKUPMESSAGES = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.fta_on);
467
static MenuOption_t MEO_SCREENSETUP_SHOWPICKUPMESSAGES = MAKE_MENUOPTION(&MF_Redfont, &MEOS_OffOn, &ud.fta_on);
468
static MenuEntry_t ME_SCREENSETUP_SHOWPICKUPMESSAGES = MAKE_MENUENTRY( "Pickup messages:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_SHOWPICKUPMESSAGES, Option );
468
static MenuEntry_t ME_SCREENSETUP_SHOWPICKUPMESSAGES = MAKE_MENUENTRY( "Pickup messages:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_SHOWPICKUPMESSAGES, Option );
469
469
470
static char *MEOSN_SCREENSETUP_NEWSTATUSBAR[] = { "Classic", "New",
470
static char *MEOSN_SCREENSETUP_NEWSTATUSBAR[] = { "Classic", "New",
471
#ifdef DROIDMENU
471
#ifdef DROIDMENU
472
"On top",
472
"On top",
473
#endif
473
#endif
474
};
474
};
475
475
476
static int32_t MEOSV_SCREENSETUP_NEWSTATUSBAR[] = { 0, 1,
476
static int32_t MEOSV_SCREENSETUP_NEWSTATUSBAR[] = { 0, 1,
477
#ifdef DROIDMENU
477
#ifdef DROIDMENU
478
2,
478
2,
479
#endif
479
#endif
480
};
480
};
481
481
482
static MenuOptionSet_t MEOS_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUOPTIONSET( MEOSN_SCREENSETUP_NEWSTATUSBAR, MEOSV_SCREENSETUP_NEWSTATUSBAR, 0x2 );
482
static MenuOptionSet_t MEOS_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUOPTIONSET( MEOSN_SCREENSETUP_NEWSTATUSBAR, MEOSV_SCREENSETUP_NEWSTATUSBAR, 0x2 );
483
static MenuOption_t MEO_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUOPTION(&MF_Redfont, &MEOS_SCREENSETUP_NEWSTATUSBAR, &ud.althud);
483
static MenuOption_t MEO_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUOPTION(&MF_Redfont, &MEOS_SCREENSETUP_NEWSTATUSBAR, &ud.althud);
484
static MenuEntry_t ME_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUENTRY( "Status bar:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_NEWSTATUSBAR, Option );
484
static MenuEntry_t ME_SCREENSETUP_NEWSTATUSBAR = MAKE_MENUENTRY( "Status bar:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_NEWSTATUSBAR, Option );
485
485
486
486
487
487
488
static MenuRangeInt32_t MEO_SCREENSETUP_SBARSIZE = MAKE_MENURANGE( &ud.statusbarscale, &MF_Redfont, 36, 100, 0, 17, 2 );
488
static MenuRangeInt32_t MEO_SCREENSETUP_SBARSIZE = MAKE_MENURANGE( &ud.statusbarscale, &MF_Redfont, 36, 100, 0, 17, 2 );
489
static MenuEntry_t ME_SCREENSETUP_SBARSIZE = MAKE_MENUENTRY( "Size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_SBARSIZE, RangeInt32 );
489
static MenuEntry_t ME_SCREENSETUP_SBARSIZE = MAKE_MENUENTRY( "Size:", &MF_Redfont, &MEF_BigOptions, &MEO_SCREENSETUP_SBARSIZE, RangeInt32 );
490
490
491
491
492
static MenuLink_t MEO_DISPLAYSETUP_SCREENSETUP = { MENU_SCREENSETUP, MA_Advance, };
492
static MenuLink_t MEO_DISPLAYSETUP_SCREENSETUP = { MENU_SCREENSETUP, MA_Advance, };
493
static MenuEntry_t ME_DISPLAYSETUP_SCREENSETUP = MAKE_MENUENTRY( "On-screen displays", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_SCREENSETUP, Link );
493
static MenuEntry_t ME_DISPLAYSETUP_SCREENSETUP = MAKE_MENUENTRY( "On-screen displays", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_SCREENSETUP, Link );
494
494
495
495
496
#ifndef DROIDMENU
496
#ifndef DROIDMENU
497
#ifdef USE_OPENGL
497
#ifdef USE_OPENGL
498
static MenuLink_t MEO_DISPLAYSETUP_ADVANCED_GL = { MENU_RENDERERSETUP, MA_Advance, };
498
static MenuLink_t MEO_DISPLAYSETUP_ADVANCED_GL = { MENU_RENDERERSETUP, MA_Advance, };
499
static MenuEntry_t ME_DISPLAYSETUP_ADVANCED_GL = MAKE_MENUENTRY( "Advanced", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ADVANCED_GL, Link );
499
static MenuEntry_t ME_DISPLAYSETUP_ADVANCED_GL = MAKE_MENUENTRY( "Advanced", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_ADVANCED_GL, Link );
500
#endif
500
#endif
501
501
502
static MenuLink_t MEO_DISPLAYSETUP_VIDEOSETUP = { MENU_VIDEOSETUP, MA_Advance, };
502
static MenuLink_t MEO_DISPLAYSETUP_VIDEOSETUP = { MENU_VIDEOSETUP, MA_Advance, };
503
static MenuEntry_t ME_DISPLAYSETUP_VIDEOSETUP = MAKE_MENUENTRY( "Video mode", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_VIDEOSETUP, Link );
503
static MenuEntry_t ME_DISPLAYSETUP_VIDEOSETUP = MAKE_MENUENTRY( "Video mode", &MF_Redfont, &MEF_BigOptionsRt, &MEO_DISPLAYSETUP_VIDEOSETUP, Link );
504
#endif
504
#endif
505
505
506
static MenuEntry_t *MEL_OPTIONS[] = {
506
static MenuEntry_t *MEL_OPTIONS[] = {
507
    &ME_OPTIONS_GAMESETUP,
507
    &ME_OPTIONS_GAMESETUP,
508
    &ME_OPTIONS_SOUNDSETUP,
508
    &ME_OPTIONS_SOUNDSETUP,
509
    &ME_OPTIONS_DISPLAYSETUP,
509
    &ME_OPTIONS_DISPLAYSETUP,
510
#ifndef DROIDMENU
510
#ifndef DROIDMENU
511
    &ME_OPTIONS_PLAYERSETUP,
511
    &ME_OPTIONS_PLAYERSETUP,
512
#endif
512
#endif
513
    &ME_OPTIONS_CONTROLS,
513
    &ME_OPTIONS_CONTROLS,
514
};
514
};
515
515
516
static MenuEntry_t *MEL_CONTROLS[] = {
516
static MenuEntry_t *MEL_CONTROLS[] = {
517
    &ME_OPTIONS_KEYBOARDSETUP,
517
    &ME_OPTIONS_KEYBOARDSETUP,
518
    &ME_OPTIONS_MOUSESETUP,
518
    &ME_OPTIONS_MOUSESETUP,
519
    &ME_OPTIONS_JOYSTICKSETUP,
519
    &ME_OPTIONS_JOYSTICKSETUP,
520
};
520
};
521
521
522
522
523
static MenuEntry_t *MEL_VIDEOSETUP[] = {
523
static MenuEntry_t *MEL_VIDEOSETUP[] = {
524
    &ME_VIDEOSETUP_RESOLUTION,
524
    &ME_VIDEOSETUP_RESOLUTION,
525
#ifdef USE_OPENGL
525
#ifdef USE_OPENGL
526
    &ME_VIDEOSETUP_RENDERER,
526
    &ME_VIDEOSETUP_RENDERER,
527
#endif
527
#endif
528
    &ME_VIDEOSETUP_FULLSCREEN,
528
    &ME_VIDEOSETUP_FULLSCREEN,
529
    &ME_Space6,
529
    &ME_Space6,
530
    &ME_VIDEOSETUP_APPLY,
530
    &ME_VIDEOSETUP_APPLY,
531
};
531
};
532
static MenuEntry_t *MEL_DISPLAYSETUP[] = {
532
static MenuEntry_t *MEL_DISPLAYSETUP[] = {
533
    &ME_DISPLAYSETUP_SCREENSETUP,
533
    &ME_DISPLAYSETUP_SCREENSETUP,
534
    &ME_DISPLAYSETUP_COLORCORR,
534
    &ME_DISPLAYSETUP_COLORCORR,
535
#ifndef DROIDMENU
535
#ifndef DROIDMENU
536
    &ME_DISPLAYSETUP_VIDEOSETUP,
536
    &ME_DISPLAYSETUP_VIDEOSETUP,
537
#endif
537
#endif
538
    &ME_DISPLAYSETUP_ASPECTRATIO,
538
    &ME_DISPLAYSETUP_ASPECTRATIO,
539
    &ME_DISPLAYSETUP_PIXELDOUBLING,
539
    &ME_DISPLAYSETUP_PIXELDOUBLING,
540
};
540
};
541
541
542
#ifdef USE_OPENGL
542
#ifdef USE_OPENGL
543
static MenuEntry_t *MEL_DISPLAYSETUP_GL[] = {
543
static MenuEntry_t *MEL_DISPLAYSETUP_GL[] = {
544
    &ME_DISPLAYSETUP_SCREENSETUP,
544
    &ME_DISPLAYSETUP_SCREENSETUP,
545
    &ME_DISPLAYSETUP_COLORCORR,
545
    &ME_DISPLAYSETUP_COLORCORR,
546
#ifndef DROIDMENU
546
#ifndef DROIDMENU
547
    &ME_DISPLAYSETUP_VIDEOSETUP,
547
    &ME_DISPLAYSETUP_VIDEOSETUP,
548
#endif
548
#endif
549
    &ME_DISPLAYSETUP_ASPECTRATIO,
549
    &ME_DISPLAYSETUP_ASPECTRATIO,
550
    &ME_DISPLAYSETUP_TEXFILTER,
550
    &ME_DISPLAYSETUP_TEXFILTER,
551
#ifndef DROIDMENU
551
#ifndef DROIDMENU
552
    &ME_DISPLAYSETUP_ANISOTROPY,
552
    &ME_DISPLAYSETUP_ANISOTROPY,
553
    &ME_DISPLAYSETUP_VSYNC,
553
    &ME_DISPLAYSETUP_VSYNC,
554
    &ME_DISPLAYSETUP_ADVANCED_GL,
554
    &ME_DISPLAYSETUP_ADVANCED_GL,
555
#endif
555
#endif
556
};
556
};
557
557
558
#ifdef POLYMER
558
#ifdef POLYMER
559
static MenuEntry_t *MEL_DISPLAYSETUP_GL_POLYMER[] = {
559
static MenuEntry_t *MEL_DISPLAYSETUP_GL_POLYMER[] = {
560
    &ME_DISPLAYSETUP_SCREENSETUP,
560
    &ME_DISPLAYSETUP_SCREENSETUP,
561
    &ME_DISPLAYSETUP_COLORCORR,
561
    &ME_DISPLAYSETUP_COLORCORR,
562
#ifndef DROIDMENU
562
#ifndef DROIDMENU
563
    &ME_DISPLAYSETUP_VIDEOSETUP,
563
    &ME_DISPLAYSETUP_VIDEOSETUP,
564
#endif
564
#endif
565
    &ME_DISPLAYSETUP_ASPECTRATIO_POLYMER,
565
    &ME_DISPLAYSETUP_ASPECTRATIO_POLYMER,
566
    &ME_DISPLAYSETUP_TEXFILTER,
566
    &ME_DISPLAYSETUP_TEXFILTER,
567
#ifndef DROIDMENU
567
#ifndef DROIDMENU
568
    &ME_DISPLAYSETUP_ANISOTROPY,
568
    &ME_DISPLAYSETUP_ANISOTROPY,
569
    &ME_DISPLAYSETUP_VSYNC,
569
    &ME_DISPLAYSETUP_VSYNC,
570
    &ME_DISPLAYSETUP_ADVANCED_GL,
570
    &ME_DISPLAYSETUP_ADVANCED_GL,
571
#endif
571
#endif
572
};
572
};
573
573
574
#endif
574
#endif
575
#endif
575
#endif
576
576
577
577
578
578
579
static char *MenuKeyNone = "  -";
579
static char *MenuKeyNone = "  -";
580
static char *MEOSN_Keys[NUMKEYS];
580
static char *MEOSN_Keys[NUMKEYS];
581
581
582
static MenuCustom2Col_t MEO_KEYBOARDSETUPFUNCS_TEMPLATE = { { NULL, NULL, }, MEOSN_Keys, &MF_MinifontRed, NUMKEYS, 54<<16, 0 };
582
static MenuCustom2Col_t MEO_KEYBOARDSETUPFUNCS_TEMPLATE = { { NULL, NULL, }, MEOSN_Keys, &MF_MinifontRed, NUMKEYS, 54<<16, 0 };
583
static MenuCustom2Col_t MEO_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
583
static MenuCustom2Col_t MEO_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
584
static MenuEntry_t ME_KEYBOARDSETUPFUNCS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_FuncList, &MEO_KEYBOARDSETUPFUNCS_TEMPLATE, Custom2Col );
584
static MenuEntry_t ME_KEYBOARDSETUPFUNCS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_FuncList, &MEO_KEYBOARDSETUPFUNCS_TEMPLATE, Custom2Col );
585
static MenuEntry_t ME_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
585
static MenuEntry_t ME_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
586
static MenuEntry_t *MEL_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
586
static MenuEntry_t *MEL_KEYBOARDSETUPFUNCS[NUMGAMEFUNCTIONS];
587
587
588
static MenuLink_t MEO_KEYBOARDSETUP_KEYS = { MENU_KEYBOARDKEYS, MA_Advance, };
588
static MenuLink_t MEO_KEYBOARDSETUP_KEYS = { MENU_KEYBOARDKEYS, MA_Advance, };
589
static MenuEntry_t ME_KEYBOARDSETUP_KEYS = MAKE_MENUENTRY( "Configure Keys", &MF_Redfont, &MEF_CenterMenu, &MEO_KEYBOARDSETUP_KEYS, Link );
589
static MenuEntry_t ME_KEYBOARDSETUP_KEYS = MAKE_MENUENTRY( "Configure Keys", &MF_Redfont, &MEF_CenterMenu, &MEO_KEYBOARDSETUP_KEYS, Link );
590
static MenuEntry_t ME_KEYBOARDSETUP_RESET = MAKE_MENUENTRY( "Reset To Defaults", &MF_Redfont, &MEF_CenterMenu, &MEO_NULL, Link );
590
static MenuEntry_t ME_KEYBOARDSETUP_RESET = MAKE_MENUENTRY( "Reset To Defaults", &MF_Redfont, &MEF_CenterMenu, &MEO_NULL, Link );
591
static MenuEntry_t ME_KEYBOARDSETUP_RESETCLASSIC = MAKE_MENUENTRY( "Reset To Classic", &MF_Redfont, &MEF_CenterMenu, &MEO_NULL, Link );
591
static MenuEntry_t ME_KEYBOARDSETUP_RESETCLASSIC = MAKE_MENUENTRY( "Reset To Classic", &MF_Redfont, &MEF_CenterMenu, &MEO_NULL, Link );
592
592
593
static MenuEntry_t *MEL_KEYBOARDSETUP[] = {
593
static MenuEntry_t *MEL_KEYBOARDSETUP[] = {
594
    &ME_KEYBOARDSETUP_KEYS,
594
    &ME_KEYBOARDSETUP_KEYS,
595
    &ME_KEYBOARDSETUP_RESET,
595
    &ME_KEYBOARDSETUP_RESET,
596
    &ME_KEYBOARDSETUP_RESETCLASSIC,
596
    &ME_KEYBOARDSETUP_RESETCLASSIC,
597
};
597
};
598
598
599
599
600
// There is no better way to do this than manually.
600
// There is no better way to do this than manually.
601
601
602
#define MENUMOUSEFUNCTIONS 12
602
#define MENUMOUSEFUNCTIONS 12
603
603
604
static char *MenuMouseNames[MENUMOUSEFUNCTIONS] = {
604
static char *MenuMouseNames[MENUMOUSEFUNCTIONS] = {
605
    "Button 1",
605
    "Button 1",
606
    "Double Button 1",
606
    "Double Button 1",
607
    "Button 2",
607
    "Button 2",
608
    "Double Button 2",
608
    "Double Button 2",
609
    "Button 3",
609
    "Button 3",
610
    "Double Button 3",
610
    "Double Button 3",
611
611
612
    "Wheel Up",
612
    "Wheel Up",
613
    "Wheel Down",
613
    "Wheel Down",
614
614
615
    "Button 4",
615
    "Button 4",
616
    "Double Button 4",
616
    "Double Button 4",
617
    "Button 5",
617
    "Button 5",
618
    "Double Button 5",
618
    "Double Button 5",
619
};
619
};
620
static int32_t MenuMouseDataIndex[MENUMOUSEFUNCTIONS][2] = {
620
static int32_t MenuMouseDataIndex[MENUMOUSEFUNCTIONS][2] = {
621
    { 0, 0, },
621
    { 0, 0, },
622
    { 0, 1, },
622
    { 0, 1, },
623
    { 1, 0, },
623
    { 1, 0, },
624
    { 1, 1, },
624
    { 1, 1, },
625
    { 2, 0, },
625
    { 2, 0, },
626
    { 2, 1, },
626
    { 2, 1, },
627
627
628
    // note the mouse wheel
628
    // note the mouse wheel
629
    { 4, 0, },
629
    { 4, 0, },
630
    { 5, 0, },
630
    { 5, 0, },
631
631
632
    { 3, 0, },
632
    { 3, 0, },
633
    { 3, 1, },
633
    { 3, 1, },
634
    { 6, 0, },
634
    { 6, 0, },
635
    { 6, 1, },
635
    { 6, 1, },
636
};
636
};
637
637
638
static MenuOption_t MEO_MOUSEJOYSETUPBTNS_TEMPLATE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
638
static MenuOption_t MEO_MOUSEJOYSETUPBTNS_TEMPLATE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
639
static MenuOption_t MEO_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
639
static MenuOption_t MEO_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
640
static MenuEntry_t ME_MOUSEJOYSETUPBTNS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_FuncList, NULL, Option );
640
static MenuEntry_t ME_MOUSEJOYSETUPBTNS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Minifont, &MEF_FuncList, NULL, Option );
641
static MenuEntry_t ME_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
641
static MenuEntry_t ME_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
642
static MenuEntry_t *MEL_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
642
static MenuEntry_t *MEL_MOUSESETUPBTNS[MENUMOUSEFUNCTIONS];
643
643
644
static MenuLink_t MEO_MOUSESETUP_BTNS = { MENU_MOUSEBTNS, MA_Advance, };
644
static MenuLink_t MEO_MOUSESETUP_BTNS = { MENU_MOUSEBTNS, MA_Advance, };
645
static MenuEntry_t ME_MOUSESETUP_BTNS = MAKE_MENUENTRY( "Button assignment", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_BTNS, Link );
645
static MenuEntry_t ME_MOUSESETUP_BTNS = MAKE_MENUENTRY( "Button assignment", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_BTNS, Link );
646
static MenuRangeFloat_t MEO_MOUSESETUP_SENSITIVITY = MAKE_MENURANGE( &CONTROL_MouseSensitivity, &MF_Redfont, .5f, 16.f, 0.f, 32, 1 );
646
static MenuRangeFloat_t MEO_MOUSESETUP_SENSITIVITY = MAKE_MENURANGE( &CONTROL_MouseSensitivity, &MF_Redfont, .5f, 16.f, 0.f, 32, 1 );
647
static MenuEntry_t ME_MOUSESETUP_SENSITIVITY = MAKE_MENUENTRY( "Sensitivity:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SENSITIVITY, RangeFloat );
647
static MenuEntry_t ME_MOUSESETUP_SENSITIVITY = MAKE_MENUENTRY( "Sensitivity:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SENSITIVITY, RangeFloat );
648
static MenuOption_t MEO_MOUSESETUP_MOUSEAIMING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &g_myAimMode );
648
static MenuOption_t MEO_MOUSESETUP_MOUSEAIMING = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &g_myAimMode );
649
static MenuEntry_t ME_MOUSESETUP_MOUSEAIMING = MAKE_MENUENTRY( "Vertical aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMING, Option );
649
static MenuEntry_t ME_MOUSESETUP_MOUSEAIMING = MAKE_MENUENTRY( "Vertical aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_MOUSEAIMING, Option );
650
static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &ud.mouseflip );
650
static MenuOption_t MEO_MOUSESETUP_INVERT = MAKE_MENUOPTION( &MF_Redfont, &MEOS_YesNo, &ud.mouseflip );
651
static MenuEntry_t ME_MOUSESETUP_INVERT = MAKE_MENUENTRY( "Invert aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_INVERT, Option );
651
static MenuEntry_t ME_MOUSESETUP_INVERT = MAKE_MENUENTRY( "Invert aiming:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_INVERT, Option );
652
static MenuOption_t MEO_MOUSESETUP_SMOOTH = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.SmoothInput );
652
static MenuOption_t MEO_MOUSESETUP_SMOOTH = MAKE_MENUOPTION( &MF_Redfont, &MEOS_NoYes, &ud.config.SmoothInput );
653
static MenuEntry_t ME_MOUSESETUP_SMOOTH = MAKE_MENUENTRY( "Filter input:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SMOOTH, Option );
653
static MenuEntry_t ME_MOUSESETUP_SMOOTH = MAKE_MENUENTRY( "Filter input:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_SMOOTH, Option );
654
static MenuLink_t MEO_MOUSESETUP_ADVANCED = { MENU_MOUSEADVANCED, MA_Advance, };
654
static MenuLink_t MEO_MOUSESETUP_ADVANCED = { MENU_MOUSEADVANCED, MA_Advance, };
655
static MenuEntry_t ME_MOUSESETUP_ADVANCED = MAKE_MENUENTRY( "Advanced setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_ADVANCED, Link );
655
static MenuEntry_t ME_MOUSESETUP_ADVANCED = MAKE_MENUENTRY( "Advanced setup", &MF_Redfont, &MEF_BigOptionsRt, &MEO_MOUSESETUP_ADVANCED, Link );
656
656
657
static MenuEntry_t *MEL_MOUSESETUP[] = {
657
static MenuEntry_t *MEL_MOUSESETUP[] = {
658
    &ME_MOUSESETUP_SENSITIVITY,
658
    &ME_MOUSESETUP_SENSITIVITY,
659
    &ME_MOUSESETUP_BTNS,
659
    &ME_MOUSESETUP_BTNS,
660
    &ME_Space2,
660
    &ME_Space2,
661
    &ME_MOUSESETUP_MOUSEAIMING,
661
    &ME_MOUSESETUP_MOUSEAIMING,
662
    &ME_MOUSESETUP_INVERT,
662
    &ME_MOUSESETUP_INVERT,
663
    &ME_MOUSESETUP_SMOOTH,
663
    &ME_MOUSESETUP_SMOOTH,
664
    &ME_MOUSESETUP_ADVANCED,
664
    &ME_MOUSESETUP_ADVANCED,
665
};
665
};
666
666
667
MAKE_MENU_TOP_ENTRYLINK( "Edit Buttons", MEF_CenterMenu, JOYSTICK_EDITBUTTONS, MENU_JOYSTICKBTNS );
667
MAKE_MENU_TOP_ENTRYLINK( "Edit Buttons", MEF_CenterMenu, JOYSTICK_EDITBUTTONS, MENU_JOYSTICKBTNS );
668
MAKE_MENU_TOP_ENTRYLINK( "Edit Axes", MEF_CenterMenu, JOYSTICK_EDITAXES, MENU_JOYSTICKAXES );
668
MAKE_MENU_TOP_ENTRYLINK( "Edit Axes", MEF_CenterMenu, JOYSTICK_EDITAXES, MENU_JOYSTICKAXES );
669
669
670
static MenuEntry_t *MEL_JOYSTICKSETUP[] = {
670
static MenuEntry_t *MEL_JOYSTICKSETUP[] = {
671
    &ME_JOYSTICK_EDITBUTTONS,
671
    &ME_JOYSTICK_EDITBUTTONS,
672
    &ME_JOYSTICK_EDITAXES,
672
    &ME_JOYSTICK_EDITAXES,
673
};
673
};
674
674
675
#define MAXJOYBUTTONSTRINGLENGTH 32
675
#define MAXJOYBUTTONSTRINGLENGTH 32
676
676
677
static char MenuJoystickNames[MAXJOYBUTTONSANDHATS*2][MAXJOYBUTTONSTRINGLENGTH];
677
static char MenuJoystickNames[MAXJOYBUTTONSANDHATS*2][MAXJOYBUTTONSTRINGLENGTH];
678
678
679
static MenuOption_t MEO_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
679
static MenuOption_t MEO_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
680
static MenuEntry_t ME_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
680
static MenuEntry_t ME_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
681
static MenuEntry_t *MEL_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
681
static MenuEntry_t *MEL_JOYSTICKBTNS[MAXJOYBUTTONSANDHATS*2];
682
682
683
static MenuLink_t MEO_JOYSTICKAXES = { MENU_JOYSTICKAXIS, MA_Advance, };
683
static MenuLink_t MEO_JOYSTICKAXES = { MENU_JOYSTICKAXIS, MA_Advance, };
684
static MenuEntry_t ME_JOYSTICKAXES_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXES, Link );
684
static MenuEntry_t ME_JOYSTICKAXES_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXES, Link );
685
static MenuEntry_t ME_JOYSTICKAXES[MAXJOYAXES];
685
static MenuEntry_t ME_JOYSTICKAXES[MAXJOYAXES];
686
static char MenuJoystickAxes[MAXJOYAXES][MAXJOYBUTTONSTRINGLENGTH];
686
static char MenuJoystickAxes[MAXJOYAXES][MAXJOYBUTTONSTRINGLENGTH];
687
687
688
static MenuEntry_t *MEL_JOYSTICKAXES[MAXJOYAXES];
688
static MenuEntry_t *MEL_JOYSTICKAXES[MAXJOYAXES];
689
689
690
static MenuRangeInt32_t MEO_MOUSEADVANCED_SCALEX = MAKE_MENURANGE( &ud.config.MouseAnalogueScale[0], &MF_Bluefont, -262144, 262144, 65536, 65, 3 );
690
static MenuRangeInt32_t MEO_MOUSEADVANCED_SCALEX = MAKE_MENURANGE( &ud.config.MouseAnalogueScale[0], &MF_Bluefont, -262144, 262144, 65536, 65, 3 );
691
static MenuEntry_t ME_MOUSEADVANCED_SCALEX = MAKE_MENUENTRY( "X-Axis Scale", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_SCALEX, RangeInt32 );
691
static MenuEntry_t ME_MOUSEADVANCED_SCALEX = MAKE_MENUENTRY( "X-Axis Scale", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_SCALEX, RangeInt32 );
692
static MenuRangeInt32_t MEO_MOUSEADVANCED_SCALEY = MAKE_MENURANGE( &ud.config.MouseAnalogueScale[1], &MF_Bluefont, -262144, 262144, 65536, 65, 3 );
692
static MenuRangeInt32_t MEO_MOUSEADVANCED_SCALEY = MAKE_MENURANGE( &ud.config.MouseAnalogueScale[1], &MF_Bluefont, -262144, 262144, 65536, 65, 3 );
693
static MenuEntry_t ME_MOUSEADVANCED_SCALEY = MAKE_MENUENTRY( "Y-Axis Scale", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_SCALEY, RangeInt32 );
693
static MenuEntry_t ME_MOUSEADVANCED_SCALEY = MAKE_MENUENTRY( "Y-Axis Scale", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_SCALEY, RangeInt32 );
694
694
695
static MenuOption_t MEO_MOUSEADVANCED_DAXES_UP = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[1][0] );
695
static MenuOption_t MEO_MOUSEADVANCED_DAXES_UP = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[1][0] );
696
static MenuEntry_t ME_MOUSEADVANCED_DAXES_UP = MAKE_MENUENTRY( "Digital Up", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_UP, Option );
696
static MenuEntry_t ME_MOUSEADVANCED_DAXES_UP = MAKE_MENUENTRY( "Digital Up", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_UP, Option );
697
static MenuOption_t MEO_MOUSEADVANCED_DAXES_DOWN = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[1][1] );
697
static MenuOption_t MEO_MOUSEADVANCED_DAXES_DOWN = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[1][1] );
698
static MenuEntry_t ME_MOUSEADVANCED_DAXES_DOWN = MAKE_MENUENTRY( "Digital Down", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_DOWN, Option );
698
static MenuEntry_t ME_MOUSEADVANCED_DAXES_DOWN = MAKE_MENUENTRY( "Digital Down", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_DOWN, Option );
699
static MenuOption_t MEO_MOUSEADVANCED_DAXES_LEFT = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[0][0] );
699
static MenuOption_t MEO_MOUSEADVANCED_DAXES_LEFT = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[0][0] );
700
static MenuEntry_t ME_MOUSEADVANCED_DAXES_LEFT = MAKE_MENUENTRY( "Digital Left", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_LEFT, Option );
700
static MenuEntry_t ME_MOUSEADVANCED_DAXES_LEFT = MAKE_MENUENTRY( "Digital Left", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_LEFT, Option );
701
static MenuOption_t MEO_MOUSEADVANCED_DAXES_RIGHT = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[0][1] );
701
static MenuOption_t MEO_MOUSEADVANCED_DAXES_RIGHT = MAKE_MENUOPTION( &MF_BluefontRed, &MEOS_Gamefuncs, &ud.config.MouseDigitalFunctions[0][1] );
702
static MenuEntry_t ME_MOUSEADVANCED_DAXES_RIGHT = MAKE_MENUENTRY( "Digital Right", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_RIGHT, Option );
702
static MenuEntry_t ME_MOUSEADVANCED_DAXES_RIGHT = MAKE_MENUENTRY( "Digital Right", &MF_Redfont, &MEF_BigSliders, &MEO_MOUSEADVANCED_DAXES_RIGHT, Option );
703
703
704
static MenuEntry_t *MEL_MOUSEADVANCED[] = {
704
static MenuEntry_t *MEL_MOUSEADVANCED[] = {
705
    &ME_MOUSEADVANCED_SCALEX,
705
    &ME_MOUSEADVANCED_SCALEX,
706
    &ME_MOUSEADVANCED_SCALEY,
706
    &ME_MOUSEADVANCED_SCALEY,
707
    &ME_Space8,
707
    &ME_Space8,
708
    &ME_MOUSEADVANCED_DAXES_UP,
708
    &ME_MOUSEADVANCED_DAXES_UP,
709
    &ME_MOUSEADVANCED_DAXES_DOWN,
709
    &ME_MOUSEADVANCED_DAXES_DOWN,
710
    &ME_MOUSEADVANCED_DAXES_LEFT,
710
    &ME_MOUSEADVANCED_DAXES_LEFT,
711
    &ME_MOUSEADVANCED_DAXES_RIGHT,
711
    &ME_MOUSEADVANCED_DAXES_RIGHT,
712
};
712
};
713
713
714
static MenuEntry_t *MEL_INTERNAL_MOUSEADVANCED_DAXES[] = {
714
static MenuEntry_t *MEL_INTERNAL_MOUSEADVANCED_DAXES[] = {
715
    &ME_MOUSEADVANCED_DAXES_UP,
715
    &ME_MOUSEADVANCED_DAXES_UP,
716
    &ME_MOUSEADVANCED_DAXES_DOWN,
716
    &ME_MOUSEADVANCED_DAXES_DOWN,
717
    &ME_MOUSEADVANCED_DAXES_LEFT,
717
    &ME_MOUSEADVANCED_DAXES_LEFT,
718
    &ME_MOUSEADVANCED_DAXES_RIGHT,
718
    &ME_MOUSEADVANCED_DAXES_RIGHT,
719
};
719
};
720
720
721
static const char *MenuJoystickHatDirections[] = { "Up", "Right", "Down", "Left", };
721
static const char *MenuJoystickHatDirections[] = { "Up", "Right", "Down", "Left", };
722
722
723
static char *MEOSN_JOYSTICKAXIS_ANALOG[] = { "  -None-", "Turning", "Strafing", "Looking", "Moving", };
723
static char *MEOSN_JOYSTICKAXIS_ANALOG[] = { "  -None-", "Turning", "Strafing", "Looking", "Moving", };
724
static int32_t MEOSV_JOYSTICKAXIS_ANALOG[] = { -1, analog_turning, analog_strafing, analog_lookingupanddown, analog_moving, };
724
static int32_t MEOSV_JOYSTICKAXIS_ANALOG[] = { -1, analog_turning, analog_strafing, analog_lookingupanddown, analog_moving, };
725
static MenuOptionSet_t MEOS_JOYSTICKAXIS_ANALOG = MAKE_MENUOPTIONSET( MEOSN_JOYSTICKAXIS_ANALOG, MEOSV_JOYSTICKAXIS_ANALOG, 0x0 );
725
static MenuOptionSet_t MEOS_JOYSTICKAXIS_ANALOG = MAKE_MENUOPTIONSET( MEOSN_JOYSTICKAXIS_ANALOG, MEOSV_JOYSTICKAXIS_ANALOG, 0x0 );
726
static MenuOption_t MEO_JOYSTICKAXIS_ANALOG = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_JOYSTICKAXIS_ANALOG, NULL );
726
static MenuOption_t MEO_JOYSTICKAXIS_ANALOG = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_JOYSTICKAXIS_ANALOG, NULL );
727
static MenuEntry_t ME_JOYSTICKAXIS_ANALOG = MAKE_MENUENTRY( "Analog", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_ANALOG, Option );
727
static MenuEntry_t ME_JOYSTICKAXIS_ANALOG = MAKE_MENUENTRY( "Analog", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_ANALOG, Option );
728
static MenuRangeInt32_t MEO_JOYSTICKAXIS_SCALE = MAKE_MENURANGE( NULL, &MF_Bluefont, -262144, 262144, 65536, 65, 3 );
728
static MenuRangeInt32_t MEO_JOYSTICKAXIS_SCALE = MAKE_MENURANGE( NULL, &MF_Bluefont, -262144, 262144, 65536, 65, 3 );
729
static MenuEntry_t ME_JOYSTICKAXIS_SCALE = MAKE_MENUENTRY( "Scale", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_SCALE, RangeInt32 );
729
static MenuEntry_t ME_JOYSTICKAXIS_SCALE = MAKE_MENUENTRY( "Scale", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_SCALE, RangeInt32 );
730
static MenuRangeInt32_t MEO_JOYSTICKAXIS_DEAD = MAKE_MENURANGE( NULL, &MF_Bluefont, 0, 1000000, 0, 33, 2 );
730
static MenuRangeInt32_t MEO_JOYSTICKAXIS_DEAD = MAKE_MENURANGE( NULL, &MF_Bluefont, 0, 1000000, 0, 33, 2 );
731
static MenuEntry_t ME_JOYSTICKAXIS_DEAD = MAKE_MENUENTRY( "Dead Zone", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DEAD, RangeInt32 );
731
static MenuEntry_t ME_JOYSTICKAXIS_DEAD = MAKE_MENUENTRY( "Dead Zone", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DEAD, RangeInt32 );
732
static MenuRangeInt32_t MEO_JOYSTICKAXIS_SATU = MAKE_MENURANGE( NULL, &MF_Bluefont, 0, 1000000, 0, 33, 2 );
732
static MenuRangeInt32_t MEO_JOYSTICKAXIS_SATU = MAKE_MENURANGE( NULL, &MF_Bluefont, 0, 1000000, 0, 33, 2 );
733
static MenuEntry_t ME_JOYSTICKAXIS_SATU = MAKE_MENUENTRY( "Saturation", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_SATU, RangeInt32 );
733
static MenuEntry_t ME_JOYSTICKAXIS_SATU = MAKE_MENUENTRY( "Saturation", &MF_Redfont, &MEF_BigSliders, &MEO_JOYSTICKAXIS_SATU, RangeInt32 );
734
734
735
static MenuOption_t MEO_JOYSTICKAXIS_DIGITALNEGATIVE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
735
static MenuOption_t MEO_JOYSTICKAXIS_DIGITALNEGATIVE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
736
static MenuEntry_t ME_JOYSTICKAXIS_DIGITALNEGATIVE = MAKE_MENUENTRY( "Digital -", &MF_BluefontRed, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DIGITALNEGATIVE, Option );
736
static MenuEntry_t ME_JOYSTICKAXIS_DIGITALNEGATIVE = MAKE_MENUENTRY( "Digital -", &MF_BluefontRed, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DIGITALNEGATIVE, Option );
737
static MenuOption_t MEO_JOYSTICKAXIS_DIGITALPOSITIVE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
737
static MenuOption_t MEO_JOYSTICKAXIS_DIGITALPOSITIVE = MAKE_MENUOPTION( &MF_Minifont, &MEOS_Gamefuncs, NULL );
738
static MenuEntry_t ME_JOYSTICKAXIS_DIGITALPOSITIVE = MAKE_MENUENTRY( "Digital +", &MF_BluefontRed, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DIGITALPOSITIVE, Option );
738
static MenuEntry_t ME_JOYSTICKAXIS_DIGITALPOSITIVE = MAKE_MENUENTRY( "Digital +", &MF_BluefontRed, &MEF_BigSliders, &MEO_JOYSTICKAXIS_DIGITALPOSITIVE, Option );
739
739
740
static MenuEntry_t *MEL_JOYSTICKAXIS[] = {
740
static MenuEntry_t *MEL_JOYSTICKAXIS[] = {
741
    &ME_JOYSTICKAXIS_ANALOG,
741
    &ME_JOYSTICKAXIS_ANALOG,
742
    &ME_JOYSTICKAXIS_SCALE,
742
    &ME_JOYSTICKAXIS_SCALE,
743
    &ME_JOYSTICKAXIS_DEAD,
743
    &ME_JOYSTICKAXIS_DEAD,
744
    &ME_JOYSTICKAXIS_SATU,
744
    &ME_JOYSTICKAXIS_SATU,
745
    &ME_Space8,
745
    &ME_Space8,
746
    &ME_JOYSTICKAXIS_DIGITALNEGATIVE,
746
    &ME_JOYSTICKAXIS_DIGITALNEGATIVE,
747
    &ME_JOYSTICKAXIS_DIGITALPOSITIVE,
747
    &ME_JOYSTICKAXIS_DIGITALPOSITIVE,
748
};
748
};
749
749
750
static MenuEntry_t *MEL_INTERNAL_JOYSTICKAXIS_DIGITAL[] = {
750
static MenuEntry_t *MEL_INTERNAL_JOYSTICKAXIS_DIGITAL[] = {
751
    &ME_JOYSTICKAXIS_DIGITALNEGATIVE,
751
    &ME_JOYSTICKAXIS_DIGITALNEGATIVE,
752
    &ME_JOYSTICKAXIS_DIGITALPOSITIVE,
752
    &ME_JOYSTICKAXIS_DIGITALPOSITIVE,
753
};
753
};
754
754
755
#ifdef USE_OPENGL
755
#ifdef USE_OPENGL
756
static MenuOption_t MEO_RENDERERSETUP_HIGHTILE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &usehightile );
756
static MenuOption_t MEO_RENDERERSETUP_HIGHTILE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &usehightile );
757
static MenuEntry_t ME_RENDERERSETUP_HIGHTILE = MAKE_MENUENTRY( "Hires textures:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_HIGHTILE, Option );
757
static MenuEntry_t ME_RENDERERSETUP_HIGHTILE = MAKE_MENUENTRY( "Hires textures:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_HIGHTILE, Option );
758
static MenuRangeInt32_t MEO_RENDERERSETUP_TEXQUALITY = MAKE_MENURANGE( &r_downsize, &MF_Bluefont, 2, 0, 0, 3, 0 );
758
static MenuRangeInt32_t MEO_RENDERERSETUP_TEXQUALITY = MAKE_MENURANGE( &r_downsize, &MF_Bluefont, 2, 0, 0, 3, 0 );
759
static MenuEntry_t ME_RENDERERSETUP_TEXQUALITY = MAKE_MENUENTRY( "Hires texture quality", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_TEXQUALITY, RangeInt32 );
759
static MenuEntry_t ME_RENDERERSETUP_TEXQUALITY = MAKE_MENUENTRY( "Hires texture quality", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_TEXQUALITY, RangeInt32 );
760
static MenuOption_t MEO_RENDERERSETUP_PRECACHE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.config.useprecache );
760
static MenuOption_t MEO_RENDERERSETUP_PRECACHE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.config.useprecache );
761
static MenuEntry_t ME_RENDERERSETUP_PRECACHE = MAKE_MENUENTRY( "Pre-load map textures", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_PRECACHE, Option );
761
static MenuEntry_t ME_RENDERERSETUP_PRECACHE = MAKE_MENUENTRY( "Pre-load map textures", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_PRECACHE, Option );
762
static char *MEOSN_RENDERERSETUP_TEXCACHE[] = { "Off", "On", "Compress", };
762
static char *MEOSN_RENDERERSETUP_TEXCACHE[] = { "Off", "On", "Compress", };
763
static MenuOptionSet_t MEOS_RENDERERSETUP_TEXCACHE = MAKE_MENUOPTIONSET( MEOSN_RENDERERSETUP_TEXCACHE, NULL, 0x2 );
763
static MenuOptionSet_t MEOS_RENDERERSETUP_TEXCACHE = MAKE_MENUOPTIONSET( MEOSN_RENDERERSETUP_TEXCACHE, NULL, 0x2 );
764
static MenuOption_t MEO_RENDERERSETUP_TEXCACHE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_RENDERERSETUP_TEXCACHE, &glusetexcache );
764
static MenuOption_t MEO_RENDERERSETUP_TEXCACHE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_RENDERERSETUP_TEXCACHE, &glusetexcache );
765
static MenuEntry_t ME_RENDERERSETUP_TEXCACHE = MAKE_MENUENTRY( "On disk texture cache", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_TEXCACHE, Option );
765
static MenuEntry_t ME_RENDERERSETUP_TEXCACHE = MAKE_MENUENTRY( "On disk texture cache", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_TEXCACHE, Option );
766
static MenuOption_t MEO_RENDERERSETUP_DETAILTEX = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &r_detailmapping );
766
static MenuOption_t MEO_RENDERERSETUP_DETAILTEX = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &r_detailmapping );
767
static MenuEntry_t ME_RENDERERSETUP_DETAILTEX = MAKE_MENUENTRY( "Detail textures:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_DETAILTEX, Option );
767
static MenuEntry_t ME_RENDERERSETUP_DETAILTEX = MAKE_MENUENTRY( "Detail textures:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_DETAILTEX, Option );
768
static MenuOption_t MEO_RENDERERSETUP_MODELS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &usemodels );
768
static MenuOption_t MEO_RENDERERSETUP_MODELS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NoYes, &usemodels );
769
static MenuEntry_t ME_RENDERERSETUP_MODELS = MAKE_MENUENTRY( "Models:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_MODELS, Option );
769
static MenuEntry_t ME_RENDERERSETUP_MODELS = MAKE_MENUENTRY( "Models:", &MF_BluefontRed, &MEF_SmallOptions, &MEO_RENDERERSETUP_MODELS, Option );
770
#endif
770
#endif
771
771
772
#ifdef USE_OPENGL
772
#ifdef USE_OPENGL
773
static MenuEntry_t *MEL_RENDERERSETUP[] = {
773
static MenuEntry_t *MEL_RENDERERSETUP[] = {
774
    &ME_RENDERERSETUP_HIGHTILE,
774
    &ME_RENDERERSETUP_HIGHTILE,
775
    &ME_RENDERERSETUP_TEXQUALITY,
775
    &ME_RENDERERSETUP_TEXQUALITY,
776
    &ME_RENDERERSETUP_PRECACHE,
776
    &ME_RENDERERSETUP_PRECACHE,
777
    &ME_RENDERERSETUP_TEXCACHE,
777
    &ME_RENDERERSETUP_TEXCACHE,
778
    &ME_RENDERERSETUP_DETAILTEX,
778
    &ME_RENDERERSETUP_DETAILTEX,
779
    &ME_Space4,
779
    &ME_Space4,
780
    &ME_RENDERERSETUP_MODELS,
780
    &ME_RENDERERSETUP_MODELS,
781
};
781
};
782
#endif
782
#endif
783
783
784
#ifdef DROIDMENU
784
#ifdef DROIDMENU
785
static MenuRangeFloat_t MEO_COLCORR_GAMMA = MAKE_MENURANGE( &vid_gamma, &MF_Bluefont, 1.f, 2.5f, 0.f, 39, 1 );
785
static MenuRangeFloat_t MEO_COLCORR_GAMMA = MAKE_MENURANGE( &vid_gamma, &MF_Bluefont, 1.f, 2.5f, 0.f, 39, 1 );
786
#else
786
#else
787
static MenuRangeFloat_t MEO_COLCORR_GAMMA = MAKE_MENURANGE( &vid_gamma, &MF_Bluefont, 0.2f, 4.f, 0.f, 39, 1 );
787
static MenuRangeFloat_t MEO_COLCORR_GAMMA = MAKE_MENURANGE( &vid_gamma, &MF_Bluefont, 0.2f, 4.f, 0.f, 39, 1 );
788
#endif
788
#endif
789
static MenuEntry_t ME_COLCORR_GAMMA = MAKE_MENUENTRY( "Gamma:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_GAMMA, RangeFloat );
789
static MenuEntry_t ME_COLCORR_GAMMA = MAKE_MENUENTRY( "Gamma:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_GAMMA, RangeFloat );
790
static MenuRangeFloat_t MEO_COLCORR_CONTRAST = MAKE_MENURANGE( &vid_contrast, &MF_Bluefont, 0.1f, 2.7f, 0.f, 53, 1 );
790
static MenuRangeFloat_t MEO_COLCORR_CONTRAST = MAKE_MENURANGE( &vid_contrast, &MF_Bluefont, 0.1f, 2.7f, 0.f, 53, 1 );
791
static MenuEntry_t ME_COLCORR_CONTRAST = MAKE_MENUENTRY( "Contrast:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_CONTRAST, RangeFloat );
791
static MenuEntry_t ME_COLCORR_CONTRAST = MAKE_MENUENTRY( "Contrast:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_CONTRAST, RangeFloat );
792
static MenuRangeFloat_t MEO_COLCORR_BRIGHTNESS = MAKE_MENURANGE( &vid_brightness, &MF_Bluefont, -0.8f, 0.8f, 0.f, 33, 1 );
792
static MenuRangeFloat_t MEO_COLCORR_BRIGHTNESS = MAKE_MENURANGE( &vid_brightness, &MF_Bluefont, -0.8f, 0.8f, 0.f, 33, 1 );
793
static MenuEntry_t ME_COLCORR_BRIGHTNESS = MAKE_MENUENTRY( "Brightness:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_BRIGHTNESS, RangeFloat );
793
static MenuEntry_t ME_COLCORR_BRIGHTNESS = MAKE_MENUENTRY( "Brightness:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_BRIGHTNESS, RangeFloat );
794
static MenuEntry_t ME_COLCORR_RESET = MAKE_MENUENTRY( "Reset To Defaults", &MF_Redfont, &MEF_ColorCorrect, &MEO_NULL, Link );
794
static MenuEntry_t ME_COLCORR_RESET = MAKE_MENUENTRY( "Reset To Defaults", &MF_Redfont, &MEF_ColorCorrect, &MEO_NULL, Link );
795
static MenuRangeFloat_t MEO_COLCORR_AMBIENT = MAKE_MENURANGE( &r_ambientlight, &MF_Bluefont, 0.125f, 4.f, 0.f, 32, 1 );
795
static MenuRangeFloat_t MEO_COLCORR_AMBIENT = MAKE_MENURANGE( &r_ambientlight, &MF_Bluefont, 0.125f, 4.f, 0.f, 32, 1 );
796
static MenuEntry_t ME_COLCORR_AMBIENT = MAKE_MENUENTRY( "Visibility:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_AMBIENT, RangeFloat );
796
static MenuEntry_t ME_COLCORR_AMBIENT = MAKE_MENUENTRY( "Visibility:", &MF_Redfont, &MEF_ColorCorrect, &MEO_COLCORR_AMBIENT, RangeFloat );
797
797
798
static MenuEntry_t *MEL_COLCORR[] = {
798
static MenuEntry_t *MEL_COLCORR[] = {
799
    &ME_COLCORR_GAMMA,
799
    &ME_COLCORR_GAMMA,
800
#ifndef DROIDMENU
800
#ifndef DROIDMENU
801
    &ME_COLCORR_CONTRAST,
801
    &ME_COLCORR_CONTRAST,
802
    &ME_COLCORR_BRIGHTNESS,
802
    &ME_COLCORR_BRIGHTNESS,
803
#endif
803
#endif
804
    &ME_COLCORR_AMBIENT,
804
    &ME_COLCORR_AMBIENT,
805
    &ME_Space8,
805
    &ME_Space8,
806
    &ME_COLCORR_RESET,
806
    &ME_COLCORR_RESET,
807
};
807
};
808
808
809
static MenuEntry_t *MEL_SCREENSETUP[] = {
809
static MenuEntry_t *MEL_SCREENSETUP[] = {
810
#ifndef DROIDMENU
810
#ifndef DROIDMENU
811
    &ME_SCREENSETUP_SCREENSIZE,
811
    &ME_SCREENSETUP_SCREENSIZE,
812
#endif
812
#endif
813
813
814
    &ME_SCREENSETUP_NEWSTATUSBAR,
814
    &ME_SCREENSETUP_NEWSTATUSBAR,
815
    &ME_SCREENSETUP_SBARSIZE,
815
    &ME_SCREENSETUP_SBARSIZE,
816
816
817
    &ME_SCREENSETUP_CROSSHAIR,
817
    &ME_SCREENSETUP_CROSSHAIR,
818
    &ME_SCREENSETUP_CROSSHAIRSIZE,
818
    &ME_SCREENSETUP_CROSSHAIRSIZE,
819
819
820
    &ME_SCREENSETUP_LEVELSTATS,
820
    &ME_SCREENSETUP_LEVELSTATS,
821
    &ME_SCREENSETUP_TEXTSIZE,
821
    &ME_SCREENSETUP_TEXTSIZE,
822
822
823
    &ME_SCREENSETUP_SHOWPICKUPMESSAGES,
823
    &ME_SCREENSETUP_SHOWPICKUPMESSAGES,
824
};
824
};
825
825
826
// Save and load will be filled in before every viewing of the save/load screen.
826
// Save and load will be filled in before every viewing of the save/load screen.
827
static MenuLink_t MEO_LOAD = { MENU_NULL, MA_None, };
827
static MenuLink_t MEO_LOAD = { MENU_NULL, MA_None, };
828
static MenuLink_t MEO_LOAD_VALID = { MENU_LOADVERIFY, MA_None, };
828
static MenuLink_t MEO_LOAD_VALID = { MENU_LOADVERIFY, MA_None, };
829
static MenuEntry_t ME_LOAD_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_MinifontRed, &MEF_LoadSave, &MEO_LOAD, Link );
829
static MenuEntry_t ME_LOAD_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_MinifontRed, &MEF_LoadSave, &MEO_LOAD, Link );
830
static MenuEntry_t ME_LOAD[MAXSAVEGAMES];
830
static MenuEntry_t ME_LOAD[MAXSAVEGAMES];
831
static MenuEntry_t *MEL_LOAD[MAXSAVEGAMES];
831
static MenuEntry_t *MEL_LOAD[MAXSAVEGAMES];
832
832
833
static MenuString_t MEO_SAVE_TEMPLATE = MAKE_MENUSTRING( NULL, &MF_MinifontRed, MAXSAVEGAMENAME, 0 );
833
static MenuString_t MEO_SAVE_TEMPLATE = MAKE_MENUSTRING( NULL, &MF_MinifontRed, MAXSAVEGAMENAME, 0 );
834
static MenuString_t MEO_SAVE[MAXSAVEGAMES];
834
static MenuString_t MEO_SAVE[MAXSAVEGAMES];
835
static MenuEntry_t ME_SAVE_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_MinifontRed, &MEF_LoadSave, &MEO_SAVE_TEMPLATE, String );
835
static MenuEntry_t ME_SAVE_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_MinifontRed, &MEF_LoadSave, &MEO_SAVE_TEMPLATE, String );
836
static MenuEntry_t ME_SAVE[MAXSAVEGAMES];
836
static MenuEntry_t ME_SAVE[MAXSAVEGAMES];
837
static MenuEntry_t *MEL_SAVE[MAXSAVEGAMES];
837
static MenuEntry_t *MEL_SAVE[MAXSAVEGAMES];
838
838
839
static int32_t soundrate, soundbits, soundvoices;
839
static int32_t soundrate, soundbits, soundvoices;
840
static MenuOption_t MEO_SOUND = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.SoundToggle );
840
static MenuOption_t MEO_SOUND = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.SoundToggle );
841
static MenuEntry_t ME_SOUND = MAKE_MENUENTRY( "Sound:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND, Option );
841
static MenuEntry_t ME_SOUND = MAKE_MENUENTRY( "Sound:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND, Option );
842
842
843
static MenuOption_t MEO_SOUND_MUSIC = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.MusicToggle );
843
static MenuOption_t MEO_SOUND_MUSIC = MAKE_MENUOPTION( &MF_Redfont, &MEOS_OffOn, &ud.config.MusicToggle );
844
static MenuEntry_t ME_SOUND_MUSIC = MAKE_MENUENTRY( "Music:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_MUSIC, Option );
844
static MenuEntry_t ME_SOUND_MUSIC = MAKE_MENUENTRY( "Music:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_MUSIC, Option );
845
845
846
static MenuRangeInt32_t MEO_SOUND_VOLUME_MASTER = MAKE_MENURANGE( &ud.config.MasterVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
846
static MenuRangeInt32_t MEO_SOUND_VOLUME_MASTER = MAKE_MENURANGE( &ud.config.MasterVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
847
static MenuEntry_t ME_SOUND_VOLUME_MASTER = MAKE_MENUENTRY( "Volume:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_VOLUME_MASTER, RangeInt32 );
847
static MenuEntry_t ME_SOUND_VOLUME_MASTER = MAKE_MENUENTRY( "Volume:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_VOLUME_MASTER, RangeInt32 );
848
848
849
static MenuRangeInt32_t MEO_SOUND_VOLUME_EFFECTS = MAKE_MENURANGE( &ud.config.FXVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
849
static MenuRangeInt32_t MEO_SOUND_VOLUME_EFFECTS = MAKE_MENURANGE( &ud.config.FXVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
850
static MenuEntry_t ME_SOUND_VOLUME_EFFECTS = MAKE_MENUENTRY( "Effects:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_VOLUME_EFFECTS, RangeInt32 );
850
static MenuEntry_t ME_SOUND_VOLUME_EFFECTS = MAKE_MENUENTRY( "Effects:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_VOLUME_EFFECTS, RangeInt32 );
851
851
852
static MenuRangeInt32_t MEO_SOUND_VOLUME_MUSIC = MAKE_MENURANGE( &ud.config.MusicVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
852
static MenuRangeInt32_t MEO_SOUND_VOLUME_MUSIC = MAKE_MENURANGE( &ud.config.MusicVolume, &MF_Redfont, 0, 255, 0, 33, 2 );
853
static MenuEntry_t ME_SOUND_VOLUME_MUSIC = MAKE_MENUENTRY( "Music:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_VOLUME_MUSIC, RangeInt32 );
853
static MenuEntry_t ME_SOUND_VOLUME_MUSIC = MAKE_MENUENTRY( "Music:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_VOLUME_MUSIC, RangeInt32 );
854
854
855
static MenuOption_t MEO_SOUND_DUKETALK = MAKE_MENUOPTION(&MF_Redfont, &MEOS_NoYes, NULL);
855
static MenuOption_t MEO_SOUND_DUKETALK = MAKE_MENUOPTION(&MF_Redfont, &MEOS_NoYes, NULL);
856
static MenuEntry_t ME_SOUND_DUKETALK = MAKE_MENUENTRY( "Duke talk:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_DUKETALK, Option );
856
static MenuEntry_t ME_SOUND_DUKETALK = MAKE_MENUENTRY( "Duke talk:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_DUKETALK, Option );
857
857
858
static char *MEOSN_SOUND_SAMPLINGRATE[] = { "22050Hz", "44100Hz", "48000Hz", };
858
static char *MEOSN_SOUND_SAMPLINGRATE[] = { "22050Hz", "44100Hz", "48000Hz", };
859
static int32_t MEOSV_SOUND_SAMPLINGRATE[] = { 22050, 44100, 48000, };
859
static int32_t MEOSV_SOUND_SAMPLINGRATE[] = { 22050, 44100, 48000, };
860
static MenuOptionSet_t MEOS_SOUND_SAMPLINGRATE = MAKE_MENUOPTIONSET( MEOSN_SOUND_SAMPLINGRATE, MEOSV_SOUND_SAMPLINGRATE, 0x3 );
860
static MenuOptionSet_t MEOS_SOUND_SAMPLINGRATE = MAKE_MENUOPTIONSET( MEOSN_SOUND_SAMPLINGRATE, MEOSV_SOUND_SAMPLINGRATE, 0x3 );
861
static MenuOption_t MEO_SOUND_SAMPLINGRATE = MAKE_MENUOPTION( &MF_Redfont, &MEOS_SOUND_SAMPLINGRATE, &soundrate );
861
static MenuOption_t MEO_SOUND_SAMPLINGRATE = MAKE_MENUOPTION( &MF_Redfont, &MEOS_SOUND_SAMPLINGRATE, &soundrate );
862
static MenuEntry_t ME_SOUND_SAMPLINGRATE = MAKE_MENUENTRY( "Sample rate:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_SAMPLINGRATE, Option );
862
static MenuEntry_t ME_SOUND_SAMPLINGRATE = MAKE_MENUENTRY( "Sample rate:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_SAMPLINGRATE, Option );
863
863
864
static char *MEOSN_SOUND_SAMPLESIZE[] = { "8-bit", "16-bit", };
864
static char *MEOSN_SOUND_SAMPLESIZE[] = { "8-bit", "16-bit", };
865
static int32_t MEOSV_SOUND_SAMPLESIZE[] = { 8, 16, };
865
static int32_t MEOSV_SOUND_SAMPLESIZE[] = { 8, 16, };
866
static MenuOptionSet_t MEOS_SOUND_SAMPLESIZE = MAKE_MENUOPTIONSET( MEOSN_SOUND_SAMPLESIZE, MEOSV_SOUND_SAMPLESIZE, 0x3 );
866
static MenuOptionSet_t MEOS_SOUND_SAMPLESIZE = MAKE_MENUOPTIONSET( MEOSN_SOUND_SAMPLESIZE, MEOSV_SOUND_SAMPLESIZE, 0x3 );
867
static MenuOption_t MEO_SOUND_SAMPLESIZE = MAKE_MENUOPTION( &MF_Redfont, &MEOS_SOUND_SAMPLESIZE, &soundbits );
867
static MenuOption_t MEO_SOUND_SAMPLESIZE = MAKE_MENUOPTION( &MF_Redfont, &MEOS_SOUND_SAMPLESIZE, &soundbits );
868
static MenuEntry_t ME_SOUND_SAMPLESIZE = MAKE_MENUENTRY( "Sample size:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_SAMPLESIZE, Option );
868
static MenuEntry_t ME_SOUND_SAMPLESIZE = MAKE_MENUENTRY( "Sample size:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_SAMPLESIZE, Option );
869
869
870
static MenuRangeInt32_t MEO_SOUND_NUMVOICES = MAKE_MENURANGE( &soundvoices, &MF_Redfont, 16, 256, 0, 16, 1 );
870
static MenuRangeInt32_t MEO_SOUND_NUMVOICES = MAKE_MENURANGE( &soundvoices, &MF_Redfont, 16, 256, 0, 16, 1 );
871
static MenuEntry_t ME_SOUND_NUMVOICES = MAKE_MENUENTRY( "Voices:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_NUMVOICES, RangeInt32 );
871
static MenuEntry_t ME_SOUND_NUMVOICES = MAKE_MENUENTRY( "Voices:", &MF_Redfont, &MEF_BigOptionsRt, &MEO_SOUND_NUMVOICES, RangeInt32 );
872
872
873
static MenuEntry_t ME_SOUND_RESTART = MAKE_MENUENTRY( "Restart sound system", &MF_Redfont, &MEF_BigOptionsRt, &MEO_NULL, Link );
873
static MenuEntry_t ME_SOUND_RESTART = MAKE_MENUENTRY( "Restart sound system", &MF_Redfont, &MEF_BigOptionsRt, &MEO_NULL, Link );
874
874
875
#ifndef DROIDMENU
875
#ifndef DROIDMENU
876
static MenuLink_t MEO_ADVSOUND = { MENU_ADVSOUND, MA_Advance, };
876
static MenuLink_t MEO_ADVSOUND = { MENU_ADVSOUND, MA_Advance, };
877
static MenuEntry_t ME_SOUND_ADVSOUND = MAKE_MENUENTRY( "Advanced", &MF_Redfont, &MEF_BigOptionsRt, &MEO_ADVSOUND, Link );
877
static MenuEntry_t ME_SOUND_ADVSOUND = MAKE_MENUENTRY( "Advanced", &MF_Redfont, &MEF_BigOptionsRt, &MEO_ADVSOUND, Link );
878
#endif
878
#endif
879
879
880
static MenuEntry_t *MEL_SOUND[] = {
880
static MenuEntry_t *MEL_SOUND[] = {
881
    &ME_SOUND,
881
    &ME_SOUND,
882
    &ME_SOUND_MUSIC,
882
    &ME_SOUND_MUSIC,
883
    &ME_Space2,
883
    &ME_Space2,
884
    &ME_SOUND_VOLUME_MASTER,
884
    &ME_SOUND_VOLUME_MASTER,
885
    &ME_SOUND_VOLUME_EFFECTS,
885
    &ME_SOUND_VOLUME_EFFECTS,
886
    &ME_SOUND_VOLUME_MUSIC,
886
    &ME_SOUND_VOLUME_MUSIC,
887
    &ME_Space2,
887
    &ME_Space2,
888
    &ME_SOUND_DUKETALK,
888
    &ME_SOUND_DUKETALK,
889
#ifndef DROIDMENU
889
#ifndef DROIDMENU
890
    &ME_SOUND_ADVSOUND,
890
    &ME_SOUND_ADVSOUND,
891
#endif
891
#endif
892
};
892
};
893
893
894
static MenuEntry_t *MEL_ADVSOUND[] = {
894
static MenuEntry_t *MEL_ADVSOUND[] = {
895
    &ME_SOUND_SAMPLINGRATE,
895
    &ME_SOUND_SAMPLINGRATE,
896
    &ME_SOUND_SAMPLESIZE,
896
    &ME_SOUND_SAMPLESIZE,
897
    &ME_Space2,
897
    &ME_Space2,
898
    &ME_SOUND_NUMVOICES,
898
    &ME_SOUND_NUMVOICES,
899
    &ME_Space2,
899
    &ME_Space2,
900
    &ME_SOUND_RESTART,
900
    &ME_SOUND_RESTART,
901
};
901
};
902
902
903
MAKE_MENU_TOP_ENTRYLINK( "Player Setup", MEF_CenterMenu, NETWORK_PLAYERSETUP, MENU_PLAYER );
903
MAKE_MENU_TOP_ENTRYLINK( "Player Setup", MEF_CenterMenu, NETWORK_PLAYERSETUP, MENU_PLAYER );
904
MAKE_MENU_TOP_ENTRYLINK( "Join Game", MEF_CenterMenu, NETWORK_JOINGAME, MENU_NETJOIN );
904
MAKE_MENU_TOP_ENTRYLINK( "Join Game", MEF_CenterMenu, NETWORK_JOINGAME, MENU_NETJOIN );
905
MAKE_MENU_TOP_ENTRYLINK( "Host Game", MEF_CenterMenu, NETWORK_HOSTGAME, MENU_NETHOST );
905
MAKE_MENU_TOP_ENTRYLINK( "Host Game", MEF_CenterMenu, NETWORK_HOSTGAME, MENU_NETHOST );
906
906
907
static MenuEntry_t *MEL_NETWORK[] = {
907
static MenuEntry_t *MEL_NETWORK[] = {
908
    &ME_NETWORK_PLAYERSETUP,
908
    &ME_NETWORK_PLAYERSETUP,
909
    &ME_NETWORK_JOINGAME,
909
    &ME_NETWORK_JOINGAME,
910
    &ME_NETWORK_HOSTGAME,
910
    &ME_NETWORK_HOSTGAME,
911
};
911
};
912
912
913
static MenuString_t MEO_PLAYER_NAME = MAKE_MENUSTRING( szPlayerName, &MF_Bluefont, MAXPLAYERNAME, 0 );
913
static MenuString_t MEO_PLAYER_NAME = MAKE_MENUSTRING( szPlayerName, &MF_Bluefont, MAXPLAYERNAME, 0 );
914
static MenuEntry_t ME_PLAYER_NAME = MAKE_MENUENTRY( "Name", &MF_BluefontRed, &MEF_PlayerNarrow, &MEO_PLAYER_NAME, String );
914
static MenuEntry_t ME_PLAYER_NAME = MAKE_MENUENTRY( "Name", &MF_BluefontRed, &MEF_PlayerNarrow, &MEO_PLAYER_NAME, String );
915
static char *MEOSN_PLAYER_COLOR[] = { "Auto", "Blue", "Red", "Green", "Gray", "Dark gray", "Dark green", "Brown", "Dark blue", "Bright red", "Yellow", };
915
static char *MEOSN_PLAYER_COLOR[] = { "Auto", "Blue", "Red", "Green", "Gray", "Dark gray", "Dark green", "Brown", "Dark blue", "Bright red", "Yellow", };
916
static int32_t MEOSV_PLAYER_COLOR[] = { 0, 9, 10, 11, 12, 13, 14, 15, 16, 21, 23, };
916
static int32_t MEOSV_PLAYER_COLOR[] = { 0, 9, 10, 11, 12, 13, 14, 15, 16, 21, 23, };
917
static MenuOptionSet_t MEOS_PLAYER_COLOR = MAKE_MENUOPTIONSET( MEOSN_PLAYER_COLOR, MEOSV_PLAYER_COLOR, 0x2 );
917
static MenuOptionSet_t MEOS_PLAYER_COLOR = MAKE_MENUOPTIONSET( MEOSN_PLAYER_COLOR, MEOSV_PLAYER_COLOR, 0x2 );
918
static MenuOption_t MEO_PLAYER_COLOR = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_PLAYER_COLOR, &ud.color );
918
static MenuOption_t MEO_PLAYER_COLOR = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_PLAYER_COLOR, &ud.color );
919
static MenuEntry_t ME_PLAYER_COLOR = MAKE_MENUENTRY( "Color", &MF_BluefontRed, &MEF_PlayerNarrow, &MEO_PLAYER_COLOR, Option );
919
static MenuEntry_t ME_PLAYER_COLOR = MAKE_MENUENTRY( "Color", &MF_BluefontRed, &MEF_PlayerNarrow, &MEO_PLAYER_COLOR, Option );
920
static char *MEOSN_PLAYER_TEAM[] = { "Blue", "Red", "Green", "Gray", };
920
static char *MEOSN_PLAYER_TEAM[] = { "Blue", "Red", "Green", "Gray", };
921
static MenuOptionSet_t MEOS_PLAYER_TEAM = MAKE_MENUOPTIONSET( MEOSN_PLAYER_TEAM, NULL, 0x2 );
921
static MenuOptionSet_t MEOS_PLAYER_TEAM = MAKE_MENUOPTIONSET( MEOSN_PLAYER_TEAM, NULL, 0x2 );
922
static MenuOption_t MEO_PLAYER_TEAM = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_PLAYER_TEAM, &ud.team );
922
static MenuOption_t MEO_PLAYER_TEAM = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_PLAYER_TEAM, &ud.team );
923
static MenuEntry_t ME_PLAYER_TEAM = MAKE_MENUENTRY( "Team", &MF_BluefontRed, &MEF_PlayerNarrow, &MEO_PLAYER_TEAM, Option );
923
static MenuEntry_t ME_PLAYER_TEAM = MAKE_MENUENTRY( "Team", &MF_BluefontRed, &MEF_PlayerNarrow, &MEO_PLAYER_TEAM, Option );
924
#ifndef DROIDMENU
924
#ifndef DROIDMENU
925
static MenuLink_t MEO_PLAYER_MACROS = { MENU_MACROS, MA_Advance, };
925
static MenuLink_t MEO_PLAYER_MACROS = { MENU_MACROS, MA_Advance, };
926
static MenuEntry_t ME_PLAYER_MACROS = MAKE_MENUENTRY( "Multiplayer macros", &MF_BluefontRed, &MEF_SmallOptions, &MEO_PLAYER_MACROS, Link );
926
static MenuEntry_t ME_PLAYER_MACROS = MAKE_MENUENTRY( "Multiplayer macros", &MF_BluefontRed, &MEF_SmallOptions, &MEO_PLAYER_MACROS, Link );
927
#endif
927
#endif
928
928
929
static MenuEntry_t *MEL_PLAYER[] = {
929
static MenuEntry_t *MEL_PLAYER[] = {
930
    &ME_PLAYER_NAME,
930
    &ME_PLAYER_NAME,
931
    &ME_Space4,
931
    &ME_Space4,
932
    &ME_PLAYER_COLOR,
932
    &ME_PLAYER_COLOR,
933
    &ME_Space4,
933
    &ME_Space4,
934
    &ME_PLAYER_TEAM,
934
    &ME_PLAYER_TEAM,
935
#ifndef DROIDMENU
935
#ifndef DROIDMENU
936
    &ME_Space8,
936
    &ME_Space8,
937
    &ME_PLAYER_MACROS,
937
    &ME_PLAYER_MACROS,
938
#endif
938
#endif
939
};
939
};
940
940
941
static MenuString_t MEO_MACROS_TEMPLATE = MAKE_MENUSTRING( NULL, &MF_Bluefont, MAXRIDECULELENGTH, 0 );
941
static MenuString_t MEO_MACROS_TEMPLATE = MAKE_MENUSTRING( NULL, &MF_Bluefont, MAXRIDECULELENGTH, 0 );
942
static MenuString_t MEO_MACROS[MAXSAVEGAMES];
942
static MenuString_t MEO_MACROS[MAXSAVEGAMES];
943
static MenuEntry_t ME_MACROS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Bluefont, &MEF_Macros, &MEO_MACROS_TEMPLATE, String );
943
static MenuEntry_t ME_MACROS_TEMPLATE = MAKE_MENUENTRY( NULL, &MF_Bluefont, &MEF_Macros, &MEO_MACROS_TEMPLATE, String );
944
static MenuEntry_t ME_MACROS[MAXRIDECULE];
944
static MenuEntry_t ME_MACROS[MAXRIDECULE];
945
static MenuEntry_t *MEL_MACROS[MAXRIDECULE];
945
static MenuEntry_t *MEL_MACROS[MAXRIDECULE];
946
946
947
static char *MenuUserMap = "User Map";
947
static char *MenuUserMap = "User Map";
948
static char *MenuSkillNone = "None";
948
static char *MenuSkillNone = "None";
949
949
950
static char *MEOSN_NetGametypes[MAXGAMETYPES];
950
static char *MEOSN_NetGametypes[MAXGAMETYPES];
951
static char *MEOSN_NetEpisodes[MAXVOLUMES+1];
951
static char *MEOSN_NetEpisodes[MAXVOLUMES+1];
952
static char *MEOSN_NetLevels[MAXVOLUMES][MAXLEVELS];
952
static char *MEOSN_NetLevels[MAXVOLUMES][MAXLEVELS];
953
static char *MEOSN_NetSkills[MAXSKILLS+1];
953
static char *MEOSN_NetSkills[MAXSKILLS+1];
954
954
955
static MenuLink_t MEO_NETHOST_OPTIONS = { MENU_NETOPTIONS, MA_Advance, };
955
static MenuLink_t MEO_NETHOST_OPTIONS = { MENU_NETOPTIONS, MA_Advance, };
956
static MenuEntry_t ME_NETHOST_OPTIONS = MAKE_MENUENTRY( "Game Options", &MF_Redfont, &MEF_VideoSetup, &MEO_NETHOST_OPTIONS, Link );
956
static MenuEntry_t ME_NETHOST_OPTIONS = MAKE_MENUENTRY( "Game Options", &MF_Redfont, &MEF_VideoSetup, &MEO_NETHOST_OPTIONS, Link );
957
static MenuEntry_t ME_NETHOST_LAUNCH = MAKE_MENUENTRY( "Launch Game", &MF_Redfont, &MEF_VideoSetup, &MEO_NULL, Link );
957
static MenuEntry_t ME_NETHOST_LAUNCH = MAKE_MENUENTRY( "Launch Game", &MF_Redfont, &MEF_VideoSetup, &MEO_NULL, Link );
958
958
959
static MenuEntry_t *MEL_NETHOST[] = {
959
static MenuEntry_t *MEL_NETHOST[] = {
960
    &ME_NETHOST_OPTIONS,
960
    &ME_NETHOST_OPTIONS,
961
    &ME_NETHOST_LAUNCH,
961
    &ME_NETHOST_LAUNCH,
962
};
962
};
963
963
964
static MenuOptionSet_t MEOS_NETOPTIONS_GAMETYPE = MAKE_MENUOPTIONSET( MEOSN_NetGametypes, NULL, 0x0 );
964
static MenuOptionSet_t MEOS_NETOPTIONS_GAMETYPE = MAKE_MENUOPTIONSET( MEOSN_NetGametypes, NULL, 0x0 );
965
static MenuOption_t MEO_NETOPTIONS_GAMETYPE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_GAMETYPE, &ud.m_coop );
965
static MenuOption_t MEO_NETOPTIONS_GAMETYPE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_GAMETYPE, &ud.m_coop );
966
static MenuEntry_t ME_NETOPTIONS_GAMETYPE = MAKE_MENUENTRY( "Game Type", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_GAMETYPE, Option );
966
static MenuEntry_t ME_NETOPTIONS_GAMETYPE = MAKE_MENUENTRY( "Game Type", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_GAMETYPE, Option );
967
static MenuOptionSet_t MEOS_NETOPTIONS_EPISODE = MAKE_MENUOPTIONSET( MEOSN_NetEpisodes, NULL, 0x0 );
967
static MenuOptionSet_t MEOS_NETOPTIONS_EPISODE = MAKE_MENUOPTIONSET( MEOSN_NetEpisodes, NULL, 0x0 );
968
static MenuOption_t MEO_NETOPTIONS_EPISODE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_EPISODE, NULL );
968
static MenuOption_t MEO_NETOPTIONS_EPISODE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_EPISODE, NULL );
969
static MenuEntry_t ME_NETOPTIONS_EPISODE = MAKE_MENUENTRY( "Episode", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_EPISODE, Option );
969
static MenuEntry_t ME_NETOPTIONS_EPISODE = MAKE_MENUENTRY( "Episode", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_EPISODE, Option );
970
static MenuOptionSet_t MEOS_NETOPTIONS_LEVEL[MAXVOLUMES];
970
static MenuOptionSet_t MEOS_NETOPTIONS_LEVEL[MAXVOLUMES];
971
static MenuOption_t MEO_NETOPTIONS_LEVEL = MAKE_MENUOPTION( &MF_Bluefont, NULL, &ud.m_level_number );
971
static MenuOption_t MEO_NETOPTIONS_LEVEL = MAKE_MENUOPTION( &MF_Bluefont, NULL, &ud.m_level_number );
972
static MenuEntry_t ME_NETOPTIONS_LEVEL = MAKE_MENUENTRY( "Level", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_LEVEL, Option );
972
static MenuEntry_t ME_NETOPTIONS_LEVEL = MAKE_MENUENTRY( "Level", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_LEVEL, Option );
973
static MenuLink_t MEO_NETOPTIONS_USERMAP = { MENU_NETUSERMAP, MA_Advance, };
973
static MenuLink_t MEO_NETOPTIONS_USERMAP = { MENU_NETUSERMAP, MA_Advance, };
974
static MenuEntry_t ME_NETOPTIONS_USERMAP = MAKE_MENUENTRY( "User Map", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_USERMAP, Link );
974
static MenuEntry_t ME_NETOPTIONS_USERMAP = MAKE_MENUENTRY( "User Map", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_USERMAP, Link );
975
static MenuOptionSet_t MEOS_NETOPTIONS_MONSTERS = MAKE_MENUOPTIONSET( MEOSN_NetSkills, NULL, 0x0 );
975
static MenuOptionSet_t MEOS_NETOPTIONS_MONSTERS = MAKE_MENUOPTIONSET( MEOSN_NetSkills, NULL, 0x0 );
976
static MenuOption_t MEO_NETOPTIONS_MONSTERS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_MONSTERS, NULL );
976
static MenuOption_t MEO_NETOPTIONS_MONSTERS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_NETOPTIONS_MONSTERS, NULL );
977
static MenuEntry_t ME_NETOPTIONS_MONSTERS = MAKE_MENUENTRY( "Monsters", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MONSTERS, Option );
977
static MenuEntry_t ME_NETOPTIONS_MONSTERS = MAKE_MENUENTRY( "Monsters", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MONSTERS, Option );
978
static MenuOption_t MEO_NETOPTIONS_MARKERS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.m_marker );
978
static MenuOption_t MEO_NETOPTIONS_MARKERS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.m_marker );
979
static MenuEntry_t ME_NETOPTIONS_MARKERS = MAKE_MENUENTRY( "Markers", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MARKERS, Option );
979
static MenuEntry_t ME_NETOPTIONS_MARKERS = MAKE_MENUENTRY( "Markers", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MARKERS, Option );
980
static MenuEntry_t ME_NETOPTIONS_MARKERS_DISABLED = MAKE_MENUENTRY( "Markers", &MF_RedfontBlue, &MEF_NetSetup, NULL, Dummy );
980
static MenuEntry_t ME_NETOPTIONS_MARKERS_DISABLED = MAKE_MENUENTRY( "Markers", &MF_RedfontBlue, &MEF_NetSetup, NULL, Dummy );
981
static MenuOption_t MEO_NETOPTIONS_MAPEXITS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OnOff, &ud.m_noexits );
981
static MenuOption_t MEO_NETOPTIONS_MAPEXITS = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OnOff, &ud.m_noexits );
982
static MenuEntry_t ME_NETOPTIONS_MAPEXITS = MAKE_MENUENTRY( "Map Exits", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MAPEXITS, Option );
982
static MenuEntry_t ME_NETOPTIONS_MAPEXITS = MAKE_MENUENTRY( "Map Exits", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_MAPEXITS, Option );
983
static MenuOption_t MEO_NETOPTIONS_FRFIRE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.m_ffire );
983
static MenuOption_t MEO_NETOPTIONS_FRFIRE = MAKE_MENUOPTION( &MF_Bluefont, &MEOS_OffOn, &ud.m_ffire );
984
static MenuEntry_t ME_NETOPTIONS_FRFIRE = MAKE_MENUENTRY( "Fr. Fire", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_FRFIRE, Option );
984
static MenuEntry_t ME_NETOPTIONS_FRFIRE = MAKE_MENUENTRY( "Fr. Fire", &MF_Redfont, &MEF_NetSetup, &MEO_NETOPTIONS_FRFIRE, Option );
985
static MenuEntry_t ME_NETOPTIONS_ACCEPT = MAKE_MENUENTRY( "Accept", &MF_RedfontGreen, &MEF_NetSetup, &MEO_NULL, Link );
985
static MenuEntry_t ME_NETOPTIONS_ACCEPT = MAKE_MENUENTRY( "Accept", &MF_RedfontGreen, &MEF_NetSetup, &MEO_NULL, Link );
986
986
987
static MenuEntry_t *MEL_NETOPTIONS[] = {
987
static MenuEntry_t *MEL_NETOPTIONS[] = {
988
    &ME_NETOPTIONS_GAMETYPE,
988
    &ME_NETOPTIONS_GAMETYPE,
989
    &ME_NETOPTIONS_EPISODE,
989
    &ME_NETOPTIONS_EPISODE,
990
    &ME_NETOPTIONS_LEVEL,
990
    &ME_NETOPTIONS_LEVEL,
991
    &ME_NETOPTIONS_MONSTERS,
991
    &ME_NETOPTIONS_MONSTERS,
992
    &ME_NETOPTIONS_MARKERS,
992
    &ME_NETOPTIONS_MARKERS,
993
    &ME_NETOPTIONS_MAPEXITS,
993
    &ME_NETOPTIONS_MAPEXITS,
994
    &ME_NETOPTIONS_ACCEPT,
994
    &ME_NETOPTIONS_ACCEPT,
995
};
995
};
996
996
997
static char MenuServer[BMAX_PATH] = "localhost";
997
static char MenuServer[BMAX_PATH] = "localhost";
998
static MenuString_t MEO_NETJOIN_SERVER = MAKE_MENUSTRING( MenuServer, &MF_Bluefont, BMAX_PATH, 0 );
998
static MenuString_t MEO_NETJOIN_SERVER = MAKE_MENUSTRING( MenuServer, &MF_Bluefont, BMAX_PATH, 0 );
999
static MenuEntry_t ME_NETJOIN_SERVER = MAKE_MENUENTRY( "Server", &MF_Redfont, &MEF_VideoSetup, &MEO_NETJOIN_SERVER, String );
999
static MenuEntry_t ME_NETJOIN_SERVER = MAKE_MENUENTRY( "Server", &MF_Redfont, &MEF_VideoSetup, &MEO_NETJOIN_SERVER, String );
1000
#define MAXPORTSTRINGLENGTH 6 // unsigned 16-bit integer
1000
#define MAXPORTSTRINGLENGTH 6 // unsigned 16-bit integer
1001
static char MenuPort[MAXPORTSTRINGLENGTH] = "19014";
1001
static char MenuPort[MAXPORTSTRINGLENGTH] = "19014";
1002
static MenuString_t MEO_NETJOIN_PORT = MAKE_MENUSTRING( MenuPort, &MF_Bluefont, MAXPORTSTRINGLENGTH, INPUT_NUMERIC );
1002
static MenuString_t MEO_NETJOIN_PORT = MAKE_MENUSTRING( MenuPort, &MF_Bluefont, MAXPORTSTRINGLENGTH, INPUT_NUMERIC );
1003
static MenuEntry_t ME_NETJOIN_PORT = MAKE_MENUENTRY( "Port", &MF_Redfont, &MEF_VideoSetup, &MEO_NETJOIN_PORT, String );
1003
static MenuEntry_t ME_NETJOIN_PORT = MAKE_MENUENTRY( "Port", &MF_Redfont, &MEF_VideoSetup, &MEO_NETJOIN_PORT, String );
1004
static MenuEntry_t ME_NETJOIN_CONNECT = MAKE_MENUENTRY( "Connect", &MF_RedfontGreen, &MEF_VideoSetup, &MEO_NULL, Link );
1004
static MenuEntry_t ME_NETJOIN_CONNECT = MAKE_MENUENTRY( "Connect", &MF_RedfontGreen, &MEF_VideoSetup, &MEO_NULL, Link );
1005
1005
1006
static MenuEntry_t *MEL_NETJOIN[] = {
1006
static MenuEntry_t *MEL_NETJOIN[] = {
1007
    &ME_NETJOIN_SERVER,
1007
    &ME_NETJOIN_SERVER,
1008
    &ME_NETJOIN_PORT,
1008
    &ME_NETJOIN_PORT,
1009
    &ME_NETJOIN_CONNECT,
1009
    &ME_NETJOIN_CONNECT,
1010
};
1010
};
1011
1011
1012
1012
1013
#define NoTitle NULL
1013
#define NoTitle NULL
1014
1014
1015
#define MAKE_MENUMENU(Title, Format, Entries) { Title, Format, Entries, ARRAY_SIZE(Entries), 0, 0, 0, 0 }
1015
#define MAKE_MENUMENU(Title, Format, Entries) { Title, Format, Entries, ARRAY_SIZE(Entries), 0, 0, 0, 0 }
1016
1016
1017
static MenuMenu_t M_MAIN = MAKE_MENUMENU( NoTitle, &MMF_Top_Main, MEL_MAIN );
1017
static MenuMenu_t M_MAIN = MAKE_MENUMENU( NoTitle, &MMF_Top_Main, MEL_MAIN );
1018
static MenuMenu_t M_MAIN_INGAME = MAKE_MENUMENU( NoTitle, &MMF_Top_Main, MEL_MAIN_INGAME );
1018
static MenuMenu_t M_MAIN_INGAME = MAKE_MENUMENU( NoTitle, &MMF_Top_Main, MEL_MAIN_INGAME );
1019
static MenuMenu_t M_EPISODE = MAKE_MENUMENU( "Select An Episode", &MMF_Top_Episode, MEL_EPISODE );
1019
static MenuMenu_t M_EPISODE = MAKE_MENUMENU( "Select An Episode", &MMF_Top_Episode, MEL_EPISODE );
1020
static MenuMenu_t M_SKILL = MAKE_MENUMENU( "Select Skill", &MMF_Top_Skill, MEL_SKILL );
1020
static MenuMenu_t M_SKILL = MAKE_MENUMENU( "Select Skill", &MMF_Top_Skill, MEL_SKILL );
1021
static MenuMenu_t M_GAMESETUP = MAKE_MENUMENU( "Game Setup", &MMF_BigOptions, MEL_GAMESETUP );
1021
static MenuMenu_t M_GAMESETUP = MAKE_MENUMENU( "Game Setup", &MMF_BigOptions, MEL_GAMESETUP );
1022
static MenuMenu_t M_OPTIONS = MAKE_MENUMENU( "Options", &MMF_Top_Options, MEL_OPTIONS );
1022
static MenuMenu_t M_OPTIONS = MAKE_MENUMENU( "Options", &MMF_Top_Options, MEL_OPTIONS );
1023
static MenuMenu_t M_VIDEOSETUP = MAKE_MENUMENU( "Video Mode", &MMF_BigOptions, MEL_VIDEOSETUP );
1023
static MenuMenu_t M_VIDEOSETUP = MAKE_MENUMENU( "Video Mode", &MMF_BigOptions, MEL_VIDEOSETUP );
1024
static MenuMenu_t M_KEYBOARDSETUP = MAKE_MENUMENU( "Keyboard Setup", &MMF_Top_Options, MEL_KEYBOARDSETUP );
1024
static MenuMenu_t M_KEYBOARDSETUP = MAKE_MENUMENU( "Keyboard Setup", &MMF_Top_Options, MEL_KEYBOARDSETUP );
1025
static MenuMenu_t M_CONTROLS = MAKE_MENUMENU( "Control Setup", &MMF_Top_Options, MEL_CONTROLS );
1025
static MenuMenu_t M_CONTROLS = MAKE_MENUMENU( "Control Setup", &MMF_Top_Options, MEL_CONTROLS );
1026
static MenuMenu_t M_MOUSESETUP = MAKE_MENUMENU( "Mouse Setup", &MMF_BigOptions, MEL_MOUSESETUP );
1026
static MenuMenu_t M_MOUSESETUP = MAKE_MENUMENU( "Mouse Setup", &MMF_BigOptions, MEL_MOUSESETUP );
1027
static MenuMenu_t M_JOYSTICKSETUP = MAKE_MENUMENU( "Joystick Setup", &MMF_Top_Joystick_Network, MEL_JOYSTICKSETUP );
1027
static MenuMenu_t M_JOYSTICKSETUP = MAKE_MENUMENU( "Joystick Setup", &MMF_Top_Joystick_Network, MEL_JOYSTICKSETUP );
1028
static MenuMenu_t M_JOYSTICKBTNS = MAKE_MENUMENU( "Joystick Buttons", &MMF_MouseJoySetupBtns, MEL_JOYSTICKBTNS );
1028
static MenuMenu_t M_JOYSTICKBTNS = MAKE_MENUMENU( "Joystick Buttons", &MMF_MouseJoySetupBtns, MEL_JOYSTICKBTNS );
1029
static MenuMenu_t M_JOYSTICKAXES = MAKE_MENUMENU( "Joystick Axes", &MMF_BigSliders, MEL_JOYSTICKAXES );
1029
static MenuMenu_t M_JOYSTICKAXES = MAKE_MENUMENU( "Joystick Axes", &MMF_BigSliders, MEL_JOYSTICKAXES );
1030
static MenuMenu_t M_KEYBOARDKEYS = MAKE_MENUMENU( "Keyboard Keys", &MMF_KeyboardSetupFuncs, MEL_KEYBOARDSETUPFUNCS );
1030
static MenuMenu_t M_KEYBOARDKEYS = MAKE_MENUMENU( "Keyboard Keys", &MMF_KeyboardSetupFuncs, MEL_KEYBOARDSETUPFUNCS );
1031
static MenuMenu_t M_MOUSEBTNS = MAKE_MENUMENU( "Mouse Buttons", &MMF_MouseJoySetupBtns, MEL_MOUSESETUPBTNS );
1031
static MenuMenu_t M_MOUSEBTNS = MAKE_MENUMENU( "Mouse Buttons", &MMF_MouseJoySetupBtns, MEL_MOUSESETUPBTNS );
1032
static MenuMenu_t M_MOUSEADVANCED = MAKE_MENUMENU( "Advanced Mouse", &MMF_BigSliders, MEL_MOUSEADVANCED );
1032
static MenuMenu_t M_MOUSEADVANCED = MAKE_MENUMENU( "Advanced Mouse", &MMF_BigSliders, MEL_MOUSEADVANCED );
1033
static MenuMenu_t M_JOYSTICKAXIS = MAKE_MENUMENU( NULL, &MMF_BigSliders, MEL_JOYSTICKAXIS );
1033
static MenuMenu_t M_JOYSTICKAXIS = MAKE_MENUMENU( NULL, &MMF_BigSliders, MEL_JOYSTICKAXIS );
1034
#ifdef USE_OPENGL
1034
#ifdef USE_OPENGL
1035
static MenuMenu_t M_RENDERERSETUP = MAKE_MENUMENU( "Advanced Video", &MMF_SmallOptions, MEL_RENDERERSETUP );
1035
static MenuMenu_t M_RENDERERSETUP = MAKE_MENUMENU( "Advanced Video", &MMF_SmallOptions, MEL_RENDERERSETUP );
1036
#endif
1036
#endif
1037
static MenuMenu_t M_COLCORR = MAKE_MENUMENU( "Color Correction", &MMF_ColorCorrect, MEL_COLCORR );
1037
static MenuMenu_t M_COLCORR = MAKE_MENUMENU( "Color Correction", &MMF_ColorCorrect, MEL_COLCORR );
1038
static MenuMenu_t M_SCREENSETUP = MAKE_MENUMENU( "On-Screen Displays", &MMF_BigOptions, MEL_SCREENSETUP );
1038
static MenuMenu_t M_SCREENSETUP = MAKE_MENUMENU( "On-Screen Displays", &MMF_BigOptions, MEL_SCREENSETUP );
1039
static MenuMenu_t M_DISPLAYSETUP = MAKE_MENUMENU( "Display Setup", &MMF_BigOptions, MEL_DISPLAYSETUP );
1039
static MenuMenu_t M_DISPLAYSETUP = MAKE_MENUMENU( "Display Setup", &MMF_BigOptions, MEL_DISPLAYSETUP );
1040
static MenuMenu_t M_LOAD = MAKE_MENUMENU( "Load Game", &MMF_LoadSave, MEL_LOAD );
1040
static MenuMenu_t M_LOAD = MAKE_MENUMENU( "Load Game", &MMF_LoadSave, MEL_LOAD );
1041
static MenuMenu_t M_SAVE = MAKE_MENUMENU( "Save Game", &MMF_LoadSave, MEL_SAVE );
1041
static MenuMenu_t M_SAVE = MAKE_MENUMENU( "Save Game", &MMF_LoadSave, MEL_SAVE );
1042
static MenuMenu_t M_SOUND = MAKE_MENUMENU( "Sound Setup", &MMF_BigOptions, MEL_SOUND );
1042
static MenuMenu_t M_SOUND = MAKE_MENUMENU( "Sound Setup", &MMF_BigOptions, MEL_SOUND );
1043
static MenuMenu_t M_ADVSOUND = MAKE_MENUMENU( "Advanced Sound", &MMF_BigOptions, MEL_ADVSOUND );
1043
static MenuMenu_t M_ADVSOUND = MAKE_MENUMENU( "Advanced Sound", &MMF_BigOptions, MEL_ADVSOUND );
1044
static MenuMenu_t M_NETWORK = MAKE_MENUMENU( "Network Game", &MMF_Top_Joystick_Network, MEL_NETWORK );
1044
static MenuMenu_t M_NETWORK = MAKE_MENUMENU( "Network Game", &MMF_Top_Joystick_Network, MEL_NETWORK );
1045
static MenuMenu_t M_PLAYER = MAKE_MENUMENU( "Player Setup", &MMF_SmallOptions, MEL_PLAYER );
1045
static MenuMenu_t M_PLAYER = MAKE_MENUMENU( "Player Setup", &MMF_SmallOptions, MEL_PLAYER );
1046
static MenuMenu_t M_MACROS = MAKE_MENUMENU( "Multiplayer Macros", &MMF_Macros, MEL_MACROS );
1046
static MenuMenu_t M_MACROS = MAKE_MENUMENU( "Multiplayer Macros", &MMF_Macros, MEL_MACROS );
1047
static MenuMenu_t M_NETHOST = MAKE_MENUMENU( "Host Network Game", &MMF_SmallOptionsNarrow, MEL_NETHOST );
1047
static MenuMenu_t M_NETHOST = MAKE_MENUMENU( "Host Network Game", &MMF_SmallOptionsNarrow, MEL_NETHOST );
1048
static MenuMenu_t M_NETOPTIONS = MAKE_MENUMENU( "Net Game Options", &MMF_NetSetup, MEL_NETOPTIONS );
1048
static MenuMenu_t M_NETOPTIONS = MAKE_MENUMENU( "Net Game Options", &MMF_NetSetup, MEL_NETOPTIONS );
1049
static MenuMenu_t M_NETJOIN = MAKE_MENUMENU( "Join Network Game", &MMF_SmallOptionsNarrow, MEL_NETJOIN );
1049
static MenuMenu_t M_NETJOIN = MAKE_MENUMENU( "Join Network Game", &MMF_SmallOptionsNarrow, MEL_NETJOIN );
1050
1050
1051
#ifdef DROIDMENU
1051
#ifdef DROIDMENU
1052
static MenuPanel_t M_STORY = { NoTitle, MENU_STORY, MA_Return, MENU_STORY, MA_Advance, };
1052
static MenuPanel_t M_STORY = { NoTitle, MENU_STORY, MA_Return, MENU_STORY, MA_Advance, };
1053
#else
1053
#else
1054
static MenuPanel_t M_STORY = { NoTitle, MENU_F1HELP, MA_Return, MENU_F1HELP, MA_Advance, };
1054
static MenuPanel_t M_STORY = { NoTitle, MENU_F1HELP, MA_Return, MENU_F1HELP, MA_Advance, };
1055
#endif
1055
#endif
1056
1056
1057
static MenuPanel_t M_F1HELP = { NoTitle, MENU_STORY, MA_Return, MENU_STORY, MA_Advance, };
1057
static MenuPanel_t M_F1HELP = { NoTitle, MENU_STORY, MA_Return, MENU_STORY, MA_Advance, };
1058
static const char* MenuCredits = "Credits";
1058
static const char* MenuCredits = "Credits";
1059
static MenuPanel_t M_CREDITS = { NoTitle, MENU_CREDITS5, MA_Return, MENU_CREDITS2, MA_Advance, };
1059
static MenuPanel_t M_CREDITS = { NoTitle, MENU_CREDITS5, MA_Return, MENU_CREDITS2, MA_Advance, };
1060
static MenuPanel_t M_CREDITS2 = { NoTitle, MENU_CREDITS, MA_Return, MENU_CREDITS3, MA_Advance, };
1060
static MenuPanel_t M_CREDITS2 = { NoTitle, MENU_CREDITS, MA_Return, MENU_CREDITS3, MA_Advance, };
1061
static MenuPanel_t M_CREDITS3 = { NoTitle, MENU_CREDITS2, MA_Return, MENU_CREDITS4, MA_Advance, };
1061
static MenuPanel_t M_CREDITS3 = { NoTitle, MENU_CREDITS2, MA_Return, MENU_CREDITS4, MA_Advance, };
1062
#ifdef DROIDMENU
1062
#ifdef DROIDMENU
1063
static MenuPanel_t M_CREDITS4 = { "Meltdown Collection", MENU_CREDITS3, MA_Return, MENU_CREDITS5, MA_Advance, };
1063
static MenuPanel_t M_CREDITS4 = { "Meltdown Collection", MENU_CREDITS3, MA_Return, MENU_CREDITS5, MA_Advance, };
1064
#else
1064
#else
1065
static MenuPanel_t M_CREDITS4 = { "About EDuke32", MENU_CREDITS3, MA_Return, MENU_CREDITS5, MA_Advance, };
1065
static MenuPanel_t M_CREDITS4 = { "About EDuke32", MENU_CREDITS3, MA_Return, MENU_CREDITS5, MA_Advance, };
1066
#endif
1066
#endif
1067
static MenuPanel_t M_CREDITS5 = { "About EDuke32", MENU_CREDITS4, MA_Return, MENU_CREDITS, MA_Advance, };
1067
static MenuPanel_t M_CREDITS5 = { "About EDuke32", MENU_CREDITS4, MA_Return, MENU_CREDITS, MA_Advance, };
1068
1068
1069
#define CURSOR_CENTER_2LINE { MENU_MARGIN_CENTER<<16, 120<<16, }
1069
#define CURSOR_CENTER_2LINE { MENU_MARGIN_CENTER<<16, 120<<16, }
1070
#define CURSOR_CENTER_3LINE { MENU_MARGIN_CENTER<<16, 129<<16, }
1070
#define CURSOR_CENTER_3LINE { MENU_MARGIN_CENTER<<16, 129<<16, }
1071
#define CURSOR_BOTTOMRIGHT { 304<<16, 186<<16, }
1071
#define CURSOR_BOTTOMRIGHT { 304<<16, 186<<16, }
1072
1072
1073
static MenuVerify_t M_QUIT = { CURSOR_CENTER_2LINE, MENU_CLOSE, MA_None, };
1073
static MenuVerify_t M_QUIT = { CURSOR_CENTER_2LINE, MENU_CLOSE, MA_None, };
1074
static MenuVerify_t M_QUITTOTITLE = { CURSOR_CENTER_2LINE, MENU_CLOSE, MA_None, };
1074
static MenuVerify_t M_QUITTOTITLE = { CURSOR_CENTER_2LINE, MENU_CLOSE, MA_None, };
1075
static MenuVerify_t M_LOADVERIFY = { CURSOR_CENTER_3LINE, MENU_CLOSE, MA_None, };
1075
static MenuVerify_t M_LOADVERIFY = { CURSOR_CENTER_3LINE, MENU_CLOSE, MA_None, };
1076
static MenuVerify_t M_NEWVERIFY = { CURSOR_CENTER_2LINE, MENU_EPISODE, MA_Advance, };
1076
static MenuVerify_t M_NEWVERIFY = { CURSOR_CENTER_2LINE, MENU_EPISODE, MA_Advance, };
1077
static MenuVerify_t M_SAVEVERIFY = { CURSOR_CENTER_2LINE, MENU_SAVE, MA_None, };
1077
static MenuVerify_t M_SAVEVERIFY = { CURSOR_CENTER_2LINE, MENU_SAVE, MA_None, };
1078
static MenuVerify_t M_RESETPLAYER = { CURSOR_CENTER_3LINE, MENU_CLOSE, MA_None, };
1078
static MenuVerify_t M_RESETPLAYER = { CURSOR_CENTER_3LINE, MENU_CLOSE, MA_None, };
1079
1079
1080
static MenuMessage_t M_NETWAITMASTER = { CURSOR_BOTTOMRIGHT, MENU_NULL, MA_None, };
1080
static MenuMessage_t M_NETWAITMASTER = { CURSOR_BOTTOMRIGHT, MENU_NULL, MA_None, };
1081
static MenuMessage_t M_NETWAITVOTES = { CURSOR_BOTTOMRIGHT, MENU_NULL, MA_None, };
1081
static MenuMessage_t M_NETWAITVOTES = { CURSOR_BOTTOMRIGHT, MENU_NULL, MA_None, };
1082
static MenuMessage_t M_BUYDUKE = { CURSOR_BOTTOMRIGHT, MENU_EPISODE, MA_Return, };
1082
static MenuMessage_t M_BUYDUKE = { CURSOR_BOTTOMRIGHT, MENU_EPISODE, MA_Return, };
1083
1083
1084
static MenuPassword_t M_ADULTPASSWORD = { NULL, MAXPWLOCKOUT };
1084
static MenuPassword_t M_ADULTPASSWORD = { NULL, MAXPWLOCKOUT };
1085
1085
1086
#define MAKE_MENUFILESELECT(a, b, c) { a, { &MMF_FileSelectLeft, &MMF_FileSelectRight }, { &MF_Minifont, &MF_MinifontRed }, b, c, { NULL, NULL }, { 0, 0 }, { 3<<16, 3<<16 }, FNLIST_INITIALIZER, 0 }
1086
#define MAKE_MENUFILESELECT(a, b, c) { a, { &MMF_FileSelectLeft, &MMF_FileSelectRight }, { &MF_Minifont, &MF_MinifontRed }, b, c, { NULL, NULL }, { 0, 0 }, { 3<<16, 3<<16 }, FNLIST_INITIALIZER, 0 }
1087
1087
1088
static MenuFileSelect_t M_USERMAP = MAKE_MENUFILESELECT( "Select A User Map", "*.map", boardfilename );
1088
static MenuFileSelect_t M_USERMAP = MAKE_MENUFILESELECT( "Select A User Map", "*.map", boardfilename );
1089
1089
1090
// MUST be in ascending order of MenuID enum values due to binary search
1090
// MUST be in ascending order of MenuID enum values due to binary search
1091
static Menu_t Menus[] = {
1091
static Menu_t Menus[] = {
1092
    { &M_MAIN, MENU_MAIN, MENU_CLOSE, MA_None, Menu },
1092
    { &M_MAIN, MENU_MAIN, MENU_CLOSE, MA_None, Menu },
1093
    { &M_MAIN_INGAME, MENU_MAIN_INGAME, MENU_CLOSE, MA_None, Menu },
1093
    { &M_MAIN_INGAME, MENU_MAIN_INGAME, MENU_CLOSE, MA_None, Menu },
1094
    { &M_EPISODE, MENU_EPISODE, MENU_MAIN, MA_Return, Menu },
1094
    { &M_EPISODE, MENU_EPISODE, MENU_MAIN, MA_Return, Menu },
1095
    { &M_USERMAP, MENU_USERMAP, MENU_EPISODE, MA_Return, FileSelect },
1095
    { &M_USERMAP, MENU_USERMAP, MENU_EPISODE, MA_Return, FileSelect },
1096
    { &M_SKILL, MENU_SKILL, MENU_EPISODE, MA_Return, Menu },
1096
    { &M_SKILL, MENU_SKILL, MENU_EPISODE, MA_Return, Menu },
1097
    { &M_GAMESETUP, MENU_GAMESETUP, MENU_OPTIONS, MA_Return, Menu },
1097
    { &M_GAMESETUP, MENU_GAMESETUP, MENU_OPTIONS, MA_Return, Menu },
1098
    { &M_OPTIONS, MENU_OPTIONS, MENU_MAIN, MA_Return, Menu },
1098
    { &M_OPTIONS, MENU_OPTIONS, MENU_MAIN, MA_Return, Menu },
1099
    { &M_VIDEOSETUP, MENU_VIDEOSETUP, MENU_DISPLAYSETUP, MA_Return, Menu },
1099
    { &M_VIDEOSETUP, MENU_VIDEOSETUP, MENU_DISPLAYSETUP, MA_Return, Menu },
1100
    { &M_KEYBOARDSETUP, MENU_KEYBOARDSETUP, MENU_CONTROLS, MA_Return, Menu },
1100
    { &M_KEYBOARDSETUP, MENU_KEYBOARDSETUP, MENU_CONTROLS, MA_Return, Menu },
1101
    { &M_MOUSESETUP, MENU_MOUSESETUP, MENU_CONTROLS, MA_Return, Menu },
1101
    { &M_MOUSESETUP, MENU_MOUSESETUP, MENU_CONTROLS, MA_Return, Menu },
1102
    { &M_JOYSTICKSETUP, MENU_JOYSTICKSETUP, MENU_CONTROLS, MA_Return, Menu },
1102
    { &M_JOYSTICKSETUP, MENU_JOYSTICKSETUP, MENU_CONTROLS, MA_Return, Menu },
1103
    { &M_JOYSTICKBTNS, MENU_JOYSTICKBTNS, MENU_JOYSTICKSETUP, MA_Return, Menu },
1103
    { &M_JOYSTICKBTNS, MENU_JOYSTICKBTNS, MENU_JOYSTICKSETUP, MA_Return, Menu },
1104
    { &M_JOYSTICKAXES, MENU_JOYSTICKAXES, MENU_JOYSTICKSETUP, MA_Return, Menu },
1104
    { &M_JOYSTICKAXES, MENU_JOYSTICKAXES, MENU_JOYSTICKSETUP, MA_Return, Menu },
1105
    { &M_KEYBOARDKEYS, MENU_KEYBOARDKEYS, MENU_KEYBOARDSETUP, MA_Return, Menu },
1105
    { &M_KEYBOARDKEYS, MENU_KEYBOARDKEYS, MENU_KEYBOARDSETUP, MA_Return, Menu },
1106
    { &M_MOUSEBTNS, MENU_MOUSEBTNS, MENU_MOUSESETUP, MA_Return, Menu },
1106
    { &M_MOUSEBTNS, MENU_MOUSEBTNS, MENU_MOUSESETUP, MA_Return, Menu },
1107
    { &M_MOUSEADVANCED, MENU_MOUSEADVANCED, MENU_MOUSESETUP, MA_Return, Menu },
1107
    { &M_MOUSEADVANCED, MENU_MOUSEADVANCED, MENU_MOUSESETUP, MA_Return, Menu },
1108
    { &M_JOYSTICKAXIS, MENU_JOYSTICKAXIS, MENU_JOYSTICKAXES, MA_Return, Menu },
1108
    { &M_JOYSTICKAXIS, MENU_JOYSTICKAXIS, MENU_JOYSTICKAXES, MA_Return, Menu },
1109
    { &M_CONTROLS, MENU_CONTROLS, MENU_OPTIONS, MA_Return, Menu },
1109
    { &M_CONTROLS, MENU_CONTROLS, MENU_OPTIONS, MA_Return, Menu },
1110
#ifdef USE_OPENGL
1110
#ifdef USE_OPENGL
1111
    { &M_RENDERERSETUP, MENU_RENDERERSETUP, MENU_DISPLAYSETUP, MA_Return, Menu },
1111
    { &M_RENDERERSETUP, MENU_RENDERERSETUP, MENU_DISPLAYSETUP, MA_Return, Menu },
1112
#endif
1112
#endif
1113
    { &M_COLCORR, MENU_COLCORR, MENU_DISPLAYSETUP, MA_Return, Menu },
1113
    { &M_COLCORR, MENU_COLCORR, MENU_DISPLAYSETUP, MA_Return, Menu },
1114
    { &M_COLCORR, MENU_COLCORR_INGAME, MENU_CLOSE, MA_Return, Menu },
1114
    { &M_COLCORR, MENU_COLCORR_INGAME, MENU_CLOSE, MA_Return, Menu },
1115
    { &M_SCREENSETUP, MENU_SCREENSETUP, MENU_DISPLAYSETUP, MA_Return, Menu },
1115
    { &M_SCREENSETUP, MENU_SCREENSETUP, MENU_DISPLAYSETUP, MA_Return, Menu },
1116
    { &M_DISPLAYSETUP, MENU_DISPLAYSETUP, MENU_OPTIONS, MA_Return, Menu },
1116
    { &M_DISPLAYSETUP, MENU_DISPLAYSETUP, MENU_OPTIONS, MA_Return, Menu },
1117
    { &M_LOAD, MENU_LOAD, MENU_MAIN, MA_Return, Menu },
1117
    { &M_LOAD, MENU_LOAD, MENU_MAIN, MA_Return, Menu },
1118
    { &M_SAVE, MENU_SAVE, MENU_MAIN, MA_Return, Menu },
1118
    { &M_SAVE, MENU_SAVE, MENU_MAIN, MA_Return, Menu },
1119
    { &M_STORY, MENU_STORY, MENU_MAIN, MA_Return, Panel },
1119
    { &M_STORY, MENU_STORY, MENU_MAIN, MA_Return, Panel },
1120
    { &M_F1HELP, MENU_F1HELP, MENU_MAIN, MA_Return, Panel },
1120
    { &M_F1HELP, MENU_F1HELP, MENU_MAIN, MA_Return, Panel },
1121
    { &M_QUIT, MENU_QUIT, MENU_PREVIOUS, MA_Return, Verify },
1121
    { &M_QUIT, MENU_QUIT, MENU_PREVIOUS, MA_Return, Verify },
1122
    { &M_QUITTOTITLE, MENU_QUITTOTITLE, MENU_PREVIOUS, MA_Return, Verify },
1122
    { &M_QUITTOTITLE, MENU_QUITTOTITLE, MENU_PREVIOUS, MA_Return, Verify },
1123
    { &M_QUIT, MENU_QUIT_INGAME, MENU_CLOSE, MA_None, Verify },
1123
    { &M_QUIT, MENU_QUIT_INGAME, MENU_CLOSE, MA_None, Verify },
1124
    { &M_NETHOST, MENU_NETSETUP, MENU_MAIN, MA_Return, Menu },
1124
    { &M_NETHOST, MENU_NETSETUP, MENU_MAIN, MA_Return, Menu },
1125
    { &M_NETWAITMASTER, MENU_NETWAITMASTER, MENU_MAIN, MA_Return, Message },
1125
    { &M_NETWAITMASTER, MENU_NETWAITMASTER, MENU_MAIN, MA_Return, Message },
1126
    { &M_NETWAITVOTES, MENU_NETWAITVOTES, MENU_MAIN, MA_Return, Message },
1126
    { &M_NETWAITVOTES, MENU_NETWAITVOTES, MENU_MAIN, MA_Return, Message },
1127
    { &M_SOUND, MENU_SOUND, MENU_OPTIONS, MA_Return, Menu },
1127
    { &M_SOUND, MENU_SOUND, MENU_OPTIONS, MA_Return, Menu },
1128
    { &M_SOUND, MENU_SOUND_INGAME, MENU_CLOSE, MA_Return, Menu },
1128
    { &M_SOUND, MENU_SOUND_INGAME, MENU_CLOSE, MA_Return, Menu },
1129
    { &M_ADVSOUND, MENU_ADVSOUND, MENU_SOUND, MA_Return, Menu },
1129
    { &M_ADVSOUND, MENU_ADVSOUND, MENU_SOUND, MA_Return, Menu },
1130
    { &M_CREDITS, MENU_CREDITS, MENU_MAIN, MA_Return, Panel },
1130
    { &M_CREDITS, MENU_CREDITS, MENU_MAIN, MA_Return, Panel },
1131
    { &M_CREDITS2, MENU_CREDITS2, MENU_MAIN, MA_Return, Panel },
1131
    { &M_CREDITS2, MENU_CREDITS2, MENU_MAIN, MA_Return, Panel },
1132
    { &M_CREDITS3, MENU_CREDITS3, MENU_MAIN, MA_Return, Panel },
1132
    { &M_CREDITS3, MENU_CREDITS3, MENU_MAIN, MA_Return, Panel },
1133
    { &M_CREDITS4, MENU_CREDITS4, MENU_MAIN, MA_Return, Panel },
1133
    { &M_CREDITS4, MENU_CREDITS4, MENU_MAIN, MA_Return, Panel },
1134
    { &M_CREDITS5, MENU_CREDITS5, MENU_MAIN, MA_Return, Panel },
1134
    { &M_CREDITS5, MENU_CREDITS5, MENU_MAIN, MA_Return, Panel },
1135
    { &M_LOADVERIFY, MENU_LOADVERIFY, MENU_LOAD, MA_None, Verify },
1135
    { &M_LOADVERIFY, MENU_LOADVERIFY, MENU_LOAD, MA_None, Verify },
1136
    { &M_NEWVERIFY, MENU_NEWVERIFY, MENU_MAIN, MA_Return, Verify },
1136
    { &M_NEWVERIFY, MENU_NEWVERIFY, MENU_MAIN, MA_Return, Verify },
1137
    { &M_SAVEVERIFY, MENU_SAVEVERIFY, MENU_SAVE, MA_None, Verify },
1137
    { &M_SAVEVERIFY, MENU_SAVEVERIFY, MENU_SAVE, MA_None, Verify },
1138
    { &M_ADULTPASSWORD, MENU_ADULTPASSWORD, MENU_GAMESETUP, MA_None, Password },
1138
    { &M_ADULTPASSWORD, MENU_ADULTPASSWORD, MENU_GAMESETUP, MA_None, Password },
1139
    { &M_RESETPLAYER, MENU_RESETPLAYER, MENU_CLOSE, MA_None, Verify },
1139
    { &M_RESETPLAYER, MENU_RESETPLAYER, MENU_CLOSE, MA_None, Verify },
1140
    { &M_BUYDUKE, MENU_BUYDUKE, MENU_EPISODE, MA_Return, Message },
1140
    { &M_BUYDUKE, MENU_BUYDUKE, MENU_EPISODE, MA_Return, Message },
1141
    { &M_NETWORK, MENU_NETWORK, MENU_MAIN, MA_Return, Menu },
1141
    { &M_NETWORK, MENU_NETWORK, MENU_MAIN, MA_Return, Menu },
1142
    { &M_PLAYER, MENU_PLAYER, MENU_OPTIONS, MA_Return, Menu },
1142
    { &M_PLAYER, MENU_PLAYER, MENU_OPTIONS, MA_Return, Menu },
1143
    { &M_MACROS, MENU_MACROS, MENU_PLAYER, MA_Return, Menu },
1143
    { &M_MACROS, MENU_MACROS, MENU_PLAYER, MA_Return, Menu },
1144
    { &M_NETHOST, MENU_NETHOST, MENU_NETWORK, MA_Return, Menu },
1144
    { &M_NETHOST, MENU_NETHOST, MENU_NETWORK, MA_Return, Menu },
1145
    { &M_NETOPTIONS, MENU_NETOPTIONS, MENU_NETWORK, MA_Return, Menu },
1145
    { &M_NETOPTIONS, MENU_NETOPTIONS, MENU_NETWORK, MA_Return, Menu },
1146
    { &M_USERMAP, MENU_NETUSERMAP, MENU_NETOPTIONS, MA_Return, FileSelect },
1146
    { &M_USERMAP, MENU_NETUSERMAP, MENU_NETOPTIONS, MA_Return, FileSelect },
1147
    { &M_NETJOIN, MENU_NETJOIN, MENU_NETWORK, MA_Return, Menu },
1147
    { &M_NETJOIN, MENU_NETJOIN, MENU_NETWORK, MA_Return, Menu },
1148
};
1148
};
1149
1149
1150
static const size_t numMenus = ARRAY_SIZE(Menus);
1150
static const size_t numMenus = ARRAY_SIZE(Menus);
1151
1151
1152
Menu_t *m_currentMenu = &Menus[0];
1152
Menu_t *m_currentMenu = &Menus[0];
1153
static Menu_t *m_previousMenu = &Menus[0];
1153
static Menu_t *m_previousMenu = &Menus[0];
1154
1154
1155
MenuID_t g_currentMenu;
1155
MenuID_t g_currentMenu;
1156
static MenuID_t g_previousMenu;
1156
static MenuID_t g_previousMenu;
1157
1157
1158
1158
1159
#define MenuMenu_ChangeEntryList(m, el)\
1159
#define MenuMenu_ChangeEntryList(m, el)\
1160
    do {\
1160
    do {\
1161
        m.entrylist = el;\
1161
        m.entrylist = el;\
1162
        m.numEntries = ARRAY_SIZE(el);\
1162
        m.numEntries = ARRAY_SIZE(el);\
1163
    } while (0)
1163
    } while (0)
1164
1164
1165
static void MenuEntry_DisableOnCondition(MenuEntry_t * const entry, const int32_t condition)
1165
static void MenuEntry_DisableOnCondition(MenuEntry_t * const entry, const int32_t condition)
1166
{
1166
{
1167
    if (condition)
1167
    if (condition)
1168
        entry->flags |= Disabled;
1168
        entry->flags |= Disabled;
1169
    else
1169
    else
1170
        entry->flags &= ~Disabled;
1170
        entry->flags &= ~Disabled;
1171
}
1171
}
1172
1172
1173
/*
1173
/*
1174
This function prepares data after ART and CON have been processed.
1174
This function prepares data after ART and CON have been processed.
1175
It also initializes some data in loops rather than statically at compile time.
1175
It also initializes some data in loops rather than statically at compile time.
1176
*/
1176
*/
1177
void M_Init(void)
1177
void M_Init(void)
1178
{
1178
{
1179
    int32_t i, j, k;
1179
    int32_t i, j, k;
1180
1180
1181
    // prepare menu fonts
1181
    // prepare menu fonts
1182
    MF_Redfont.tilenum = MF_RedfontBlue.tilenum = MF_RedfontGreen.tilenum = BIGALPHANUM;
1182
    MF_Redfont.tilenum = MF_RedfontBlue.tilenum = MF_RedfontGreen.tilenum = BIGALPHANUM;
1183
    MF_Bluefont.tilenum = MF_BluefontRed.tilenum = STARTALPHANUM;
1183
    MF_Bluefont.tilenum = MF_BluefontRed.tilenum = STARTALPHANUM;
1184
    MF_Minifont.tilenum = MF_MinifontRed.tilenum = MF_MinifontDarkGray.tilenum = MINIFONT;
1184
    MF_Minifont.tilenum = MF_MinifontRed.tilenum = MF_MinifontDarkGray.tilenum = MINIFONT;
1185
    if (!minitext_lowercase)
1185
    if (!minitext_lowercase)
1186
    {
1186
    {
1187
        MF_Minifont.textflags |= TEXT_UPPERCASE;
1187
        MF_Minifont.textflags |= TEXT_UPPERCASE;
1188
        MF_MinifontRed.textflags |= TEXT_UPPERCASE;
1188
        MF_MinifontRed.textflags |= TEXT_UPPERCASE;
1189
        MF_MinifontDarkGray.textflags |= TEXT_UPPERCASE;
1189
        MF_MinifontDarkGray.textflags |= TEXT_UPPERCASE;
1190
    }
1190
    }
1191
1191
1192
    // prepare gamefuncs and keys
1192
    // prepare gamefuncs and keys
1193
    for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
1193
    for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
1194
    {
1194
    {
1195
        Bstrcpy(MenuGameFuncs[i], gamefunctions[i]);
1195
        Bstrcpy(MenuGameFuncs[i], gamefunctions[i]);
1196
1196
1197
        for (j = 0; j < MAXGAMEFUNCLEN; ++j)
1197
        for (j = 0; j < MAXGAMEFUNCLEN; ++j)
1198
            if (MenuGameFuncs[i][j] == '_')
1198
            if (MenuGameFuncs[i][j] == '_')
1199
                MenuGameFuncs[i][j] = ' ';
1199
                MenuGameFuncs[i][j] = ' ';
1200
1200
1201
        MEOSN_Gamefuncs[i] = MenuGameFuncs[i];
1201
        MEOSN_Gamefuncs[i] = MenuGameFuncs[i];
1202
    }
1202
    }
1203
    MEOSN_Gamefuncs[NUMGAMEFUNCTIONS] = MenuGameFuncNone;
1203
    MEOSN_Gamefuncs[NUMGAMEFUNCTIONS] = MenuGameFuncNone;
1204
    for (i = 0; i < NUMKEYS; ++i)
1204
    for (i = 0; i < NUMKEYS; ++i)
1205
        MEOSN_Keys[i] = key_names[i];
1205
        MEOSN_Keys[i] = key_names[i];
1206
    MEOSN_Keys[NUMKEYS-1] = MenuKeyNone;
1206
    MEOSN_Keys[NUMKEYS-1] = MenuKeyNone;
1207
1207
1208
1208
1209
    // prepare episodes
1209
    // prepare episodes
1210
    k = -1;
1210
    k = -1;
1211
    for (i = 0; i < g_numVolumes; ++i)
1211
    for (i = 0; i < g_numVolumes; ++i)
1212
    {
1212
    {
1213
        if (EpisodeNames[i][0])
1213
        if (EpisodeNames[i][0])
1214
        {
1214
        {
1215
            MEL_EPISODE[i] = &ME_EPISODE[i];
1215
            MEL_EPISODE[i] = &ME_EPISODE[i];
1216
            ME_EPISODE[i] = ME_EPISODE_TEMPLATE;
1216
            ME_EPISODE[i] = ME_EPISODE_TEMPLATE;
1217
            ME_EPISODE[i].name = EpisodeNames[i];
1217
            ME_EPISODE[i].name = EpisodeNames[i];
1218
1218
1219
            MEOSN_NetEpisodes[i] = EpisodeNames[i];
1219
            MEOSN_NetEpisodes[i] = EpisodeNames[i];
1220
1220
1221
            k = i;
1221
            k = i;
1222
        }
1222
        }
1223
1223
1224
        // prepare levels
1224
        // prepare levels
1225
        for (j = 0; j < MAXLEVELS; ++j)
1225
        for (j = 0; j < MAXLEVELS; ++j)
1226
        {
1226
        {
1227
            MEOSN_NetLevels[i][j] = MapInfo[MAXLEVELS*i+j].name;
1227
            MEOSN_NetLevels[i][j] = MapInfo[MAXLEVELS*i+j].name;
1228
            if (MapInfo[i*MAXLEVELS+j].filename != NULL)
1228
            if (MapInfo[i*MAXLEVELS+j].filename != NULL)
1229
                MEOS_NETOPTIONS_LEVEL[i].numOptions = j+1;
1229
                MEOS_NETOPTIONS_LEVEL[i].numOptions = j+1;
1230
        }
1230
        }
1231
        MEOS_NETOPTIONS_LEVEL[i].optionNames = MEOSN_NetLevels[i];
1231
        MEOS_NETOPTIONS_LEVEL[i].optionNames = MEOSN_NetLevels[i];
1232
    }
1232
    }
1233
    ++k;
1233
    ++k;
1234
    M_EPISODE.numEntries = g_numVolumes+2; // k;
1234
    M_EPISODE.numEntries = g_numVolumes+2; // k;
1235
    MEL_EPISODE[g_numVolumes] = &ME_Space4;
1235
    MEL_EPISODE[g_numVolumes] = &ME_Space4;
1236
    MEL_EPISODE[g_numVolumes+1] = &ME_EPISODE_USERMAP;
1236
    MEL_EPISODE[g_numVolumes+1] = &ME_EPISODE_USERMAP;
1237
    MEOS_NETOPTIONS_EPISODE.numOptions = g_numVolumes + 1; // k+1;
1237
    MEOS_NETOPTIONS_EPISODE.numOptions = g_numVolumes + 1; // k+1;
1238
    MEOSN_NetEpisodes[g_numVolumes] = MenuUserMap;
1238
    MEOSN_NetEpisodes[g_numVolumes] = MenuUserMap;
1239
    MMF_Top_Episode.pos.y = (48-(g_numVolumes*2))<<16;
1239
    MMF_Top_Episode.pos.y = (48-(g_numVolumes*2))<<16;
1240
1240
1241
    // prepare skills
1241
    // prepare skills
1242
    k = -1;
1242
    k = -1;
1243
    for (i = 0; i < g_numSkills && SkillNames[i][0]; ++i)
1243
    for (i = 0; i < g_numSkills && SkillNames[i][0]; ++i)
1244
    {
1244
    {
1245
        MEL_SKILL[i] = &ME_SKILL[i];
1245
        MEL_SKILL[i] = &ME_SKILL[i];
1246
        ME_SKILL[i] = ME_SKILL_TEMPLATE;
1246
        ME_SKILL[i] = ME_SKILL_TEMPLATE;
1247
        ME_SKILL[i].name = SkillNames[i];
1247
        ME_SKILL[i].name = SkillNames[i];
1248
1248
1249
        MEOSN_NetSkills[i] = SkillNames[i];
1249
        MEOSN_NetSkills[i] = SkillNames[i];
1250
1250
1251
        k = i;
1251
        k = i;
1252
    }
1252
    }
1253
    ++k;
1253
    ++k;
1254
    M_SKILL.numEntries = g_numSkills; // k;
1254
    M_SKILL.numEntries = g_numSkills; // k;
1255
    MEOS_NETOPTIONS_MONSTERS.numOptions = g_numSkills + 1; // k+1;
1255
    MEOS_NETOPTIONS_MONSTERS.numOptions = g_numSkills + 1; // k+1;
1256
    MEOSN_NetSkills[g_numSkills] = MenuSkillNone;
1256
    MEOSN_NetSkills[g_numSkills] = MenuSkillNone;
1257
    MMF_Top_Skill.pos.y = (58 + (4-g_numSkills)*6)<<16;
1257
    MMF_Top_Skill.pos.y = (58 + (4-g_numSkills)*6)<<16;
1258
    M_SKILL.currentEntry = 1;
1258
    M_SKILL.currentEntry = 1;
1259
1259
1260
    // prepare multiplayer gametypes
1260
    // prepare multiplayer gametypes
1261
    k = -1;
1261
    k = -1;
1262
    for (i = 0; i < MAXGAMETYPES; ++i)
1262
    for (i = 0; i < MAXGAMETYPES; ++i)
1263
        if (GametypeNames[i][0])
1263
        if (GametypeNames[i][0])
1264
        {
1264
        {
1265
            MEOSN_NetGametypes[i] = GametypeNames[i];
1265
            MEOSN_NetGametypes[i] = GametypeNames[i];
1266
            k = i;
1266
            k = i;
1267
        }
1267
        }
1268
    ++k;
1268
    ++k;
1269
    MEOS_NETOPTIONS_GAMETYPE.numOptions = k;
1269
    MEOS_NETOPTIONS_GAMETYPE.numOptions = k;
1270
1270
1271
    // prepare savegames
1271
    // prepare savegames
1272
    for (i = 0; i < MAXSAVEGAMES; ++i)
1272
    for (i = 0; i < MAXSAVEGAMES; ++i)
1273
    {
1273
    {
1274
        MEL_LOAD[i] = &ME_LOAD[i];
1274
        MEL_LOAD[i] = &ME_LOAD[i];
1275
        MEL_SAVE[i] = &ME_SAVE[i];
1275
        MEL_SAVE[i] = &ME_SAVE[i];
1276
        ME_LOAD[i] = ME_LOAD_TEMPLATE;
1276
        ME_LOAD[i] = ME_LOAD_TEMPLATE;
1277
        ME_SAVE[i] = ME_SAVE_TEMPLATE;
1277
        ME_SAVE[i] = ME_SAVE_TEMPLATE;
1278
        ME_SAVE[i].entry = &MEO_SAVE[i];
1278
        ME_SAVE[i].entry = &MEO_SAVE[i];
1279
        MEO_SAVE[i] = MEO_SAVE_TEMPLATE;
1279
        MEO_SAVE[i] = MEO_SAVE_TEMPLATE;
1280
1280
1281
        ME_LOAD[i].name = ud.savegame[i];
1281
        ME_LOAD[i].name = ud.savegame[i];
1282
        MEO_SAVE[i].variable = ud.savegame[i];
1282
        MEO_SAVE[i].variable = ud.savegame[i];
1283
    }
1283
    }
1284
1284
1285
    // prepare text chat macros
1285
    // prepare text chat macros
1286
    for (i = 0; i < MAXRIDECULE; ++i)
1286
    for (i = 0; i < MAXRIDECULE; ++i)
1287
    {
1287
    {
1288
        MEL_MACROS[i] = &ME_MACROS[i];
1288
        MEL_MACROS[i] = &ME_MACROS[i];
1289
        ME_MACROS[i] = ME_MACROS_TEMPLATE;
1289
        ME_MACROS[i] = ME_MACROS_TEMPLATE;
1290
        ME_MACROS[i].entry = &MEO_MACROS[i];
1290
        ME_MACROS[i].entry = &MEO_MACROS[i];
1291
        MEO_MACROS[i] = MEO_MACROS_TEMPLATE;
1291
        MEO_MACROS[i] = MEO_MACROS_TEMPLATE;
1292
1292
1293
        MEO_MACROS[i].variable = ud.ridecule[i];
1293
        MEO_MACROS[i].variable = ud.ridecule[i];
1294
    }
1294
    }
1295
1295
1296
    // prepare input
1296
    // prepare input
1297
    for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
1297
    for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
1298
    {
1298
    {
1299
        MEL_KEYBOARDSETUPFUNCS[i] = &ME_KEYBOARDSETUPFUNCS[i];
1299
        MEL_KEYBOARDSETUPFUNCS[i] = &ME_KEYBOARDSETUPFUNCS[i];
1300
        ME_KEYBOARDSETUPFUNCS[i] = ME_KEYBOARDSETUPFUNCS_TEMPLATE;
1300
        ME_KEYBOARDSETUPFUNCS[i] = ME_KEYBOARDSETUPFUNCS_TEMPLATE;
1301
        ME_KEYBOARDSETUPFUNCS[i].name = MenuGameFuncs[i];
1301
        ME_KEYBOARDSETUPFUNCS[i].name = MenuGameFuncs[i];
1302
        ME_KEYBOARDSETUPFUNCS[i].entry = &MEO_KEYBOARDSETUPFUNCS[i];
1302
        ME_KEYBOARDSETUPFUNCS[i].entry = &MEO_KEYBOARDSETUPFUNCS[i];
1303
        MEO_KEYBOARDSETUPFUNCS[i] = MEO_KEYBOARDSETUPFUNCS_TEMPLATE;
1303
        MEO_KEYBOARDSETUPFUNCS[i] = MEO_KEYBOARDSETUPFUNCS_TEMPLATE;
1304
        MEO_KEYBOARDSETUPFUNCS[i].column[0] = &ud.config.KeyboardKeys[i][0];
1304
        MEO_KEYBOARDSETUPFUNCS[i].column[0] = &ud.config.KeyboardKeys[i][0];
1305
        MEO_KEYBOARDSETUPFUNCS[i].column[1] = &ud.config.KeyboardKeys[i][1];
1305
        MEO_KEYBOARDSETUPFUNCS[i].column[1] = &ud.config.KeyboardKeys[i][1];
1306
    }
1306
    }
1307
    for (i = 0; i < MENUMOUSEFUNCTIONS; ++i)
1307
    for (i = 0; i < MENUMOUSEFUNCTIONS; ++i)
1308
    {
1308
    {
1309
        MEL_MOUSESETUPBTNS[i] = &ME_MOUSESETUPBTNS[i];
1309
        MEL_MOUSESETUPBTNS[i] = &ME_MOUSESETUPBTNS[i];
1310
        ME_MOUSESETUPBTNS[i] = ME_MOUSEJOYSETUPBTNS_TEMPLATE;
1310
        ME_MOUSESETUPBTNS[i] = ME_MOUSEJOYSETUPBTNS_TEMPLATE;
1311
        ME_MOUSESETUPBTNS[i].name = MenuMouseNames[i];
1311
        ME_MOUSESETUPBTNS[i].name = MenuMouseNames[i];
1312
        ME_MOUSESETUPBTNS[i].entry = &MEO_MOUSESETUPBTNS[i];
1312
        ME_MOUSESETUPBTNS[i].entry = &MEO_MOUSESETUPBTNS[i];
1313
        MEO_MOUSESETUPBTNS[i] = MEO_MOUSEJOYSETUPBTNS_TEMPLATE;
1313
        MEO_MOUSESETUPBTNS[i] = MEO_MOUSEJOYSETUPBTNS_TEMPLATE;
1314
        MEO_MOUSESETUPBTNS[i].data = &ud.config.MouseFunctions[MenuMouseDataIndex[i][0]][MenuMouseDataIndex[i][1]];
1314
        MEO_MOUSESETUPBTNS[i].data = &ud.config.MouseFunctions[MenuMouseDataIndex[i][0]][MenuMouseDataIndex[i][1]];
1315
    }
1315
    }
1316
    for (i = 0; i < 2*joynumbuttons + 8*joynumhats; ++i)
1316
    for (i = 0; i < 2*joynumbuttons + 8*joynumhats; ++i)
1317
    {
1317
    {
1318
        if (i < 2*joynumbuttons)
1318
        if (i < 2*joynumbuttons)
1319
        {
1319
        {
1320
            if (i & 1)
1320
            if (i & 1)
1321
                Bsnprintf(MenuJoystickNames[i], MAXJOYBUTTONSTRINGLENGTH, "Double %s", getjoyname(1, i>>1));
1321
                Bsnprintf(MenuJoystickNames[i], MAXJOYBUTTONSTRINGLENGTH, "Double %s", getjoyname(1, i>>1));
1322
            else
1322
            else
1323
                Bstrncpy(MenuJoystickNames[i], getjoyname(1, i>>1), MAXJOYBUTTONSTRINGLENGTH);
1323
                Bstrncpy(MenuJoystickNames[i], getjoyname(1, i>>1), MAXJOYBUTTONSTRINGLENGTH);
1324
        }
1324
        }
1325
        else
1325
        else
1326
        {
1326
        {
1327
            Bsnprintf(MenuJoystickNames[i], MAXJOYBUTTONSTRINGLENGTH, (i & 1) ? "Double Hat %d %s" : "Hat %d %s", ((i - 2*joynumbuttons)>>3), MenuJoystickHatDirections[((i - 2*joynumbuttons)>>1) % 4]);
1327
            Bsnprintf(MenuJoystickNames[i], MAXJOYBUTTONSTRINGLENGTH, (i & 1) ? "Double Hat %d %s" : "Hat %d %s", ((i - 2*joynumbuttons)>>3), MenuJoystickHatDirections[((i - 2*joynumbuttons)>>1) % 4]);
1328
        }
1328
        }
1329
1329
1330
        MEL_JOYSTICKBTNS[i] = &ME_JOYSTICKBTNS[i];
1330
        MEL_JOYSTICKBTNS[i] = &ME_JOYSTICKBTNS[i];
1331
        ME_JOYSTICKBTNS[i] = ME_MOUSEJOYSETUPBTNS_TEMPLATE;
1331
        ME_JOYSTICKBTNS[i] = ME_MOUSEJOYSETUPBTNS_TEMPLATE;
1332
        ME_JOYSTICKBTNS[i].name = MenuJoystickNames[i];
1332
        ME_JOYSTICKBTNS[i].name = MenuJoystickNames[i];
1333
        ME_JOYSTICKBTNS[i].entry = &MEO_JOYSTICKBTNS[i];
1333
        ME_JOYSTICKBTNS[i].entry = &MEO_JOYSTICKBTNS[i];
1334
        MEO_JOYSTICKBTNS[i] = MEO_MOUSEJOYSETUPBTNS_TEMPLATE;
1334
        MEO_JOYSTICKBTNS[i] = MEO_MOUSEJOYSETUPBTNS_TEMPLATE;
1335
        MEO_JOYSTICKBTNS[i].data = &ud.config.JoystickFunctions[i>>1][i&1];
1335
        MEO_JOYSTICKBTNS[i].data = &ud.config.JoystickFunctions[i>>1][i&1];
1336
    }
1336
    }
1337
    M_JOYSTICKBTNS.numEntries = 2*joynumbuttons + 8*joynumhats;
1337
    M_JOYSTICKBTNS.numEntries = 2*joynumbuttons + 8*joynumhats;
1338
    for (i = 0; i < joynumaxes; ++i)
1338
    for (i = 0; i < joynumaxes; ++i)
1339
    {
1339
    {
1340
        ME_JOYSTICKAXES[i] = ME_JOYSTICKAXES_TEMPLATE;
1340
        ME_JOYSTICKAXES[i] = ME_JOYSTICKAXES_TEMPLATE;
1341
        Bstrncpy(MenuJoystickAxes[i], getjoyname(0, i), MAXJOYBUTTONSTRINGLENGTH);
1341
        Bstrncpy(MenuJoystickAxes[i], getjoyname(0, i), MAXJOYBUTTONSTRINGLENGTH);
1342
        ME_JOYSTICKAXES[i].name = MenuJoystickAxes[i];
1342
        ME_JOYSTICKAXES[i].name = MenuJoystickAxes[i];
1343
        MEL_JOYSTICKAXES[i] = &ME_JOYSTICKAXES[i];
1343
        MEL_JOYSTICKAXES[i] = &ME_JOYSTICKAXES[i];
1344
    }
1344
    }
1345
    M_JOYSTICKAXES.numEntries = joynumaxes;
1345
    M_JOYSTICKAXES.numEntries = joynumaxes;
1346
1346
1347
    // prepare video setup
1347
    // prepare video setup
1348
    for (i = 0; i < validmodecnt; ++i)
1348
    for (i = 0; i < validmodecnt; ++i)
1349
    {
1349
    {
1350
        int32_t *const r = &MEOS_VIDEOSETUP_RESOLUTION.numOptions;
1350
        int32_t *const r = &MEOS_VIDEOSETUP_RESOLUTION.numOptions;
1351
1351
1352
        for (j = 0; j < *r; ++j)
1352
        for (j = 0; j < *r; ++j)
1353
        {
1353
        {
1354
            if (validmode[i].xdim == resolution[j].xdim && validmode[i].ydim == resolution[j].ydim)
1354
            if (validmode[i].xdim == resolution[j].xdim && validmode[i].ydim == resolution[j].ydim)
1355
            {
1355
            {
1356
                resolution[j].flags |= validmode[i].fs ? RES_FS : RES_WIN;
1356
                resolution[j].flags |= validmode[i].fs ? RES_FS : RES_WIN;
1357
                if (validmode[i].bpp > resolution[j].bppmax)
1357
                if (validmode[i].bpp > resolution[j].bppmax)
1358
                    resolution[j].bppmax = validmode[i].bpp;
1358
                    resolution[j].bppmax = validmode[i].bpp;
1359
                break;
1359
                break;
1360
            }
1360
            }
1361
        }
1361
        }
1362
1362
1363
        if (j == *r) // no match found
1363
        if (j == *r) // no match found
1364
        {
1364
        {
1365
            resolution[j].xdim = validmode[i].xdim;
1365
            resolution[j].xdim = validmode[i].xdim;
1366
            resolution[j].ydim = validmode[i].ydim;
1366
            resolution[j].ydim = validmode[i].ydim;
1367
            resolution[j].bppmax = validmode[i].bpp;
1367
            resolution[j].bppmax = validmode[i].bpp;
1368
            resolution[j].flags = validmode[i].fs ? RES_FS : RES_WIN;
1368
            resolution[j].flags = validmode[i].fs ? RES_FS : RES_WIN;
1369
            Bsnprintf(resolution[j].name, MAXRESOLUTIONSTRINGLENGTH, "%d x %d", resolution[j].xdim, resolution[j].ydim);
1369
            Bsnprintf(resolution[j].name, MAXRESOLUTIONSTRINGLENGTH, "%d x %d", resolution[j].xdim, resolution[j].ydim);
1370
            MEOSN_VIDEOSETUP_RESOLUTION[j] = resolution[j].name;
1370
            MEOSN_VIDEOSETUP_RESOLUTION[j] = resolution[j].name;
1371
            ++*r;
1371
            ++*r;
1372
        }
1372
        }
1373
    }
1373
    }
1374
1374
1375
    // prepare shareware
1375
    // prepare shareware
1376
    if (VOLUMEONE)
1376
    if (VOLUMEONE)
1377
    {
1377
    {
1378
        // blue out episodes beyond the first
1378
        // blue out episodes beyond the first
1379
        for (i = 1; i < g_numVolumes; ++i)
1379
        for (i = 1; i < g_numVolumes; ++i)
1380
        {
1380
        {
1381
            if (MEL_EPISODE[i])
1381
            if (MEL_EPISODE[i])
1382
            {
1382
            {
1383
                ME_EPISODE[i].font = &MF_RedfontBlue;
1383
                ME_EPISODE[i].font = &MF_RedfontBlue;
1384
                ME_EPISODE[i].entry = &MEO_EPISODE_SHAREWARE;
1384
                ME_EPISODE[i].entry = &MEO_EPISODE_SHAREWARE;
1385
            }
1385
            }
1386
        }
1386
        }
1387
        M_EPISODE.numEntries = g_numVolumes; // remove User Map (and spacer)
1387
        M_EPISODE.numEntries = g_numVolumes; // remove User Map (and spacer)
1388
        MEOS_NETOPTIONS_EPISODE.numOptions = 1;
1388
        MEOS_NETOPTIONS_EPISODE.numOptions = 1;
1389
        MenuEntry_DisableOnCondition(&ME_NETOPTIONS_EPISODE, 1);
1389
        MenuEntry_DisableOnCondition(&ME_NETOPTIONS_EPISODE, 1);
1390
    }
1390
    }
1391
1391
1392
    // prepare pre-Atomic
1392
    // prepare pre-Atomic
1393
    if (!VOLUMEALL || !PLUTOPAK)
1393
    if (!VOLUMEALL || !PLUTOPAK)
1394
    {
1394
    {
1395
        // prepare credits
1395
        // prepare credits
1396
        M_CREDITS.title = M_CREDITS2.title = M_CREDITS3.title = MenuCredits;
1396
        M_CREDITS.title = M_CREDITS2.title = M_CREDITS3.title = MenuCredits;