]> git.mxchange.org Git - flightgear.git/commitdiff
Removed current_model global variable and added a reference in
authordavid <david>
Tue, 9 Apr 2002 18:58:24 +0000 (18:58 +0000)
committerdavid <david>
Tue, 9 Apr 2002 18:58:24 +0000 (18:58 +0000)
FGGlobals instead (we still need to do the same with current_input and
a few other globals).

src/Main/fg_init.cxx
src/Main/globals.hxx
src/Main/main.cxx
src/Model/acmodel.cxx
src/Model/acmodel.hxx

index deace45193936baf5207bf35b0fcd4597b3b57ff..dd67485a7b06bd3b98b9a0356f231b75d06c9067 100644 (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.
     ////////////////////////////////////////////////////////////////////
index 0ec5980b96d5acccdec843bc97945db48601d3eb..7a4899fe277fea0e9d8edd72b95257c8b9ea59a0 100644 (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;
     }
index ef3071dc862306b9a2620e8979367660f85908dd..bb3175380950c0ca9f3ebd4514b8b4fce8d1d14e 100644 (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") ) {
index ece3d5076f0a4d0dcff43bb8a191e5d122bcc2a8..63cacf89f5ca34b97ba9cfee6f61cfba1e0deadf 100644 (file)
@@ -24,8 +24,6 @@
 
 extern ssgRoot * cockpit;              // FIXME: from main.cxx
 
-FGAircraftModel current_model; // FIXME: add to globals
-
 
 \f
 ////////////////////////////////////////////////////////////////////////
index 920fbbdc4c6e351dc642bf0d494e65397902cfa2..22401df6100fd29301f166dd80736fb5adc0be79 100644 (file)
@@ -40,7 +40,5 @@ private:
 
 };
 
-extern FGAircraftModel current_model;
-
 #endif // __ACMODEL_HXX