]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/options.cxx
A new comm radio and atis implementation
[flightgear.git] / src / Main / options.cxx
index 7448eb6ed46330851b319e31a28df6e9f0d54529..c1996bbef6ed22cf873393109a9b18173a562d7a 100644 (file)
@@ -185,7 +185,6 @@ void fgSetDefaults ()
     fgSetBool("/environment/clouds/status", true);
     fgSetBool("/sim/startup/fullscreen", false);
     fgSetBool("/sim/rendering/shading", true);
-    fgSetBool("/sim/rendering/textures", true);
     fgTie( "/sim/rendering/filtering", SGGetTextureFilter, SGSetTextureFilter, false);
     fgSetInt("/sim/rendering/filtering", 1);
     fgSetBool("/sim/rendering/wireframe", false);
@@ -1532,8 +1531,6 @@ struct OptionDesc {
     {"restore-defaults",             false, OPTION_BOOL,   "/sim/startup/restore-defaults", true, "", 0 },
     {"shading-flat",                 false, OPTION_BOOL,   "/sim/rendering/shading", false, "", 0 },
     {"shading-smooth",               false, OPTION_BOOL,   "/sim/rendering/shading", true, "", 0 },
-    {"disable-textures",             false, OPTION_BOOL,   "/sim/rendering/textures", false, "", 0 },
-    {"enable-textures",              false, OPTION_BOOL,   "/sim/rendering/textures", true, "", 0 },
     {"texture-filtering",            false, OPTION_INT,    "/sim/rendering/filtering", 1, "", 0 },
     {"disable-wireframe",            false, OPTION_BOOL,   "/sim/rendering/wireframe", false, "", 0 },
     {"enable-wireframe",             false, OPTION_BOOL,   "/sim/rendering/wireframe", true, "", 0 },
@@ -1558,9 +1555,7 @@ struct OptionDesc {
     {"atcsim",                       true,  OPTION_CHANNEL, "", false, "dummy", 0 },
     {"atlas",                        true,  OPTION_CHANNEL | OPTION_MULTI, "", false, "", 0 },
     {"httpd",                        true,  OPTION_CHANNEL, "", false, "", 0 },
-#ifdef FG_JPEG_SERVER
     {"jpg-httpd",                    true,  OPTION_CHANNEL, "", false, "", 0 },
-#endif
     {"native",                       true,  OPTION_CHANNEL | OPTION_MULTI, "", false, "", 0 },
     {"native-ctrls",                 true,  OPTION_CHANNEL | OPTION_MULTI, "", false, "", 0 },
     {"native-fdm",                   true,  OPTION_CHANNEL | OPTION_MULTI, "", false, "", 0 },
@@ -2106,6 +2101,20 @@ string_list Options::valuesForOption(const std::string& key) const
   return result;
 }
 
+
+static string defaultTerrasyncDir()
+{
+#if defined(SG_WINDOWS)
+       SGPath p(SGPath::documents());
+       p.append("FlightGear");
+#else
+    SGPath p(globals->get_fg_home());
+#endif
+       p.append("TerraSync");
+       return p.str();
+}
+
+
 OptionResult Options::processOptions()
 {
   // establish locale before showing help (this selects the default locale,
@@ -2169,15 +2178,16 @@ OptionResult Options::processOptions()
 // terrasync directory fixup
   string terrasyncDir = fgGetString("/sim/terrasync/scenery-dir");
   if (terrasyncDir.empty()) {
-    SGPath p(globals->get_fg_home());
-    p.append("TerraSync");
-    terrasyncDir = p.str();
-    SG_LOG(SG_GENERAL, SG_INFO,
-           "Using default TerraSync dir: " << terrasyncDir);
-    fgSetString("/sim/terrasync/scenery-dir", terrasyncDir);
+         terrasyncDir = defaultTerrasyncDir();
+         // auto-save it for next time
+         
+         SG_LOG(SG_GENERAL, SG_INFO,
+                 "Using default TerraSync: " << terrasyncDir);
+      fgSetString("/sim/terrasync/scenery-dir", terrasyncDir);
   }
-  
+
   SGPath p(terrasyncDir);
+
   // following is necessary to ensure NavDataCache sees stable scenery paths from
   // terrasync. Ensure the Terrain and Objects subdirs exist immediately, rather
   // than waiting for the first tiles to be scheduled.
@@ -2406,6 +2416,22 @@ bool Options::shouldLoadDefaultConfig() const
 {
   return p->shouldLoadDefaultConfig;
 }
-  
+
+bool Options::checkForArg(int argc, char* argv[], const char* checkArg)
+{
+    for (int i = 0; i < argc; ++i) {
+        char* arg = argv[i];
+        if (!strncmp("--", arg, 2) && !strcmp(arg + 2, checkArg)) {
+            return true;
+        }
+        
+        if ((arg[0] == '-') && !strcmp(arg + 1, checkArg)) {
+            return true;
+        }
+    }
+    
+    return false;
+}
+    
 } // of namespace flightgear