DCAST_HACK_ENABLE();
}
+LinkableValueNode*
+ValueNode_Linear::create_new()const
+{
+ return new ValueNode_Linear(get_type());
+}
+
ValueNode_Linear*
ValueNode_Linear::create(const ValueBase &x)
{
case ValueBase::TYPE_COLOR:
return (*m_)(t).get( Color())*t+(*b_)(t).get( Color());
case ValueBase::TYPE_INTEGER:
- return static_cast<int>((*m_)(t).get(int())*t+(*b_)(t).get(int()) + 0.5f);
+ {
+ Real ret = (*m_)(t).get(int())*t+(*b_)(t).get(int()) + 0.5f;
+ if (ret < 0) return static_cast<int>(ret-1);
+ return static_cast<int>(ret);
+ }
case ValueBase::TYPE_REAL:
return (*m_)(t).get( Real())*t+(*b_)(t).get( Real());
case ValueBase::TYPE_TIME:
throw Exception::BadLinkName(name);
}
-
-LinkableValueNode*
-ValueNode_Linear::create_new()const
-{
- return new ValueNode_Linear(get_type());
-}