X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fmodel%2Fanimation.cxx;h=b6748fe036c0bee7df286f530aab5401f1fad7f9;hb=5a96b283f63cfacd3a3a90a82246defb038242d3;hp=3511334288121913255408f918fbf564906b0b96;hpb=baf511684119e219906fa37f3e7c7f43151bb435;p=simgear.git diff --git a/simgear/scene/model/animation.cxx b/simgear/scene/model/animation.cxx index 35113342..b6748fe0 100644 --- a/simgear/scene/model/animation.cxx +++ b/simgear/scene/model/animation.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -386,20 +387,30 @@ SGAnimation::SGAnimation(const SGPropertyNode* configNode, SGAnimation::~SGAnimation() { - if (_found) - return; - - SG_LOG(SG_IO, SG_ALERT, "Could not find at least one of the following" - " objects for animation:\n"); - std::list::const_iterator i; - for (i = _objectNames.begin(); i != _objectNames.end(); ++i) - SG_LOG(SG_IO, SG_ALERT, *i << "\n"); + if (!_found) + { + std::list::const_iterator i; + string info; + for (i = _objectNames.begin(); i != _objectNames.end(); ++i) + { + if (!info.empty()) + info.append(", "); + info.append("'"); + info.append(*i); + info.append("'"); + } + if (!info.empty()) + { + SG_LOG(SG_IO, SG_ALERT, "Could not find at least one of the following" + " objects for animation: " << info); + } + } } bool SGAnimation::animate(osg::Node* node, const SGPropertyNode* configNode, SGPropertyNode* modelRoot, - const osgDB::ReaderWriter::Options* options) + const osgDB::Options* options) { std::string type = configNode->getStringValue("type", "none"); if (type == "alpha-test") { @@ -454,6 +465,9 @@ SGAnimation::animate(osg::Node* node, const SGPropertyNode* configNode, } else if (type == "translate") { SGTranslateAnimation animInst(configNode, modelRoot); animInst.apply(node); + } else if (type == "light") { + SGLightAnimation animInst(configNode, modelRoot); + animInst.apply(node); } else if (type == "null" || type == "none" || type.empty()) { SGGroupAnimation animInst(configNode, modelRoot); animInst.apply(node);