]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/model/animation.cxx
Merge branch 'next' of git.gitorious.org:fg/simgear into next
[simgear.git] / simgear / scene / model / animation.cxx
index a6734c1e6c35af922a67c9b688270bb0136fba46..fa9b44e1021ab3390df18defad2d91a6e5408368 100644 (file)
@@ -206,6 +206,10 @@ SGExpressiond*
 read_value(const SGPropertyNode* configNode, SGPropertyNode* modelRoot,
            const char* unit, double defMin, double defMax)
 {
+  const SGPropertyNode * expression = configNode->getNode( "expression" );
+  if( expression != NULL )
+    return SGReadDoubleExpression( modelRoot, expression->getChild(0) );
+
   SGExpression<double>* value = 0;
 
   std::string inputPropertyName = configNode->getStringValue("property", "");
@@ -382,14 +386,24 @@ 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<std::string>::const_iterator i;
-  for (i = _objectNames.begin(); i != _objectNames.end(); ++i)
-    SG_LOG(SG_IO, SG_ALERT, *i << "\n");
+  if (!_found)
+  {
+      std::list<std::string>::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
@@ -2086,7 +2100,7 @@ public:
   virtual bool buttonPressed(int button, const Info&)
   {
     bool found = false;
-    for( std::vector<int>::iterator it = _buttons.begin(); it != _buttons.end(); it++ ) {
+    for( std::vector<int>::iterator it = _buttons.begin(); it != _buttons.end(); ++it ) {
       if( *it == button ) {
         found = true;
         break;