1
0
Fork 0

TestSuite: Complete removal of FG_TESTLIB.

This commit is contained in:
Edward d'Auvergne 2018-06-11 11:35:09 +02:00
parent 583461a812
commit feb854946e
14 changed files with 5 additions and 90 deletions

View file

@ -186,7 +186,6 @@ public:
private: private:
void populate() void populate()
{ {
#if !defined(FG_TESTLIB)
SGVec3d cartAirportPos = m_airport->cart(); SGVec3d cartAirportPos = m_airport->cart();
FGAIManager* aiManager = globals->get_subsystem<FGAIManager>(); FGAIManager* aiManager = globals->get_subsystem<FGAIManager>();
for (auto ai : aiManager->get_ai_list()) { for (auto ai : aiManager->get_ai_list()) {
@ -199,7 +198,6 @@ private:
m_cache.push_back(cart); m_cache.push_back(cart);
} }
#endif
m_populated = true; m_populated = true;
} }

View file

@ -27,12 +27,8 @@
#include <simgear/constants.h> #include <simgear/constants.h>
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
#ifdef FG_TESTLIB
#include <tests/fake_sgSky.hxx>
#else
#include <simgear/scene/sky/sky.hxx> #include <simgear/scene/sky/sky.hxx>
#include <simgear/scene/model/particles.hxx> #include <simgear/scene/model/particles.hxx>
#endif
#include <simgear/structure/event_mgr.hxx> #include <simgear/structure/event_mgr.hxx>
#include <Main/main.hxx> #include <Main/main.hxx>
@ -52,7 +48,6 @@
#include "gravity.hxx" #include "gravity.hxx"
#include "magvarmanager.hxx" #include "magvarmanager.hxx"
#ifndef FG_TESTLIB
class FG3DCloudsListener : public SGPropertyChangeListener { class FG3DCloudsListener : public SGPropertyChangeListener {
public: public:
FG3DCloudsListener( FGClouds * fgClouds ); FG3DCloudsListener( FGClouds * fgClouds );
@ -83,7 +78,6 @@ void FG3DCloudsListener::valueChanged( SGPropertyNode * node )
{ {
_fgClouds->set_3dClouds( _enableNode->getBoolValue() ); _fgClouds->set_3dClouds( _enableNode->getBoolValue() );
} }
#endif
FGEnvironmentMgr::FGEnvironmentMgr () : FGEnvironmentMgr::FGEnvironmentMgr () :
_environment(new FGEnvironment()), _environment(new FGEnvironment()),
@ -92,17 +86,13 @@ FGEnvironmentMgr::FGEnvironmentMgr () :
_3dCloudsEnableListener(nullptr), _3dCloudsEnableListener(nullptr),
_sky(globals->get_renderer()->getSky()) _sky(globals->get_renderer()->getSky())
{ {
#ifndef FG_TESTLIB
fgClouds = new FGClouds; fgClouds = new FGClouds;
_3dCloudsEnableListener = new FG3DCloudsListener(fgClouds); _3dCloudsEnableListener = new FG3DCloudsListener(fgClouds);
#endif
set_subsystem("controller", Environment::LayerInterpolateController::createInstance( fgGetNode("/environment/config", true ) )); set_subsystem("controller", Environment::LayerInterpolateController::createInstance( fgGetNode("/environment/config", true ) ));
set_subsystem("precipitation", new FGPrecipitationMgr); set_subsystem("precipitation", new FGPrecipitationMgr);
#ifndef FG_TESTLIB
set_subsystem("realwx", Environment::RealWxController::createInstance( fgGetNode("/environment/realwx", true ) ), 1.0 ); set_subsystem("realwx", Environment::RealWxController::createInstance( fgGetNode("/environment/realwx", true ) ), 1.0 );
set_subsystem("terrainsampler", Environment::TerrainSampler::createInstance( fgGetNode("/environment/terrain", true ) )); set_subsystem("terrainsampler", Environment::TerrainSampler::createInstance( fgGetNode("/environment/terrain", true ) ));
#endif
set_subsystem("ridgelift", new FGRidgeLift); set_subsystem("ridgelift", new FGRidgeLift);
set_subsystem("magvar", new FGMagVarManager); set_subsystem("magvar", new FGMagVarManager);
@ -117,10 +107,8 @@ FGEnvironmentMgr::~FGEnvironmentMgr ()
remove_subsystem("controller"); remove_subsystem("controller");
remove_subsystem("magvar"); remove_subsystem("magvar");
#ifndef FG_TESTLIB
delete fgClouds; delete fgClouds;
delete _3dCloudsEnableListener; delete _3dCloudsEnableListener;
#endif
delete _environment; delete _environment;
} }
@ -129,9 +117,7 @@ SGSubsystem::InitStatus FGEnvironmentMgr::incrementalInit()
InitStatus r = SGSubsystemGroup::incrementalInit(); InitStatus r = SGSubsystemGroup::incrementalInit();
if (r == INIT_DONE) { if (r == INIT_DONE) {
#ifndef FG_TESTLIB
fgClouds->Init(); fgClouds->Init();
#endif
globals->get_event_mgr()->addTask("updateClosestAirport", this, globals->get_event_mgr()->addTask("updateClosestAirport", this,
&FGEnvironmentMgr::updateClosestAirport, 30 ); &FGEnvironmentMgr::updateClosestAirport, 30 );
} }
@ -164,11 +150,9 @@ FGEnvironmentMgr::bind ()
_tiedProperties.Tie( "effective-visibility-m", _sky, _tiedProperties.Tie( "effective-visibility-m", _sky,
&SGSky::get_visibility ); &SGSky::get_visibility );
#ifndef FG_TESTLIB
_tiedProperties.Tie("rebuild-layers", fgClouds, _tiedProperties.Tie("rebuild-layers", fgClouds,
&FGClouds::get_update_event, &FGClouds::get_update_event,
&FGClouds::set_update_event); &FGClouds::set_update_event);
#endif
// _tiedProperties.Tie("turbulence/use-cloud-turbulence", &sgEnviro, // _tiedProperties.Tie("turbulence/use-cloud-turbulence", &sgEnviro,
// &SGEnviro::get_turbulence_enable_state, // &SGEnviro::get_turbulence_enable_state,
// &SGEnviro::set_turbulence_enable_state); // &SGEnviro::set_turbulence_enable_state);
@ -256,14 +240,12 @@ FGEnvironmentMgr::update (double dt)
SGGeod aircraftPos(globals->get_aircraft_position()); SGGeod aircraftPos(globals->get_aircraft_position());
_environment->set_elevation_ft( aircraftPos.getElevationFt() ); _environment->set_elevation_ft( aircraftPos.getElevationFt() );
#ifndef FG_TESTLIB
simgear::Particles::setWindFrom( _environment->get_wind_from_heading_deg(), simgear::Particles::setWindFrom( _environment->get_wind_from_heading_deg(),
_environment->get_wind_speed_kt() ); _environment->get_wind_speed_kt() );
if( _cloudLayersDirty ) { if( _cloudLayersDirty ) {
_cloudLayersDirty = false; _cloudLayersDirty = false;
fgClouds->set_update_event( fgClouds->get_update_event()+1 ); fgClouds->set_update_event( fgClouds->get_update_event()+1 );
} }
#endif
fgSetDouble( "/environment/gravitational-acceleration-mps2", fgSetDouble( "/environment/gravitational-acceleration-mps2",
Environment::Gravity::instance()->getGravity(aircraftPos)); Environment::Gravity::instance()->getGravity(aircraftPos));

View file

@ -36,10 +36,8 @@
class FGPrecipitationMgr : public SGSubsystem class FGPrecipitationMgr : public SGSubsystem
{ {
private: private:
#ifndef FG_TESTLIB
osg::ref_ptr<osg::MatrixTransform> transform; osg::ref_ptr<osg::MatrixTransform> transform;
osg::ref_ptr<SGPrecipitation> precipitation; osg::ref_ptr<SGPrecipitation> precipitation;
#endif
float getPrecipitationAtAltitudeMax(void); float getPrecipitationAtAltitudeMax(void);
simgear::TiedPropertyList _tiedProperties; simgear::TiedPropertyList _tiedProperties;

View file

@ -240,10 +240,8 @@ setFreeze (bool f)
} }
} }
#ifndef FG_TESTLIB
// Pause the particle system // Pause the particle system
simgear::Particles::setFrozen(f); simgear::Particles::setFrozen(f);
#endif
} }

View file

@ -25,10 +25,8 @@
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include <algorithm> #include <algorithm>
#ifndef FG_TESTLIB
#include <osgViewer/Viewer> #include <osgViewer/Viewer>
#include <osgDB/Registry> #include <osgDB/Registry>
#endif
#include <simgear/structure/commands.hxx> #include <simgear/structure/commands.hxx>
#include <simgear/structure/exception.hxx> #include <simgear/structure/exception.hxx>
@ -54,7 +52,6 @@
#include <GUI/gui.h> #include <GUI/gui.h>
#include <Viewer/viewmgr.hxx> #include <Viewer/viewmgr.hxx>
#ifndef FG_TESTLIB
#include <Scenery/scenery.hxx> #include <Scenery/scenery.hxx>
#include <Scenery/tilemgr.hxx> #include <Scenery/tilemgr.hxx>
#include <Viewer/renderer.hxx> #include <Viewer/renderer.hxx>
@ -63,7 +60,6 @@
#include <simgear/sound/soundmgr.hxx> #include <simgear/sound/soundmgr.hxx>
#include <simgear/scene/material/matlib.hxx> #include <simgear/scene/material/matlib.hxx>
#endif
#include "globals.hxx" #include "globals.hxx"
#include "locale.hxx" #include "locale.hxx"
@ -148,9 +144,7 @@ FGGlobals *globals = NULL;
// Constructor // Constructor
FGGlobals::FGGlobals() : FGGlobals::FGGlobals() :
#ifndef FG_TESTLIB
renderer( new FGRenderer ), renderer( new FGRenderer ),
#endif
subsystem_mgr( new SGSubsystemMgr ), subsystem_mgr( new SGSubsystemMgr ),
event_mgr( new SGEventMgr ), event_mgr( new SGEventMgr ),
sim_time_sec( 0.0 ), sim_time_sec( 0.0 ),
@ -201,7 +195,6 @@ FGGlobals::~FGGlobals()
// stop OSG threading first, to avoid thread races while we tear down // stop OSG threading first, to avoid thread races while we tear down
// scene-graph pieces // scene-graph pieces
#ifndef FG_TESTLIB
osg::ref_ptr<osgViewer::Viewer> vw(renderer->getViewer()); osg::ref_ptr<osgViewer::Viewer> vw(renderer->getViewer());
if (vw) { if (vw) {
// https://code.google.com/p/flightgear-bugs/issues/detail?id=1291 // https://code.google.com/p/flightgear-bugs/issues/detail?id=1291
@ -210,11 +203,9 @@ FGGlobals::~FGGlobals()
// GraphicsContext) // GraphicsContext)
vw->stopThreading(); vw->stopThreading();
} }
#endif
subsystem_mgr->shutdown(); subsystem_mgr->shutdown();
subsystem_mgr->unbind(); subsystem_mgr->unbind();
#ifndef FG_TESTLIB
// don't cancel the pager until after shutdown, since AIModels (and // don't cancel the pager until after shutdown, since AIModels (and
// potentially others) can queue delete requests on the pager. // potentially others) can queue delete requests on the pager.
if (vw && vw->getDatabasePager()) { if (vw && vw->getDatabasePager()) {
@ -230,14 +221,11 @@ FGGlobals::~FGGlobals()
FGFontCache::shutdown(); FGFontCache::shutdown();
fgCancelSnapShot(); fgCancelSnapShot();
#endif
delete subsystem_mgr; delete subsystem_mgr;
subsystem_mgr = NULL; // important so ::get_subsystem returns NULL subsystem_mgr = NULL; // important so ::get_subsystem returns NULL
#ifndef FG_TESTLIB
vw = nullptr; // don't delete the viewer until now vw = nullptr; // don't delete the viewer until now
set_matlib(NULL); set_matlib(NULL);
#endif
delete time_params; delete time_params;
delete channel_options_list; delete channel_options_list;
@ -245,9 +233,7 @@ FGGlobals::~FGGlobals()
delete channellist; delete channellist;
simgear::PropertyObjectBase::setDefaultRoot(NULL); simgear::PropertyObjectBase::setDefaultRoot(NULL);
#ifndef FG_TESTLIB
simgear::SGModelLib::resetPropertyRoot(); simgear::SGModelLib::resetPropertyRoot();
#endif
delete locale; delete locale;
locale = NULL; locale = NULL;
@ -520,14 +506,12 @@ FGGlobals::get_renderer () const
void FGGlobals::set_renderer(FGRenderer *render) void FGGlobals::set_renderer(FGRenderer *render)
{ {
#ifndef FG_TESTLIB
if (render == renderer) { if (render == renderer) {
return; return;
} }
delete renderer; delete renderer;
renderer = render; renderer = render;
#endif
} }
SGSubsystemMgr * SGSubsystemMgr *
@ -870,11 +854,7 @@ void FGGlobals::set_warp_delta( long int d )
FGScenery* FGGlobals::get_scenery () const FGScenery* FGGlobals::get_scenery () const
{ {
#ifdef FG_TESTLIB
return nullptr;
#else
return get_subsystem<FGScenery>(); return get_subsystem<FGScenery>();
#endif
} }
FGViewMgr *FGGlobals::get_viewmgr() const FGViewMgr *FGGlobals::get_viewmgr() const
@ -890,9 +870,7 @@ flightgear::View* FGGlobals::get_current_view () const
void FGGlobals::set_matlib( SGMaterialLib *m ) void FGGlobals::set_matlib( SGMaterialLib *m )
{ {
#ifndef FG_TESTLIB
matlib = m; matlib = m;
#endif
} }
FGControls *FGGlobals::get_controls() const FGControls *FGGlobals::get_controls() const

View file

@ -118,10 +118,8 @@ private:
// Time structure // Time structure
SGTime *time_params; SGTime *time_params;
#ifndef FG_TESTLIB
// Material properties library // Material properties library
SGSharedPtr<SGMaterialLib> matlib; SGSharedPtr<SGMaterialLib> matlib;
#endif
SGCommandMgr *commands; SGCommandMgr *commands;
@ -324,11 +322,7 @@ public:
inline SGMaterialLib *get_matlib() const inline SGMaterialLib *get_matlib() const
{ {
#ifdef FG_TESTLIB
return nullptr;
#else
return matlib; return matlib;
#endif
} }
void set_matlib( SGMaterialLib *m ); void set_matlib( SGMaterialLib *m );

View file

@ -60,7 +60,7 @@
#include <GUI/gui.h> #include <GUI/gui.h>
#include <GUI/MessageBox.hxx> #include <GUI/MessageBox.hxx>
#if defined(HAVE_QT) && !defined(FG_TESTLIB) #if defined(HAVE_QT)
#include <GUI/QtLauncher.hxx> #include <GUI/QtLauncher.hxx>
#include <GUI/SetupRootDialog.hxx> #include <GUI/SetupRootDialog.hxx>
#endif #endif
@ -238,12 +238,10 @@ void fgSetDefaults ()
SGPropertyNode* v = globals->get_props()->getNode("/sim/version", true); SGPropertyNode* v = globals->get_props()->getNode("/sim/version", true);
v->setValueReadOnly("flightgear", FLIGHTGEAR_VERSION); v->setValueReadOnly("flightgear", FLIGHTGEAR_VERSION);
v->setValueReadOnly("simgear", SG_STRINGIZE(SIMGEAR_VERSION)); v->setValueReadOnly("simgear", SG_STRINGIZE(SIMGEAR_VERSION));
#ifndef FG_TESTLIB
v->setValueReadOnly("openscenegraph", osgGetVersion()); v->setValueReadOnly("openscenegraph", osgGetVersion());
#if OSG_VERSION_LESS_THAN(3,5,2) #if OSG_VERSION_LESS_THAN(3,5,2)
v->setValueReadOnly("openscenegraph-thread-safe-reference-counting", v->setValueReadOnly("openscenegraph-thread-safe-reference-counting",
osg::Referenced::getThreadSafeReferenceCounting()); osg::Referenced::getThreadSafeReferenceCounting());
#endif
#endif #endif
v->setValueReadOnly("revision", REVISION); v->setValueReadOnly("revision", REVISION);
v->setValueReadOnly("build-number", HUDSON_BUILD_NUMBER); v->setValueReadOnly("build-number", HUDSON_BUILD_NUMBER);
@ -1036,14 +1034,12 @@ fgOptJpgHttpd( const char * arg )
static int static int
fgOptHttpd( const char * arg ) fgOptHttpd( const char * arg )
{ {
#ifndef FG_TESTLIB
// port may be any valid address:port notation // port may be any valid address:port notation
// like 127.0.0.1:8080 // like 127.0.0.1:8080
// or just the port 8080 // or just the port 8080
string port = simgear::strutils::strip(string(arg)); string port = simgear::strutils::strip(string(arg));
if( port.empty() ) return FG_OPTIONS_ERROR; if( port.empty() ) return FG_OPTIONS_ERROR;
fgSetString( string(flightgear::http::PROPERTY_ROOT).append("/options/listening-port").c_str(), port ); fgSetString( string(flightgear::http::PROPERTY_ROOT).append("/options/listening-port").c_str(), port );
#endif
return FG_OPTIONS_OK; return FG_OPTIONS_OK;
} }
@ -2109,9 +2105,7 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath)
} }
if (!p->shouldLoadDefaultConfig) { if (!p->shouldLoadDefaultConfig) {
#if !defined(FG_TESTLIB)
setupRoot(argc, argv); setupRoot(argc, argv);
#endif
return; return;
} }
@ -2750,9 +2744,7 @@ void Options::showVersion() const
PathList scn = globals->get_fg_scenery(); PathList scn = globals->get_fg_scenery();
cout << SGPath::join(scn, SGPath::pathListSep) << endl; cout << SGPath::join(scn, SGPath::pathListSep) << endl;
cout << "SimGear version: " << SG_STRINGIZE(SIMGEAR_VERSION) << endl; cout << "SimGear version: " << SG_STRINGIZE(SIMGEAR_VERSION) << endl;
#ifndef FG_TESTLIB
cout << "OSG version: " << osgGetVersion() << endl; cout << "OSG version: " << osgGetVersion() << endl;
#endif
cout << "PLIB version: " << PLIB_VERSION << endl; cout << "PLIB version: " << PLIB_VERSION << endl;
} }
@ -2890,7 +2882,7 @@ void Options::setupRoot(int argc, char **argv)
root = SGPath::fromLocal8Bit(envp); root = SGPath::fromLocal8Bit(envp);
SG_LOG(SG_GENERAL, SG_INFO, "set from FG_ROOT env var: fg_root = " << root ); SG_LOG(SG_GENERAL, SG_INFO, "set from FG_ROOT env var: fg_root = " << root );
} else { } else {
#if defined(HAVE_QT) && !defined(FG_TESTLIB) #if defined(HAVE_QT)
flightgear::initApp(argc, argv); flightgear::initApp(argc, argv);
root = SetupRootDialog::restoreUserSelectedRoot(); root = SetupRootDialog::restoreUserSelectedRoot();
#endif #endif
@ -2908,7 +2900,7 @@ void Options::setupRoot(int argc, char **argv)
string base_version = fgBasePackageVersion(root); string base_version = fgBasePackageVersion(root);
#if defined(HAVE_QT) && !defined(FG_TESTLIB) #if defined(HAVE_QT)
// only compare major and minor version, not the patch level. // only compare major and minor version, not the patch level.
const int versionComp = simgear::strutils::compare_versions(FLIGHTGEAR_VERSION, base_version, 2); const int versionComp = simgear::strutils::compare_versions(FLIGHTGEAR_VERSION, base_version, 2);

View file

@ -456,7 +456,6 @@ static bool fgSetPosFromNAV( const string& id,
static InitPosResult setInitialPosFromCarrier( const string& carrier ) static InitPosResult setInitialPosFromCarrier( const string& carrier )
{ {
#if !defined(FG_TESTLIB)
const auto initialPos = FGAICarrier::initialPositionForCarrier(carrier); const auto initialPos = FGAICarrier::initialPositionForCarrier(carrier);
if (initialPos.first) { if (initialPos.first) {
// set these so scenery system has a vicinity to work with, and // set these so scenery system has a vicinity to work with, and
@ -468,7 +467,6 @@ static InitPosResult setInitialPosFromCarrier( const string& carrier )
} }
SG_LOG( SG_GENERAL, SG_ALERT, "Failed to locate aircraft carrier = " << carrier ); SG_LOG( SG_GENERAL, SG_ALERT, "Failed to locate aircraft carrier = " << carrier );
#endif
return Failure; return Failure;
} }
@ -476,7 +474,6 @@ static InitPosResult setInitialPosFromCarrier( const string& carrier )
static InitPosResult setFinalPosFromCarrier( const string& carrier, const string& posid ) static InitPosResult setFinalPosFromCarrier( const string& carrier, const string& posid )
{ {
#if !defined(FG_TESTLIB)
SGSharedPtr<FGAICarrier> carrierRef = FGAICarrier::findCarrierByNameOrPennant(carrier); SGSharedPtr<FGAICarrier> carrierRef = FGAICarrier::findCarrierByNameOrPennant(carrier);
if (!carrierRef) { if (!carrierRef) {
SG_LOG( SG_GENERAL, SG_ALERT, "Failed to locate aircraft carrier = " SG_LOG( SG_GENERAL, SG_ALERT, "Failed to locate aircraft carrier = "
@ -540,7 +537,6 @@ static InitPosResult setFinalPosFromCarrier( const string& carrier, const string
///////// /////////
return ExactPosition; return ExactPosition;
} }
#endif
SG_LOG( SG_GENERAL, SG_ALERT, "Failed to locate aircraft carrier = " << carrier ); SG_LOG( SG_GENERAL, SG_ALERT, "Failed to locate aircraft carrier = " << carrier );
return Failure; return Failure;
} }

View file

@ -1262,7 +1262,6 @@ static naRef f_geodinfo(naContext c, naRef me, int argc, naRef* args)
naRef vec = naNewVector(c); naRef vec = naNewVector(c);
naVec_append(vec, naNum(elev)); naVec_append(vec, naNum(elev));
#ifndef FG_TESTLIB
naRef matdata = naNil(); naRef matdata = naNil();
const SGMaterial *mat = dynamic_cast<const SGMaterial *>(material); const SGMaterial *mat = dynamic_cast<const SGMaterial *>(material);
@ -1281,7 +1280,6 @@ static naRef f_geodinfo(naContext c, naRef me, int argc, naRef* args)
HASHSET("light_coverage", 14, naNum(mat->get_light_coverage())); HASHSET("light_coverage", 14, naNum(mat->get_light_coverage()));
} }
naVec_append(vec, matdata); naVec_append(vec, matdata);
#endif
return vec; return vec;
#undef HASHSET #undef HASHSET
} }

View file

@ -913,10 +913,8 @@ void FGNasalSys::init()
initNasalPositioned(_globals, _context); initNasalPositioned(_globals, _context);
initNasalPositioned_cppbind(_globals, _context); initNasalPositioned_cppbind(_globals, _context);
initNasalAircraft(_globals, _context); initNasalAircraft(_globals, _context);
#ifndef FG_TESTLIB
NasalClipboard::init(this); NasalClipboard::init(this);
initNasalCanvas(_globals, _context); initNasalCanvas(_globals, _context);
#endif
initNasalCondition(_globals, _context); initNasalCondition(_globals, _context);
initNasalHTTP(_globals, _context); initNasalHTTP(_globals, _context);
initNasalSGPath(_globals, _context); initNasalSGPath(_globals, _context);
@ -1016,17 +1014,14 @@ naRef FGNasalSys::wrappedPropsNode(SGPropertyNode* aProps)
void FGNasalSys::update(double) void FGNasalSys::update(double)
{ {
#ifndef FG_TESTLIB
if( NasalClipboard::getInstance() ) if( NasalClipboard::getInstance() )
NasalClipboard::getInstance()->update(); NasalClipboard::getInstance()->update();
#endif
if(!_dead_listener.empty()) { if(!_dead_listener.empty()) {
vector<FGNasalListener *>::iterator it, end = _dead_listener.end(); vector<FGNasalListener *>::iterator it, end = _dead_listener.end();
for(it = _dead_listener.begin(); it != end; ++it) delete *it; for(it = _dead_listener.begin(); it != end; ++it) delete *it;
_dead_listener.clear(); _dead_listener.clear();
} }
#ifndef FG_TESTLIB
if (!_loadList.empty()) if (!_loadList.empty())
{ {
if( _delay_load ) if( _delay_load )
@ -1042,7 +1037,6 @@ void FGNasalSys::update(double)
// (only unload one per update loop to avoid excessive lags) // (only unload one per update loop to avoid excessive lags)
_unloadList.pop()->unload(); _unloadList.pop()->unload();
} }
#endif
// Destroy all queued ghosts // Destroy all queued ghosts
nasal::ghostProcessDestroyList(); nasal::ghostProcessDestroyList();
@ -1478,18 +1472,14 @@ naRef FGNasalSys::removeListener(naContext c, int argc, naRef* args)
void FGNasalSys::registerToLoad(FGNasalModelData *data) void FGNasalSys::registerToLoad(FGNasalModelData *data)
{ {
#ifndef FG_TESTLIB
if( _loadList.empty() ) if( _loadList.empty() )
_delay_load = true; _delay_load = true;
_loadList.push(data); _loadList.push(data);
#endif
} }
void FGNasalSys::registerToUnload(FGNasalModelData *data) void FGNasalSys::registerToUnload(FGNasalModelData *data)
{ {
#ifndef FG_TESTLIB
_unloadList.push(data); _unloadList.push(data);
#endif
} }
void FGNasalSys::addCommand(naRef func, const std::string& name) void FGNasalSys::addCommand(naRef func, const std::string& name)

View file

@ -160,10 +160,8 @@ private:
//friend class FGNasalScript; //friend class FGNasalScript;
friend class FGNasalListener; friend class FGNasalListener;
friend class FGNasalModuleListener; friend class FGNasalModuleListener;
#ifndef FG_TESTLIB
SGLockedQueue<SGSharedPtr<FGNasalModelData> > _loadList; SGLockedQueue<SGSharedPtr<FGNasalModelData> > _loadList;
SGLockedQueue<SGSharedPtr<FGNasalModelData> > _unloadList; SGLockedQueue<SGSharedPtr<FGNasalModelData> > _unloadList;
#endif
// Delay removing items of the _loadList to ensure the are already attached // Delay removing items of the _loadList to ensure the are already attached
// to the scene graph (eg. enables to retrieve world position in load // to the scene graph (eg. enables to retrieve world position in load
// callback). // callback).

View file

@ -1078,11 +1078,7 @@ double View::getOrientation_z() const{
double View::get_aspect_ratio() const double View::get_aspect_ratio() const
{ {
#ifdef FG_TESTLIB
return 4.0 / 3.0;
#else
return flightgear::CameraGroup::getDefault()->getMasterAspectRatio(); return flightgear::CameraGroup::getDefault()->getMasterAspectRatio();
#endif
} }
double View::getLon_deg() const double View::getLon_deg() const

View file

@ -137,15 +137,12 @@ FGViewMgr::update (double dt)
// Update the current view // Update the current view
currentView->update(dt); currentView->update(dt);
#ifndef FG_TESTLIB
// update the camera now // update the camera now
osg::ref_ptr<flightgear::CameraGroup> cameraGroup = flightgear::CameraGroup::getDefault(); osg::ref_ptr<flightgear::CameraGroup> cameraGroup = flightgear::CameraGroup::getDefault();
cameraGroup->update(toOsg(currentView->getViewPosition()), cameraGroup->update(toOsg(currentView->getViewPosition()),
toOsg(currentView->getViewOrientation())); toOsg(currentView->getViewOrientation()));
cameraGroup->setCameraParameters(currentView->get_v_fov(), cameraGroup->setCameraParameters(currentView->get_v_fov(),
cameraGroup->getMasterAspectRatio()); cameraGroup->getMasterAspectRatio());
#endif
} }
void FGViewMgr::clear() void FGViewMgr::clear()

View file

@ -4,7 +4,7 @@
#include "globals.hxx" #include "globals.hxx"
#if defined(HAVE_QT) && !defined(FG_TESTLIB) #if defined(HAVE_QT)
#include <GUI/QtLauncher.hxx> #include <GUI/QtLauncher.hxx>
#endif #endif
@ -57,7 +57,7 @@ void shutdownTestGlobals()
{ {
// The QApplication instance must be destroyed before exit() begins, see // The QApplication instance must be destroyed before exit() begins, see
// <https://bugreports.qt.io/browse/QTBUG-48709> (otherwise, segfault). // <https://bugreports.qt.io/browse/QTBUG-48709> (otherwise, segfault).
#if defined(HAVE_QT) && !defined(FG_TESTLIB) #if defined(HAVE_QT)
flightgear::shutdownQtApp(); flightgear::shutdownQtApp();
#endif #endif