1
0
Fork 0

Removed current_model global variable and added a reference in

FGGlobals instead (we still need to do the same with current_input and
a few other globals).
This commit is contained in:
david 2002-04-09 18:58:24 +00:00
parent 4a2f192fb1
commit cde90e06d5
5 changed files with 22 additions and 17 deletions

View file

@ -95,6 +95,7 @@
#include <Input/input.hxx>
// #include <Joystick/joystick.hxx>
#include <Objects/matlib.hxx>
#include <Model/acmodel.hxx>
#include <Navaids/fixlist.hxx>
#include <Navaids/ilslist.hxx>
#include <Navaids/mkrbeacons.hxx>
@ -789,6 +790,7 @@ bool fgInitSubsystems( void ) {
globals->get_logger()->init();
globals->get_logger()->bind();
////////////////////////////////////////////////////////////////////
// Initialize the local time subsystem.
////////////////////////////////////////////////////////////////////
@ -968,15 +970,6 @@ bool fgInitSubsystems( void ) {
}
////////////////////////////////////////////////////////////////////
// Initialize the joystick subsystem.
////////////////////////////////////////////////////////////////////
// if ( ! fgJoystickInit() ) {
// SG_LOG( SG_GENERAL, SG_ALERT, "Error in Joystick initialization!" );
// }
////////////////////////////////////////////////////////////////////
// Initialize the autopilot subsystem.
////////////////////////////////////////////////////////////////////
@ -1037,6 +1030,15 @@ bool fgInitSubsystems( void ) {
current_input.bind();
////////////////////////////////////////////////////////////////////
// Initialize the 3D aircraft model subsystem.
////////////////////////////////////////////////////////////////////
globals->set_aircraft_model(new FGAircraftModel);
globals->get_aircraft_model()->init();
globals->get_aircraft_model()->bind();
////////////////////////////////////////////////////////////////////////
// End of subsystem initialization.
////////////////////////////////////////////////////////////////////

View file

@ -64,6 +64,7 @@ class FGViewer;
class FGATCMgr;
class FGATCDisplay;
class FGAIMgr;
class FGAircraftModel;
/**
@ -149,6 +150,8 @@ private:
SGCommandMgr *commands;
FGAircraftModel *acmodel;
// list of serial port-like configurations
string_list *channel_options_list;
@ -241,6 +244,13 @@ public:
inline SGCommandMgr *get_commands () { return commands; }
inline FGAircraftModel *get_aircraft_model () { return acmodel; }
inline void set_aircraft_model (FGAircraftModel * model)
{
acmodel = model;
}
inline string_list *get_channel_options_list () {
return channel_options_list;
}

View file

@ -614,7 +614,7 @@ void fgRenderFrame( void ) {
ssgSetNearFar( scene_nearplane, scene_farplane );
current_model.update(dt_ms);
globals->get_aircraft_model()->update(dt_ms);
// $$$ begin - added VS Renganthan 17 Oct 2K
if(objc)
@ -1569,9 +1569,6 @@ int mainLoop( int argc, char **argv ) {
fgLoadDCS();
// ADA
// temporary visible aircraft "own ship"
current_model.init();
#ifdef FG_NETWORK_OLK
// Do the network intialization
if ( fgGetBool("/sim/networking/network-olk") ) {

View file

@ -24,8 +24,6 @@
extern ssgRoot * cockpit; // FIXME: from main.cxx
FGAircraftModel current_model; // FIXME: add to globals
////////////////////////////////////////////////////////////////////////

View file

@ -40,7 +40,5 @@ private:
};
extern FGAircraftModel current_model;
#endif // __ACMODEL_HXX