]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/util/parse_color_test.cxx
Work around apparent OSG 3.2.0 normal binding bug.
[simgear.git] / simgear / scene / util / parse_color_test.cxx
index d5605bf2c9cabadbca467bf0d544ba0252a58fad..36ec882f44ed128aadb0f46122a98529e050eb68 100644 (file)
@@ -41,31 +41,30 @@ int main (int ac, char ** av)
   SGPropertyNode color_node, color_arg;
   color_arg.setStringValue("#000000");
 
-  simgear::PropertyInterpolator* interp =
-    simgear::PropertyInterpolator
-           ::create<simgear::ColorInterpolator>(&color_arg);
+  simgear::PropertyInterpolator* interp = new simgear::ColorInterpolator;
+  interp->reset(color_arg);
 
-  interp->update(&color_node, 0.5); // with no color it should immediately set to the target
+  interp->update(color_node, 0.5); // with no color it should immediately set to the target
   VERIFY_NODE_STR(color_node, "rgb(0,0,0)");
 
   color_arg.setStringValue("rgba(255,0,0,0.5)");
-  interp->reset(&color_arg);
+  interp->reset(color_arg);
 
-  interp->update(&color_node, 0.5);
+  interp->update(color_node, 0.5);
   VERIFY_NODE_STR(color_node, "rgba(127,0,0,0.75)");
 
-  interp->update(&color_node, 0.5);
+  interp->update(color_node, 0.5);
   VERIFY_NODE_STR(color_node, "rgba(255,0,0,0.5)");
 
   // Animation has already completed and therefore should be reset and start a
   // new animation starting with the current value of the animation. As this
   // is already the same as the target value, nothing should change.
-  interp->update(&color_node, 0.5);
+  interp->update(color_node, 0.5);
   VERIFY_NODE_STR(color_node, "rgba(255,0,0,0.5)");
 
   color_arg.setStringValue("#00ff00");
-  interp->reset(&color_arg);
-  interp->update(&color_node, 1.0);
+  interp->reset(color_arg);
+  interp->update(color_node, 1.0);
   VERIFY_NODE_STR(color_node, "rgb(0,255,0)");
 
   std::cout << "all tests passed successfully!" << std::endl;