Many additional setup menu options; only volume remains.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2041 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+222
-19
@@ -27,6 +27,7 @@
|
|||||||
#include "libs/graphics/widgets.h"
|
#include "libs/graphics/widgets.h"
|
||||||
#include "libs/graphics/tfb_draw.h"
|
#include "libs/graphics/tfb_draw.h"
|
||||||
#include "libs/reslib.h"
|
#include "libs/reslib.h"
|
||||||
|
#include "libs/sound/sound.h"
|
||||||
#include "resinst.h"
|
#include "resinst.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -47,9 +48,11 @@ static WIDGET *current, *next;
|
|||||||
static int quit_main_menu (WIDGET *self, int event);
|
static int quit_main_menu (WIDGET *self, int event);
|
||||||
static int quit_sub_menu (WIDGET *self, int event);
|
static int quit_sub_menu (WIDGET *self, int event);
|
||||||
static int do_graphics (WIDGET *self, int event);
|
static int do_graphics (WIDGET *self, int event);
|
||||||
|
static int do_audio (WIDGET *self, int event);
|
||||||
static int do_engine (WIDGET *self, int event);
|
static int do_engine (WIDGET *self, int event);
|
||||||
static int do_resources (WIDGET *self, int event);
|
static int do_resources (WIDGET *self, int event);
|
||||||
static int do_keyconfig (WIDGET *self, int event);
|
static int do_keyconfig (WIDGET *self, int event);
|
||||||
|
static int do_advanced (WIDGET *self, int event);
|
||||||
|
|
||||||
static CHOICE_OPTION scaler_opts[] = {
|
static CHOICE_OPTION scaler_opts[] = {
|
||||||
{ "None",
|
{ "None",
|
||||||
@@ -102,6 +105,36 @@ static CHOICE_OPTION music_opts[] = {
|
|||||||
"Prefers .OGG files over .MOD."
|
"Prefers .OGG files over .MOD."
|
||||||
} } };
|
} } };
|
||||||
|
|
||||||
|
static CHOICE_OPTION meleezoom_opts[] = {
|
||||||
|
{ "Stepped",
|
||||||
|
{ "Cut between three zoom levels in combat.",
|
||||||
|
"Resembles PC combat.",
|
||||||
|
"" } },
|
||||||
|
{ "Smooth",
|
||||||
|
{ "Continuously scale the combat view.",
|
||||||
|
"Resembles 3do combat.",
|
||||||
|
"" } } };
|
||||||
|
|
||||||
|
static CHOICE_OPTION stereo_opts[] = {
|
||||||
|
{ "Disabled", { "Sound effects are center-channel.", "", "" } },
|
||||||
|
{ "Enabled",
|
||||||
|
{ "Uses positional SFX if possible..",
|
||||||
|
"Currently only supported on OpenAL.", "" } } };
|
||||||
|
|
||||||
|
static CHOICE_OPTION fps_opts[] = {
|
||||||
|
{ "No", { "Do not show FPS in the console window.", "", "" } } ,
|
||||||
|
{ "Yes", { "Show FPS in the console window.", "", "" } } };
|
||||||
|
|
||||||
|
static CHOICE_OPTION intro_opts[] = {
|
||||||
|
{ "Slides",
|
||||||
|
{ "Prefer slides to movies if both are present.",
|
||||||
|
"Forces the PC intro.",
|
||||||
|
"" } },
|
||||||
|
{ "Movie",
|
||||||
|
{ "Prefer movies to slides.",
|
||||||
|
"Will use 3do content if present.",
|
||||||
|
"", } } };
|
||||||
|
|
||||||
static CHOICE_OPTION menu_opts[] = {
|
static CHOICE_OPTION menu_opts[] = {
|
||||||
{ "Text",
|
{ "Text",
|
||||||
{ "In-game menus resemble the Original PC version.",
|
{ "In-game menus resemble the Original PC version.",
|
||||||
@@ -142,7 +175,7 @@ static CHOICE_OPTION scroll_opts[] = {
|
|||||||
{ "Per-Page",
|
{ "Per-Page",
|
||||||
{ "When fast-forwarding or rewinding conversations",
|
{ "When fast-forwarding or rewinding conversations",
|
||||||
"in-game, advance one screen of subtitles at a time.",
|
"in-game, advance one screen of subtitles at a time.",
|
||||||
"This mimics the Original PC version."
|
"This mimics the original PC version."
|
||||||
} },
|
} },
|
||||||
{ "Smooth",
|
{ "Smooth",
|
||||||
{ "When fast-forwarding or rewinding conversations",
|
{ "When fast-forwarding or rewinding conversations",
|
||||||
@@ -235,6 +268,23 @@ static CHOICE_OPTION fullscreen_opts[] = {
|
|||||||
} },
|
} },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static CHOICE_OPTION aquality_opts[] = {
|
||||||
|
{ "Low",
|
||||||
|
{ "Low audio quality.", "", "" } },
|
||||||
|
{ "Medium",
|
||||||
|
{ "Medium audio quality.", "", "" } },
|
||||||
|
{ "High",
|
||||||
|
{ "Highest audio quality.",
|
||||||
|
"May not work on all architectures.", "" } }
|
||||||
|
};
|
||||||
|
|
||||||
|
static CHOICE_OPTION adriver_opts[] = {
|
||||||
|
{ "None",
|
||||||
|
{ "Play silently.", "", "" } },
|
||||||
|
{ "MixSDL",
|
||||||
|
{ "Use the default audio mixer.", "", "" } },
|
||||||
|
{ "OpenAL",
|
||||||
|
{ "Use the Creative Labs OpenAL driver.", "", "" } } };
|
||||||
|
|
||||||
#ifdef HAVE_OPENGL
|
#ifdef HAVE_OPENGL
|
||||||
#define RES_OPTS 4
|
#define RES_OPTS 4
|
||||||
@@ -253,8 +303,14 @@ static WIDGET_CHOICE cmdline_opts[] = {
|
|||||||
{ CHOICE_PREFACE, "Scan Style", 2, 2, scan_opts, 0, 0 },
|
{ CHOICE_PREFACE, "Scan Style", 2, 2, scan_opts, 0, 0 },
|
||||||
{ CHOICE_PREFACE, "Scroll Style", 2, 2, scroll_opts, 0, 0 },
|
{ CHOICE_PREFACE, "Scroll Style", 2, 2, scroll_opts, 0, 0 },
|
||||||
{ CHOICE_PREFACE, "Subtitles", 2, 2, subtitles_opts, 0, 0 },
|
{ CHOICE_PREFACE, "Subtitles", 2, 2, subtitles_opts, 0, 0 },
|
||||||
{ CHOICE_PREFACE, "Music Driver", 2, 3, music_opts, 0, 0 },
|
{ CHOICE_PREFACE, "Music Format", 2, 2, music_opts, 0, 0 },
|
||||||
{ CHOICE_PREFACE, "Display", 2, 2, fullscreen_opts, 0, 0} };
|
{ CHOICE_PREFACE, "Display", 2, 2, fullscreen_opts, 0, 0},
|
||||||
|
{ CHOICE_PREFACE, "Cutscenes", 2, 2, intro_opts, 0, 0 },
|
||||||
|
{ CHOICE_PREFACE, "Show FPS", 2, 3, fps_opts, 0, 0 },
|
||||||
|
{ CHOICE_PREFACE, "Melee Zoom", 2, 2, meleezoom_opts, 0, 0 },
|
||||||
|
{ CHOICE_PREFACE, "Positional Audio", 2, 2, stereo_opts, 0, 0 },
|
||||||
|
{ CHOICE_PREFACE, "Sound Driver", 3, 3, adriver_opts, 0, 0 },
|
||||||
|
{ CHOICE_PREFACE, "Sound Quality", 3, 3, aquality_opts, 0, 0 } };
|
||||||
|
|
||||||
static WIDGET_BUTTON quit_button = BUTTON_INIT (quit_main_menu,
|
static WIDGET_BUTTON quit_button = BUTTON_INIT (quit_main_menu,
|
||||||
"Quit Setup Menu",
|
"Quit Setup Menu",
|
||||||
@@ -267,12 +323,15 @@ static WIDGET_BUTTON prev_button = BUTTON_INIT (quit_sub_menu,
|
|||||||
"you quit setup entirely.");
|
"you quit setup entirely.");
|
||||||
|
|
||||||
static WIDGET_BUTTON graphics_button = BUTTON_INIT (do_graphics, "Graphics Options",
|
static WIDGET_BUTTON graphics_button = BUTTON_INIT (do_graphics, "Graphics Options",
|
||||||
"Configure display options for UQM.",
|
"Configure display options for UQM.",
|
||||||
"Graphics drivers, resolution, and scalers.", "");
|
"Graphics drivers, resolution, and scalers.", "");
|
||||||
|
|
||||||
static WIDGET_BUTTON engine_button = BUTTON_INIT (do_engine, "PC/3do Compatibility Options",
|
static WIDGET_BUTTON engine_button = BUTTON_INIT (do_engine, "PC/3do Compatibility Options",
|
||||||
"Configure behavior of UQM",
|
"Configure behavior of UQM",
|
||||||
"to more closely match the PC or 3do behavior.", "");
|
"to more closely match the PC or 3do behavior.", "");
|
||||||
|
|
||||||
|
static WIDGET_BUTTON audio_button = BUTTON_INIT (do_audio, "Sound Options",
|
||||||
|
"Configure sound and audio options for UQM.", "", "");
|
||||||
|
|
||||||
static WIDGET_BUTTON resources_button = BUTTON_INIT (do_resources, "Resources Options",
|
static WIDGET_BUTTON resources_button = BUTTON_INIT (do_resources, "Resources Options",
|
||||||
"Configure UQM Addon Packs.", "", "Currently unimplemented.");
|
"Configure UQM Addon Packs.", "", "Currently unimplemented.");
|
||||||
@@ -280,6 +339,9 @@ static WIDGET_BUTTON resources_button = BUTTON_INIT (do_resources, "Resources Op
|
|||||||
static WIDGET_BUTTON keyconfig_button = BUTTON_INIT (do_keyconfig, "Configure Controls",
|
static WIDGET_BUTTON keyconfig_button = BUTTON_INIT (do_keyconfig, "Configure Controls",
|
||||||
"Set up keyboard and joystick controls.", "", "Currently unimplemented.");
|
"Set up keyboard and joystick controls.", "", "Currently unimplemented.");
|
||||||
|
|
||||||
|
static WIDGET_BUTTON advanced_button = BUTTON_INIT (do_advanced, "Advanced Options",
|
||||||
|
"Select underlying drivers or other", "hardware-dependent options.", "");
|
||||||
|
|
||||||
static const char *incomplete_msg[] = {
|
static const char *incomplete_msg[] = {
|
||||||
"This part of the configuration",
|
"This part of the configuration",
|
||||||
"has not yet been implemented.",
|
"has not yet been implemented.",
|
||||||
@@ -292,30 +354,46 @@ static WIDGET_LABEL incomplete_label = {
|
|||||||
|
|
||||||
static WIDGET *main_widgets[] = {
|
static WIDGET *main_widgets[] = {
|
||||||
(WIDGET *)(&graphics_button),
|
(WIDGET *)(&graphics_button),
|
||||||
|
(WIDGET *)(&audio_button),
|
||||||
(WIDGET *)(&engine_button),
|
(WIDGET *)(&engine_button),
|
||||||
(WIDGET *)(&resources_button),
|
(WIDGET *)(&resources_button),
|
||||||
(WIDGET *)(&keyconfig_button),
|
(WIDGET *)(&keyconfig_button),
|
||||||
|
(WIDGET *)(&advanced_button),
|
||||||
(WIDGET *)(&quit_button) };
|
(WIDGET *)(&quit_button) };
|
||||||
|
|
||||||
static WIDGET *graphics_widgets[] = {
|
static WIDGET *graphics_widgets[] = {
|
||||||
(WIDGET *)(&cmdline_opts[0]),
|
(WIDGET *)(&cmdline_opts[0]),
|
||||||
#ifdef HAVE_OPENGL
|
|
||||||
(WIDGET *)(&cmdline_opts[1]),
|
|
||||||
#endif
|
|
||||||
(WIDGET *)(&cmdline_opts[11]),
|
(WIDGET *)(&cmdline_opts[11]),
|
||||||
(WIDGET *)(&cmdline_opts[2]),
|
|
||||||
(WIDGET *)(&cmdline_opts[3]),
|
(WIDGET *)(&cmdline_opts[3]),
|
||||||
(WIDGET *)(&cmdline_opts[4]),
|
(WIDGET *)(&cmdline_opts[4]),
|
||||||
(WIDGET *)(&prev_button) };
|
(WIDGET *)(&prev_button) };
|
||||||
|
|
||||||
|
static WIDGET *audio_widgets[] = {
|
||||||
|
(WIDGET *)(&cmdline_opts[15]),
|
||||||
|
(WIDGET *)(&prev_button) };
|
||||||
|
|
||||||
static WIDGET *engine_widgets[] = {
|
static WIDGET *engine_widgets[] = {
|
||||||
(WIDGET *)(&cmdline_opts[5]),
|
(WIDGET *)(&cmdline_opts[5]),
|
||||||
(WIDGET *)(&cmdline_opts[6]),
|
(WIDGET *)(&cmdline_opts[6]),
|
||||||
(WIDGET *)(&cmdline_opts[7]),
|
(WIDGET *)(&cmdline_opts[7]),
|
||||||
(WIDGET *)(&cmdline_opts[8]),
|
(WIDGET *)(&cmdline_opts[8]),
|
||||||
(WIDGET *)(&cmdline_opts[9]),
|
(WIDGET *)(&cmdline_opts[9]),
|
||||||
|
(WIDGET *)(&cmdline_opts[14]),
|
||||||
|
(WIDGET *)(&cmdline_opts[12]),
|
||||||
|
(WIDGET *)(&cmdline_opts[10]),
|
||||||
(WIDGET *)(&prev_button) };
|
(WIDGET *)(&prev_button) };
|
||||||
|
|
||||||
|
static WIDGET *advanced_widgets[] = {
|
||||||
|
#ifdef HAVE_OPENGL
|
||||||
|
(WIDGET *)(&cmdline_opts[1]),
|
||||||
|
#endif
|
||||||
|
(WIDGET *)(&cmdline_opts[2]),
|
||||||
|
(WIDGET *)(&cmdline_opts[13]),
|
||||||
|
(WIDGET *)(&cmdline_opts[16]),
|
||||||
|
(WIDGET *)(&cmdline_opts[17]),
|
||||||
|
(WIDGET *)(&prev_button) };
|
||||||
|
|
||||||
|
|
||||||
static WIDGET *incomplete_widgets[] = {
|
static WIDGET *incomplete_widgets[] = {
|
||||||
(WIDGET *)(&incomplete_label),
|
(WIDGET *)(&incomplete_label),
|
||||||
(WIDGET *)(&prev_button) };
|
(WIDGET *)(&prev_button) };
|
||||||
@@ -325,7 +403,7 @@ static WIDGET_MENU_SCREEN menu = {
|
|||||||
"Ur-Quan Masters Setup",
|
"Ur-Quan Masters Setup",
|
||||||
"",
|
"",
|
||||||
{ {0, 0}, NULL },
|
{ {0, 0}, NULL },
|
||||||
5, main_widgets,
|
7, main_widgets,
|
||||||
0 };
|
0 };
|
||||||
|
|
||||||
static WIDGET_MENU_SCREEN graphics_menu = {
|
static WIDGET_MENU_SCREEN graphics_menu = {
|
||||||
@@ -333,19 +411,23 @@ static WIDGET_MENU_SCREEN graphics_menu = {
|
|||||||
"Ur-Quan Masters Setup",
|
"Ur-Quan Masters Setup",
|
||||||
"Graphics Options",
|
"Graphics Options",
|
||||||
{ {0, 0}, NULL },
|
{ {0, 0}, NULL },
|
||||||
#ifdef HAVE_OPENGL
|
5, graphics_widgets,
|
||||||
7, graphics_widgets,
|
|
||||||
#else
|
|
||||||
6, graphics_widgets,
|
|
||||||
#endif
|
|
||||||
0 };
|
0 };
|
||||||
|
|
||||||
|
static WIDGET_MENU_SCREEN audio_menu = {
|
||||||
|
MENU_SCREEN_PREFACE,
|
||||||
|
"Ur-Quan Masters Setup",
|
||||||
|
"Audio Options",
|
||||||
|
{ {0, 0}, NULL },
|
||||||
|
2, audio_widgets,
|
||||||
|
0 };
|
||||||
|
|
||||||
static WIDGET_MENU_SCREEN engine_menu = {
|
static WIDGET_MENU_SCREEN engine_menu = {
|
||||||
MENU_SCREEN_PREFACE,
|
MENU_SCREEN_PREFACE,
|
||||||
"Ur-Quan Masters Setup",
|
"Ur-Quan Masters Setup",
|
||||||
"3do/PC Options",
|
"3do/PC Options",
|
||||||
{ {0, 0}, NULL },
|
{ {0, 0}, NULL },
|
||||||
6, engine_widgets,
|
9, engine_widgets,
|
||||||
0 };
|
0 };
|
||||||
|
|
||||||
static WIDGET_MENU_SCREEN resources_menu = {
|
static WIDGET_MENU_SCREEN resources_menu = {
|
||||||
@@ -364,6 +446,18 @@ static WIDGET_MENU_SCREEN keyconfig_menu = {
|
|||||||
2, incomplete_widgets,
|
2, incomplete_widgets,
|
||||||
0 };
|
0 };
|
||||||
|
|
||||||
|
static WIDGET_MENU_SCREEN advanced_menu = {
|
||||||
|
MENU_SCREEN_PREFACE,
|
||||||
|
"Ur-Quan Masters Setup",
|
||||||
|
"Advanced Options",
|
||||||
|
{ {0, 0}, NULL },
|
||||||
|
#ifdef HAVE_OPENGL
|
||||||
|
6, advanced_widgets,
|
||||||
|
#else
|
||||||
|
5, advanced_widgets,
|
||||||
|
#endif
|
||||||
|
0 };
|
||||||
|
|
||||||
static int
|
static int
|
||||||
quit_main_menu (WIDGET *self, int event)
|
quit_main_menu (WIDGET *self, int event)
|
||||||
{
|
{
|
||||||
@@ -400,6 +494,18 @@ do_graphics (WIDGET *self, int event)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
do_audio (WIDGET *self, int event)
|
||||||
|
{
|
||||||
|
if (event == WIDGET_EVENT_SELECT)
|
||||||
|
{
|
||||||
|
next = (WIDGET *)(&audio_menu);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
(void)self;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
do_engine (WIDGET *self, int event)
|
do_engine (WIDGET *self, int event)
|
||||||
{
|
{
|
||||||
@@ -436,6 +542,18 @@ do_keyconfig (WIDGET *self, int event)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
do_advanced (WIDGET *self, int event)
|
||||||
|
{
|
||||||
|
if (event == WIDGET_EVENT_SELECT)
|
||||||
|
{
|
||||||
|
next = (WIDGET *)(&advanced_menu);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
(void)self;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
#define NUM_STEPS 20
|
#define NUM_STEPS 20
|
||||||
#define X_STEP (SCREEN_WIDTH / NUM_STEPS)
|
#define X_STEP (SCREEN_WIDTH / NUM_STEPS)
|
||||||
#define Y_STEP (SCREEN_HEIGHT / NUM_STEPS)
|
#define Y_STEP (SCREEN_HEIGHT / NUM_STEPS)
|
||||||
@@ -465,7 +583,14 @@ SetDefaults (void)
|
|||||||
cmdline_opts[7].selected = opts.cscan;
|
cmdline_opts[7].selected = opts.cscan;
|
||||||
cmdline_opts[8].selected = opts.scroll;
|
cmdline_opts[8].selected = opts.scroll;
|
||||||
cmdline_opts[9].selected = opts.subtitles;
|
cmdline_opts[9].selected = opts.subtitles;
|
||||||
|
cmdline_opts[10].selected = opts.music;
|
||||||
cmdline_opts[11].selected = opts.fullscreen;
|
cmdline_opts[11].selected = opts.fullscreen;
|
||||||
|
cmdline_opts[12].selected = opts.intro;
|
||||||
|
cmdline_opts[13].selected = opts.fps;
|
||||||
|
cmdline_opts[14].selected = opts.meleezoom;
|
||||||
|
cmdline_opts[15].selected = opts.stereo;
|
||||||
|
cmdline_opts[16].selected = opts.adriver;
|
||||||
|
cmdline_opts[17].selected = opts.aquality;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -482,7 +607,14 @@ PropagateResults (void)
|
|||||||
opts.cscan = cmdline_opts[7].selected;
|
opts.cscan = cmdline_opts[7].selected;
|
||||||
opts.scroll = cmdline_opts[8].selected;
|
opts.scroll = cmdline_opts[8].selected;
|
||||||
opts.subtitles = cmdline_opts[9].selected;
|
opts.subtitles = cmdline_opts[9].selected;
|
||||||
|
opts.music = cmdline_opts[10].selected;
|
||||||
opts.fullscreen = cmdline_opts[11].selected;
|
opts.fullscreen = cmdline_opts[11].selected;
|
||||||
|
opts.intro = cmdline_opts[12].selected;
|
||||||
|
opts.fps = cmdline_opts[13].selected;
|
||||||
|
opts.meleezoom = cmdline_opts[14].selected;
|
||||||
|
opts.stereo = cmdline_opts[15].selected;
|
||||||
|
opts.adriver = cmdline_opts[16].selected;
|
||||||
|
opts.aquality = cmdline_opts[17].selected;
|
||||||
|
|
||||||
SetGlobalOptions (&opts);
|
SetGlobalOptions (&opts);
|
||||||
}
|
}
|
||||||
@@ -510,6 +642,9 @@ DoSetupMenu (PSETUP_MENU_STATE pInputState)
|
|||||||
graphics_menu.bgStamp.origin.x = 0;
|
graphics_menu.bgStamp.origin.x = 0;
|
||||||
graphics_menu.bgStamp.origin.y = 0;
|
graphics_menu.bgStamp.origin.y = 0;
|
||||||
graphics_menu.bgStamp.frame = SetAbsFrameIndex (f, 1);
|
graphics_menu.bgStamp.frame = SetAbsFrameIndex (f, 1);
|
||||||
|
audio_menu.bgStamp.origin.x = 0;
|
||||||
|
audio_menu.bgStamp.origin.y = 0;
|
||||||
|
audio_menu.bgStamp.frame = SetAbsFrameIndex (f, 1);
|
||||||
engine_menu.bgStamp.origin.x = 0;
|
engine_menu.bgStamp.origin.x = 0;
|
||||||
engine_menu.bgStamp.origin.y = 0;
|
engine_menu.bgStamp.origin.y = 0;
|
||||||
engine_menu.bgStamp.frame = SetAbsFrameIndex (f, 2);
|
engine_menu.bgStamp.frame = SetAbsFrameIndex (f, 2);
|
||||||
@@ -519,6 +654,9 @@ DoSetupMenu (PSETUP_MENU_STATE pInputState)
|
|||||||
keyconfig_menu.bgStamp.origin.x = 0;
|
keyconfig_menu.bgStamp.origin.x = 0;
|
||||||
keyconfig_menu.bgStamp.origin.y = 0;
|
keyconfig_menu.bgStamp.origin.y = 0;
|
||||||
keyconfig_menu.bgStamp.frame = SetAbsFrameIndex (f, 1);
|
keyconfig_menu.bgStamp.frame = SetAbsFrameIndex (f, 1);
|
||||||
|
advanced_menu.bgStamp.origin.x = 0;
|
||||||
|
advanced_menu.bgStamp.origin.y = 0;
|
||||||
|
advanced_menu.bgStamp.frame = SetAbsFrameIndex (f, 2);
|
||||||
}
|
}
|
||||||
if (current != next)
|
if (current != next)
|
||||||
{
|
{
|
||||||
@@ -606,11 +744,41 @@ GetGlobalOptions (GLOBALOPTS *opts)
|
|||||||
opts->subtitles = optSubtitles ? OPTVAL_ENABLED : OPTVAL_DISABLED;
|
opts->subtitles = optSubtitles ? OPTVAL_ENABLED : OPTVAL_DISABLED;
|
||||||
opts->scanlines = (GfxFlags & TFB_GFXFLAGS_SCANLINES) ?
|
opts->scanlines = (GfxFlags & TFB_GFXFLAGS_SCANLINES) ?
|
||||||
OPTVAL_ENABLED : OPTVAL_DISABLED;
|
OPTVAL_ENABLED : OPTVAL_DISABLED;
|
||||||
// opts->music = (optWhichMusic == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
|
||||||
opts->menu = (optWhichMenu == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
opts->menu = (optWhichMenu == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
||||||
opts->text = (optWhichFonts == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
opts->text = (optWhichFonts == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
||||||
opts->cscan = (optWhichCoarseScan == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
opts->cscan = (optWhichCoarseScan == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
||||||
opts->scroll = (optSmoothScroll == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
opts->scroll = (optSmoothScroll == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
||||||
|
opts->intro = (optWhichIntro == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
||||||
|
opts->fps = (GfxFlags & TFB_GFXFLAGS_SHOWFPS) ?
|
||||||
|
OPTVAL_ENABLED : OPTVAL_DISABLED;
|
||||||
|
opts->meleezoom = (optMeleeScale == TFB_SCALE_TRILINEAR) ?
|
||||||
|
OPTVAL_3DO : OPTVAL_PC;
|
||||||
|
opts->stereo = optStereoSFX ? OPTVAL_ENABLED : OPTVAL_DISABLED;
|
||||||
|
/* These values are read in, but won't change during a run. */
|
||||||
|
opts->music = (optWhichMusic == OPT_3DO) ? OPTVAL_3DO : OPTVAL_PC;
|
||||||
|
switch (snddriver) {
|
||||||
|
case audio_DRIVER_OPENAL:
|
||||||
|
opts->adriver = OPTVAL_OPENAL;
|
||||||
|
break;
|
||||||
|
case audio_DRIVER_MIXSDL:
|
||||||
|
opts->adriver = OPTVAL_MIXSDL;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
opts->adriver = OPTVAL_SILENCE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (soundflags & audio_QUALITY_HIGH)
|
||||||
|
{
|
||||||
|
opts->aquality = OPTVAL_HIGH;
|
||||||
|
}
|
||||||
|
else if (soundflags & audio_QUALITY_LOW)
|
||||||
|
{
|
||||||
|
opts->aquality = OPTVAL_LOW;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
opts->aquality = OPTVAL_MEDIUM;
|
||||||
|
}
|
||||||
|
|
||||||
switch (ScreenColorDepth)
|
switch (ScreenColorDepth)
|
||||||
{
|
{
|
||||||
@@ -822,5 +990,40 @@ SetGlobalOptions (GLOBALOPTS *opts)
|
|||||||
res_PutBoolean ("config.iconicscan", opts->cscan == OPTVAL_3DO);
|
res_PutBoolean ("config.iconicscan", opts->cscan == OPTVAL_3DO);
|
||||||
res_PutBoolean ("config.smoothscroll", opts->scroll == OPTVAL_3DO);
|
res_PutBoolean ("config.smoothscroll", opts->scroll == OPTVAL_3DO);
|
||||||
|
|
||||||
|
res_PutBoolean ("config.3domusic", opts->music == OPTVAL_3DO);
|
||||||
|
res_PutBoolean ("config.3domovies", opts->intro == OPTVAL_3DO);
|
||||||
|
res_PutBoolean ("config.showfps", opts->fps == OPTVAL_ENABLED);
|
||||||
|
res_PutBoolean ("config.smoothmelee", opts->meleezoom == OPTVAL_3DO);
|
||||||
|
res_PutBoolean ("config.positionalsfx", opts->stereo == OPTVAL_ENABLED);
|
||||||
|
|
||||||
|
switch (opts->adriver) {
|
||||||
|
case OPTVAL_SILENCE:
|
||||||
|
res_PutString ("config.audiodriver", "silence");
|
||||||
|
break;
|
||||||
|
case OPTVAL_MIXSDL:
|
||||||
|
res_PutString ("config.audiodriver", "mixsdl");
|
||||||
|
break;
|
||||||
|
case OPTVAL_OPENAL:
|
||||||
|
res_PutString ("config.audiodriver", "openal");
|
||||||
|
default:
|
||||||
|
/* Shouldn't happen; leave config untouched */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (opts->aquality) {
|
||||||
|
case OPTVAL_LOW:
|
||||||
|
res_PutString ("config.audioquality", "low");
|
||||||
|
break;
|
||||||
|
case OPTVAL_MEDIUM:
|
||||||
|
res_PutString ("config.audioquality", "medium");
|
||||||
|
break;
|
||||||
|
case OPTVAL_HIGH:
|
||||||
|
res_PutString ("config.audioquality", "high");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* Shouldn't happen; leave config untouched */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
res_SaveFilename (configDir, "uqm.cfg", "config.");
|
res_SaveFilename (configDir, "uqm.cfg", "config.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,18 @@ typedef enum {
|
|||||||
OPTVAL_ALWAYS_GL
|
OPTVAL_ALWAYS_GL
|
||||||
} OPT_DRIVERTYPE;
|
} OPT_DRIVERTYPE;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
OPTVAL_SILENCE,
|
||||||
|
OPTVAL_MIXSDL,
|
||||||
|
OPTVAL_OPENAL
|
||||||
|
} OPT_ADRIVERTYPE;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
OPTVAL_LOW,
|
||||||
|
OPTVAL_MEDIUM,
|
||||||
|
OPTVAL_HIGH
|
||||||
|
} OPT_AQUALITYTYPE;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OPTVAL_16,
|
OPTVAL_16,
|
||||||
OPTVAL_24,
|
OPTVAL_24,
|
||||||
@@ -60,10 +72,11 @@ typedef struct globalopts_struct {
|
|||||||
OPT_SCALETYPE scaler;
|
OPT_SCALETYPE scaler;
|
||||||
OPT_RESTYPE res;
|
OPT_RESTYPE res;
|
||||||
OPT_DRIVERTYPE driver;
|
OPT_DRIVERTYPE driver;
|
||||||
|
OPT_ADRIVERTYPE adriver;
|
||||||
|
OPT_AQUALITYTYPE aquality;
|
||||||
OPT_DEPTH depth;
|
OPT_DEPTH depth;
|
||||||
OPT_ENABLABLE fullscreen;
|
OPT_ENABLABLE fullscreen, subtitles, scanlines, fps, stereo;
|
||||||
OPT_ENABLABLE subtitles, scanlines;
|
OPT_CONSOLETYPE music, menu, text, cscan, scroll, intro, meleezoom;
|
||||||
OPT_CONSOLETYPE music, menu, text, cscan, scroll;
|
|
||||||
} GLOBALOPTS;
|
} GLOBALOPTS;
|
||||||
|
|
||||||
void SetupMenu (void);
|
void SetupMenu (void);
|
||||||
|
|||||||
@@ -233,6 +233,67 @@ main (int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
options.smoothScroll = res_GetBoolean ("config.smoothscroll") ? OPT_3DO : OPT_PC;
|
options.smoothScroll = res_GetBoolean ("config.smoothscroll") ? OPT_3DO : OPT_PC;
|
||||||
}
|
}
|
||||||
|
if (res_HasKey ("config.3domusic"))
|
||||||
|
{
|
||||||
|
options.whichMusic = res_GetBoolean ("config.3domusic") ? OPT_3DO : OPT_PC;
|
||||||
|
}
|
||||||
|
if (res_HasKey ("config.3domovies"))
|
||||||
|
{
|
||||||
|
options.whichIntro = res_GetBoolean ("config.3domovies") ? OPT_3DO : OPT_PC;
|
||||||
|
}
|
||||||
|
if (res_HasKey ("config.showfps") && res_GetBoolean ("config.showfps"))
|
||||||
|
{
|
||||||
|
options.gfxFlags |= TFB_GFXFLAGS_SHOWFPS;
|
||||||
|
}
|
||||||
|
if (res_HasKey ("config.smoothmelee"))
|
||||||
|
{
|
||||||
|
options.meleeScale = res_GetBoolean ("config.smoothmelee") ? TFB_SCALE_TRILINEAR : TFB_SCALE_STEP;
|
||||||
|
}
|
||||||
|
if (res_HasKey ("config.positionalsfx"))
|
||||||
|
{
|
||||||
|
options.stereoSFX = res_GetBoolean ("config.positionalsfx");
|
||||||
|
}
|
||||||
|
if (res_HasKey ("config.audiodriver"))
|
||||||
|
{
|
||||||
|
const char *driverstr = res_GetString ("config.audiodriver");
|
||||||
|
if (!strcmp (driverstr, "openal"))
|
||||||
|
{
|
||||||
|
options.soundDriver = audio_DRIVER_OPENAL;
|
||||||
|
}
|
||||||
|
else if (!strcmp (driverstr, "none"))
|
||||||
|
{
|
||||||
|
options.soundDriver = audio_DRIVER_NOSOUND;
|
||||||
|
options.speechVolumeScale = 0.0f;
|
||||||
|
}
|
||||||
|
else if (!strcmp (driverstr, "mixsdl"))
|
||||||
|
{
|
||||||
|
options.soundDriver = audio_DRIVER_MIXSDL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Can't figure it out, leave as initial default */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (res_HasKey ("config.audioquality"))
|
||||||
|
{
|
||||||
|
const char *qstr = res_GetString ("config.audioquality");
|
||||||
|
if (!strcmp (qstr, "low"))
|
||||||
|
{
|
||||||
|
options.soundDriver = audio_QUALITY_LOW;
|
||||||
|
}
|
||||||
|
else if (!strcmp (qstr, "medium"))
|
||||||
|
{
|
||||||
|
options.soundDriver = audio_QUALITY_MEDIUM;
|
||||||
|
}
|
||||||
|
else if (!strcmp (qstr, "high"))
|
||||||
|
{
|
||||||
|
options.soundDriver = audio_QUALITY_HIGH;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Can't figure it out, leave as initial default */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
optionsResult = parseOptions(argc, argv, &options);
|
optionsResult = parseOptions(argc, argv, &options);
|
||||||
if (optionsResult != 0)
|
if (optionsResult != 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user