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;