123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- #include "REDKeyframe.h"
- using namespace cocos2d;
- namespace redream {
- REDKeyframe::REDKeyframe()
- : _object(nullptr)
- , _time(0.0f)
- , _easingType(EasingType::INSTANT)
- {
- _easingOpt = (float*)malloc(4 * sizeof(float));;
- }
- REDKeyframe::~REDKeyframe()
- {
- CC_SAFE_RELEASE(_object);
- CC_SAFE_FREE(_easingOpt);
- }
- const Value& REDKeyframe::getValue() const
- {
- return _value;
- }
- void REDKeyframe::setValue(const Value& value)
- {
- _value = value;
- }
-
- Ref* REDKeyframe::getObject() const
- {
- return _object;
- }
- void REDKeyframe::setObject(Ref* obj)
- {
- CC_SAFE_RETAIN(obj);
- CC_SAFE_RELEASE(_object);
- _object = obj;
- }
- float REDKeyframe::getTime()
- {
- return _time;
- }
- void REDKeyframe::setTime(float fTime)
- {
- _time = fTime;
- }
- REDKeyframe::EasingType REDKeyframe::getEasingType()
- {
- return _easingType;
- }
- void REDKeyframe::setEasingType(REDKeyframe::EasingType easingType)
- {
- _easingType = easingType;
- }
- float* REDKeyframe::getEasingOpt()
- {
- return _easingOpt;
- }
- void REDKeyframe::setEasingOpt(float *fEasingOpt)
- {
- _easingOpt[0] = fEasingOpt[0];
- _easingOpt[1] = fEasingOpt[1];
- _easingOpt[2] = fEasingOpt[2];
- _easingOpt[3] = fEasingOpt[3];
- }
- std::vector<cocos2d::Vec2> REDKeyframe::getEqualPoints() {
- return _equalPoints;
- }
- void REDKeyframe::setEqualPoints(std::vector<cocos2d::Vec2> equalPoints) {\
- _equalPoints = equalPoints;
- }
- }
|