diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c464cbda..ef8b6ade3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -99,6 +99,7 @@ find_package(SimGear 2.0.0 REQUIRED) check_include_file(unistd.h HAVE_UNISTD_H) check_include_file(sys/time.h HAVE_SYS_TIME_H) +check_include_file(windows.h HAVE_WINDOWS_H) # definition depends on OSG version set(CMAKE_REQUIRED_INCLUDES ${OPENSCENEGRAPH_INCLUDE_DIRS}) @@ -152,7 +153,7 @@ if(WIN32) # SET(WARNING_FLAGS "${WARNING_FLAGS} /wd${warning}") # endforeach(warning) - set(MSVC_FLAGS "-DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS") + set(MSVC_FLAGS "-DNOMINMAX -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS -D__CRT_NONSTDC_NO_WARNINGS") endif(MSVC) set(NOMINMAX 1) diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index c5ac75baf..a085fab57 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -456,9 +456,13 @@ void FGAirport::readTowerData(SGPropertyNode* aRoot) SGPropertyNode* twrNode = aRoot->getChild("tower")->getChild("twr"); double lat = twrNode->getDoubleValue("lat"), lon = twrNode->getDoubleValue("lon"), - elevM = twrNode->getDoubleValue("elev-m"); - - _tower_location = SGGeod::fromDegM(lon, lat, elevM); + elevM = twrNode->getDoubleValue("elev-m"); +// tower elevation is AGL, not AMSL. Since we don't want to depend on the +// scenery for a precise terrain elevation, we use the field elevation +// (this is also what the apt.dat code does) + double fieldElevationM = geod().getElevationM(); + + _tower_location = SGGeod::fromDegM(lon, lat, fieldElevationM + elevM); } bool FGAirport::buildApproach(Waypt* aEnroute, STAR* aSTAR, FGRunway* aRwy, WayptVec& aRoute) diff --git a/src/Include/config_cmake.h.in b/src/Include/config_cmake.h.in index de02ad902..4505aa2dc 100644 --- a/src/Include/config_cmake.h.in +++ b/src/Include/config_cmake.h.in @@ -17,6 +17,7 @@ #define ENABLE_AUDIO_SUPPORT 1 #cmakedefine HAVE_SYS_TIME_H +#cmakedefine HAVE_WINDOWS_H #cmakedefine HAVE_CULLSETTINGS_CLEAR_MASK #define VERSION "@FLIGHTGEAR_VERSION@" diff --git a/src/Navaids/navrecord.hxx b/src/Navaids/navrecord.hxx index 2773629f4..09abb6e97 100644 --- a/src/Navaids/navrecord.hxx +++ b/src/Navaids/navrecord.hxx @@ -33,14 +33,6 @@ #define FG_DME_DEFAULT_RANGE 50 // nm #define FG_NAV_MAX_RANGE 300 // nm -// FIXME - get rid of these, and use the real enum directly -#define FG_NAV_VOR FGPositioned::VOR -#define FG_NAV_NDB FGPositioned::NDB -#define FG_NAV_ILS FGPositioned::ILS -#define FG_NAV_ANY FGPositioned::INVALID - -typedef FGPositioned::Type fg_nav_types; - // forward decls class FGRunway; class SGPropertyNode;