]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/options.cxx
Refactor SGSky handling and ownership - sink into Renderer, remove global variable...
[flightgear.git] / src / Main / options.cxx
index 5ca9cd2cffe7781c4e7304b129dacaa161902933..bcb5ccdad98cdb54fe941659ed60330e59dfbca0 100644 (file)
@@ -333,7 +333,6 @@ parseIntValue(char** ppParserPos, int* pValue,int min, int max, const char* fiel
     }
 }
 
-#ifndef HAVE_RINT
 // parse a time string ([+/-]%f[:%f[:%f]]) into hours
 static double
 parse_time(const string& time_in) {
@@ -414,7 +413,6 @@ parse_time(const string& time_in) {
 
     return(sign * result);
 }
-#endif
 
 // parse a date string (yyyy:mm:dd:hh:mm:ss) into a time_t (seconds)
 static long int
@@ -1493,7 +1491,7 @@ struct OptionDesc {
     {"jsclient",                     true,  OPTION_CHANNEL, "", false, "", 0 },
     {"proxy",                        true,  OPTION_FUNC,    "", false, "", fgSetupProxy },
     {"callsign",                     true,  OPTION_FUNC,    "", false, "", fgOptCallSign},
-    {"multiplay",                    true,  OPTION_CHANNEL, "", false, "", 0 },
+    {"multiplay",                    true,  OPTION_CHANNEL | OPTION_MULTI, "", false, "", 0 },
 #ifdef FG_HAVE_HLA
     {"hla",                          true,  OPTION_CHANNEL, "", false, "", 0 },
 #endif
@@ -1953,14 +1951,17 @@ void Options::processOptions()
     exit(0);
   }
   
-  BOOST_FOREACH(const OptionValue& v, p->values) {
-    int result = p->processOption(v.desc, v.value);
+  // proces options in LIFO order, so earlier (first in) options are processed
+  // after, and hence override, later specified options.
+  OptionValueVec::const_reverse_iterator it = p->values.rbegin();
+  for (; it != p->values.rend(); ++it) {
+    int result = p->processOption(it->desc, it->value);
     if (result == FG_OPTIONS_ERROR) {
       showUsage();
       exit(-1);
     }
   }
-  
+
   BOOST_FOREACH(const SGPath& file, p->propertyFiles) {
     if (!file.exists()) {
       SG_LOG(SG_GENERAL, SG_ALERT, "config file not found:" << file.str());