]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Moved random ground cover object management code (userdata.[ch]xx) over
[flightgear.git] / src / Main / main.cxx
index 24f294a6e19b7a108b1b6828c08725e46edeafdc..32a6ed112b83bcd06d7eab3d02bef4d3dbb8614e 100644 (file)
@@ -79,9 +79,9 @@ SG_USING_STD(endl);
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/scene/material/matlib.hxx>
 #include <simgear/scene/model/animation.hxx>
-#include <simgear/scene/model/loader.hxx>
 #include <simgear/scene/model/location.hxx>
 #include <simgear/scene/model/model.hxx>
+#include <simgear/scene/model/modellib.hxx>
 #ifdef FG_USE_CLOUDS_3D
 #  include <simgear/sky/clouds3d/SkySceneLoader.hpp>
 #  include <simgear/sky/clouds3d/SkyUtil.hpp>
@@ -593,6 +593,7 @@ void fgRenderFrame() {
             */
             thesky->repaint( cur_light_params.sky_color,
                              cur_light_params.adj_fog_color,
+                             cur_light_params.cloud_color,
                              cur_light_params.sun_angle,
                              cur_light_params.moon_angle,
                              globals->get_ephem()->getNumPlanets(),
@@ -1680,33 +1681,36 @@ static bool fgMainInit( int argc, char **argv ) {
     SGPath modelpath( globals->get_fg_root() );
     ssgModelPath( (char *)modelpath.c_str() );
 
-    // Initialize the global scenery manager
-    globals->set_matlib( new SGMaterialLib );
-    globals->set_scenery( new FGScenery );
-    globals->get_scenery()->init();
-    globals->get_scenery()->bind();
-
-    // Initialize the global tile manager
-    globals->set_tile_mgr( new FGTileMgr );
-
     ////////////////////////////////////////////////////////////////////
     // Initialize the property-based built-in commands
     ////////////////////////////////////////////////////////////////////
     fgInitCommands();
 
     ////////////////////////////////////////////////////////////////////
-    // Initialize the general model subsystem.
+    // Initialize the material manager
     ////////////////////////////////////////////////////////////////////
+    globals->set_matlib( new SGMaterialLib );
 
-    globals->set_model_loader(new SGModelLoader);
+    ////////////////////////////////////////////////////////////////////
+    // 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 3D aircraft model subsystem.
+    // Initialize the TG scenery subsystem.
     ////////////////////////////////////////////////////////////////////
+    globals->set_scenery( new FGScenery );
+    globals->get_scenery()->init();
+    globals->get_scenery()->bind();
+    globals->set_tile_mgr( new FGTileMgr );
 
+    ////////////////////////////////////////////////////////////////////
+    // Initialize the 3D aircraft model subsystem (has a dependency on
+    // the scenery subsystem.)
+    ////////////////////////////////////////////////////////////////////
     globals->set_aircraft_model(new FGAircraftModel);
     globals->get_aircraft_model()->init();
     globals->get_aircraft_model()->bind();
@@ -1934,7 +1938,7 @@ void fgLoadDCS(void) {
 
                 if ( strcmp(obj_filename,"repeat") != 0) {
                     ship_obj =
-                      globals->get_model_loader()->load_model( globals->get_fg_root(), obj_filename, globals->get_props(), globals->get_sim_time_sec() );
+                      globals->get_model_lib()->load_model( globals->get_fg_root(), obj_filename, globals->get_props(), globals->get_sim_time_sec() );
                 }
       
                 if ( ship_obj != NULL ) {