X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2Fmodelmgr.cxx;h=2e6ad72bcdaf19b498301a6f7503859cd14c1d7f;hb=9bd00a62facf50830e4eeccfbf8ce57f4c1f444f;hp=600086d29e9d77ece1819bc319f6e8f6fac1fa87;hpb=a6db6d89ff41a619569e6433409e8bf62ff98499;p=flightgear.git diff --git a/src/Model/modelmgr.cxx b/src/Model/modelmgr.cxx index 600086d29..2e6ad72bc 100644 --- a/src/Model/modelmgr.cxx +++ b/src/Model/modelmgr.cxx @@ -16,6 +16,7 @@ #include #include #include +#include #include @@ -69,10 +70,6 @@ FGModelMgr::add_model (SGPropertyNode * node) { SG_LOG(SG_GENERAL, SG_INFO, "Adding model " << node->getStringValue("name", "[unnamed]")); - Instance * instance = new Instance; - SGModelPlacement *model = new SGModelPlacement; - instance->model = model; - instance->node = node; const char *path = node->getStringValue("path", "Models/Geometry/glider.ac"); osg::Node *object; @@ -84,6 +81,11 @@ FGModelMgr::add_model (SGPropertyNode * node) << t.getFormattedMessage() << t.getOrigin()); return; } + + Instance * instance = new Instance; + SGModelPlacement *model = new SGModelPlacement; + instance->model = model; + instance->node = node; model->init( object );