|
|
@@ -11,11 +11,35 @@ AnimationValue::AnimationValue(unsigned int componentCount)
|
|
|
_value = new float[_componentCount];
|
|
|
}
|
|
|
|
|
|
+AnimationValue::AnimationValue(const AnimationValue& copy)
|
|
|
+{
|
|
|
+ _value = new float[copy._componentCount];
|
|
|
+ _componentSize = copy._componentSize;
|
|
|
+ _componentCount = copy._componentCount;
|
|
|
+ memcpy(_value, copy._value, _componentSize);
|
|
|
+}
|
|
|
+
|
|
|
AnimationValue::~AnimationValue()
|
|
|
{
|
|
|
SAFE_DELETE_ARRAY(_value);
|
|
|
}
|
|
|
|
|
|
+AnimationValue& AnimationValue::operator=(const AnimationValue& v)
|
|
|
+{
|
|
|
+ if (this != &v)
|
|
|
+ {
|
|
|
+ if (_value == NULL || _componentSize != v._componentSize || _componentCount != v._componentCount)
|
|
|
+ {
|
|
|
+ _componentSize = v._componentSize;
|
|
|
+ _componentCount = v._componentCount;
|
|
|
+ SAFE_DELETE_ARRAY(_value);
|
|
|
+ _value = new float[v._componentCount];
|
|
|
+ }
|
|
|
+ memcpy(_value, v._value, _componentSize);
|
|
|
+ }
|
|
|
+ return *this;
|
|
|
+}
|
|
|
+
|
|
|
float AnimationValue::getFloat(unsigned int index) const
|
|
|
{
|
|
|
GP_ASSERT(index < _componentCount);
|