Patches from Tony Peden to separate property XML I/O operations into a
separate header file. This change will help integrate properties into JSBSim. Also, I (David Megginson) removed most of the SimGear include statements from globals.hxx, reducing the amount of recompilation every time SimGear changes. This required making minor changes to a lot of files that were depending on the side-effects of the inclusions in globals.hxx.
This commit is contained in:
parent
96a4e9abc3
commit
d0eaafb1e1
25 changed files with 66 additions and 78 deletions
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
|
|
||||||
|
#include <simgear/route/route.hxx>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
#include <simgear/math/sg_geodesy.hxx>
|
#include <simgear/math/sg_geodesy.hxx>
|
||||||
#include <simgear/math/sg_random.h>
|
#include <simgear/math/sg_random.h>
|
||||||
|
#include <simgear/route/route.hxx>
|
||||||
|
|
||||||
#include <Cockpit/steam.hxx>
|
#include <Cockpit/steam.hxx>
|
||||||
#include <Cockpit/radiostack.hxx>
|
#include <Cockpit/radiostack.hxx>
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
#include <simgear/math/polar3d.hxx>
|
#include <simgear/math/polar3d.hxx>
|
||||||
#include <simgear/misc/props.hxx>
|
#include <simgear/misc/props.hxx>
|
||||||
|
#include <simgear/timing/sg_time.hxx>
|
||||||
|
|
||||||
#include <Aircraft/aircraft.hxx>
|
#include <Aircraft/aircraft.hxx>
|
||||||
#include <Include/general.hxx>
|
#include <Include/general.hxx>
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include <simgear/constants.h>
|
#include <simgear/constants.h>
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
#include <simgear/misc/props.hxx>
|
#include <simgear/misc/props.hxx>
|
||||||
|
#include <simgear/misc/sg_path.hxx>
|
||||||
//#include <simgear/math/fg_random.h>
|
//#include <simgear/math/fg_random.h>
|
||||||
//#include <simgear/math/polar3d.hxx>
|
//#include <simgear/math/polar3d.hxx>
|
||||||
|
|
||||||
|
|
|
@ -407,7 +407,7 @@ FGInterface::unbind ()
|
||||||
void
|
void
|
||||||
FGInterface::update (int dt)
|
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
|
// -dw- metrowerks complains about ambiguous access, not critical
|
||||||
// to keep this ;)
|
// to keep this ;)
|
||||||
#ifndef __MWERKS__
|
#ifndef __MWERKS__
|
||||||
cout << "extrapolating FDM by dt = " << dt << endl;
|
SG_LOG(SG_FLIGHT, SG_INFO, "extrapolating FDM by dt = " << dt);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
double lat = geodetic_position_v[0] + geocentric_rates_v[0] * dt;
|
double lat = geodetic_position_v[0] + geocentric_rates_v[0] * dt;
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
|
#include <simgear/misc/props.hxx>
|
||||||
|
|
||||||
#define DOTDOTSLASH "../"
|
#define DOTDOTSLASH "../"
|
||||||
#define SLASH "/"
|
#define SLASH "/"
|
||||||
|
|
|
@ -90,7 +90,7 @@ static FGProtocol *parse_port_config( const string& config )
|
||||||
FGATC610x *atc610x = new FGATC610x;
|
FGATC610x *atc610x = new FGATC610x;
|
||||||
io = atc610x;
|
io = atc610x;
|
||||||
short_circuit = true;
|
short_circuit = true;
|
||||||
cout << "here ..." << endl;
|
std::cout << "here ..." << endl;
|
||||||
} else if ( protocol == "atlas" ) {
|
} else if ( protocol == "atlas" ) {
|
||||||
FGAtlas *atlas = new FGAtlas;
|
FGAtlas *atlas = new FGAtlas;
|
||||||
io = atlas;
|
io = atlas;
|
||||||
|
@ -299,7 +299,7 @@ void fgIOProcess() {
|
||||||
p->dec_count_down( interval );
|
p->dec_count_down( interval );
|
||||||
while ( p->get_count_down() < 0 ) {
|
while ( p->get_count_down() < 0 ) {
|
||||||
p->process();
|
p->process();
|
||||||
p->dec_count_down( -1000000.0 / p->get_hz() );
|
p->dec_count_down(int( -1000000.0 / p->get_hz()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <simgear/misc/exception.hxx>
|
#include <simgear/misc/exception.hxx>
|
||||||
|
#include <simgear/magvar/magvar.hxx>
|
||||||
|
#include <simgear/timing/sg_time.hxx>
|
||||||
|
|
||||||
#include STL_IOSTREAM
|
#include STL_IOSTREAM
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
|
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
#include <simgear/misc/props.hxx>
|
#include <simgear/misc/props.hxx>
|
||||||
|
#include <simgear/misc/props_io.hxx>
|
||||||
|
|
||||||
#include "globals.hxx"
|
#include "globals.hxx"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
|
||||||
|
#include <simgear/misc/commands.hxx>
|
||||||
|
|
||||||
#include <Environment/environment_mgr.hxx>
|
#include <Environment/environment_mgr.hxx>
|
||||||
|
|
||||||
#include "globals.hxx"
|
#include "globals.hxx"
|
||||||
|
|
|
@ -29,14 +29,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include STL_STRING
|
#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"
|
#include "viewmgr.hxx"
|
||||||
|
|
||||||
SG_USING_STD( vector );
|
SG_USING_STD( vector );
|
||||||
|
@ -46,6 +38,22 @@ typedef vector<string> string_list;
|
||||||
|
|
||||||
|
|
||||||
// Forward declarations
|
// 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 FGLogger;
|
||||||
class FGEnvironmentMgr;
|
class FGEnvironmentMgr;
|
||||||
class FGEnvironment;
|
class FGEnvironment;
|
||||||
|
@ -57,7 +65,12 @@ class FGViewer;
|
||||||
class FGATCMgr;
|
class FGATCMgr;
|
||||||
class FGATCDisplay;
|
class FGATCDisplay;
|
||||||
|
|
||||||
class FGGlobals {
|
|
||||||
|
/**
|
||||||
|
* Bucket for subsystem pointers representing the sim's state.
|
||||||
|
*/
|
||||||
|
class FGGlobals
|
||||||
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
#include <simgear/misc/exception.hxx>
|
#include <simgear/misc/exception.hxx>
|
||||||
|
#include <simgear/ephemeris/ephemeris.hxx>
|
||||||
|
#include <simgear/route/route.hxx>
|
||||||
|
|
||||||
#ifdef SG_MATH_EXCEPTION_CLASH
|
#ifdef SG_MATH_EXCEPTION_CLASH
|
||||||
# include <math.h>
|
# include <math.h>
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
#include STL_STRING
|
#include STL_STRING
|
||||||
|
|
||||||
#include <simgear/misc/sgstream.hxx>
|
#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 <Include/general.hxx>
|
||||||
// #include <Airports/simple.hxx>
|
// #include <Airports/simple.hxx>
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
#include <simgear/math/sg_geodesy.hxx>
|
#include <simgear/math/sg_geodesy.hxx>
|
||||||
#include <simgear/io/iochannel.hxx>
|
#include <simgear/io/iochannel.hxx>
|
||||||
|
#include <simgear/timing/sg_time.hxx>
|
||||||
|
|
||||||
#include <FDM/flight.hxx>
|
#include <FDM/flight.hxx>
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
|
@ -144,7 +145,7 @@ bool FGGarmin::gen_message() {
|
||||||
garmin_sentence += rmz_sum;
|
garmin_sentence += rmz_sum;
|
||||||
garmin_sentence += "\n";
|
garmin_sentence += "\n";
|
||||||
|
|
||||||
cout << garmin_sentence;
|
std::cout << garmin_sentence;
|
||||||
|
|
||||||
length = garmin_sentence.length();
|
length = garmin_sentence.length();
|
||||||
strncpy( buf, garmin_sentence.c_str(), length );
|
strncpy( buf, garmin_sentence.c_str(), length );
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
#include <simgear/io/lowlevel.hxx> // endian tests
|
#include <simgear/io/lowlevel.hxx> // endian tests
|
||||||
#include <simgear/io/iochannel.hxx>
|
#include <simgear/io/iochannel.hxx>
|
||||||
|
#include <simgear/timing/sg_time.hxx>
|
||||||
|
|
||||||
#include <FDM/flight.hxx>
|
#include <FDM/flight.hxx>
|
||||||
#include <Time/tmp.hxx>
|
#include <Time/tmp.hxx>
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
#include <simgear/math/sg_geodesy.hxx>
|
#include <simgear/math/sg_geodesy.hxx>
|
||||||
#include <simgear/io/iochannel.hxx>
|
#include <simgear/io/iochannel.hxx>
|
||||||
|
#include <simgear/timing/sg_time.hxx>
|
||||||
|
|
||||||
#include <FDM/flight.hxx>
|
#include <FDM/flight.hxx>
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
|
@ -144,7 +145,7 @@ bool FGNMEA::gen_message() {
|
||||||
nmea_sentence += gga_sum;
|
nmea_sentence += gga_sum;
|
||||||
nmea_sentence += "\n";
|
nmea_sentence += "\n";
|
||||||
|
|
||||||
cout << nmea_sentence;
|
std::cout << nmea_sentence;
|
||||||
|
|
||||||
length = nmea_sentence.length();
|
length = nmea_sentence.length();
|
||||||
strncpy( buf, nmea_sentence.c_str(), length );
|
strncpy( buf, nmea_sentence.c_str(), length );
|
||||||
|
|
|
@ -21,13 +21,15 @@
|
||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
|
|
||||||
#include <Main/globals.hxx>
|
|
||||||
|
|
||||||
#include <simgear/compiler.h>
|
#include <simgear/compiler.h>
|
||||||
#include <simgear/debug/logstream.hxx>
|
#include <simgear/debug/logstream.hxx>
|
||||||
#include <simgear/io/iochannel.hxx>
|
#include <simgear/io/iochannel.hxx>
|
||||||
#include <simgear/math/sg_types.hxx>
|
#include <simgear/math/sg_types.hxx>
|
||||||
#include <simgear/misc/props.hxx>
|
#include <simgear/misc/props.hxx>
|
||||||
|
#include <simgear/misc/props_io.hxx>
|
||||||
|
|
||||||
|
#include <Main/globals.hxx>
|
||||||
|
|
||||||
#include <stdlib.h> // atoi() atof()
|
#include <stdlib.h> // atoi() atof()
|
||||||
|
|
||||||
|
@ -38,6 +40,7 @@
|
||||||
#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
|
#if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
|
||||||
SG_USING_STD(cout);
|
SG_USING_STD(cout);
|
||||||
SG_USING_STD(istrstream);
|
SG_USING_STD(istrstream);
|
||||||
|
SG_USING_STD(strstream);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FGProps::FGProps() {
|
FGProps::FGProps() {
|
||||||
|
|
|
@ -63,6 +63,8 @@ extern "C" {
|
||||||
#include <plib/sg.h>
|
#include <plib/sg.h>
|
||||||
#include <plib/ssg.h>
|
#include <plib/ssg.h>
|
||||||
|
|
||||||
|
#include <simgear/compiler.h>
|
||||||
|
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
#include <Main/fg_props.hxx>
|
#include <Main/fg_props.hxx>
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ bool FGMaterialLib::load( const string& mpath ) {
|
||||||
|
|
||||||
SGPropertyNode materials;
|
SGPropertyNode materials;
|
||||||
|
|
||||||
cout << "Reading materials from " << mpath << endl;
|
SG_LOG(SG_INPUT, SG_INFO, "Reading materials from " << mpath);
|
||||||
try {
|
try {
|
||||||
readProperties(mpath, &materials);
|
readProperties(mpath, &materials);
|
||||||
} catch (const sg_exception &ex) {
|
} catch (const sg_exception &ex) {
|
||||||
|
|
|
@ -478,10 +478,8 @@ ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t,
|
||||||
string file = path;
|
string file = path;
|
||||||
int pos = file.rfind( "/" );
|
int pos = file.rfind( "/" );
|
||||||
file = file.substr( 0, pos );
|
file = file.substr( 0, pos );
|
||||||
cout << "current file = " << file << endl;
|
|
||||||
file += "/";
|
file += "/";
|
||||||
file += material;
|
file += material;
|
||||||
cout << "current file = " << file << endl;
|
|
||||||
if ( ! material_lib.add_item( file ) ) {
|
if ( ! material_lib.add_item( file ) ) {
|
||||||
SG_LOG( SG_TERRAIN, SG_ALERT,
|
SG_LOG( SG_TERRAIN, SG_ALERT,
|
||||||
"Ack! unknown usemtl name = " << material
|
"Ack! unknown usemtl name = " << material
|
||||||
|
@ -504,8 +502,6 @@ ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t,
|
||||||
tex_height = newmat->get_ysize();
|
tex_height = newmat->get_ysize();
|
||||||
state = newmat->get_state();
|
state = newmat->get_state();
|
||||||
coverage = newmat->get_light_coverage();
|
coverage = newmat->get_light_coverage();
|
||||||
// cout << "(w) = " << tex_width << " (h) = "
|
|
||||||
// << tex_width << endl;
|
|
||||||
} else {
|
} else {
|
||||||
coverage = -1;
|
coverage = -1;
|
||||||
}
|
}
|
||||||
|
@ -520,8 +516,6 @@ ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t,
|
||||||
|
|
||||||
in >> token;
|
in >> token;
|
||||||
|
|
||||||
// cout << "token = " << token << endl;
|
|
||||||
|
|
||||||
if ( token == "vn" ) {
|
if ( token == "vn" ) {
|
||||||
// vertex normal
|
// vertex normal
|
||||||
if ( vncount < FG_MAX_NODES ) {
|
if ( vncount < FG_MAX_NODES ) {
|
||||||
|
@ -634,10 +628,6 @@ ssgBranch *fgAsciiObjLoad( const string& path, FGTileEntry *t,
|
||||||
|
|
||||||
in >> n3;
|
in >> n3;
|
||||||
fan_vertices.push_back( n3 );
|
fan_vertices.push_back( n3 );
|
||||||
// cout << " triangle = "
|
|
||||||
// << n1 << "," << n2 << "," << n3
|
|
||||||
// << endl;
|
|
||||||
// xglNormal3dv(normals[n3]);
|
|
||||||
if ( in.get( c ) && c == '/' ) {
|
if ( in.get( c ) && c == '/' ) {
|
||||||
in >> tex;
|
in >> tex;
|
||||||
fan_tex_coords.push_back( tex );
|
fan_tex_coords.push_back( tex );
|
||||||
|
@ -767,10 +757,8 @@ ssgLeaf *gen_leaf( const string& path,
|
||||||
string file = path;
|
string file = path;
|
||||||
int pos = file.rfind( "/" );
|
int pos = file.rfind( "/" );
|
||||||
file = file.substr( 0, pos );
|
file = file.substr( 0, pos );
|
||||||
cout << "current file = " << file << endl;
|
|
||||||
file += "/";
|
file += "/";
|
||||||
file += material;
|
file += material;
|
||||||
cout << "current file = " << file << endl;
|
|
||||||
if ( ! material_lib.add_item( file ) ) {
|
if ( ! material_lib.add_item( file ) ) {
|
||||||
SG_LOG( SG_TERRAIN, SG_ALERT,
|
SG_LOG( SG_TERRAIN, SG_ALERT,
|
||||||
"Ack! unknown usemtl name = " << material
|
"Ack! unknown usemtl name = " << material
|
||||||
|
@ -793,19 +781,10 @@ ssgLeaf *gen_leaf( const string& path,
|
||||||
tex_height = newmat->get_ysize();
|
tex_height = newmat->get_ysize();
|
||||||
state = newmat->get_state();
|
state = newmat->get_state();
|
||||||
coverage = newmat->get_light_coverage();
|
coverage = newmat->get_light_coverage();
|
||||||
// cout << "(w) = " << tex_width << " (h) = "
|
|
||||||
// << tex_width << endl;
|
|
||||||
} else {
|
} else {
|
||||||
coverage = -1;
|
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;
|
sgVec2 tmp2;
|
||||||
sgVec3 tmp3;
|
sgVec3 tmp3;
|
||||||
sgVec4 tmp4;
|
sgVec4 tmp4;
|
||||||
|
@ -879,14 +858,9 @@ ssgLeaf *gen_leaf( const string& path,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// cout << "before leaf create" << endl;
|
|
||||||
ssgLeaf *leaf = new ssgVtxTable ( ty, vl, nl, tl, cl );
|
ssgLeaf *leaf = new ssgVtxTable ( ty, vl, nl, tl, cl );
|
||||||
// cout << "after leaf create" << endl;
|
|
||||||
|
|
||||||
// lookup the state record
|
// lookup the state record
|
||||||
// cout << "looking up material = " << endl;
|
|
||||||
// cout << material << endl;
|
|
||||||
// cout << "'" << endl;
|
|
||||||
|
|
||||||
leaf->setState( state );
|
leaf->setState( state );
|
||||||
|
|
||||||
|
@ -919,9 +893,6 @@ bool fgBinObjLoad( const string& path, const bool is_base,
|
||||||
return false;
|
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() );
|
geometry->setName( (char *)path.c_str() );
|
||||||
|
|
||||||
if ( is_base ) {
|
if ( is_base ) {
|
||||||
|
@ -948,7 +919,6 @@ bool fgBinObjLoad( const string& path, const bool is_base,
|
||||||
group_list pts_v = obj.get_pts_v();
|
group_list pts_v = obj.get_pts_v();
|
||||||
group_list pts_n = obj.get_pts_n();
|
group_list pts_n = obj.get_pts_n();
|
||||||
for ( i = 0; i < (int)pts_v.size(); ++i ) {
|
for ( i = 0; i < (int)pts_v.size(); ++i ) {
|
||||||
cout << "pts_v.size() = " << pts_v.size() << endl;
|
|
||||||
tmp_mat = pt_materials[i];
|
tmp_mat = pt_materials[i];
|
||||||
if ( tmp_mat.substr(0, 3) == "RWY" ) {
|
if ( tmp_mat.substr(0, 3) == "RWY" ) {
|
||||||
material = "LIGHTS";
|
material = "LIGHTS";
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
# include <config.h>
|
# include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <simgear/compiler.h>
|
||||||
|
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
#include "FGTileLoader.hxx"
|
#include "FGTileLoader.hxx"
|
||||||
#include "tileentry.hxx"
|
#include "tileentry.hxx"
|
||||||
|
|
|
@ -292,7 +292,6 @@ int FGTileMgr::update( double lon, double lat ) {
|
||||||
// happen in the render thread because model loading can trigger
|
// happen in the render thread because model loading can trigger
|
||||||
// texture loading which involves use of the opengl api.
|
// texture loading which involves use of the opengl api.
|
||||||
if ( !model_queue.empty() ) {
|
if ( !model_queue.empty() ) {
|
||||||
cout << "loading next model ..." << endl;
|
|
||||||
// load the next tile in the queue
|
// load the next tile in the queue
|
||||||
#ifdef ENABLE_THREADS
|
#ifdef ENABLE_THREADS
|
||||||
FGDeferredModel* dm = model_queue.pop();
|
FGDeferredModel* dm = model_queue.pop();
|
||||||
|
@ -312,8 +311,6 @@ int FGTileMgr::update( double lon, double lat ) {
|
||||||
delete dm;
|
delete dm;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cout << "current elevation (ssg) == " << scenery.get_cur_elev() << endl;
|
|
||||||
|
|
||||||
previous_bucket = current_bucket;
|
previous_bucket = current_bucket;
|
||||||
last_longitude = longitude;
|
last_longitude = longitude;
|
||||||
last_latitude = latitude;
|
last_latitude = latitude;
|
||||||
|
@ -337,7 +334,6 @@ int FGTileMgr::update( double lon, double lat ) {
|
||||||
e->add_ssg_nodes( terrain_branch,
|
e->add_ssg_nodes( terrain_branch,
|
||||||
gnd_lights_branch,
|
gnd_lights_branch,
|
||||||
rwy_lights_branch );
|
rwy_lights_branch );
|
||||||
// cout << "Adding ssg nodes for "
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sgdVec3 sc;
|
sgdVec3 sc;
|
||||||
|
@ -349,7 +345,6 @@ int FGTileMgr::update( double lon, double lat ) {
|
||||||
#if 0
|
#if 0
|
||||||
if ( scenery.center == Point3D(0.0) ) {
|
if ( scenery.center == Point3D(0.0) ) {
|
||||||
// initializing
|
// initializing
|
||||||
cout << "initializing scenery current elevation ... " << endl;
|
|
||||||
sgdVec3 tmp_abs_view_pos;
|
sgdVec3 tmp_abs_view_pos;
|
||||||
|
|
||||||
Point3D geod_pos = Point3D( longitude * SGD_DEGREES_TO_RADIANS,
|
Point3D geod_pos = Point3D( longitude * SGD_DEGREES_TO_RADIANS,
|
||||||
|
@ -359,7 +354,6 @@ int FGTileMgr::update( double lon, double lat ) {
|
||||||
scenery.center = tmp;
|
scenery.center = tmp;
|
||||||
sgdSetVec3( tmp_abs_view_pos, tmp.x(), tmp.y(), tmp.z() );
|
sgdSetVec3( tmp_abs_view_pos, tmp.x(), tmp.y(), tmp.z() );
|
||||||
|
|
||||||
// cout << "abs_view_pos = " << tmp_abs_view_pos << endl;
|
|
||||||
prep_ssg_nodes();
|
prep_ssg_nodes();
|
||||||
|
|
||||||
double tmp_elev;
|
double tmp_elev;
|
||||||
|
@ -370,24 +364,8 @@ int FGTileMgr::update( double lon, double lat ) {
|
||||||
} else {
|
} else {
|
||||||
scenery.set_cur_elev( 0.0 );
|
scenery.set_cur_elev( 0.0 );
|
||||||
}
|
}
|
||||||
cout << "result = " << scenery.get_cur_elev() << endl;
|
|
||||||
} else {
|
} else {
|
||||||
#endif
|
#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
|
// overridden with actual values if a terrain intersection is
|
||||||
// found
|
// found
|
||||||
double hit_elev = -9999.0;
|
double hit_elev = -9999.0;
|
||||||
|
@ -415,8 +393,6 @@ int FGTileMgr::update( double lon, double lat ) {
|
||||||
scenery.set_cur_radius( 0.0 );
|
scenery.set_cur_radius( 0.0 );
|
||||||
scenery.set_cur_normal( hit_normal );
|
scenery.set_cur_normal( hit_normal );
|
||||||
}
|
}
|
||||||
|
|
||||||
// cout << "Current elevation = " << scenery.get_cur_elev() << endl;
|
|
||||||
#if 0
|
#if 0
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -437,11 +413,10 @@ void FGTileMgr::prep_ssg_nodes() {
|
||||||
tile_cache.reset_traversal();
|
tile_cache.reset_traversal();
|
||||||
|
|
||||||
while ( ! tile_cache.at_end() ) {
|
while ( ! tile_cache.at_end() ) {
|
||||||
// cout << "processing a tile" << endl;
|
|
||||||
if ( (e = tile_cache.get_current()) ) {
|
if ( (e = tile_cache.get_current()) ) {
|
||||||
e->prep_ssg_node( scenery.get_center(), vis);
|
e->prep_ssg_node( scenery.get_center(), vis);
|
||||||
} else {
|
} else {
|
||||||
cout << "warning ... empty tile in cache" << endl;
|
SG_LOG(SG_INPUT, SG_ALERT, "warning ... empty tile in cache");
|
||||||
}
|
}
|
||||||
tile_cache.next();
|
tile_cache.next();
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
#include <simgear/math/polar3d.hxx>
|
#include <simgear/math/polar3d.hxx>
|
||||||
#include <simgear/math/sg_geodesy.hxx>
|
#include <simgear/math/sg_geodesy.hxx>
|
||||||
#include <simgear/math/vector.hxx>
|
#include <simgear/math/vector.hxx>
|
||||||
|
#include <simgear/timing/sg_time.hxx>
|
||||||
|
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
#include <Main/viewer.hxx>
|
#include <Main/viewer.hxx>
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
#include <simgear/math/polar3d.hxx>
|
#include <simgear/math/polar3d.hxx>
|
||||||
#include <simgear/math/sg_geodesy.hxx>
|
#include <simgear/math/sg_geodesy.hxx>
|
||||||
#include <simgear/math/vector.hxx>
|
#include <simgear/math/vector.hxx>
|
||||||
|
#include <simgear/timing/sg_time.hxx>
|
||||||
|
|
||||||
#include <Main/globals.hxx>
|
#include <Main/globals.hxx>
|
||||||
#include <Main/viewer.hxx>
|
#include <Main/viewer.hxx>
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
#include <simgear/misc/sg_path.hxx>
|
#include <simgear/misc/sg_path.hxx>
|
||||||
#include <simgear/magvar/magvar.hxx>
|
#include <simgear/magvar/magvar.hxx>
|
||||||
|
#include <simgear/timing/sg_time.hxx>
|
||||||
|
|
||||||
#include <FDM/flight.hxx>
|
#include <FDM/flight.hxx>
|
||||||
#include <Main/fg_props.hxx>
|
#include <Main/fg_props.hxx>
|
||||||
|
@ -48,11 +49,11 @@ void fgUpdateLocalTime() {
|
||||||
SGPath zone( globals->get_fg_root() );
|
SGPath zone( globals->get_fg_root() );
|
||||||
zone.append( "Timezone" );
|
zone.append( "Timezone" );
|
||||||
|
|
||||||
cout << "updateLocal("
|
SG_LOG(SG_GENERAL, SG_INFO, "updateLocal("
|
||||||
<< longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
|
<< longitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
|
||||||
<< ", "
|
<< ", "
|
||||||
<< latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
|
<< latitude->getDoubleValue() * SGD_DEGREES_TO_RADIANS
|
||||||
<< ", " << zone.str() << ")" << endl;
|
<< ", " << zone.str() << ")");
|
||||||
globals->get_time_params()->updateLocal( longitude->getDoubleValue()
|
globals->get_time_params()->updateLocal( longitude->getDoubleValue()
|
||||||
* SGD_DEGREES_TO_RADIANS,
|
* SGD_DEGREES_TO_RADIANS,
|
||||||
latitude->getDoubleValue()
|
latitude->getDoubleValue()
|
||||||
|
|
Loading…
Add table
Reference in a new issue