diff --git a/src/Autopilot/auto_gui.cxx b/src/Autopilot/auto_gui.cxx index 585689094..b148bd908 100644 --- a/src/Autopilot/auto_gui.cxx +++ b/src/Autopilot/auto_gui.cxx @@ -28,6 +28,8 @@ #include +#include + #include #include #include diff --git a/src/Autopilot/newauto.cxx b/src/Autopilot/newauto.cxx index fb9a37814..83e601fc6 100644 --- a/src/Autopilot/newauto.cxx +++ b/src/Autopilot/newauto.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/src/Cockpit/cockpit.cxx b/src/Cockpit/cockpit.cxx index 6feb75bb3..fa2780343 100644 --- a/src/Cockpit/cockpit.cxx +++ b/src/Cockpit/cockpit.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include diff --git a/src/Cockpit/hud.cxx b/src/Cockpit/hud.cxx index fb7c29d1c..098e755c7 100644 --- a/src/Cockpit/hud.cxx +++ b/src/Cockpit/hud.cxx @@ -45,6 +45,7 @@ #include #include #include +#include //#include //#include diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx index 22870b3bd..991e150dd 100644 --- a/src/FDM/flight.cxx +++ b/src/FDM/flight.cxx @@ -407,7 +407,7 @@ FGInterface::unbind () void FGInterface::update (int dt) { - cout << "dummy update() ... SHOULDN'T BE CALLED!" << endl; + SG_LOG(SG_FLIGHT, SG_ALERT, "dummy update() ... SHOULDN'T BE CALLED!"); } @@ -525,7 +525,7 @@ void FGInterface::extrapolate( int time_offset ) { // -dw- metrowerks complains about ambiguous access, not critical // to keep this ;) #ifndef __MWERKS__ - cout << "extrapolating FDM by dt = " << dt << endl; + SG_LOG(SG_FLIGHT, SG_INFO, "extrapolating FDM by dt = " << dt); #endif double lat = geodetic_position_v[0] + geocentric_rates_v[0] * dt; diff --git a/src/GUI/prop_picker.cxx b/src/GUI/prop_picker.cxx index a7e5c6c07..83e90005c 100755 --- a/src/GUI/prop_picker.cxx +++ b/src/GUI/prop_picker.cxx @@ -39,6 +39,7 @@ #include
#include +#include #define DOTDOTSLASH "../" #define SLASH "/" diff --git a/src/Main/fg_io.cxx b/src/Main/fg_io.cxx index 5e22ce66a..9bfff40d2 100644 --- a/src/Main/fg_io.cxx +++ b/src/Main/fg_io.cxx @@ -90,7 +90,7 @@ static FGProtocol *parse_port_config( const string& config ) FGATC610x *atc610x = new FGATC610x; io = atc610x; short_circuit = true; - cout << "here ..." << endl; + std::cout << "here ..." << endl; } else if ( protocol == "atlas" ) { FGAtlas *atlas = new FGAtlas; io = atlas; @@ -299,7 +299,7 @@ void fgIOProcess() { p->dec_count_down( interval ); while ( p->get_count_down() < 0 ) { p->process(); - p->dec_count_down( -1000000.0 / p->get_hz() ); + p->dec_count_down(int( -1000000.0 / p->get_hz())); } } } diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index ebbc4bc87..4d42d8c08 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -25,6 +25,8 @@ #endif #include +#include +#include #include STL_IOSTREAM diff --git a/src/Main/fg_props.hxx b/src/Main/fg_props.hxx index 3a612cdb2..e53cc3bf4 100644 --- a/src/Main/fg_props.hxx +++ b/src/Main/fg_props.hxx @@ -8,6 +8,8 @@ #include #include +#include + #include "globals.hxx" diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 1540d7a61..15c898998 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -21,6 +21,8 @@ // $Id$ +#include + #include #include "globals.hxx" diff --git a/src/Main/globals.hxx b/src/Main/globals.hxx index 52d58e451..75c119313 100644 --- a/src/Main/globals.hxx +++ b/src/Main/globals.hxx @@ -29,14 +29,6 @@ #include #include STL_STRING - -#include -#include -#include -#include -#include -#include - #include "viewmgr.hxx" SG_USING_STD( vector ); @@ -46,6 +38,22 @@ typedef vector string_list; // Forward declarations + +// This file is included, directly or indirectly, almost everywhere in +// FlightGear, so if any of its dependencies changes, most of the sim +// has to be recompiled. Using these forward declarations helps us to +// avoid including a lot of header files (and thus, a lot of +// dependencies). Since Most of the methods simply set or return +// pointers, we don't need to know anything about the class details +// anyway. + +class SGEphemeris; +class SGMagVar; +class SGRoute; +class SGTime; +class SGPropertyNode; +class SGCommandMgr; + class FGLogger; class FGEnvironmentMgr; class FGEnvironment; @@ -57,7 +65,12 @@ class FGViewer; class FGATCMgr; class FGATCDisplay; -class FGGlobals { + +/** + * Bucket for subsystem pointers representing the sim's state. + */ +class FGGlobals +{ private: diff --git a/src/Main/main.cxx b/src/Main/main.cxx index e0aa6d70b..1a350a6f7 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -32,6 +32,8 @@ #include #include +#include +#include #ifdef SG_MATH_EXCEPTION_CLASH # include diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 52e3f7748..2b0122f2e 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -36,6 +36,9 @@ #include STL_STRING #include +#include +#include +#include // #include // #include diff --git a/src/Network/garmin.cxx b/src/Network/garmin.cxx index 45e03c66c..877baca1b 100644 --- a/src/Network/garmin.cxx +++ b/src/Network/garmin.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include
@@ -144,7 +145,7 @@ bool FGGarmin::gen_message() { garmin_sentence += rmz_sum; garmin_sentence += "\n"; - cout << garmin_sentence; + std::cout << garmin_sentence; length = garmin_sentence.length(); strncpy( buf, garmin_sentence.c_str(), length ); diff --git a/src/Network/native_fdm.cxx b/src/Network/native_fdm.cxx index 33566a9d8..9f83f4fab 100644 --- a/src/Network/native_fdm.cxx +++ b/src/Network/native_fdm.cxx @@ -28,6 +28,7 @@ #include #include // endian tests #include +#include #include #include