X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2Fmodelmgr.cxx;h=2e6ad72bcdaf19b498301a6f7503859cd14c1d7f;hb=9bd00a62facf50830e4eeccfbf8ce57f4c1f444f;hp=2b547cf027486a0cfcefbad6f69f98329ada551c;hpb=dc2341b643e0ec7537b01354c7e8b23be90c60db;p=flightgear.git diff --git a/src/Model/modelmgr.cxx b/src/Model/modelmgr.cxx index 2b547cf02..2e6ad72bc 100644 --- a/src/Model/modelmgr.cxx +++ b/src/Model/modelmgr.cxx @@ -3,6 +3,10 @@ // // This file is in the Public Domain, and comes with no warranty. +#ifdef _MSC_VER +# pragma warning( disable: 4355 ) +#endif + #ifdef HAVE_CONFIG_H # include #endif @@ -12,6 +16,7 @@ #include #include #include +#include #include @@ -65,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; @@ -80,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 ); @@ -172,7 +178,7 @@ struct UpdateFunctor : public std::unary_function pitch = testNan(instance->pitch_deg_node->getDoubleValue()); if (instance->heading_deg_node != 0) heading = testNan(instance->heading_deg_node->getDoubleValue()); - } catch (const sg_range_exception& e) { + } catch (const sg_range_exception&) { const char *path = instance->node->getStringValue("path", "unknown"); SG_LOG(SG_GENERAL, SG_INFO, "Instance of model " << path