]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a initialization ordering bug:
authorehofman <ehofman>
Sat, 31 May 2003 13:38:10 +0000 (13:38 +0000)
committerehofman <ehofman>
Sat, 31 May 2003 13:38:10 +0000 (13:38 +0000)
Melchior FRANZ:
The reason: these models are to be added to the scenery, but the
scenery isn't yet set up at this point. The correct order is:

 - set up model_lib (needed by the scenery)
 - set up scenery (needed by the model manager)
 - set up model manager

src/Main/main.cxx

index 17bdd49c8a7c072ae53861178a7a79d2eca2b5d5..1cc9fe5c096de4d65ee359b9fdd6e24e69330f0c 100644 (file)
@@ -1690,13 +1690,7 @@ static bool fgMainInit( int argc, char **argv ) {
     ////////////////////////////////////////////////////////////////////
     globals->set_matlib( new SGMaterialLib );
 
-    ////////////////////////////////////////////////////////////////////
-    // Initialize the general model subsystem.
-    ////////////////////////////////////////////////////////////////////
     globals->set_model_lib(new SGModelLib);
-    globals->set_model_mgr(new FGModelMgr);
-    globals->get_model_mgr()->init();
-    globals->get_model_mgr()->bind();
 
     ////////////////////////////////////////////////////////////////////
     // Initialize the TG scenery subsystem.
@@ -1706,6 +1700,13 @@ static bool fgMainInit( int argc, char **argv ) {
     globals->get_scenery()->bind();
     globals->set_tile_mgr( new FGTileMgr );
 
+    ////////////////////////////////////////////////////////////////////
+    // Initialize the general model subsystem.
+    ////////////////////////////////////////////////////////////////////
+    globals->set_model_mgr(new FGModelMgr);
+    globals->get_model_mgr()->init();
+    globals->get_model_mgr()->bind();
+
     ////////////////////////////////////////////////////////////////////
     // Initialize the 3D aircraft model subsystem (has a dependency on
     // the scenery subsystem.)