Fixed headers. Compiles but it doesn't link yet.

Many methods not implemented yet.
This commit is contained in:
Ricardo Quesada 2013-06-15 18:54:34 -07:00
parent e40adb7ae7
commit 71ea3c7a3c
9 changed files with 60 additions and 59 deletions

View File

@ -23,12 +23,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
#include "CCActionCamera.h" #include "CCActionCamera.h"
#include "base_nodes/CCNode.h" #include "base_nodes/CCNode.h"
#include "CCCamera.h" #include "CCCamera.h"
#include "CCStdC.h" #include "CCStdC.h"
#include "cocoa/CCZone.h" #include "cocoa/CCZone.h"
NS_CC_BEGIN NS_CC_BEGIN
// //
// CameraAction // CameraAction
@ -50,9 +52,9 @@ CCActionCamera* CCActionCamera::clone() const
return a; return a;
} }
CCReverseTime * CCActionCamera::reverse() const CCFiniteTimeAction * CCActionCamera::reverse() const
{ {
return CCReverseTime::create(this); return CCReverseTime::create(const_cast<CCActionCamera*>(this));
} }
// //
// CCOrbitCamera // CCOrbitCamera

View File

@ -59,9 +59,9 @@ public:
// super methods // super methods
virtual void startWithTarget(CCNode *pTarget); virtual void startWithTarget(CCNode *pTarget);
/** returns a new reversed action */ /** returns a new reversed action */
virtual CCReverseTime * reverse() const; virtual CCFiniteTimeAction * reverse() const;
/** returns a new clone of the action */ /** returns a new clone of the action */
CCActionCamera *clone() const; virtual CCActionCamera *clone() const;
protected: protected:
float m_fCenterXOrig; float m_fCenterXOrig;
float m_fCenterYOrig; float m_fCenterYOrig;

View File

@ -75,6 +75,11 @@ void CCGridAction::startWithTarget(CCNode *pTarget)
} }
} }
CCGridAction* CCGridAction::reverse() const
{
return (CCGridAction*)CCReverseTime::create( this->clone() );
}
CCGridBase* CCGridAction::getGrid(void) CCGridBase* CCGridAction::getGrid(void)
{ {
// Abstract class needs implementation // Abstract class needs implementation
@ -199,7 +204,7 @@ void CCAccelDeccelAmplitude::update(float time)
((CCAccelDeccelAmplitude*)(m_pOther))->setAmplitudeRate(powf(f, m_fRate)); ((CCAccelDeccelAmplitude*)(m_pOther))->setAmplitudeRate(powf(f, m_fRate));
} }
CCAccelDeccelAmplitude* CCAccelDeccelAmplitude::reverse(void) const CCAccelDeccelAmplitude* CCAccelDeccelAmplitude::reverse() const
{ {
return CCAccelDeccelAmplitude::create(m_pOther->reverse(), m_fDuration); return CCAccelDeccelAmplitude::create(m_pOther->reverse(), m_fDuration);
} }
@ -263,7 +268,7 @@ void CCAccelAmplitude::update(float time)
m_pOther->update(time); m_pOther->update(time);
} }
CCAccelAmplitude* CCAccelAmplitude::reverse(void) const CCAccelAmplitude* CCAccelAmplitude::reverse() const
{ {
return CCAccelAmplitude::create(m_pOther->reverse(), m_fDuration); return CCAccelAmplitude::create(m_pOther->reverse(), m_fDuration);
} }
@ -320,7 +325,7 @@ void CCDeccelAmplitude::update(float time)
m_pOther->update(time); m_pOther->update(time);
} }
CCDeccelAmplitude* CCDeccelAmplitude::reverse(void) const CCDeccelAmplitude* CCDeccelAmplitude::reverse() const
{ {
return CCDeccelAmplitude::create(m_pOther->reverse(), m_fDuration); return CCDeccelAmplitude::create(m_pOther->reverse(), m_fDuration);
} }

View File

@ -43,8 +43,11 @@ class CC_DLL CCGridAction : public CCActionInterval
public: public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCGridAction * clone() const = 0; virtual CCGridAction * clone() const = 0;
/** returns a new reversed action */
virtual CCGridAction* reverse(void) const = 0; /** returns a new reversed action.
The reversed action is created with the CCReverseTime action.
*/
virtual CCGridAction* reverse() const;
virtual void startWithTarget(CCNode *pTarget); virtual void startWithTarget(CCNode *pTarget);

View File

@ -1449,7 +1449,7 @@ void CCJumpBy::update(float t)
} }
} }
CCActionInterval* CCJumpBy::reverse(void) CCJumpBy* CCJumpBy::reverse() const
{ {
return CCJumpBy::create(m_fDuration, ccp(-m_delta.x, -m_delta.y), return CCJumpBy::create(m_fDuration, ccp(-m_delta.x, -m_delta.y),
m_height, m_nJumps); m_height, m_nJumps);
@ -1844,7 +1844,7 @@ void CCScaleBy::startWithTarget(CCNode *pTarget)
m_fDeltaY = m_fStartScaleY * m_fEndScaleY - m_fStartScaleY; m_fDeltaY = m_fStartScaleY * m_fEndScaleY - m_fStartScaleY;
} }
CCActionInterval* CCScaleBy::reverse(void) CCScaleBy* CCScaleBy::reverse() const
{ {
return CCScaleBy::create(m_fDuration, 1 / m_fEndScaleX, 1 / m_fEndScaleY); return CCScaleBy::create(m_fDuration, 1 / m_fEndScaleX, 1 / m_fEndScaleY);
} }
@ -1985,7 +1985,7 @@ void CCFadeIn::update(float time)
/*m_pTarget->setOpacity((GLubyte)(255 * time));*/ /*m_pTarget->setOpacity((GLubyte)(255 * time));*/
} }
CCActionInterval* CCFadeIn::reverse(void) CCActionInterval* CCFadeIn::reverse() const
{ {
return CCFadeOut::create(m_fDuration); return CCFadeOut::create(m_fDuration);
} }
@ -2043,7 +2043,7 @@ void CCFadeOut::update(float time)
/*m_pTarget->setOpacity(GLubyte(255 * (1 - time)));*/ /*m_pTarget->setOpacity(GLubyte(255 * (1 - time)));*/
} }
CCActionInterval* CCFadeOut::reverse(void) CCActionInterval* CCFadeOut::reverse() const
{ {
return CCFadeIn::create(m_fDuration); return CCFadeIn::create(m_fDuration);
} }
@ -2284,7 +2284,7 @@ void CCTintBy::update(float time)
} }
} }
CCActionInterval* CCTintBy::reverse(void) CCTintBy* CCTintBy::reverse() const
{ {
return CCTintBy::create(m_fDuration, -m_deltaR, -m_deltaG, -m_deltaB); return CCTintBy::create(m_fDuration, -m_deltaR, -m_deltaG, -m_deltaB);
} }
@ -2337,7 +2337,7 @@ void CCDelayTime::update(float time)
return; return;
} }
CCActionInterval* CCDelayTime::reverse(void) CCDelayTime* CCDelayTime::reverse() const
{ {
return CCDelayTime::create(m_fDuration); return CCDelayTime::create(m_fDuration);
} }
@ -2350,7 +2350,7 @@ CCReverseTime* CCReverseTime::create(CCFiniteTimeAction *pAction)
{ {
// casting to prevent warnings // casting to prevent warnings
CCReverseTime *pReverseTime = new CCReverseTime(); CCReverseTime *pReverseTime = new CCReverseTime();
pReverseTime->initWithAction(pAction); pReverseTime->initWithAction( pAction->clone() );
pReverseTime->autorelease(); pReverseTime->autorelease();
return pReverseTime; return pReverseTime;
@ -2378,7 +2378,7 @@ bool CCReverseTime::initWithAction(CCFiniteTimeAction *pAction)
CCReverseTime* CCReverseTime::clone(void) const CCReverseTime* CCReverseTime::clone(void) const
{ {
auto a = new CCReverseTime(*this); auto a = new CCReverseTime(*this);
a->initWithAction((CCFiniteTimeAction*)m_pOther->clone()); a->initWithAction( m_pOther->clone() );
a->autorelease(); a->autorelease();
return a; return a;
} }
@ -2436,7 +2436,7 @@ void CCReverseTime::update(float time)
} }
} }
CCReverseTime* CCReverseTime::reverse(void) const CCFiniteTimeAction* CCReverseTime::reverse() const
{ {
return m_pOther->clone(); return m_pOther->clone();
} }

View File

@ -282,9 +282,13 @@ public:
virtual bool initWithDuration(float fDuration, float fDeltaAngleX, float fDeltaAngleY); virtual bool initWithDuration(float fDuration, float fDeltaAngleX, float fDeltaAngleY);
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCRotateTo* clone() const; virtual CCRotateTo* clone() const;
/** returns a new reversed action */
virtual CCRotateTo* reverse() const;
virtual void startWithTarget(CCNode *pTarget); virtual void startWithTarget(CCNode *pTarget);
virtual void update(float time); virtual void update(float time);
@ -645,7 +649,7 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCFadeIn* clone() const; virtual CCFadeIn* clone() const;
/** returns a new reversed action */ /** returns a new reversed action */
virtual CCFadeIn* reverse(void) const; virtual CCActionInterval* reverse(void) const;
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
@ -665,7 +669,7 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCFadeOut* clone() const; virtual CCFadeOut* clone() const;
/** returns a new reversed action */ /** returns a new reversed action */
virtual CCFadeOut* reverse(void) const; virtual CCActionInterval* reverse(void) const;
public: public:
@ -793,7 +797,7 @@ public:
bool initWithAction(CCFiniteTimeAction *pAction); bool initWithAction(CCFiniteTimeAction *pAction);
/** returns a new reversed action */ /** returns a new reversed action */
virtual CCReverseTime* reverse(void) const; virtual CCFiniteTimeAction* reverse() const;
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCReverseTime* clone() const; virtual CCReverseTime* clone() const;
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);

View File

@ -44,9 +44,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCShakyTiles3D* clone() const; virtual CCShakyTiles3D* clone() const;
/** returns a new reversed action */
virtual CCShakyTiles3D* reverse() const;
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
virtual void update(float time); virtual void update(float time);
@ -70,9 +67,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCShatteredTiles3D* clone() const; virtual CCShatteredTiles3D* clone() const;
/** returns a new reversed action */
virtual CCShatteredTiles3D* reverse() const;
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
virtual void update(float time); virtual void update(float time);
@ -106,9 +100,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCShuffleTiles* clone() const; virtual CCShuffleTiles* clone() const;
/** returns a new reversed action */
virtual CCShuffleTiles* reverse() const;
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
public: public:
@ -136,9 +127,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCFadeOutTRTiles* clone() const; virtual CCFadeOutTRTiles* clone() const;
/** returns a new reversed action */
virtual CCFadeOutTRTiles* reverse() const;
public: public:
/** creates the action with the grid size and the duration */ /** creates the action with the grid size and the duration */
@ -156,9 +144,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCFadeOutBLTiles* clone() const; virtual CCFadeOutBLTiles* clone() const;
/** returns a new reversed action */
virtual CCFadeOutBLTiles* reverse() const;
public: public:
/** creates the action with the grid size and the duration */ /** creates the action with the grid size and the duration */
@ -177,9 +162,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCFadeOutUpTiles* clone() const; virtual CCFadeOutUpTiles* clone() const;
/** returns a new reversed action */
virtual CCFadeOutUpTiles* reverse() const;
public: public:
/** creates the action with the grid size and the duration */ /** creates the action with the grid size and the duration */
static CCFadeOutUpTiles* create(float duration, const CCSize& gridSize); static CCFadeOutUpTiles* create(float duration, const CCSize& gridSize);
@ -195,9 +177,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCFadeOutDownTiles* clone() const; virtual CCFadeOutDownTiles* clone() const;
/** returns a new reversed action */
virtual CCFadeOutDownTiles* reverse() const;
virtual float testFunc(const CCSize& pos, float time); virtual float testFunc(const CCSize& pos, float time);
public: public:
@ -222,9 +201,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCTurnOffTiles* clone() const; virtual CCTurnOffTiles* clone() const;
/** returns a new reversed action */
virtual CCTurnOffTiles* reverse() const;
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
virtual void startWithTarget(CCNode *pTarget); virtual void startWithTarget(CCNode *pTarget);
virtual void update(float time); virtual void update(float time);
@ -260,9 +236,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCWavesTiles3D* clone() const; virtual CCWavesTiles3D* clone() const;
/** returns a new reversed action */
virtual CCWavesTiles3D* reverse() const;
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
virtual void update(float time); virtual void update(float time);
@ -295,9 +268,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCJumpTiles3D* clone() const; virtual CCJumpTiles3D* clone() const;
/** returns a new reversed action */
virtual CCJumpTiles3D* reverse() const;
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
virtual void update(float time); virtual void update(float time);
@ -321,9 +291,6 @@ public :
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCSplitRows* clone() const; virtual CCSplitRows* clone() const;
/** returns a new reversed action */
virtual CCSplitRows* reverse() const;
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
virtual void update(float time); virtual void update(float time);
virtual void startWithTarget(CCNode *pTarget); virtual void startWithTarget(CCNode *pTarget);
@ -347,9 +314,6 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCSplitCols* clone() const; virtual CCSplitCols* clone() const;
/** returns a new reversed action */
virtual CCSplitCols* reverse() const;
virtual CCObject* copyWithZone(CCZone* pZone); virtual CCObject* copyWithZone(CCZone* pZone);
virtual void update(float time); virtual void update(float time);
virtual void startWithTarget(CCNode *pTarget); virtual void startWithTarget(CCNode *pTarget);

View File

@ -141,6 +141,10 @@ public:
virtual void update(float time); virtual void update(float time);
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCBSetSpriteFrame* clone() const; virtual CCBSetSpriteFrame* clone() const;
/** returns a new reversed action */
virtual CCBSetSpriteFrame* reverse() const;
virtual CCObject* copyWithZone(CCZone *pZone); virtual CCObject* copyWithZone(CCZone *pZone);
}; };
@ -160,6 +164,10 @@ public:
virtual void update(float time); virtual void update(float time);
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCBSoundEffect* clone() const; virtual CCBSoundEffect* clone() const;
/** returns a new reversed action */
virtual CCBSoundEffect* reverse() const;
virtual CCObject* copyWithZone(CCZone *pZone); virtual CCObject* copyWithZone(CCZone *pZone);
}; };
@ -177,6 +185,10 @@ public:
virtual void update(float time); virtual void update(float time);
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCBRotateTo* clone() const; virtual CCBRotateTo* clone() const;
/** returns a new reversed action */
virtual CCBRotateTo* reverse() const;
virtual CCObject* copyWithZone(CCZone *pZone); virtual CCObject* copyWithZone(CCZone *pZone);
virtual void startWithTarget(CCNode *pNode); virtual void startWithTarget(CCNode *pNode);
}; };
@ -193,6 +205,10 @@ public:
virtual void startWithTarget(CCNode *pNode); virtual void startWithTarget(CCNode *pNode);
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCBRotateXTo* clone() const; virtual CCBRotateXTo* clone() const;
/** returns a new reversed action */
virtual CCBRotateXTo* reverse() const;
virtual CCObject* copyWithZone(CCZone *pZone); virtual CCObject* copyWithZone(CCZone *pZone);
virtual void update(float time); virtual void update(float time);
}; };
@ -210,6 +226,10 @@ public:
virtual void startWithTarget(CCNode *pNode); virtual void startWithTarget(CCNode *pNode);
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCBRotateYTo* clone() const; virtual CCBRotateYTo* clone() const;
/** returns a new reversed action */
virtual CCBRotateYTo* reverse() const;
virtual CCObject* copyWithZone(CCZone *pZone); virtual CCObject* copyWithZone(CCZone *pZone);
virtual void update(float time); virtual void update(float time);
}; };
@ -222,6 +242,9 @@ public:
/** returns a new clone of the action */ /** returns a new clone of the action */
virtual CCBEaseInstant* clone() const; virtual CCBEaseInstant* clone() const;
/** returns a new reversed action */
virtual CCBEaseInstant* reverse() const;
virtual void update(float dt); virtual void update(float dt);
}; };

View File

@ -1164,8 +1164,8 @@ void ActionReverseSequence2::onEnter()
// Sequence should work both with IntervalAction and InstantActions // Sequence should work both with IntervalAction and InstantActions
CCActionInterval* move1 = CCMoveBy::create(1, ccp(250,0)); CCActionInterval* move1 = CCMoveBy::create(1, ccp(250,0));
CCActionInterval* move2 = CCMoveBy::create(1, ccp(0,50)); CCActionInterval* move2 = CCMoveBy::create(1, ccp(0,50));
CCToggleVisibility* tog1 = new CCToggleVisibility(); CCToggleVisibility* tog1 = CCToggleVisibility::create();
CCToggleVisibility* tog2 = new CCToggleVisibility(); CCToggleVisibility* tog2 = CCToggleVisibility::create();
tog1->autorelease(); tog1->autorelease();
tog2->autorelease(); tog2->autorelease();
CCFiniteTimeAction* seq = CCSequence::create( move1, tog1, move2, tog2, move1->reverse(), NULL); CCFiniteTimeAction* seq = CCSequence::create( move1, tog1, move2, tog2, move1->reverse(), NULL);