// #include <Airports/simple.hxx>
// #include <Cockpit/cockpit.hxx>
// #include <FDM/flight.hxx>
-// #include <FDM/UIUCModel/uiuc_aircraftdir.h>
#include <Autopilot/route_mgr.hxx>
#include <GUI/gui.h>
// fgSetString("/sim/startup/mouse-pointer", "disabled");
fgSetString("/sim/control-mode", "joystick");
fgSetBool("/sim/auto-coordination", false);
-#if !defined(WIN32)
- fgSetString("/sim/startup/browser-app", "netscape");
-#else
+#if defined(WIN32)
fgSetString("/sim/startup/browser-app", "webrun.bat");
+#elif defined(__APPLE__)
+ fgSetString("/sim/startup/browser-app", "open");
+#elif defined(sgi)
+ fgSetString("/sim/startup/browser-app", "launchWebJumper");
+#else
+ envp = ::getenv( "WEBBROWSER" );
+ if (!envp) envp = "netscape";
+ fgSetString("/sim/startup/browser-app", envp);
#endif
fgSetString("/sim/logging/priority", "alert");
fgSetBool("/sim/freeze/clock", false);
fgSetBool("/sim/freeze/fuel", false);
-#ifdef FG_MPLAYER_AS
fgSetString("/sim/multiplay/callsign", "callsign");
fgSetString("/sim/multiplay/rxhost", "0");
fgSetString("/sim/multiplay/txhost", "0");
fgSetInt("/sim/multiplay/rxport", 0);
fgSetInt("/sim/multiplay/txport", 0);
-#endif
-
}
static bool
fgSetString("/sim/presets/airport-id", "");
fgSetString("/sim/presets/vor-id", "");
fgSetString("/sim/presets/ndb-id", "");
+ fgSetString("/sim/presets/carrier", "");
+ fgSetString("/sim/presets/parkpos", "");
fgSetString("/sim/presets/fix", "");
}
return FG_OPTIONS_OK;
}
+static int
+fgOptCarrier( const char * arg )
+{
+ clearLocation();
+ fgSetString("/sim/presets/carrier", arg);
+ return FG_OPTIONS_OK;
+}
+
+static int
+fgOptParkpos( const char * arg )
+{
+ fgSetString("/sim/presets/parkpos", arg);
+ return FG_OPTIONS_OK;
+}
+
static int
fgOptFIX( const char * arg )
{
readProperties(file, globals->get_props());
} catch (const sg_exception &e) {
string message = "Error loading config file: ";
- message += e.getFormattedMessage();
+ message += e.getFormattedMessage() + e.getOrigin();
SG_LOG(SG_INPUT, SG_ALERT, message);
exit(2);
}
return FG_OPTIONS_OK;
}
+static int
+fgOptLivery( const char *arg )
+{
+ string opt = arg;
+ string livery_path = "livery/" + opt;
+ fgSetString("/sim/model/texture-path", livery_path.c_str() );
+ return FG_OPTIONS_OK;
+}
+
static map<string,size_t> fgOptionMap;
/*
{"runway", true, OPTION_STRING, "/sim/presets/runway", false, "", 0 },
{"vor", true, OPTION_FUNC, "", false, "", fgOptVOR },
{"ndb", true, OPTION_FUNC, "", false, "", fgOptNDB },
+ {"carrier", true, OPTION_FUNC, "", false, "", fgOptCarrier },
+ {"parkpos", true, OPTION_FUNC, "", false, "", fgOptParkpos },
{"fix", true, OPTION_FUNC, "", false, "", fgOptFIX },
{"offset-distance", true, OPTION_DOUBLE, "/sim/presets/offset-distance", false, "", 0 },
{"offset-azimuth", true, OPTION_DOUBLE, "/sim/presets/offset-azimuth", false, "", 0 },
{"enable-specular-highlight", false, OPTION_BOOL, "/sim/rendering/specular-highlight", true, "", 0 },
{"disable-clouds", false, OPTION_BOOL, "/environment/clouds/status", false, "", 0 },
{"enable-clouds", false, OPTION_BOOL, "/environment/clouds/status", true, "", 0 },
-#ifdef FG_USE_CLOUDS_3D
- {"disable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d", false, "", 0 },
- {"enable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d", true, "", 0 },
-#endif
+ {"disable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d-enable", false, "", 0 },
+ {"enable-clouds3d", false, OPTION_BOOL, "/sim/rendering/clouds3d-enable", true, "", 0 },
{"fov", true, OPTION_FUNC, "", false, "", fgOptFov },
{"aspect-ratio-multiplier", true, OPTION_DOUBLE, "/sim/current-view/aspect-ratio-multiplier", false, "", 0 },
{"disable-fullscreen", false, OPTION_BOOL, "/sim/startup/fullscreen", false, "", 0 },
{"enable-fullscreen", false, OPTION_BOOL, "/sim/startup/fullscreen", true, "", 0 },
+ {"disable-save-on-exit", false, OPTION_BOOL, "/sim/startup/save-on-exit", false, "", 0 },
+ {"enable-save-on-exit", false, OPTION_BOOL, "/sim/startup/save-on-exit", true, "", 0 },
{"shading-flat", false, OPTION_BOOL, "/sim/rendering/shading", false, "", 0 },
{"shading-smooth", false, OPTION_BOOL, "/sim/rendering/shading", true, "", 0 },
{"disable-skyblend", false, OPTION_BOOL, "/sim/rendering/skyblend", false, "", 0 },
{"units-feet", false, OPTION_STRING, "/sim/startup/units", false, "feet", 0 },
{"units-meters", false, OPTION_STRING, "/sim/startup/units", false, "meters", 0 },
{"timeofday", true, OPTION_STRING, "/sim/startup/time-offset-type", false, "noon", 0 },
+ {"season", true, OPTION_STRING, "/sim/startup/season", false, "summer", 0 },
{"time-offset", true, OPTION_FUNC, "", false, "", fgOptTimeOffset },
{"time-match-real", false, OPTION_STRING, "/sim/startup/time-offset-type", false, "system-offset", 0 },
{"time-match-local", false, OPTION_STRING, "/sim/startup/time-offset-type", false, "latitude-offset", 0 },
{"joyclient", true, OPTION_CHANNEL, "", false, "", 0 },
{"jsclient", true, OPTION_CHANNEL, "", false, "", 0 },
{"proxy", true, OPTION_FUNC, "", false, "", fgSetupProxy },
-#ifdef FG_MPLAYER_AS
{"callsign", true, OPTION_STRING, "sim/multiplay/callsign", false, "", 0 },
{"multiplay", true, OPTION_CHANNEL, "", false, "", 0 },
-#endif
{"trace-read", true, OPTION_FUNC, "", false, "", fgOptTraceRead },
{"trace-write", true, OPTION_FUNC, "", false, "", fgOptTraceWrite },
{"log-level", true, OPTION_FUNC, "", false, "", fgOptLogLevel },
{"adf", true, OPTION_FUNC, "", false, "", fgOptADF },
{"dme", true, OPTION_FUNC, "", false, "", fgOptDME },
{"min-status", true, OPTION_STRING, "/sim/aircraft-min-status", false, "all", 0 },
+ {"livery", true, OPTION_FUNC, "", false, "", fgOptLivery },
{0}
};
#endif
// catch extraneous (DOS) line ending character
- if ( line[line.length() - 1] < 32 ) {
- line = line.substr( 0, line.length()-1 );
- }
+ int i;
+ for (i = line.length(); i > 0; i--)
+ if (line[i - 1] > 32)
+ break;
+ line = line.substr( 0, i );
if ( parse_option( line ) == FG_OPTIONS_ERROR ) {
cerr << endl << "Config file parse error: " << path << " '"
ulDirEnt* dire;
ulDir *dirp = ulOpenDir(path.str().c_str());
if (dirp == NULL) {
- cerr << "Unable to open aircraft directory." << endl;
+ cerr << "Unable to open aircraft directory '" << path.str() << '\'' << endl;
exit(-1);
}