From 40170cb722a08f0ab93875e4e35e022941551c40 Mon Sep 17 00:00:00 2001 From: curt Date: Fri, 25 Feb 2005 19:41:53 +0000 Subject: [PATCH] The view frustum is defined in plib apps using calls to ssgSetFOV() and ssgSetNearFar(). This by default creates a symmetric view frustum which is typically what an application wants. However, to get control of the view frustum in order to build support for asymmetric view frustums, we need to wrap these calls with a bit of our own logic. This set of changes wraps all calls to ssgSetFOV() and ssgSetNearFar() with FGRenderer methods. I also standardized how the FGRenderer class is handled in globals.[ch]xx. This led to some cascading changes in a variety of source files. As I was working my way through the changes, I fixed a few warnings along the way. --- src/Airports/simple.cxx | 17 +++--- src/Environment/environment_mgr.cxx | 1 + src/GUI/gui_funcs.cxx | 1 + src/GUI/gui_local.cxx | 1 + src/Main/globals.cxx | 1 + src/Main/globals.hxx | 3 +- src/Main/renderer.cxx | 80 ++++++++++++++++++++++++++--- src/Main/renderer.hxx | 13 +++++ src/Model/acmodel.cxx | 3 +- src/Network/ATC-Inputs.cxx | 4 ++ src/Network/ATC-Main.hxx | 2 + src/Network/ATC-Outputs.cxx | 5 +- src/Scenery/hitlist.hxx | 3 +- src/Time/light.cxx | 1 + 14 files changed, 116 insertions(+), 19 deletions(-) diff --git a/src/Airports/simple.cxx b/src/Airports/simple.cxx index 6c1e71194..5ea71ac06 100644 --- a/src/Airports/simple.cxx +++ b/src/Airports/simple.cxx @@ -35,6 +35,9 @@ #include #include + +#include + #include #include #include @@ -113,7 +116,7 @@ string ScheduleTime::getName(time_t dayStart) //cerr << "Nr of items to process: " << nrItems << endl; if (nrItems > 0) { - for (int i = 0; i < start.size(); i++) + for (unsigned int i = 0; i < start.size(); i++) { //cerr << i << endl; if ((dayStart >= start[i]) && (dayStart <= end[i])) @@ -209,8 +212,8 @@ void RunwayGroup::setActive(string aptId, FGRunway rwy; int activeRwys = rwyList.size(); // get the number of runways active int nrOfPreferences; - bool found = true; - double heading; + // bool found = true; + // double heading; double hdgDiff; double crossWind; double tailWind; @@ -335,7 +338,7 @@ void RunwayGroup::getActive(int i, string *name, string *type) { return; } - if (nrActive == rwyList.size()) + if (nrActive == (int)rwyList.size()) { *name = rwyList[i].getRwyList(active); *type = rwyList[i].getType(); @@ -851,14 +854,14 @@ void FGAirport::getParking (int id, double *lat, double* lon, double *heading) FGParking *FGAirport::getParking(int i) { - if (i < parkings.size()) + if (i < (int)parkings.size()) return &(parkings[i]); else return 0; } string FGAirport::getParkingName(int i) { - if (i < parkings.size() && i >= 0) + if (i < (int)parkings.size() && i >= 0) return (parkings[i].getName()); else return string("overflow"); @@ -888,7 +891,7 @@ void FGAirport::endXML () { } void FGAirport::startElement (const char * name, const XMLAttributes &atts) { - const char * attval; + // const char *attval; FGParking park; //cout << "Start element " << name << endl; string attname; diff --git a/src/Environment/environment_mgr.cxx b/src/Environment/environment_mgr.cxx index 172c41f1c..d44d77e89 100644 --- a/src/Environment/environment_mgr.cxx +++ b/src/Environment/environment_mgr.cxx @@ -25,6 +25,7 @@ #include
#include
+#include
#include #include "environment.hxx" diff --git a/src/GUI/gui_funcs.cxx b/src/GUI/gui_funcs.cxx index 2764dce3c..26a9df4a4 100644 --- a/src/GUI/gui_funcs.cxx +++ b/src/GUI/gui_funcs.cxx @@ -79,6 +79,7 @@ #include
#include
#include
+#include
#include
#if defined( WIN32 ) && !defined( __CYGWIN__ ) && !defined(__MINGW32__) diff --git a/src/GUI/gui_local.cxx b/src/GUI/gui_local.cxx index adb75f656..1ec2b08ed 100644 --- a/src/GUI/gui_local.cxx +++ b/src/GUI/gui_local.cxx @@ -13,6 +13,7 @@ #include
#include
#include
+#include
#include #include