From e9a9ad64788c397b743df782de9fff864195675e Mon Sep 17 00:00:00 2001 From: jmt Date: Sat, 5 Dec 2009 10:55:55 +0000 Subject: [PATCH 1/2] Fix displaced threshold handling when using in-scenery definitions of runways. --- src/Airports/runways.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Airports/runways.cxx b/src/Airports/runways.cxx index c076d8cfc..3eb853823 100644 --- a/src/Airports/runways.cxx +++ b/src/Airports/runways.cxx @@ -151,9 +151,8 @@ void FGRunway::processThreshold(SGPropertyNode* aThreshold) _displ_thresh = aThreshold->getDoubleValue("displ-m") * SG_METER_TO_FEET; _stopway = aThreshold->getDoubleValue("stopw-m") * SG_METER_TO_FEET; - // compute the new runway center, based on the threshold lat/lon, length, - // and any displaced threshold. - double offsetFt = (0.5 * _length) - _displ_thresh; + // compute the new runway center, based on the threshold lat/lon and length, + double offsetFt = (0.5 * _length); SGGeod newCenter; double dummy; SGGeodesy::direct(newThreshold, _heading, offsetFt * SG_FEET_TO_METER, newCenter, dummy); From 106aa02b7621f661a25445cc2aad78f50c55a7b1 Mon Sep 17 00:00:00 2001 From: jmt Date: Sat, 5 Dec 2009 14:25:31 +0000 Subject: [PATCH 2/2] Case-insensitive aircraft names, for the startup arg, so 'C172', 'F16', etc work. --- src/Main/fg_init.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 2e8713a17..08d453730 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -49,6 +49,8 @@ #include #include +#include +#include #include #include @@ -137,6 +139,7 @@ #endif using std::string; +using namespace boost::algorithm; class Sound; extern const char *default_root; @@ -557,7 +560,7 @@ static string fgFindAircraftPath( const SGPath &path, const string &aircraft, n->setStringValue(path.str().c_str()); n->setAttribute(SGPropertyNode::USERARCHIVE, true); - if ( !strcmp(dire->d_name, aircraft.c_str()) ) { + if ( boost::equals(dire->d_name, aircraft.c_str(), is_iequal()) ) { result = path.str(); break; } @@ -640,7 +643,7 @@ bool fgInitConfig ( int argc, char **argv ) { vector cache = cache_root->getChildren("aircraft"); for (unsigned int i = 0; i < cache.size(); i++) { const char *name = cache[i]->getStringValue("file", ""); - if (aircraft_set == name) { + if (boost::equals(aircraft_set, name, is_iequal())) { const char *path = cache[i]->getStringValue("path", ""); SGPath xml(path); xml.append(name);