Subversion Repositories eduke32

Rev

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

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

149

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

151

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

232

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