]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tilemgr.cxx
Added static port system and a new altimeter model connected to it.
[flightgear.git] / src / Scenery / tilemgr.cxx
index 767fcd8e57883da3074720a1d2e9c13ed2b407ac..7cc4224b0ba3137feb33901a05ca2b203da9f431 100644 (file)
 #include <simgear/math/polar3d.hxx>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/math/vector.hxx>
+#include <simgear/misc/exception.hxx>
 
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/viewer.hxx>
+#include <Model/loader.hxx>
 #include <Objects/obj.hxx>
 
 #include "newcache.hxx"
@@ -329,13 +331,20 @@ int FGTileMgr::update( double lon, double lat, double visibility_meters,
 #endif
        
        ssgTexturePath( (char *)(dm->get_texture_path().c_str()) );
-       ssgEntity *obj_model
-           = ssgLoad( (char *)(dm->get_model_path().c_str()) );
-        if ( obj_model != NULL ) {
-            dm->get_obj_trans()->addKid( obj_model );
-        }
-        dm->get_tile()->dec_pending_models();
+       try
+       {
+           ssgEntity *obj_model =
+               globals->get_model_loader()->load_model(dm->get_model_path());
+           if ( obj_model != NULL ) {
+               dm->get_obj_trans()->addKid( obj_model );
+           }
+       }
+       catch (const sg_exception& exc)
+       {
+           SG_LOG( SG_ALL, SG_ALERT, exc.getMessage() );
+       }
 
+       dm->get_tile()->dec_pending_models();
        delete dm;
     }