#include <simgear/compiler.h>
+#include <simgear/route/route.hxx>
+
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/sg_random.h>
+#include <simgear/route/route.hxx>
#include <Cockpit/steam.hxx>
#include <Cockpit/radiostack.hxx>
#include <simgear/debug/logstream.hxx>
#include <simgear/math/polar3d.hxx>
#include <simgear/misc/props.hxx>
+#include <simgear/timing/sg_time.hxx>
#include <Aircraft/aircraft.hxx>
#include <Include/general.hxx>
#include <simgear/constants.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/props.hxx>
+#include <simgear/misc/sg_path.hxx>
//#include <simgear/math/fg_random.h>
//#include <simgear/math/polar3d.hxx>
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!");
}
// -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;
#include <Main/globals.hxx>
#include <simgear/compiler.h>
+#include <simgear/misc/props.hxx>
#define DOTDOTSLASH "../"
#define SLASH "/"
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;
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()));
}
}
}
#endif
#include <simgear/misc/exception.hxx>
+#include <simgear/magvar/magvar.hxx>
+#include <simgear/timing/sg_time.hxx>
#include STL_IOSTREAM
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/props.hxx>
+#include <simgear/misc/props_io.hxx>
+
#include "globals.hxx"
\f
// $Id$
+#include <simgear/misc/commands.hxx>
+
#include <Environment/environment_mgr.hxx>
#include "globals.hxx"
#include <vector>
#include STL_STRING
-
-#include <simgear/ephemeris/ephemeris.hxx>
-#include <simgear/magvar/magvar.hxx>
-#include <simgear/route/route.hxx>
-#include <simgear/timing/sg_time.hxx>
-#include <simgear/misc/commands.hxx>
-#include <simgear/misc/props.hxx>
-
#include "viewmgr.hxx"
SG_USING_STD( vector );
// 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;
class FGATCMgr;
class FGATCDisplay;
-class FGGlobals {
+
+/**
+ * Bucket for subsystem pointers representing the sim's state.
+ */
+class FGGlobals
+{
private:
#include <simgear/compiler.h>
#include <simgear/misc/exception.hxx>
+#include <simgear/ephemeris/ephemeris.hxx>
+#include <simgear/route/route.hxx>
#ifdef SG_MATH_EXCEPTION_CLASH
# include <math.h>
#include STL_STRING
#include <simgear/misc/sgstream.hxx>
+#include <simgear/misc/sg_path.hxx>
+#include <simgear/route/route.hxx>
+#include <simgear/route/waypoint.hxx>
// #include <Include/general.hxx>
// #include <Airports/simple.hxx>
#include <simgear/debug/logstream.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/io/iochannel.hxx>
+#include <simgear/timing/sg_time.hxx>
#include <FDM/flight.hxx>
#include <Main/globals.hxx>
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 );
#include <simgear/debug/logstream.hxx>
#include <simgear/io/lowlevel.hxx> // endian tests
#include <simgear/io/iochannel.hxx>
+#include <simgear/timing/sg_time.hxx>
#include <FDM/flight.hxx>
#include <Time/tmp.hxx>
#include <simgear/debug/logstream.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/io/iochannel.hxx>
+#include <simgear/timing/sg_time.hxx>
#include <FDM/flight.hxx>
#include <Main/globals.hxx>
nmea_sentence += gga_sum;
nmea_sentence += "\n";
- cout << nmea_sentence;
+ std::cout << nmea_sentence;
length = nmea_sentence.length();
strncpy( buf, nmea_sentence.c_str(), length );
// $Id$
-#include <Main/globals.hxx>
#include <simgear/compiler.h>
#include <simgear/debug/logstream.hxx>
#include <simgear/io/iochannel.hxx>
#include <simgear/math/sg_types.hxx>
#include <simgear/misc/props.hxx>
+#include <simgear/misc/props_io.hxx>
+
+#include <Main/globals.hxx>
#include <stdlib.h> // atoi() atof()
#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
SG_USING_STD(cout);
SG_USING_STD(istrstream);
+SG_USING_STD(strstream);
#endif
FGProps::FGProps() {
#include <plib/sg.h>
#include <plib/ssg.h>
+#include <simgear/compiler.h>
+
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
SGPropertyNode materials;
- cout << "Reading materials from " << mpath << endl;
+ SG_LOG(SG_INPUT, SG_INFO, "Reading materials from " << mpath);
try {
readProperties(mpath, &materials);
} catch (const sg_exception &ex) {
string file = path;
int pos = file.rfind( "/" );
file = file.substr( 0, pos );
- cout << "current file = " << file << endl;
file += "/";
file += material;
- cout << "current file = " << file << endl;
if ( ! material_lib.add_item( file ) ) {
SG_LOG( SG_TERRAIN, SG_ALERT,
"Ack! unknown usemtl name = " << material
tex_height = newmat->get_ysize();
state = newmat->get_state();
coverage = newmat->get_light_coverage();
- // cout << "(w) = " << tex_width << " (h) = "
- // << tex_width << endl;
} else {
coverage = -1;
}
in >> token;
- // cout << "token = " << token << endl;
-
if ( token == "vn" ) {
// vertex normal
if ( vncount < FG_MAX_NODES ) {
in >> n3;
fan_vertices.push_back( n3 );
- // cout << " triangle = "
- // << n1 << "," << n2 << "," << n3
- // << endl;
- // xglNormal3dv(normals[n3]);
if ( in.get( c ) && c == '/' ) {
in >> tex;
fan_tex_coords.push_back( tex );
string file = path;
int pos = file.rfind( "/" );
file = file.substr( 0, pos );
- cout << "current file = " << file << endl;
file += "/";
file += material;
- cout << "current file = " << file << endl;
if ( ! material_lib.add_item( file ) ) {
SG_LOG( SG_TERRAIN, SG_ALERT,
"Ack! unknown usemtl name = " << material
tex_height = newmat->get_ysize();
state = newmat->get_state();
coverage = newmat->get_light_coverage();
- // cout << "(w) = " << tex_width << " (h) = "
- // << tex_width << endl;
} else {
coverage = -1;
}
- // cout << "before list allocs" << endl;
-
- // cout << "before vl, size = " << size << endl;
- // cout << "before nl" << endl;
- // cout << "before tl" << endl;
- // cout << "before cl" << endl;
-
sgVec2 tmp2;
sgVec3 tmp3;
sgVec4 tmp4;
}
}
- // cout << "before leaf create" << endl;
ssgLeaf *leaf = new ssgVtxTable ( ty, vl, nl, tl, cl );
- // cout << "after leaf create" << endl;
// lookup the state record
- // cout << "looking up material = " << endl;
- // cout << material << endl;
- // cout << "'" << endl;
leaf->setState( state );
return false;
}
- // cout << "fans size = " << obj.get_fans_v().size()
- // << " fan_mats size = " << obj.get_fan_materials().size() << endl;
-
geometry->setName( (char *)path.c_str() );
if ( is_base ) {
group_list pts_v = obj.get_pts_v();
group_list pts_n = obj.get_pts_n();
for ( i = 0; i < (int)pts_v.size(); ++i ) {
- cout << "pts_v.size() = " << pts_v.size() << endl;
tmp_mat = pt_materials[i];
if ( tmp_mat.substr(0, 3) == "RWY" ) {
material = "LIGHTS";
# include <config.h>
#endif
+#include <simgear/compiler.h>
+
#include <Main/globals.hxx>
#include "FGTileLoader.hxx"
#include "tileentry.hxx"
// happen in the render thread because model loading can trigger
// texture loading which involves use of the opengl api.
if ( !model_queue.empty() ) {
- cout << "loading next model ..." << endl;
// load the next tile in the queue
#ifdef ENABLE_THREADS
FGDeferredModel* dm = model_queue.pop();
delete dm;
}
- // cout << "current elevation (ssg) == " << scenery.get_cur_elev() << endl;
-
previous_bucket = current_bucket;
last_longitude = longitude;
last_latitude = latitude;
e->add_ssg_nodes( terrain_branch,
gnd_lights_branch,
rwy_lights_branch );
- // cout << "Adding ssg nodes for "
}
sgdVec3 sc;
#if 0
if ( scenery.center == Point3D(0.0) ) {
// initializing
- cout << "initializing scenery current elevation ... " << endl;
sgdVec3 tmp_abs_view_pos;
Point3D geod_pos = Point3D( longitude * SGD_DEGREES_TO_RADIANS,
scenery.center = tmp;
sgdSetVec3( tmp_abs_view_pos, tmp.x(), tmp.y(), tmp.z() );
- // cout << "abs_view_pos = " << tmp_abs_view_pos << endl;
prep_ssg_nodes();
double tmp_elev;
} else {
scenery.set_cur_elev( 0.0 );
}
- cout << "result = " << scenery.get_cur_elev() << endl;
} else {
#endif
- /*
- cout << "abs view pos = "
- << globals->get_current_view()->get_abs_view_pos()[0] << ","
- << globals->get_current_view()->get_abs_view_pos()[1] << ","
- << globals->get_current_view()->get_abs_view_pos()[2]
- << " view pos = "
- << globals->get_current_view()->get_view_pos()[0] << ","
- << globals->get_current_view()->get_view_pos()[1] << ","
- << globals->get_current_view()->get_view_pos()[2]
- << endl;
- cout << "current_tile = " << current_tile << endl;
- cout << "Scenery center = " << sc[0] << "," << sc[1] << "," << sc[2]
- << endl;
- */
-
// overridden with actual values if a terrain intersection is
// found
double hit_elev = -9999.0;
scenery.set_cur_radius( 0.0 );
scenery.set_cur_normal( hit_normal );
}
-
- // cout << "Current elevation = " << scenery.get_cur_elev() << endl;
#if 0
}
#endif
tile_cache.reset_traversal();
while ( ! tile_cache.at_end() ) {
- // cout << "processing a tile" << endl;
if ( (e = tile_cache.get_current()) ) {
e->prep_ssg_node( scenery.get_center(), vis);
} else {
- cout << "warning ... empty tile in cache" << endl;
+ SG_LOG(SG_INPUT, SG_ALERT, "warning ... empty tile in cache");
}
tile_cache.next();
}
#include <simgear/math/polar3d.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/vector.hxx>
+#include <simgear/timing/sg_time.hxx>
#include <Main/globals.hxx>
#include <Main/viewer.hxx>
#include <simgear/math/polar3d.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/vector.hxx>
+#include <simgear/timing/sg_time.hxx>
#include <Main/globals.hxx>
#include <Main/viewer.hxx>
#include <simgear/misc/sg_path.hxx>
#include <simgear/magvar/magvar.hxx>
+#include <simgear/timing/sg_time.hxx>
#include <FDM/flight.hxx>
#include <Main/fg_props.hxx>
SGPath zone( globals->get_fg_root() );
zone.append( "Timezone" );
- cout << "updateLocal("
- << longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
- << ", "
- << latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
- << ", " << zone.str() << ")" << endl;
+ SG_LOG(SG_GENERAL, SG_INFO, "updateLocal("
+ << longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
+ << ", "
+ << latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
+ << ", " << zone.str() << ")");
globals->get_time_params()->updateLocal( longitude->getDoubleValue()
* SGD_DEGREES_TO_RADIANS,
latitude->getDoubleValue()