]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/options.cxx
minor upodate by John
[flightgear.git] / src / Main / options.cxx
index 685d61ff1ea26a62969b297f5a2d00d640b870df..73ebf0627d28e853162c7be7eb7e0fc19163606a 100644 (file)
@@ -60,7 +60,7 @@
 #include "options.hxx"
 #include "util.hxx"
 #include "viewmgr.hxx"
-
+#include <Main/viewer.hxx>
 
 using std::string;
 using std::sort;
@@ -186,6 +186,7 @@ fgSetDefaults ()
     fgSetBool("/sim/hud/enable3d", true);
     fgSetBool("/sim/hud/visibility", false);
     fgSetBool("/sim/panel/visibility", true);
+    fgSetBool("/sim/sound/enabled", true);
     fgSetBool("/sim/sound/pause", false);
 
                                // Flight Model options
@@ -996,7 +997,7 @@ fgOptRandomWind( const char *arg )
 static int
 fgOptWind( const char *arg )
 {
-    double min_hdg, max_hdg, speed, gust;
+    double min_hdg = 0.0, max_hdg = 0.0, speed = 0.0, gust = 0.0;
     if (!parse_wind( arg, &min_hdg, &max_hdg, &speed, &gust)) {
        SG_LOG( SG_GENERAL, SG_ALERT, "bad wind value " << arg );
        return FG_OPTIONS_ERROR;
@@ -1290,8 +1291,8 @@ struct OptionDesc {
     {"enable-hud",                   false, OPTION_BOOL,   "/sim/hud/visibility", true, "", 0 },
     {"disable-panel",                false, OPTION_BOOL,   "/sim/panel/visibility", false, "", 0 },
     {"enable-panel",                 false, OPTION_BOOL,   "/sim/panel/visibility", true, "", 0 },
-    {"disable-sound",                false, OPTION_BOOL,   "/sim/sound/pause", true, "", 0 },
-    {"enable-sound",                 false, OPTION_BOOL,   "/sim/sound/pause", false, "", 0 },
+    {"disable-sound",                false, OPTION_BOOL,   "/sim/sound/enabled", true, "", 0 },
+    {"enable-sound",                 false, OPTION_BOOL,   "/sim/sound/enabled", false, "", 0 },
     {"airport",                      true,  OPTION_STRING, "/sim/presets/airport-id", false, "", 0 },
     {"runway",                       true,  OPTION_FUNC,   "", false, "", fgOptRunway },
     {"vor",                          true,  OPTION_FUNC,   "", false, "", fgOptVOR },
@@ -1815,9 +1816,9 @@ unsigned int getNumMaturity(const char * str)
 {
   // changes should also be reflected in $FG_ROOT/data/options.xml & 
   // $FG_ROOT/data/Translations/string-default.xml
-  const char levels[][20]= {"alpha","beta","early-production","production",0}; 
+  const char* levels[] = {"alpha","beta","early-production","production"}; 
 
-  for (unsigned int i=0; i<(sizeof(levels)/sizeof(levels[0])-1);i++) 
+  for (size_t i=0; i<(sizeof(levels)/sizeof(levels[0]));i++) 
     if (strcmp(str,levels[i])==0)
       return i;