Improved safemode; --safe option now ignores uqm.cfg entirely.

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3350 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2009-11-25 03:40:49 +00:00
parent 700305b994
commit 76abf75aaa
3 changed files with 16 additions and 4 deletions
+1
View File
@@ -1,4 +1,5 @@
Changes towards version 0.7: Changes towards version 0.7:
- Cross-platform safemode (ignores uqm.cfg, bug #946) - Michael
- Correct Chmmr response when asking about Sa-Matra (bug #1073) - Alex - Correct Chmmr response when asking about Sa-Matra (bug #1073) - Alex
- Refactored universe generation - SvdB - Refactored universe generation - SvdB
- Comm animation processing rewrite, bugs fixed - Alex - Comm animation processing rewrite, bugs fixed - Alex
+2 -2
View File
@@ -438,8 +438,8 @@ Section -ShortcutsAndIcons
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP" CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\The Ur-Quan Masters.lnk" "$INSTDIR\uqm.exe" $UQMARGS CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\The Ur-Quan Masters.lnk" "$INSTDIR\uqm.exe" $UQMARGS
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\UQM (Safe Mode).lnk" "$INSTDIR\uqm.exe" "-wx -r 640x480 -c none --sound=none -g 1.0 -M 100 -S 100 -T 100 -q medium" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\UQM (Safe Mode).lnk" "$INSTDIR\uqm.exe" "-x --safe"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\UQM (Safe OpenGL).lnk" "$INSTDIR\uqm.exe" "-wo -r 640x480 -c none --sound=none -g 1.0 -M 100 -S 100 -T 100 -q medium" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\UQM (Safe OpenGL).lnk" "$INSTDIR\uqm.exe" "-o --safe"
CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Documentation" CreateDirectory "$SMPROGRAMS\$ICONS_GROUP\Documentation"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\AUTHORS.lnk" "$INSTDIR\AUTHORS.txt" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\AUTHORS.lnk" "$INSTDIR\AUTHORS.txt"
CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\COPYING.lnk" "$INSTDIR\COPYING.txt" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Documentation\COPYING.lnk" "$INSTDIR\COPYING.txt"
+11
View File
@@ -125,6 +125,7 @@ struct options_struct
DECL_CONFIG_OPTION(float, musicVolumeScale); DECL_CONFIG_OPTION(float, musicVolumeScale);
DECL_CONFIG_OPTION(float, sfxVolumeScale); DECL_CONFIG_OPTION(float, sfxVolumeScale);
DECL_CONFIG_OPTION(float, speechVolumeScale); DECL_CONFIG_OPTION(float, speechVolumeScale);
DECL_CONFIG_OPTION(bool, safeMode);
#define INIT_CONFIG_OPTION(name, val) \ #define INIT_CONFIG_OPTION(name, val) \
{ val, false } { val, false }
@@ -257,6 +258,7 @@ main (int argc, char *argv[])
INIT_CONFIG_OPTION( musicVolumeScale, 1.0f ), INIT_CONFIG_OPTION( musicVolumeScale, 1.0f ),
INIT_CONFIG_OPTION( sfxVolumeScale, 1.0f ), INIT_CONFIG_OPTION( sfxVolumeScale, 1.0f ),
INIT_CONFIG_OPTION( speechVolumeScale, 1.0f ), INIT_CONFIG_OPTION( speechVolumeScale, 1.0f ),
INIT_CONFIG_OPTION( safeMode, false ),
}; };
struct options_struct defaults = options; struct options_struct defaults = options;
int optionsResult; int optionsResult;
@@ -334,8 +336,11 @@ main (int argc, char *argv[])
PlayerControls[1] = CONTROL_TEMPLATE_JOY_1; PlayerControls[1] = CONTROL_TEMPLATE_JOY_1;
// Fill in the options struct based on uqm.cfg // Fill in the options struct based on uqm.cfg
if (!options.safeMode.value)
{
LoadResourceIndex (configDir, "uqm.cfg", "config."); LoadResourceIndex (configDir, "uqm.cfg", "config.");
getUserConfigOptions (&options); getUserConfigOptions (&options);
}
{ /* remove old control template names */ { /* remove old control template names */
int i; int i;
@@ -673,6 +678,7 @@ enum
ADDON_OPT, ADDON_OPT,
ADDONDIR_OPT, ADDONDIR_OPT,
ACCEL_OPT, ACCEL_OPT,
SAFEMODE_OPT,
#ifdef NETPLAY #ifdef NETPLAY
NETHOST1_OPT, NETHOST1_OPT,
NETPORT1_OPT, NETPORT1_OPT,
@@ -719,6 +725,7 @@ static struct option longOptions[] =
{"addon", 1, NULL, ADDON_OPT}, {"addon", 1, NULL, ADDON_OPT},
{"addondir", 1, NULL, ADDONDIR_OPT}, {"addondir", 1, NULL, ADDONDIR_OPT},
{"accel", 1, NULL, ACCEL_OPT}, {"accel", 1, NULL, ACCEL_OPT},
{"safe", 0, NULL, SAFEMODE_OPT},
#ifdef NETPLAY #ifdef NETPLAY
{"nethost1", 1, NULL, NETHOST1_OPT}, {"nethost1", 1, NULL, NETHOST1_OPT},
{"netport1", 1, NULL, NETPORT1_OPT}, {"netport1", 1, NULL, NETPORT1_OPT},
@@ -1007,6 +1014,9 @@ parseOptions (int argc, char *argv[], struct options_struct *options)
} }
break; break;
} }
case SAFEMODE_OPT:
setBoolOption (&options->safeMode, true);
break;
#ifdef NETPLAY #ifdef NETPLAY
case NETHOST1_OPT: case NETHOST1_OPT:
netplayOptions.peer[0].isServer = false; netplayOptions.peer[0].isServer = false;
@@ -1169,6 +1179,7 @@ usage (FILE *out, const struct options_struct *defaults)
"mixsdl)"); "mixsdl)");
log_add (log_User, " --stereosfx (enables positional sound effects, " log_add (log_User, " --stereosfx (enables positional sound effects, "
"currently only for openal)"); "currently only for openal)");
log_add (log_User, " --safe (start in safe mode)");
#ifdef NETPLAY #ifdef NETPLAY
log_add (log_User, " --nethostN=HOSTNAME (server to connect to for " log_add (log_User, " --nethostN=HOSTNAME (server to connect to for "
"player N (1=bottom, 2=top)"); "player N (1=bottom, 2=top)");