FS2_Open
Open source remastering of the Freespace 2 engine
optionsmenu.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 
13 #include "bmpman/bmpman.h"
14 #include "freespace2/freespace.h"
16 #include "gamesnd/eventmusic.h"
17 #include "gamesnd/gamesnd.h"
18 #include "globalincs/alphacolors.h"
19 #include "io/joy.h"
20 #include "io/key.h"
21 #include "io/mouse.h"
22 #include "io/timer.h"
23 #include "menuui/mainhallmenu.h"
24 #include "menuui/optionsmenu.h"
28 #include "nebula/neb.h"
29 #include "network/multi.h"
30 #include "osapi/osregistry.h"
31 #include "pilotfile/pilotfile.h"
32 #include "popup/popup.h"
33 #include "popup/popupdead.h"
34 #include "sound/audiostr.h"
35 #include "weapon/weapon.h"
36 
37 
38 
39 // will display a notification warning message
40 #define OPTIONS_NOTIFY_TIME 3500
41 #define OPTIONS_NOTIFY_Y 450
42 
43 #define NUM_BUTTONS 24
44 #define NUM_ANIS 4
45 #define NUM_TABS 3
46 #define NUM_COMMONS 10
47 
48 #define TABLESS 999
49 
50 #define OPTIONS_TAB 0
51 #define MULTIPLAYER_TAB 1
52 #define DETAIL_LEVELS_TAB 2
53 #define ABORT_GAME_BUTTON 3
54 #define CONTROL_CONFIG_BUTTON 4
55 #define HUD_CONFIG_BUTTON 5
56 #define ACCEPT_BUTTON 6
57 
58 #define BRIEF_VOICE_OFF 7
59 #define BRIEF_VOICE_ON 8
60 #define MOUSE_OFF 9
61 #define MOUSE_ON 10
62 #define GAMMA_DOWN 11
63 #define GAMMA_UP 12
64 
65 // detail level screen buttons
66 #define PLANETS_ON 13
67 #define PLANETS_OFF 14
68 #define HUD_TARGETVIEW_RENDER_ON 15
69 #define HUD_TARGETVIEW_RENDER_OFF 16
70 #define WEAPON_EXTRAS_ON 17
71 #define WEAPON_EXTRAS_OFF 18
72 
73 #define LOW_DETAIL_N 19
74 #define MEDIUM_DETAIL_N 20
75 #define HIGH_DETAIL_N 21
76 #define VERY_HIGH_DETAIL_N 22
77 #define CUSTOM_DETAIL_N 23
78 
79 #define REPEAT (1<<0)
80 #define NO_MOUSE_OVER_SOUND (1<<1)
81 
82 // indicies for options coordinates
83 #define OPTIONS_X_COORD 0
84 #define OPTIONS_Y_COORD 1
85 #define OPTIONS_W_COORD 2
86 #define OPTIONS_H_COORD 3
87 
89  char *filename;
90  int x, y;
91  int hotspot;
92  int tab;
93  int flags;
94  UI_BUTTON button; // because we have a class inside this struct, we need the constructor below..
95 
96  options_buttons(char *name, int x1, int y1, int h, int t, int f = 0) : filename(name), x(x1), y(y1), hotspot(h), tab(t), flags(f) {}
97 };
98 
100  { // GR_640
101  options_buttons("OPT_00", 17, 2, 0, -1), // options tab
102  options_buttons("OPT_01", 102, 2, 1, -1), // multiplayer tab
103  options_buttons("OPT_02", 170, 2, 2, -1), // detail levels tab
104  options_buttons("OPT_03", 10, 444, 3, -1), // abort game button
105  options_buttons("OPT_04", 411, 444, 4, -1), // control config button
106  options_buttons("OPT_05", 506, 444, 5, -1), // hud config
107  options_buttons("OPT_06", 576, 434, 6, -1), // accept button
108 
109  options_buttons("OMB_07", 51, 74, 7, OPTIONS_TAB, 2), // Briefing / debriefing voice toggle off
110  options_buttons("OMB_08", 106, 74, 8, OPTIONS_TAB, 2), // Briefing / debriefing voice toggle on
111  options_buttons("OMB_18", 51, 266, 18, OPTIONS_TAB, 2), // Mouse off
112  options_buttons("OMB_19", 106, 266, 19, OPTIONS_TAB, 2), // Mouse on
113  options_buttons("OMB_26", 578, 149, 26, OPTIONS_TAB, 1), // Gamma Down
114  options_buttons("OMB_27", 607, 149, 27, OPTIONS_TAB, 1), // Gamma Up
115 
116  options_buttons("ODB_21", 597, 261, 21, DETAIL_LEVELS_TAB, 2), // Planets On
117  options_buttons("ODB_20", 539, 261, 20, DETAIL_LEVELS_TAB, 2), // Planets Off
118  options_buttons("ODB_23", 597, 307, 23, DETAIL_LEVELS_TAB, 2), // Target View Rendering On
119  options_buttons("ODB_22", 539, 307, 22, DETAIL_LEVELS_TAB, 2), // Target View Rendering Off
120  options_buttons("ODB_25", 597, 354, 25, DETAIL_LEVELS_TAB, 2), // Weapon Extras On
121  options_buttons("ODB_24", 539, 354, 24, DETAIL_LEVELS_TAB, 2), // Weapon Extras Off
122 
123  options_buttons("ODB_14", 614, 76, 14, DETAIL_LEVELS_TAB, 2), // Low Preset Detail
124  options_buttons("ODB_15", 614, 96, 15, DETAIL_LEVELS_TAB, 2), // Medium Preset Detail
125  options_buttons("ODB_16", 614, 114, 16, DETAIL_LEVELS_TAB, 2), // High Preset Detail
126  options_buttons("ODB_17", 614, 133, 17, DETAIL_LEVELS_TAB, 2), // Highest Preset Detail
127  options_buttons("ODB_18", 614, 152, 18, DETAIL_LEVELS_TAB, 2), // Custom Detail
128  },
129  { // GR_1024
130  options_buttons("2_OPT_00", 27, 4, 0, -1), // options tab
131  options_buttons("2_OPT_01", 164, 4, 1, -1), // multiplayer tab
132  options_buttons("2_OPT_02", 272, 4, 2, -1), // detail levels tab
133  options_buttons("2_OPT_03", 16, 711, 3, -1), // abort game
134  options_buttons("2_OPT_04", 657, 711, 4, -1), // control config button
135  options_buttons("2_OPT_05", 809, 711, 5, -1), // hud config button
136  options_buttons("2_OPT_06", 922, 694, 6, -1), // accept button
137 
138  options_buttons("2_OMB_07", 81, 118, 7, OPTIONS_TAB, 2), // Briefing / debriefing voice toggle off
139  options_buttons("2_OMB_08", 170, 118, 8, OPTIONS_TAB, 2), // Briefing / debriefing voice toggle on
140  options_buttons("2_OMB_18", 81, 425, 18, OPTIONS_TAB, 2), // Mouse off
141  options_buttons("2_OMB_19", 170, 425, 19, OPTIONS_TAB, 2), // Mouse on
142  options_buttons("2_OMB_26", 925, 238, 26, OPTIONS_TAB, 1), // Gamma Down
143  options_buttons("2_OMB_27", 971, 238, 27, OPTIONS_TAB, 1), // Gamma Up
144 
145  options_buttons("2_ODB_21", 956, 417, 21, DETAIL_LEVELS_TAB, 2), // Planets On
146  options_buttons("2_ODB_20", 863, 417, 20, DETAIL_LEVELS_TAB, 2), // Planets Off
147  options_buttons("2_ODB_23", 956, 492, 23, DETAIL_LEVELS_TAB, 2), // Target View Rendering On
148  options_buttons("2_ODB_22", 863, 492, 22, DETAIL_LEVELS_TAB, 2), // Target View Rendering Off
149  options_buttons("2_ODB_25", 956, 567, 25, DETAIL_LEVELS_TAB, 2), // Weapon Extras On
150  options_buttons("2_ODB_24", 863, 567, 24, DETAIL_LEVELS_TAB, 2), // Weapon Extras Off
151 
152  options_buttons("2_ODB_14", 983, 122, 14, DETAIL_LEVELS_TAB, 2), // Low Preset Detail
153  options_buttons("2_ODB_15", 983, 153, 15, DETAIL_LEVELS_TAB, 2), // Medium Preset Detail
154  options_buttons("2_ODB_16", 983, 183, 16, DETAIL_LEVELS_TAB, 2), // High Preset Detail
155  options_buttons("2_ODB_17", 983, 213, 17, DETAIL_LEVELS_TAB, 2), // Highest Preset Detail
156  options_buttons("2_ODB_18", 983, 243, 18, DETAIL_LEVELS_TAB, 2), // Custom Detail
157  }
158 };
159 
160 #define NUM_OPTIONS_SLIDERS 7
161 #define OPT_SOUND_VOLUME_SLIDER 0
162 #define OPT_MUSIC_VOLUME_SLIDER 1
163 #define OPT_VOICE_VOLUME_SLIDER 2
164 #define OPT_MOUSE_SENS_SLIDER 3
165 #define OPT_JOY_SENS_SLIDER 4
166 #define OPT_JOY_DEADZONE_SLIDER 5
167 #define OPT_SKILL_SLIDER 6
168 
170  { // GR_640
171  op_sliders("OMB_10", 31, 139, -1, -1, 10, 20, 10,
172  "OMB_11", 11, 226, 137,
173  "OMB_09", 9, 4, 137 ), // sound fx volume slider
174  op_sliders("OMB_13", 31, 174, -1, -1, 13, 20, 10,
175  "OMB_14", 14, 226, 172,
176  "OMB_12", 12, 4, 172 ), // music volume slider
177  op_sliders("OMB_16", 31, 209, -1, -1, 16, 20, 10,
178  "OMB_17", 17, 226, 206,
179  "OMB_15", 15, 4, 206 ), // voice volume slider
180  op_sliders("OMB_20", 6, 316, -1, -1, 20, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // mouse sensitivity
181  op_sliders("OMB_28", 440, 259, -1, -1, 28, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // joystick sensitivity
182  op_sliders("OMB_29", 440, 290, -1, -1, 29, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // joystick deadzone
183  op_sliders("OMB_21", 440, 75, -1, -1, 21, 36, 5, NULL, -1, -1, -1, NULL, -1, -1, -1)
184  },
185  { // GR_1024
186  op_sliders("2_OMB_10", 50, 223, -1, -1, 10, 32, 10,
187  "2_OMB_11", 11, 361, 219,
188  "2_OMB_09", 9, 7, 219 ), // sound fx volume slider
189  op_sliders("2_OMB_13", 50, 279, -1, -1, 13, 32, 10,
190  "2_OMB_14", 14, 361, 275,
191  "2_OMB_12", 12, 7, 275 ), // music volume slider
192  op_sliders("2_OMB_16", 50, 335, -1, -1, 16, 32, 10,
193  "2_OMB_17", 17, 361, 330,
194  "2_OMB_15", 15, 7, 330 ), // voice volume slider
195  op_sliders("2_OMB_20", 9, 505, -1, -1, 20, 32, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // mouse sensitivity
196  op_sliders("2_OMB_28", 704, 414, -1, -1, 28, 32, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // joystick sensitivity
197  op_sliders("2_OMB_29", 704, 464, -1, -1, 29, 32, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // joystick deadzone
198  op_sliders("2_OMB_21", 704, 120, -1, -1, 21, 60, 5, NULL, -1, -1, -1, NULL, -1, -1, -1)
199  }
200 };
201 
202 static struct {
203  char *filename;
205  int bitmap;
206  int mask;
207 
208 } Backgrounds[GR_NUM_RESOLUTIONS][NUM_TABS] = {
209 //XSTR:OFF
210  { // GR_640
211  { "OptionsMain", "OptionsMain-M", -1, -1},
212  { "OptionsMulti", "OptionsMulti-M", -1, -1},
213  { "OptionsDetail", "OptionsDetail-M", -1, -1},
214  },
215  { // GR_1024
216  { "2_OptionsMain", "2_OptionsMain-M", -1, -1},
217  { "2_OptionsMulti", "2_OptionsMulti-M", -1, -1},
218  { "2_OptionsDetail", "2_OptionsDetail-M", -1, -1},
219  }
220 //XSTR:ON
221 };
222 
223 static int Tab = 0;
224 static int Options_menu_inited = 0;
225 static int Options_multi_inited = 0;
226 static int Options_detail_inited = 0;
227 static int Button_bms[NUM_COMMONS][MAX_BMAPS_PER_GADGET];
228 
229 static UI_WINDOW Ui_window;
231 
232 static int Backup_skill_level;
233 static float Backup_sound_volume;
234 static float Backup_music_volume;
235 static float Backup_voice_volume;
236 
237 static int Backup_briefing_voice_enabled;
238 static int Backup_use_mouse_to_fly;
239 
240 static int Sound_volume_int;
241 static int Music_volume_int;
242 static int Voice_volume_int;
243 
244 static int Voice_vol_handle = -1;
247 
248 // called whenever accept is hit
249 // do any processing, etc in here.
250 void options_accept();
251 void options_force_button_frame(int n, int frame_num);
252 
253 extern float FreeSpace_gamma;
254 
255 void options_add_notify(const char *str);
257 
259  {
260  435, 179, 195, 28 // GR_640
261  },
262  {
263  692, 287, 308, 44 // GR_1024
264  }
265 };
266 
267 #define MAX_GAMMA_BITMAP_SIZE 17500
268 
270  {
271  489, 159, 65, 17 // GR_640
272  },
273  {
274  779, 254, 65, 17 // GR_1024
275  }
276 };
277 
279  {
280  468, 104, 155, 10 // GR_640
281  },
282  {
283  750, 169, 246, 21 // GR_1024
284  }
285 };
286 
287 
288 // ---------------------------------------------------------------------------------------------------------
289 // DETAIL LEVEL OPTIONS definitions BEGIN
290 //
291 
292 #define NUM_DETAIL_SLIDERS 8
293 
294 /*
295 #define DETAIL_DISTANCE_SLIDER 0
296 #define NEBULA_DETAIL_SLIDER 1
297 #define HARDWARE_TEXTURES_SLIDER 2
298 #define NUM_PARTICLES_SLIDER 6
299 #define SHARD_CULLING_SLIDER 3
300 #define SHIELD_DETAIL_SLIDER 4
301 #define NUM_STARS_SLIDER 5
302 #define LIGHTING_SLIDER 7
303 */
304 #define DETAIL_DISTANCE_SLIDER 0
305 #define NEBULA_DETAIL_SLIDER 1
306 #define HARDWARE_TEXTURES_SLIDER 2
307 #define NUM_PARTICLES_SLIDER 3
308 #define SHARD_CULLING_SLIDER 4
309 #define SHIELD_DETAIL_SLIDER 5
310 #define NUM_STARS_SLIDER 6
311 #define LIGHTING_SLIDER 7
313  { // GR_640
314  op_sliders("ODB_07", 21, 71, -1, -1, 7, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // model detail
315  op_sliders("ODB_08", 21, 119, -1, -1, 8, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // nebula detail
316  op_sliders("ODB_09", 21, 166, -1, -1, 9, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // textures
317  op_sliders("ODB_10", 21, 212, -1, -1, 10, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // particles
318  op_sliders("ODB_11", 21, 260, -1, -1, 11, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // debris
319  op_sliders("ODB_12", 21, 307, -1, -1, 12, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // shield hit
320  op_sliders("ODB_13", 21, 354, -1, -1, 13, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // stars
321  op_sliders("ODB_19", 518, 212, -1, -1, 19, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // lighting
322  },
323  { // GR_1024
324  op_sliders("2_ODB_07", 34, 114, -1, -1, 7, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // model detail
325  op_sliders("2_ODB_08", 34, 190, -1, -1, 8, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // nebula detail
326  op_sliders("2_ODB_09", 34, 265, -1, -1, 9, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // textures
327  op_sliders("2_ODB_10", 34, 340, -1, -1, 10, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // particles
328  op_sliders("2_ODB_11", 34, 416, -1, -1, 11, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // debris
329  op_sliders("2_ODB_12", 34, 492, -1, -1, 12, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // shield hit
330  op_sliders("2_ODB_13", 34, 567, -1, -1, 13, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // stars
331  op_sliders("2_ODB_19", 829, 340, -1, -1, 19, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // lighting
332  }
333 };
335 detail_levels Detail_original; // backup of Detail settings when screen is first entered
337 void options_detail_init();
342 
343 // text
344 #define OPTIONS_NUM_TEXT 49
346  { // GR_640
347  // common text
348  { "Options", 1036, 10, 35, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][OPTIONS_TAB].button },
349  { "Multi", 1042, 97, 35, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][MULTIPLAYER_TAB].button },
350  { "Detail", 1351, 166, 35, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][DETAIL_LEVELS_TAB].button },
351  { "Exit", 1059, 8, 417, UI_XSTR_COLOR_PINK, -1, &Buttons[0][ABORT_GAME_BUTTON].button },
352  { "Game", 1412, 8, 430, UI_XSTR_COLOR_PINK, -1, &Buttons[0][ABORT_GAME_BUTTON].button },
353  { "Control", 1352, 409, 418, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][CONTROL_CONFIG_BUTTON].button },
354  { "Config", 1353, 409, 430, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][CONTROL_CONFIG_BUTTON].button },
355  { "HUD", 1354, 504, 418, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][HUD_CONFIG_BUTTON].button },
356  { "Config", 1415, 504, 430, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][HUD_CONFIG_BUTTON].button },
357  { "Accept", 1035, 573, 412, UI_XSTR_COLOR_PINK, -1, &Buttons[0][ACCEPT_BUTTON].button },
358 
359  // text for the detail level screen
360  { "Preset Detail Levels", 1355, 455, 56, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
361  { "Low", 1160, 570, 82, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][LOW_DETAIL_N].button },
362  { "Medium", 1161, 550, 100, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][MEDIUM_DETAIL_N].button },
363  { "High", 1162, 568, 120, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][HIGH_DETAIL_N].button },
364  { "Very High", 1163, 530, 139, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][VERY_HIGH_DETAIL_N].button },
365  { "Custom", 1356, 546, 158, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][CUSTOM_DETAIL_N].button },
366  { "Off", 1286, 509, 267, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][PLANETS_OFF].button },
367  { "On", 1285, 573, 267, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][PLANETS_ON].button },
368  { "Off", 1286, 509, 314, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][HUD_TARGETVIEW_RENDER_OFF].button },
369  { "On", 1285, 573, 314, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][HUD_TARGETVIEW_RENDER_ON].button },
370  { "Off", 1286, 509, 361, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][WEAPON_EXTRAS_OFF].button },
371  { "On", 1285, 573, 361, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][WEAPON_EXTRAS_ON].button },
372  { "Planets/Backgrounds", 1357, 455, 244, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
373  { "Target View Rendering", 1358, 446, 291, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
374  { "Weapon Extras", 1359, 497, 338, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
375  { "Model Detail", 1360, 27, 56, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
376  { "Nebula Detail", 1361, 27, 103, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
377  { "3D Hardware Textures", 1362, 27, 150, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
378  { "Particles", 1363, 27, 197, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
379  { "Impact Effects", 1364, 27, 244, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
380  { "Shield Hit Effects", 1365, 27, 291, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
381  { "Stars", 1366, 27, 338, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
382  { "Lighting", 1367, 549, 197, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
383 
384  // main options screen text
385  { "Briefing Voice", 1368, 14, 58, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
386  { "Off", 1286, 20, 81, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][BRIEF_VOICE_OFF].button },
387  { "On", 1285, 83, 81, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][BRIEF_VOICE_ON].button },
388  { "Volume", 1369, 14, 111, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
389  { "Effects", 1370, 20, 130, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
390  { "Music", 1371, 20, 165, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
391  { "Voice", 1372, 20, 199, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
392  { "Mouse", 1373, 14, 249, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
393  { "Off", 1286, 20, 273, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][MOUSE_OFF].button },
394  { "On", 1285, 83, 273, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][MOUSE_ON].button },
395  { "Sensitivity", 1529, 20, 297, UI_XSTR_COLOR_GREEN, -1, &Options_sliders[0][OPT_MOUSE_SENS_SLIDER].slider },
396  { "Skill Level", 1509, 533, 58, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
397  { "Brightness", 1375, 532, 133, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
398  { "Joystick", 1376, 556, 231, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
399  { "Sensitivity", 1374, 538, 250, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
400  { "Deadzone", 1377, 538, 281, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
401  },
402  { // GR_1024
403  // common text
404  { "Options", 1036, 16, 57, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][OPTIONS_TAB].button },
405  { "Multi", 1042, 172, 57, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][MULTIPLAYER_TAB].button },
406  { "Detail", 1351, 283, 57, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][DETAIL_LEVELS_TAB].button },
407  { "Exit", 1059, 13, 685, UI_XSTR_COLOR_PINK, -1, &Buttons[1][ABORT_GAME_BUTTON].button },
408  { "Game", 1412, 13, 696, UI_XSTR_COLOR_PINK, -1, &Buttons[1][ABORT_GAME_BUTTON].button },
409  { "Control", 1352, 655, 685, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][CONTROL_CONFIG_BUTTON].button },
410  { "Config", 1353, 655, 696, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][CONTROL_CONFIG_BUTTON].button },
411  { "HUD", 1354, 806, 685, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][HUD_CONFIG_BUTTON].button },
412  { "Config", 1415, 806, 696, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][HUD_CONFIG_BUTTON].button },
413  { "Accept", 1035, 927, 672, UI_XSTR_COLOR_PINK, -1, &Buttons[1][ACCEPT_BUTTON].button },
414 
415  // text for the detail level screen
416  { "Preset Detail Levels", 1355, 809, 90, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
417  { "Low", 1160, 944, 131, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][LOW_DETAIL_N].button },
418  { "Medium", 1161, 924, 161, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][MEDIUM_DETAIL_N].button },
419  { "High", 1162, 942, 192, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][HIGH_DETAIL_N].button },
420  { "Very High", 1163, 903, 222, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][VERY_HIGH_DETAIL_N].button },
421  { "Custom", 1356, 922, 252, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][CUSTOM_DETAIL_N].button },
422  { "Off", 1286, 835, 427, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][PLANETS_OFF].button },
423  { "On", 1285, 936, 427, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][PLANETS_ON].button },
424  { "Off", 1286, 835, 503, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][HUD_TARGETVIEW_RENDER_OFF].button },
425  { "On", 1285, 936, 503, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][HUD_TARGETVIEW_RENDER_ON].button },
426  { "Off", 1286, 835, 578, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][WEAPON_EXTRAS_OFF].button },
427  { "On", 1285, 936, 578, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][WEAPON_EXTRAS_ON].button },
428  { "Planets/Backgrounds", 1357, 808, 391, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
429  { "Target View Rendering", 1358, 799, 466, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
430  { "Weapon Extras", 1359, 850, 542, UI_XSTR_COLOR_GREEN, -1, &Detail_bogus },
431  { "Model Detail", 1360, 44, 99, UI_XSTR_COLOR_GREEN, -1, &Detail_sliders[1][DETAIL_DISTANCE_SLIDER].slider },
432  { "Nebula Detail", 1361, 44, 175, UI_XSTR_COLOR_GREEN, -1, &Detail_sliders[1][NEBULA_DETAIL_SLIDER].slider },
433  { "3D Hardware Textures", 1362, 44, 250, UI_XSTR_COLOR_GREEN, -1, &Detail_sliders[1][HARDWARE_TEXTURES_SLIDER].slider },
434  { "Particles", 1363, 44, 325, UI_XSTR_COLOR_GREEN, -1, &Detail_sliders[1][NUM_PARTICLES_SLIDER].slider },
435  { "Impact Effects", 1364, 44, 401, UI_XSTR_COLOR_GREEN, -1, &Detail_sliders[1][SHARD_CULLING_SLIDER].slider },
436  { "Shield Hit Effects", 1365, 44, 476, UI_XSTR_COLOR_GREEN, -1, &Detail_sliders[1][SHIELD_DETAIL_SLIDER].slider },
437  { "Stars", 1366, 44, 552, UI_XSTR_COLOR_GREEN, -1, &Detail_sliders[1][NUM_STARS_SLIDER].slider },
438  { "Lighting", 1367, 903, 326, UI_XSTR_COLOR_GREEN, -1, &Detail_sliders[1][LIGHTING_SLIDER].slider },
439 
440  // main options screen text
441  { "Briefing Voice", 1368, 23, 93, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
442  { "Off", 1286, 32, 130, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][BRIEF_VOICE_OFF].button },
443  { "On", 1285, 134, 130, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][BRIEF_VOICE_ON].button },
444  { "Volume", 1369, 23, 178, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
445  { "Effects", 1370, 33, 209, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
446  { "Music", 1371, 33, 264, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
447  { "Voice", 1372, 33, 319, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
448  { "Mouse", 1373, 23, 399, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
449  { "Off", 1286, 32, 437, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][MOUSE_OFF].button },
450  { "On", 1285, 134, 437, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][MOUSE_ON].button },
451  { "Sensitivity", 1529, 34, 477, UI_XSTR_COLOR_GREEN, -1, &Options_sliders[1][OPT_MOUSE_SENS_SLIDER].slider },
452  { "Skill Level", 1509, 854, 93, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
453  { "Brightness", 1375, 852, 214, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
454  { "Joystick", 1376, 891, 370, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
455  { "Sensitivity", 1374, 861, 400, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
456  { "Deadzone", 1377, 861, 451, UI_XSTR_COLOR_GREEN, -1, &Options_bogus },
457  }
458 };
459 
460 
461 //
462 // DETAIL LEVEL tab definitions END
463 // ---------------------------------------------------------------------------------------------------------
464 
466 {
467  int snd_id;
468 
469  if ( snd_is_playing(Voice_vol_handle) ) {
470  snd_stop(Voice_vol_handle);
471  Voice_vol_handle=-1;
472  }
473 
475  Voice_vol_handle = snd_play_raw( snd_id, 0.0f, 1.0f, SND_PRIORITY_SINGLE_INSTANCE );
476 }
477 
478 void options_add_notify(const char *str)
479 {
482 }
483 
485 {
486  int w,h;
487 
488  if (Options_notify_stamp != -1) {
491 
492  } else {
495  }
496  }
497 }
498 
499 /*
500 void options_set_bmaps(int btn, int bm_index)
501 {
502  int j;
503 
504  for (j=0; j<MAX_BMAPS_PER_GADGET; j++){
505  Buttons[gr_screen.res][btn].button.bmap_ids[j] = Button_bms[bm_index][j];
506  }
507 }
508 */
509 
510 void options_tab_setup(int set_palette)
511 {
512  // char *pal;
513  int i;
514  int flags[256];
515 
516  if (Tab != MULTIPLAYER_TAB) {
517  Assert(Backgrounds[gr_screen.res][Tab].mask >= 0);
518  Ui_window.set_mask_bmap(Backgrounds[gr_screen.res][Tab].mask, Backgrounds[gr_screen.res][Tab].mask_filename);
519  }
520 
521  for (i=0; i<256; i++){
522  flags[i] = 0;
523  }
524 
525  // activate, deactivate any necessary controls
526  for (i=0; i<NUM_BUTTONS; i++) {
527  if ( ((Buttons[gr_screen.res][i].tab == Tab) || (Buttons[gr_screen.res][i].tab == -1)) && !flags[Buttons[gr_screen.res][i].hotspot] ) {
528  flags[Buttons[gr_screen.res][i].hotspot] = 1;
529  Buttons[gr_screen.res][i].button.enable();
530  if (Buttons[gr_screen.res][i].filename)
531  Buttons[gr_screen.res][i].button.unhide();
532 
533  } else {
534  Buttons[gr_screen.res][i].button.disable();
535  Buttons[gr_screen.res][i].button.hide();
536  }
537  }
538 
539  // maybe enable/disable controls based upon current tab
540  if (Tab == OPTIONS_TAB) {
541  for(i=0; i<NUM_OPTIONS_SLIDERS; i++){
542  Options_sliders[gr_screen.res][i].slider.enable();
543  Options_sliders[gr_screen.res][i].slider.unhide();
544  }
545  } else {
546  for(i=0; i<NUM_OPTIONS_SLIDERS; i++){
547  Options_sliders[gr_screen.res][i].slider.hide();
548  Options_sliders[gr_screen.res][i].slider.disable();
549  }
550  }
551 
553  Options_sliders[gr_screen.res][OPT_SKILL_SLIDER].slider.disable();
555  }
556 
557  // do other special processing
558  switch (Tab) {
559  case MULTIPLAYER_TAB:
561  break;
562 
563  case DETAIL_LEVELS_TAB:
565  break;
566  }
567 }
568 
569 // call this function to close down, do other processing of data in the tab that's being left
571 {
572  switch (Tab) {
573  case MULTIPLAYER_TAB:
575  break;
576 
577  case DETAIL_LEVELS_TAB:
579  break;
580  }
581 }
582 
584 {
585  int idx;
586 
587  switch (n) {
588  case MULTIPLAYER_TAB:
589  if ( Networking_disabled ) {
591  return;
592  }
593 
594  if ( !Options_multi_inited ) {
595  // init multiplayer
596  options_multi_init(&Ui_window);
598  Options_multi_inited = 1;
599  }
600 
601  break;
602 
603  case DETAIL_LEVELS_TAB:
604  if (!Options_detail_inited) {
605  // init detail levels
608  Options_detail_inited = 1;
609  }
610 
611  break;
612  }
613 
614  // if we're going into the main screen
615  if(n == OPTIONS_TAB){
616  Options_bogus.enable();
617  Options_bogus.unhide();
618  for(idx=0; idx<NUM_OPTIONS_SLIDERS; idx++){
619  Options_sliders[gr_screen.res][idx].slider.enable();
620  Options_sliders[gr_screen.res][idx].slider.unhide();
621  }
622  } else {
623  Options_bogus.hide();
624  Options_bogus.disable();
625  for(idx=0; idx<NUM_OPTIONS_SLIDERS; idx++){
626  Options_sliders[gr_screen.res][idx].slider.hide();
627  Options_sliders[gr_screen.res][idx].slider.disable();
628  }
629  }
630 
631  if (n != MULTIPLAYER_TAB) {
632  if (Backgrounds[gr_screen.res][n].mask < 0) {
634  return;
635  }
636  }
637 
639 
640  Tab = n;
643 }
644 
646 {
648 }
649 
651 {
653 }
654 
656 {
658 }
659 
661 {
662  Master_sound_volume = Backup_sound_volume;
664  Master_event_music_volume = Backup_music_volume;
666  Master_voice_volume = Backup_voice_volume;
668 
669  if(!(Game_mode & GM_MULTIPLAYER)){
670  Game_skill_level = Backup_skill_level;
671  }
672 
673  Briefing_voice_enabled = Backup_briefing_voice_enabled;
674  Use_mouse_to_fly = Backup_use_mouse_to_fly;
675 
676  if ( Options_detail_inited ) {
678  }
679 
681 }
682 
684 {
685  char tmp_gamma_string[32];
686 
688  if (FreeSpace_gamma < 0.1f) {
689  FreeSpace_gamma = 0.1f;
691 
692  } else if (FreeSpace_gamma > 5.0f) {
693  FreeSpace_gamma = 5.0f;
695 
696  } else {
698  }
699 
701  sprintf(tmp_gamma_string, NOX("%.2f"), FreeSpace_gamma);
702 
703  os_config_write_string( NULL, NOX("GammaD3D"), tmp_gamma_string );
704 }
705 
707 {
708  int choice;
709 
710  switch (n) {
711  case OPTIONS_TAB:
712  case MULTIPLAYER_TAB:
713  case DETAIL_LEVELS_TAB:
714  if (Tab != n)
716 
717  break;
718 
719  case ABORT_GAME_BUTTON:
721  choice = popup( PF_NO_NETWORKING | PF_BODY_BIG, 2, POPUP_NO, POPUP_YES, XSTR( "Exit Game?", 374));
722  if ( choice == 1 )
724  break;
725 
729  break;
730 
731  case HUD_CONFIG_BUTTON:
732  // can't go to the hud config screen when a multiplayer observer
735  options_add_notify(XSTR( "Cannot use HUD config when an observer!", 375));
736  break;
737  }
738 
741  break;
742 
743  case ACCEPT_BUTTON:
744  options_accept();
745  break;
746 
747  // BEGIN - detail level tab buttons
748 
752  break;
753 
757  break;
758 
759  case PLANETS_ON:
760  Detail.planets_suns = 1;
762  break;
763 
764  case PLANETS_OFF:
765  Detail.planets_suns = 0;
767  break;
768 
769  case WEAPON_EXTRAS_ON:
770  Detail.weapon_extras = 1;
772  break;
773 
774  case WEAPON_EXTRAS_OFF:
775  Detail.weapon_extras = 0;
777  break;
778 
779  case LOW_DETAIL_N:
782  break;
783 
784  case MEDIUM_DETAIL_N:
787  break;
788 
789  case HIGH_DETAIL_N:
792  break;
793 
794  case VERY_HIGH_DETAIL_N:
797  break;
798 
799  case CUSTOM_DETAIL_N:
802  break;
803  // END - detail level tab buttons
804 
805  case GAMMA_DOWN:
806  options_change_gamma(-0.05f);
807  break;
808 
809  case GAMMA_UP:
810  options_change_gamma(0.05f);
811  break;
812 
813  case BRIEF_VOICE_ON:
816  break;
817 
818  case BRIEF_VOICE_OFF:
821  break;
822 
823  case MOUSE_ON:
824  Use_mouse_to_fly = 1;
826  break;
827 
828  case MOUSE_OFF:
829  Use_mouse_to_fly = 0;
831  break;
832  }
833 }
834 
836 {
837  // sound slider
838  if (Options_sliders[gr_screen.res][OPT_SOUND_VOLUME_SLIDER].slider.pos != Sound_volume_int) {
839  Sound_volume_int = Options_sliders[gr_screen.res][OPT_SOUND_VOLUME_SLIDER].slider.pos;
840  Master_sound_volume = ((float) (Sound_volume_int) / 9.0f);
843  }
844 
845  // music slider
846  if (Options_sliders[gr_screen.res][OPT_MUSIC_VOLUME_SLIDER].slider.pos != Music_volume_int) {
847  Music_volume_int = Options_sliders[gr_screen.res][OPT_MUSIC_VOLUME_SLIDER].slider.pos;
848  Master_event_music_volume = ((float) (Music_volume_int) / 9.0f);
849  if (Master_event_music_volume > 0.0f) {
851  }
852 
855  }
856 
857  // voice slider
858  if (Options_sliders[gr_screen.res][OPT_VOICE_VOLUME_SLIDER].slider.pos != Voice_volume_int) {
859  Voice_volume_int = Options_sliders[gr_screen.res][OPT_VOICE_VOLUME_SLIDER].slider.pos;
860  Master_voice_volume = ((float) (Voice_volume_int) / 9.0f);
863  }
864 
865  if (Mouse_sensitivity != Options_sliders[gr_screen.res][OPT_MOUSE_SENS_SLIDER].slider.pos) {
868  }
869 
870  if (Joy_sensitivity != Options_sliders[gr_screen.res][OPT_JOY_SENS_SLIDER].slider.pos) {
873  }
874 
875  if (Dead_zone_size != Options_sliders[gr_screen.res][OPT_JOY_DEADZONE_SLIDER].slider.pos * 5) {
878  }
879 
880  if (Game_skill_level != Options_sliders[gr_screen.res][OPT_SKILL_SLIDER].slider.pos) {
883  }
884 }
885 
887 {
888  // apply the selected multiplayer options
889  if ( Options_multi_inited ) {
890  // if we've failed to provide a PXO password or username but have turned on PXO, we don't want to quit
891  if (!options_multi_accept()) {
893  popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, "PXO is selected but password or username is missing");
894  return;
895  }
896  }
897 
898  // If music is zero volume, disable
899  if ( Master_event_music_volume <= 0.0f ) {
900 // event_music_disable();
902  }
903 
904  // apply other options (display options, etc)
905  // note: return in here (and play failed sound) if they can't accept yet for some reason
906 
909 }
910 
912 {
913  Assert(tab == OPTIONS_TAB || tab == DETAIL_LEVELS_TAB );
914  Backgrounds[gr_screen.res][tab].bitmap = bm_load(Backgrounds[gr_screen.res][tab].filename);
915  Backgrounds[gr_screen.res][tab].mask = bm_load(Backgrounds[gr_screen.res][tab].mask_filename);
916 }
917 
918 int Gamma_last_set = -1;
920 
922 {
923  int i, j;
925 
926  Assert(!Options_menu_inited);
927 
928  // pause all sounds, since we could get here through the game
930  //audiostream_pause_all();
931 
932  Tab = 0;
933  Gamma_last_set = -1;
934 
935  common_set_interface_palette("InterfacePalette"); // set the interface palette
937 
938  for (i=0; i<PLANETS_ON; i++) {
939  b = &Buttons[gr_screen.res][i];
940 
941  b->button.create(&Ui_window, "", b->x, b->y, 60, 30, b->flags & REPEAT, 1);
942  // set up callback for when a mouse first goes over a button
943  if (b->filename) {
944  b->button.set_bmaps(b->filename);
945  if ( !(b->flags & NO_MOUSE_OVER_SOUND) ) {
947  }
948 
949  } else {
950  b->button.hide();
951  }
952 
953  b->button.link_hotspot(b->hotspot);
954  if (i < NUM_COMMONS) {
955  for (j=0; j<MAX_BMAPS_PER_GADGET; j++){
956  Button_bms[i][j] = b->button.bmap_ids[j];
957  }
958  }
959  }
960 
961  // add all xstr text
962  for(i=0; i<OPTIONS_NUM_TEXT; i++){
963  Ui_window.add_XSTR(&Options_text[gr_screen.res][i]);
964  }
965 
966  // bogus controls
967  Detail_bogus.base_create(&Ui_window, UI_KIND_ICON, 0, 0, 0, 0);
968  Options_bogus.base_create(&Ui_window, UI_KIND_ICON, 0, 0, 0, 0);
969 
972 
973  /*
974  Skill_control.first_frame = bm_load_animation("OPa_11", &Skill_control.total_frames);
975  if (Skill_control.first_frame < 0) {
976  Error(LOCATION, "Could not load OPa_11.ani\n");
977  return;
978  }
979  */
980 
981  for (i=0; i<NUM_TABS; i++) {
982  Backgrounds[gr_screen.res][i].bitmap = -1;
983  Backgrounds[gr_screen.res][i].mask = -1;
984  }
985 
988 
989  Backup_skill_level = Game_skill_level;
990  Backup_sound_volume = Master_sound_volume;
991  Backup_music_volume = Master_event_music_volume;
992  Backup_voice_volume = Master_voice_volume;
993  Backup_briefing_voice_enabled = Briefing_voice_enabled;
994  Backup_use_mouse_to_fly = Use_mouse_to_fly;
995 
996  // create slider
997  for ( i = 0; i < NUM_OPTIONS_SLIDERS; i++ ) {
998  Options_sliders[gr_screen.res][i].slider.create(&Ui_window, Options_sliders[gr_screen.res][i].x, Options_sliders[gr_screen.res][i].y,
999  Options_sliders[gr_screen.res][i].dots, Options_sliders[gr_screen.res][i].filename,
1000  Options_sliders[gr_screen.res][i].hotspot, Options_sliders[gr_screen.res][i].right_filename, Options_sliders[gr_screen.res][i].right_mask, Options_sliders[gr_screen.res][i].right_x, Options_sliders[gr_screen.res][i].right_y,
1001  Options_sliders[gr_screen.res][i].left_filename, Options_sliders[gr_screen.res][i].left_mask, Options_sliders[gr_screen.res][i].left_x, Options_sliders[gr_screen.res][i].left_y,
1002  Options_sliders[gr_screen.res][i].dot_w);
1003  }
1004 
1005  // maybe disable the skill slider
1007  Options_sliders[gr_screen.res][OPT_SKILL_SLIDER].slider.disable();
1009  }
1010 
1011  // setup slider values
1012  // note slider scale is 0-9, while Master_ values calc with 1-10 scale (hence the -1)
1013  Sound_volume_int = Options_sliders[gr_screen.res][OPT_SOUND_VOLUME_SLIDER].slider.pos = (int) (Master_sound_volume * 9.0f + 0.5f);
1014  Music_volume_int = Options_sliders[gr_screen.res][OPT_MUSIC_VOLUME_SLIDER].slider.pos = (int) (Master_event_music_volume * 9.0f + 0.5f);
1015  Voice_volume_int = Options_sliders[gr_screen.res][OPT_VOICE_VOLUME_SLIDER].slider.pos = (int) (Master_voice_volume * 9.0f + 0.5f);
1016 
1018  Options_sliders[gr_screen.res][OPT_JOY_DEADZONE_SLIDER].slider.pos = Dead_zone_size / 5;
1021 
1022  Gamma_colors_inited = 0;
1023 
1024  Options_menu_inited = 1;
1025 
1026  // hide options crap
1028 }
1029 
1031 {
1032  int i;
1033 
1034  Assert(Options_menu_inited);
1035 
1036  for (i=0; i<NUM_TABS; i++) {
1037  if (Backgrounds[gr_screen.res][i].bitmap >= 0){
1038  bm_release(Backgrounds[gr_screen.res][i].bitmap);
1039  }
1040  if ((Backgrounds[gr_screen.res][i].mask >= 0) && (i != Tab)){ // Ui_window.destroy() expects to release current tab's mask.
1041  bm_release(Backgrounds[gr_screen.res][i].mask);
1042  }
1043  }
1044 
1045  if ( Voice_vol_handle >= 0 ) {
1046  snd_stop(Voice_vol_handle);
1047  Voice_vol_handle = -1;
1048  }
1049 
1051 
1052  Ui_window.destroy();
1053  common_free_interface_palette(); // restore game palette
1054  Pilot.save_player();
1055  Pilot.save_savefile();
1056  game_flush();
1057 
1058  // unpause all sounds, since we could be headed back to the game
1060  //audiostream_unpause_all();
1061 
1062  Options_menu_inited = 0;
1063  Options_multi_inited = 0;
1064  Options_detail_inited = 0;
1065 
1066 
1067 }
1068 
1069 
1071 {
1072  int x, y, v;
1073 
1074 // NEILK: i had to change this declaration because the size is determined dynamically. I just picked an arbitrary large number to data size (although we should always be using less)
1075 // TODO: change MAX size to maximum size for a 1024x768 bitmap
1076 // ushort Gamma_data[Options_gamma_coords[gr_screen.res][OPTIONS_W_COORD]*Options_gamma_coords[gr_screen.res][OPTIONS_H_COORD]*2];
1077  ushort Gamma_data[MAX_GAMMA_BITMAP_SIZE];
1078 
1079  v = fl2i( pow(0.5f, 1.0f / FreeSpace_gamma) * 255.0f );
1080  if (v > 255){
1081  v = 255;
1082  } else if (v < 0){
1083  v = 0;
1084  }
1085 
1086  Gamma_last_set = v;
1087 
1088  {
1089  ushort clr_full_white = 0;
1090  ushort clr_half_white = 0;
1091  ubyte r, g, b, a;
1092 
1094 
1095  // set full white
1096  r = g = b = a = 255;
1097  bm_set_components((ubyte*)&clr_full_white, &r, &g, &b, &a);
1098 
1099  // set half white
1100  r = g = b = (ubyte)v;
1101  bm_set_components((ubyte*)&clr_half_white, &r, &g, &b, &a);
1102 
1103  memset( Gamma_data, 0, sizeof(ushort) * MAX_GAMMA_BITMAP_SIZE );
1104 
1105  ushort *dptr = Gamma_data;
1106  for (y=0; y<Options_gamma_coords[gr_screen.res][OPTIONS_H_COORD]; y++) {
1107  for (x=0; x<Options_gamma_coords[gr_screen.res][OPTIONS_W_COORD]; x++) {
1108  if ((x / 20) & 1) {
1109  *dptr = clr_half_white;
1110  } else {
1111  if ((x & 1) == (y & 1)) {
1112  *dptr = clr_full_white;
1113  } else {
1114  *dptr = 0;
1115  }
1116  }
1117  dptr++;
1118  }
1119  }
1120 
1121  // always go back to screen format
1123 
1124  // if we're in bitmap poly mode
1125  int Gamma_bitmap = bm_create( 16, Options_gamma_coords[gr_screen.res][OPTIONS_W_COORD], Options_gamma_coords[gr_screen.res][OPTIONS_H_COORD], Gamma_data, 0 );
1126  gr_set_bitmap(Gamma_bitmap);
1127  gr_bitmap( Options_gamma_coords[gr_screen.res][OPTIONS_X_COORD], Options_gamma_coords[gr_screen.res][OPTIONS_Y_COORD], GR_RESIZE_MENU );
1128 
1129  bm_release( Gamma_bitmap );
1130 
1131  }
1132 }
1133 
1134 
1135 void options_menu_do_frame(float frametime)
1136 {
1137  int i, k, x, y;
1138 
1139  Assert(Options_menu_inited);
1140  k = Ui_window.process() & ~KEY_DEBUGGED;
1141  switch (k) {
1142  case KEY_SHIFTED | KEY_TAB:
1143  case KEY_LEFT: // activate previous tab
1144  i = Tab - 1;
1145  if (i < 0)
1146  i = NUM_TABS - 1;
1147 
1148  options_change_tab(i);
1149  break;
1150 
1151  case KEY_TAB:
1152  case KEY_RIGHT: // activate next tab
1153  // check to see if the multiplayer options screen wants to eat the tab kay
1154  if ((k == KEY_TAB) && (Tab == MULTIPLAYER_TAB)) {
1155  if (options_multi_eat_tab()) {
1156  break;
1157  }
1158  }
1159 
1160  i = Tab + 1;
1161  if (i >= NUM_TABS)
1162  i = 0;
1163 
1164  options_change_tab(i);
1165  break;
1166 
1167  case KEY_C:
1168  if (Tab == OPTIONS_TAB) {
1171  }
1172 
1173  break;
1174 
1175  case KEY_H:
1176  if (Tab == OPTIONS_TAB) {
1179  }
1180 
1181  break;
1182 
1183  case KEY_ESC:
1185  break;
1186 
1187  case KEY_CTRLED | KEY_ENTER:
1188  options_accept();
1189  break;
1190 
1191  case KEY_DELETE:
1192  break;
1193 
1194  case KEY_ENTER:
1195  break;
1196  }
1197 
1198  for (i=0; i<NUM_BUTTONS; i++) {
1199  if (Buttons[gr_screen.res][i].button.pressed())
1201  }
1202 
1204 
1205  // if we're in the multiplayer options tab, get the background bitmap from the options multi module
1206  if(Tab == MULTIPLAYER_TAB){
1208  } else {
1209  i = Backgrounds[gr_screen.res][Tab].bitmap;
1210  }
1211 
1212  GR_MAYBE_CLEAR_RES(i);
1213  if (i >= 0) {
1214  gr_set_bitmap(i);
1215  gr_bitmap(0, 0, GR_RESIZE_MENU);
1216  }
1217 
1218  Ui_window.draw();
1219 
1220  // NOTE : this must be done here so that any special drawing crap we do is not overwritten by the UI_WINDOW::draw() call
1221  // do specific processing for the multiplayer tab
1222  switch (Tab) {
1223  case MULTIPLAYER_TAB:
1224  options_multi_do(k);
1225  break;
1226 
1227  case DETAIL_LEVELS_TAB:
1229  break;
1230 
1231  default:
1233  break;
1234  }
1235 
1236  // handle the displaying of any notification messages
1238 
1239  for (i=0; i<NUM_TABS; i++){
1240  if (Buttons[gr_screen.res][i].button.button_down()){
1241  break;
1242  }
1243  }
1244 
1245  if (i == NUM_TABS){
1246  Buttons[gr_screen.res][Tab].button.draw_forced(2);
1247  }
1248 
1249  if (Tab == OPTIONS_TAB) {
1250  // draw correct frame for briefing voice radio buttons
1251  if (Briefing_voice_enabled) {
1254 
1255  } else {
1258  }
1259 
1260  if (Use_mouse_to_fly) {
1263 
1264  } else {
1267  }
1268 
1269  int w;
1275 
1276  //==============================================================================
1277  // Draw the gamma adjustment grid.
1278 
1279  draw_gamma_box();
1280 
1284 
1285  gr_printf_menu(x, y, NOX("%.2f"), FreeSpace_gamma);
1286  }
1287  //==============================================================================
1288 
1289  // maybe blit a waveform
1290  if(Tab == MULTIPLAYER_TAB){
1292  }
1293 
1294  gr_flip();
1295 }
1296 
1297 
1298 // ---------------------------------------------------------------------------------------------------------
1299 // DETAIL LEVEL OPTIONS definitions BEGIN
1300 //
1301 
1303 {
1312 }
1313 
1315 {
1316  int i;
1317  options_buttons *b;
1318 
1319  Detail_original = Detail;
1320 
1322 
1323  for (i=PLANETS_ON; i<NUM_BUTTONS; i++) {
1324  b = &Buttons[gr_screen.res][i];
1325 
1326  b->button.create(&Ui_window, "", b->x, b->y, 60, 30, b->flags & REPEAT, 1);
1327  // set up callback for when a mouse first goes over a button
1328  if (b->filename) {
1329  b->button.set_bmaps(b->filename);
1330  if ( !(b->flags & NO_MOUSE_OVER_SOUND) ) {
1332  }
1333 
1334  } else {
1335  b->button.hide();
1336  }
1337 
1338  b->button.link_hotspot(b->hotspot);
1339  }
1340 
1341  // create detail level sliders
1342  for ( i = 0; i < NUM_DETAIL_SLIDERS; i++ ) {
1343  Detail_sliders[gr_screen.res][i].slider.create(&Ui_window, Detail_sliders[gr_screen.res][i].x, Detail_sliders[gr_screen.res][i].y,
1344  Detail_sliders[gr_screen.res][i].dots, Detail_sliders[gr_screen.res][i].filename,
1345  Detail_sliders[gr_screen.res][i].hotspot, Detail_sliders[gr_screen.res][i].right_filename, Detail_sliders[gr_screen.res][i].right_mask, Detail_sliders[gr_screen.res][i].right_x, Detail_sliders[gr_screen.res][i].right_y,
1346  Detail_sliders[gr_screen.res][i].left_filename, Detail_sliders[gr_screen.res][i].left_mask, Detail_sliders[gr_screen.res][i].left_x, Detail_sliders[gr_screen.res][i].left_y,
1347  Detail_sliders[gr_screen.res][i].dot_w);
1348  }
1349 
1350  // init the actual slider positions and our internal positions
1352 }
1353 
1355 {
1356  int i;
1357 
1358  for ( i = 0; i < NUM_DETAIL_SLIDERS; i++ ) {
1359  if ( Detail_sliders[gr_screen.res][i].slider.pos != Detail_slider_pos[i] ) {
1360  Detail_slider_pos[i] = Detail_sliders[gr_screen.res][i].slider.pos;
1362  }
1363  }
1364 
1365  // set Detail based on slider positions
1367 
1368  // modify nebula stuff
1371 
1377  Detail.lighting = Detail_sliders[gr_screen.res][LIGHTING_SLIDER].slider.pos;
1378 }
1379 
1381 {
1382  int i;
1383 
1384  for ( i = 0; i < NUM_DETAIL_SLIDERS; i++ ) {
1385  Detail_sliders[gr_screen.res][i].slider.disable();
1386  Detail_sliders[gr_screen.res][i].slider.hide();
1387  }
1388 
1389  // this will hide text unassociated with any real control
1390  Detail_bogus.hide();
1391 }
1392 
1394 {
1395  int i;
1396 
1397  for ( i = 0; i < NUM_DETAIL_SLIDERS; i++ ) {
1398  Detail_sliders[gr_screen.res][i].slider.enable();
1399  Detail_sliders[gr_screen.res][i].slider.unhide();
1400  }
1401 
1402  // this will hide text unassociated with any real control
1403  Detail_bogus.unhide();
1404 }
1405 
1406 void options_force_button_frame(int n, int frame_num)
1407 {
1408  if ( !Buttons[gr_screen.res][n].button.button_down() ) {
1409  Buttons[gr_screen.res][n].button.draw_forced(frame_num);
1410  }
1411 }
1412 
1413 // called once per frame to set lit buttons
1415 {
1417 
1418  // force on/off buttons to draw their correct setting
1419 
1420  if ( Detail.targetview_model ) {
1423  } else {
1426  }
1427 
1428  if ( Detail.planets_suns == 1 ) {
1431  } else {
1434  }
1435 
1436  if ( Detail.weapon_extras) {
1439  } else {
1442  }
1443 
1444  int current_detail;
1445 
1446  if ( Detail.setting >= 0 ) {
1447  current_detail = current_detail_level();
1448  Detail.setting = current_detail;
1449  } else {
1450  current_detail = -1;
1451  }
1452 
1458 
1459  switch ( current_detail ) {
1460  case -1:
1462  break;
1463  case 0:
1465  break;
1466  case 1:
1468  break;
1469  case 2:
1471  break;
1472  case 3:
1474  break;
1475  }
1476 }
1477 
1478 // Set all the detail settings to a predefined level
1480 {
1481  detail_level_set(level);
1483 }
1484 
1485 //
1486 // DETAIL LEVEL tab definitions END
1487 // ---------------------------------------------------------------------------------------------------------
void game_flush()
Definition: fredstubs.cpp:83
void create(UI_WINDOW *wnd, int _x, int _y, int _num_pos, char *bm_slider, int slider_mask, char *bm_left=NULL, int left_mask=-1, int left_x=-1, int left_y=-1, char *bm_right=NULL, int right_mask=-1, int right_x=-1, int right_y=-1, int _dot_width=19)
DOT_SLIDER class down here.
Definition: slider.cpp:24
#define NUM_STARS_SLIDER
#define SHARD_CULLING_SLIDER
int Joy_sensitivity
Definition: joy-unix.cpp:29
void set_highlight_action(void(*_user_function)(void))
Definition: button.cpp:375
pilotfile Pilot
Definition: pilotfile.cpp:7
int timestamp(int delta_ms)
Definition: timer.cpp:226
int targetview_model
Definition: systemvars.h:177
#define ACCEPT_BUTTON
Definition: optionsmenu.cpp:56
UI_GADGET Detail_bogus
int i
Definition: multi_pxo.cpp:466
int Briefing_voice_enabled
void audiostream_set_volume_all(float volume, int type)
Definition: audiostr.cpp:1857
void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id=-1)
Definition: window.cpp:476
#define MOUSE_OFF
Definition: optionsmenu.cpp:60
#define DETAIL_LEVELS_TAB
Definition: optionsmenu.cpp:52
#define MAX_GAMMA_BITMAP_SIZE
#define OPTIONS_TAB
Definition: optionsmenu.cpp:50
int Game_mode
Definition: systemvars.cpp:24
GLfloat GLfloat GLfloat GLfloat h
Definition: Glext.h:7280
#define KEY_LEFT
Definition: key.h:181
void gr_flip()
Definition: 2d.cpp:2113
commit pressed
Definition: gamesnd.h:294
int Mouse_sensitivity
Definition: mouse.cpp:50
void options_multi_init(UI_WINDOW *options_window)
#define LIGHTING_SLIDER
int Detail_slider_pos[NUM_DETAIL_SLIDERS]
int detail_distance
Definition: systemvars.h:168
#define GR_RESIZE_MENU
Definition: 2d.h:684
net_player * Net_player
Definition: multi.cpp:94
int Options_notify_stamp
void options_multi_vox_process_waveform()
int snd_load(game_snd *gs, int allow_hardware_load)
Definition: sound.cpp:281
#define NUM_DETAIL_SLIDERS
bool save_savefile()
Definition: csg.cpp:1524
#define ASF_VOICE
Definition: audiostr.h:21
#define KEY_RIGHT
Definition: key.h:182
int Dead_zone_size
Definition: joy-unix.cpp:27
int bmap_ids[MAX_BMAPS_PER_GADGET]
Definition: ui.h:118
virtual void unhide()
Definition: gadget.cpp:217
int bitmap
Assert(pm!=NULL)
#define GR_NUM_RESOLUTIONS
Definition: 2d.h:651
#define NETINFO_FLAG_OBSERVER
Definition: multi.h:605
__inline void gr_string(int x, int y, const char *string, int resize_mode=GR_RESIZE_FULL)
Definition: 2d.h:769
#define OPT_MOUSE_SENS_SLIDER
general failure sound for any event
Definition: gamesnd.h:297
void event_music_enable()
Definition: ui.h:61
int res
Definition: 2d.h:370
int max_h_unscaled
Definition: 2d.h:361
int shield_effects
Definition: systemvars.h:173
GLclampf f
Definition: Glext.h:7097
void base_create(UI_WINDOW *wnd, int _kind, int _x, int _y, int _w, int _h)
Definition: gadget.cpp:244
#define ABORT_GAME_BUTTON
Definition: optionsmenu.cpp:53
void set_sound_volume()
int snd_is_playing(int sig)
Definition: sound.cpp:1047
void options_multi_do(int key)
#define GR_MAYBE_CLEAR_RES(bmap)
Definition: 2d.h:639
voice clip played when volume slider changes
Definition: gamesnd.h:317
UI_BUTTON button
Definition: optionsmenu.cpp:94
#define KEY_C
Definition: key.h:84
virtual void hide(int n)
Definition: gadget.cpp:207
void gr_set_color_fast(color *dst)
Definition: 2d.cpp:1197
Definition: ui.h:195
int flags
Definition: multi.h:463
void options_notify_do_frame()
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
Definition: 2d.cpp:2105
int max_w_unscaled
Definition: 2d.h:361
#define KEY_DELETE
Definition: key.h:176
#define PLANETS_OFF
Definition: optionsmenu.cpp:67
char * right_filename
Definition: optionsmenu.h:28
op_sliders Options_sliders[GR_NUM_RESOLUTIONS][NUM_OPTIONS_SLIDERS]
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
Definition: bmpman.cpp:2603
#define OPT_VOICE_VOLUME_SLIDER
char * filename
Definition: optionsmenu.h:19
void BM_SELECT_TEX_FORMAT()
Sets bm_set_components and bm_get_components to reference texture format functions.
Definition: bmpman.cpp:2745
int current_detail_level()
Definition: systemvars.cpp:500
#define OPTIONS_Y_COORD
Definition: optionsmenu.cpp:84
float FreeSpace_gamma
Definition: fredstubs.cpp:191
void common_set_interface_palette(char *filename)
#define OPTIONS_NOTIFY_Y
Definition: optionsmenu.cpp:41
void draw_forced(int frame_num)
Definition: button.cpp:104
int options_multi_eat_tab()
void os_config_write_string(const char *section, const char *name, const char *value)
Definition: osregistry.cpp:221
void destroy()
Definition: window.cpp:189
int mask
void options_multi_select()
void options_accept()
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
void set_mask_bmap(char *fname)
Definition: window.cpp:75
#define BRIEF_VOICE_OFF
Definition: optionsmenu.cpp:58
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
Definition: gadget.cpp:71
void options_play_voice_clip()
#define REPEAT
Definition: optionsmenu.cpp:79
void options_detail_hide_stuff()
void common_free_interface_palette()
void detail_level_set(int level)
Definition: systemvars.cpp:484
GLdouble GLdouble GLdouble r
Definition: Glext.h:5337
void weapon_pause_sounds()
Definition: weapons.cpp:7248
#define OPT_JOY_SENS_SLIDER
void options_detail_synch_sliders()
void(* bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a)
Functional pointer that references any of the bm_set_components functions.
Definition: bmpman.cpp:76
GLboolean GLboolean g
Definition: Glext.h:5781
void options_change_gamma(float delta)
#define GM_MULTIPLAYER
Definition: systemvars.h:18
float Master_sound_volume
Definition: sound.cpp:53
UI_DOT_SLIDER_NEW slider
Definition: optionsmenu.h:32
detail_levels Detail
Definition: systemvars.cpp:478
UI_GADGET Options_bogus
void options_detail_init()
#define NUM_TABS
Definition: optionsmenu.cpp:45
GLboolean GLboolean GLboolean GLboolean a
Definition: Glext.h:5781
#define GAMMA_UP
Definition: optionsmenu.cpp:63
char * filename
int pressed()
Definition: button.cpp:325
Switching to a new screen, but not commit.
Definition: gamesnd.h:292
#define KEY_SHIFTED
Definition: key.h:62
#define OPT_SKILL_SLIDER
#define HARDWARE_TEXTURES_SLIDER
#define w(p)
Definition: modelsinc.h:68
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
#define KEY_ENTER
Definition: key.h:125
#define BRIEF_VOICE_ON
Definition: optionsmenu.cpp:59
char Options_notify_string[200]
int hardware_textures
Definition: systemvars.h:169
#define VERY_HIGH_DETAIL_N
Definition: optionsmenu.cpp:76
void options_detail_set_level(int level)
int right_mask
Definition: optionsmenu.h:29
void options_tab_close()
void options_menu_close()
int Use_mouse_to_fly
Definition: mouse.cpp:51
void options_detail_sliders_update()
void main_hall_reset_ambient_vol()
#define HUD_TARGETVIEW_RENDER_ON
Definition: optionsmenu.cpp:68
void options_menu_init()
int options_multi_background_bitmap()
#define MOUSE_ON
Definition: optionsmenu.cpp:61
void options_sliders_update()
int Options_skills_text_coords[GR_NUM_RESOLUTIONS][4]
#define UI_KIND_ICON
Definition: ui.h:26
int Options_gamma_num_coords[GR_NUM_RESOLUTIONS][4]
void options_add_notify(const char *str)
int use_hack_to_get_around_stupid_problem_flag
Definition: ui.h:652
#define SHIELD_DETAIL_SLIDER
#define OPT_JOY_DEADZONE_SLIDER
int left_mask
Definition: optionsmenu.h:27
bool save_player(player *_p=NULL)
Definition: plr.cpp:935
#define delta
Definition: fvi.cpp:418
int idx
Definition: multiui.cpp:761
void set_music_volume()
GLdouble GLdouble t
Definition: Glext.h:5329
int Networking_disabled
Definition: fredstubs.cpp:32
void options_load_background_and_mask(int tab)
#define MAX_BMAPS_PER_GADGET
Definition: ui.h:33
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
#define HIGH_DETAIL_N
Definition: optionsmenu.cpp:75
GLclampd n
Definition: Glext.h:7286
unsigned char ubyte
Definition: pstypes.h:62
SCP_vector< game_snd > Snds_iface
Definition: gamesnd.cpp:20
char * mask_filename
const char * XSTR(const char *str, int index)
Definition: localize.cpp:851
int bm_create(int bpp, int w, int h, void *data, int flags)
Definition: bmpman.cpp:469
void options_change_tab(int n)
user_click (mouse selects a control)
Definition: gamesnd.h:305
#define GM_IN_MISSION
Definition: systemvars.h:23
#define NOX(s)
Definition: pstypes.h:473
#define CUSTOM_DETAIL_N
Definition: optionsmenu.cpp:77
GLbitfield flags
Definition: Glext.h:6722
int Options_gamma_coords[GR_NUM_RESOLUTIONS][4]
void set_hotkey(int keycode)
Definition: gadget.cpp:280
void options_multi_unselect()
GLuint const GLchar * name
Definition: Glext.h:5608
#define KEY_COMMA
Definition: key.h:114
#define MEDIUM_DETAIL_N
Definition: optionsmenu.cpp:74
#define WEAPON_EXTRAS_ON
Definition: optionsmenu.cpp:70
#define KEY_H
Definition: key.h:89
#define NUM_PARTICLES_SLIDER
void weapon_unpause_sounds()
Definition: weapons.cpp:7257
void draw_gamma_box()
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
Definition: bmpman.cpp:1119
GLboolean GLboolean GLboolean b
Definition: Glext.h:5781
#define HUD_TARGETVIEW_RENDER_OFF
Definition: optionsmenu.cpp:69
void options_force_button_frame(int n, int frame_num)
void options_menu_do_frame(float frametime)
void event_music_set_volume_all(float volume)
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
color Color_bright_white
Definition: alphacolors.cpp:32
#define NEBULA_DETAIL_SLIDER
color Color_white
Definition: alphacolors.cpp:32
void link_hotspot(int num)
Definition: gadget.cpp:50
void options_cancel_exit()
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
Definition: button.cpp:26
#define KEY_ESC
Definition: key.h:124
press briefing, ship selection or weapons bar (top-left)
Definition: gamesnd.h:291
#define UI_XSTR_COLOR_PINK
Definition: ui.h:161
int button_down()
Definition: button.cpp:363
#define fl2i(fl)
Definition: floating.h:33
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
Definition: window.cpp:140
char * left_filename
Definition: optionsmenu.h:26
void options_multi_close()
Definition: ui.h:584
#define OPTIONS_H_COORD
Definition: optionsmenu.cpp:86
screen gr_screen
Definition: 2d.cpp:46
void gr_get_string_size(int *w, int *h, const char *text, int len=9999)
Definition: font.cpp:196
#define OPTIONS_W_COORD
Definition: optionsmenu.cpp:85
Definition: ui.h:162
unsigned short ushort
Definition: pstypes.h:63
void enable(int n=1)
Definition: gadget.cpp:440
#define NUM_COMMONS
Definition: optionsmenu.cpp:46
#define DETAIL_DISTANCE_SLIDER
void options_detail_unhide_stuff()
#define KEY_DEBUGGED
Definition: key.h:65
void common_play_highlight_sound()
Definition: gamesnd.cpp:1151
float Master_event_music_volume
Definition: eventmusic.cpp:40
const char * Skill_level_names(int skill_level, int translate=1)
Definition: aicode.cpp:208
#define HUD_CONFIG_BUTTON
Definition: optionsmenu.cpp:55
#define timestamp_elapsed(stamp)
Definition: timer.h:102
#define SND_PRIORITY_SINGLE_INSTANCE
Definition: sound.h:27
void game_feature_disabled_popup()
Definition: fredstubs.cpp:219
detail_levels Detail_original
int Game_skill_level
Definition: fredstubs.cpp:170
#define KEY_CTRLED
Definition: key.h:64
int Gamma_last_set
#define KEY_TAB
Definition: key.h:127
void options_detail_do_frame()
int Gamma_colors_inited
void event_music_level_close()
Definition: eventmusic.cpp:691
void set_voice_volume()
void gr_bitmap(int _x, int _y, int resize_mode)
Definition: 2d.cpp:1303
void options_button_pressed(int n)
#define UI_XSTR_COLOR_GREEN
Definition: ui.h:160
bool options_multi_accept()
UI_XSTR Options_text[GR_NUM_RESOLUTIONS][OPTIONS_NUM_TEXT]
#define OPTIONS_X_COORD
Definition: optionsmenu.cpp:83
options_buttons(char *name, int x1, int y1, int h, int t, int f=0)
Definition: optionsmenu.cpp:96
void neb2_set_detail_level(int level)
Definition: neb.cpp:301
#define OPT_MUSIC_VOLUME_SLIDER
#define NUM_OPTIONS_SLIDERS
#define GAMMA_DOWN
Definition: optionsmenu.cpp:62
int num_small_debris
Definition: systemvars.h:170
void snd_stop(int sig)
Definition: sound.cpp:875
void gamesnd_play_iface(int n)
Definition: gamesnd.cpp:260
GLint level
Definition: Glext.h:5180
void disable()
Definition: gadget.cpp:432
void draw()
Definition: window.cpp:220
#define OPT_SOUND_VOLUME_SLIDER
#define KEY_PERIOD
Definition: key.h:115
#define NUM_BUTTONS
Definition: optionsmenu.cpp:43
#define NO_MOUSE_OVER_SOUND
Definition: optionsmenu.cpp:80
#define gr_set_gamma
Definition: 2d.h:829
int process(int key_in=-1, int process_mouse=1)
Definition: window.cpp:401
#define CONTROL_CONFIG_BUTTON
Definition: optionsmenu.cpp:54
#define OPTIONS_NOTIFY_TIME
Definition: optionsmenu.cpp:40
void _cdecl gr_printf_menu(int x, int y, const char *format,...)
Definition: font.cpp:314
void gameseq_post_event(int event)
op_sliders Detail_sliders[GR_NUM_RESOLUTIONS][NUM_DETAIL_SLIDERS]
const GLdouble * v
Definition: Glext.h:5322
int popupdead_is_active()
Definition: popupdead.cpp:538
float Master_voice_volume
Definition: sound.cpp:54
void options_tab_setup(int set_palette)
#define PLANETS_ON
Definition: optionsmenu.cpp:66
#define MULTIPLAYER_TAB
Definition: optionsmenu.cpp:51
#define LOW_DETAIL_N
Definition: optionsmenu.cpp:73
GLint y
Definition: Gl.h:1505
#define OPTIONS_NUM_TEXT
#define strcpy_s(...)
Definition: safe_strings.h:67
void BM_SELECT_SCREEN_FORMAT()
Sets bm_set_components and bm_get_components to reference screen format functions.
Definition: bmpman.cpp:2733
int snd_play_raw(int soundnum, float pan, float vol_scale, int priority)
Definition: sound.cpp:477
#define WEAPON_EXTRAS_OFF
Definition: optionsmenu.cpp:71