Cleanup of options processing: parse all options at the very first thing we do, so do not have to screw with optind; fixes failures when running with no args on mingw

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3234 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2009-10-21 20:21:25 +00:00
parent cf7fd70c67
commit 62c7422918
5 changed files with 620 additions and 549 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ int optMeleeScale;
const char **optAddons; const char **optAddons;
BOOLEAN opt3doMusic; BOOLEAN opt3doMusic;
BOOLEAN optPrecursorsMusic; BOOLEAN optRemixMusic;
BOOLEAN optSubtitles; BOOLEAN optSubtitles;
BOOLEAN optStereoSFX; BOOLEAN optStereoSFX;
BOOLEAN optKeepAspectRatio; BOOLEAN optKeepAspectRatio;
+1 -1
View File
@@ -39,7 +39,7 @@ extern int optSmoothScroll;
extern int optMeleeScale; extern int optMeleeScale;
extern BOOLEAN opt3doMusic; extern BOOLEAN opt3doMusic;
extern BOOLEAN optPrecursorsMusic; extern BOOLEAN optRemixMusic;
extern BOOLEAN optSubtitles; extern BOOLEAN optSubtitles;
extern BOOLEAN optStereoSFX; extern BOOLEAN optStereoSFX;
extern BOOLEAN optKeepAspectRatio; extern BOOLEAN optKeepAspectRatio;
+610 -539
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -125,7 +125,7 @@ LoadKernel (int argc, char *argv[])
if (!loadAddon ("3dovoice")) if (!loadAddon ("3dovoice"))
speechVolumeScale = 0.0f; // XXX: need better no-speech indicator speechVolumeScale = 0.0f; // XXX: need better no-speech indicator
if (optPrecursorsMusic) if (optRemixMusic)
{ {
loadAddon ("remix"); loadAddon ("remix");
} }
+1 -1
View File
@@ -1092,7 +1092,7 @@ GetGlobalOptions (GLOBALOPTS *opts)
opts->stereo = optStereoSFX ? OPTVAL_ENABLED : OPTVAL_DISABLED; opts->stereo = optStereoSFX ? OPTVAL_ENABLED : OPTVAL_DISABLED;
/* These values are read in, but won't change during a run. */ /* These values are read in, but won't change during a run. */
opts->music3do = opt3doMusic ? OPTVAL_ENABLED : OPTVAL_DISABLED; opts->music3do = opt3doMusic ? OPTVAL_ENABLED : OPTVAL_DISABLED;
opts->musicremix = optPrecursorsMusic ? OPTVAL_ENABLED : OPTVAL_DISABLED; opts->musicremix = optRemixMusic ? OPTVAL_ENABLED : OPTVAL_DISABLED;
switch (snddriver) { switch (snddriver) {
case audio_DRIVER_OPENAL: case audio_DRIVER_OPENAL:
opts->adriver = OPTVAL_OPENAL; opts->adriver = OPTVAL_OPENAL;