2010-08-06 10:51:40 +08:00
|
|
|
|
/****************************************************************************
|
|
|
|
|
Copyright (c) 2010 cocos2d-x.org
|
|
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
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
|
|
|
|
|
THE SOFTWARE.
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "CCIntervalAction.h"
|
|
|
|
|
#include "CCSprite.h"
|
|
|
|
|
#include "CCNode.h"
|
|
|
|
|
#include "support/CGPointExtension.h"
|
|
|
|
|
|
2010-08-06 14:44:17 +08:00
|
|
|
|
#include <float.h>
|
|
|
|
|
|
2010-08-06 10:51:40 +08:00
|
|
|
|
namespace cocos2d {
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// IntervalAction
|
|
|
|
|
//
|
|
|
|
|
CCIntervalAction* CCIntervalAction::actionWithDuration(ccTime d)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
CCIntervalAction *pAction = new CCIntervalAction();
|
|
|
|
|
pAction->initWithDuration(d);
|
|
|
|
|
pAction->autorelease();
|
|
|
|
|
|
|
|
|
|
return pAction;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCIntervalAction::initWithDuration(cocos2d::ccTime d)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
m_fDuration = d;
|
|
|
|
|
|
|
|
|
|
// prevent division by 0
|
|
|
|
|
// This comparison could be in step:, but it might decrease the performance
|
|
|
|
|
// by 3% in heavy based action games.
|
|
|
|
|
if (m_fDuration == 0)
|
|
|
|
|
{
|
|
|
|
|
m_fDuration = FLT_EPSILON;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_elapsed = 0;
|
|
|
|
|
m_bFirstTick = true;
|
|
|
|
|
|
|
|
|
|
return this;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCIntervalAction::copyWithZone(NSZone *pZone)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
NSZone* pNewZone = NULL;
|
|
|
|
|
CCIntervalAction* pCopy = NULL;
|
|
|
|
|
if(pZone && pZone->m_pCopyObject)
|
|
|
|
|
{
|
|
|
|
|
//in case of being called at sub class
|
|
|
|
|
pCopy = static_cast<CCIntervalAction*>(pZone->m_pCopyObject);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// action's base class , must be called using __super::copyWithZone(), after overriding from derived class
|
|
|
|
|
assert(0);
|
|
|
|
|
|
|
|
|
|
pCopy = new CCIntervalAction();
|
|
|
|
|
pZone = pNewZone = new NSZone(pCopy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__super::copyWithZone(pZone);
|
|
|
|
|
|
|
|
|
|
CCX_SAFE_DELETE(pNewZone);
|
|
|
|
|
|
|
|
|
|
pCopy->initWithDuration(m_fDuration);
|
|
|
|
|
|
|
|
|
|
return pCopy;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CCIntervalAction::isDone(void)
|
|
|
|
|
{
|
2010-08-09 11:46:35 +08:00
|
|
|
|
return m_elapsed >= m_fDuration;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCIntervalAction::step(ccTime dt)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
if (m_bFirstTick)
|
|
|
|
|
{
|
|
|
|
|
m_bFirstTick = false;
|
|
|
|
|
m_elapsed = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_elapsed += dt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
update(min(1, m_elapsed/m_fDuration));
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCIntervalAction::startWithTarget(NSObject *pTarget)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
__super::startWithTarget(pTarget);
|
|
|
|
|
m_elapsed = 0.0f;
|
|
|
|
|
m_bFirstTick = true;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCIntervalAction::reverse(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
/*
|
|
|
|
|
NSException* myException = [NSException
|
|
|
|
|
exceptionWithName:@"ReverseActionNotImplemented"
|
|
|
|
|
reason:@"Reverse Action not implemented"
|
|
|
|
|
userInfo:nil];
|
|
|
|
|
@throw myException;
|
|
|
|
|
*/
|
2010-08-06 10:51:40 +08:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Sequence
|
|
|
|
|
//
|
|
|
|
|
CCSequence* CCSequence::actionOneTwo(cocos2d::CCFiniteTimeAction *pActionOne, cocos2d::CCFiniteTimeAction *pActionTwo)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
CCSequence *pSequence = new CCSequence();
|
|
|
|
|
pSequence->initOneTwo(pActionOne, pActionTwo);
|
|
|
|
|
pSequence->autorelease();
|
|
|
|
|
|
|
|
|
|
return pSequence;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-06 14:44:17 +08:00
|
|
|
|
CCFiniteTimeAction* CCSequence::actions(cocos2d::CCFiniteTimeAction *pAction1, ...)
|
2010-08-06 10:51:40 +08:00
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
va_list params;
|
|
|
|
|
va_start(params, pAction1);
|
|
|
|
|
|
|
|
|
|
CCFiniteTimeAction *pNow;
|
|
|
|
|
CCFiniteTimeAction *pPrev = pAction1;
|
|
|
|
|
|
|
|
|
|
while (pAction1)
|
|
|
|
|
{
|
|
|
|
|
pNow = va_arg(params, CCFiniteTimeAction*);
|
|
|
|
|
if (pNow)
|
|
|
|
|
{
|
|
|
|
|
pPrev = actionOneTwo(pPrev, pNow);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
va_end(params);
|
|
|
|
|
return pPrev;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCSequence* CCSequence::initOneTwo(cocos2d::CCFiniteTimeAction *pActionOne, cocos2d::CCFiniteTimeAction *pActionTwo)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
assert(pActionOne != NULL);
|
|
|
|
|
assert(pActionTwo != NULL);
|
|
|
|
|
|
|
|
|
|
ccTime d = pActionOne->getDuration() + pActionTwo->getDuration();
|
|
|
|
|
__super::initWithDuration(d);
|
|
|
|
|
|
|
|
|
|
m_pActions[0] = pActionOne;
|
|
|
|
|
pActionOne->retain();
|
|
|
|
|
|
|
|
|
|
m_pActions[1] = pActionTwo;
|
|
|
|
|
pActionTwo->retain();
|
|
|
|
|
|
|
|
|
|
return this;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCSequence::copyWithZone(NSZone *pZone)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
NSZone* pNewZone = NULL;
|
|
|
|
|
CCSequence* pCopy = NULL;
|
|
|
|
|
if(pZone && pZone->m_pCopyObject)
|
|
|
|
|
{
|
|
|
|
|
//in case of being called at sub class
|
|
|
|
|
pCopy = dynamic_cast<CCSequence*>(pZone->m_pCopyObject);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pCopy = new CCSequence();
|
|
|
|
|
pZone = pNewZone = new NSZone(pCopy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__super::copyWithZone(pZone);
|
|
|
|
|
|
|
|
|
|
pCopy->initOneTwo(static_cast<CCFiniteTimeAction*>(m_pActions[0]->copy()->autorelease()),
|
|
|
|
|
static_cast<CCFiniteTimeAction*>(m_pActions[1]->copy()->autorelease()));
|
|
|
|
|
|
|
|
|
|
CCX_SAFE_DELETE(pNewZone);
|
|
|
|
|
return pCopy;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCSequence::~CCSequence(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
m_pActions[0]->release();
|
|
|
|
|
m_pActions[1]->release();
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCSequence::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
__super::startWithTarget(pTarget);
|
|
|
|
|
m_split = m_pActions[0]->getDuration() / m_fDuration;
|
|
|
|
|
m_last = -1;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCSequence::stop(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
m_pActions[0]->stop();
|
|
|
|
|
m_pActions[1]->stop();
|
|
|
|
|
__super::stop();
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCSequence::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
int found = 0;
|
|
|
|
|
ccTime new_t = 0.0f;
|
|
|
|
|
|
|
|
|
|
if (time >= m_split)
|
|
|
|
|
{
|
|
|
|
|
found = 1;
|
|
|
|
|
if (m_split == 1)
|
|
|
|
|
{
|
|
|
|
|
new_t = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
new_t = (time - m_split) / (1 - m_split);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
found = 0;
|
|
|
|
|
if (m_split != 0)
|
|
|
|
|
{
|
|
|
|
|
new_t = time / m_split;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
new_t = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_last == -1 && found == 1)
|
|
|
|
|
{
|
|
|
|
|
m_pActions[0]->startWithTarget(m_pTarget);
|
|
|
|
|
m_pActions[0]->update(1.0f);
|
|
|
|
|
m_pActions[0]->stop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_last != found)
|
|
|
|
|
{
|
|
|
|
|
if (m_last != -1)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
m_pActions[m_last]->update(1.0f);
|
|
|
|
|
m_pActions[m_last]->stop();
|
2010-08-06 14:44:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pActions[found]->startWithTarget(m_pTarget);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pActions[found]->update(new_t);
|
|
|
|
|
m_last = found;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCSequence::reverse(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
return CCSequence::actionOneTwo(m_pActions[1]->reverse(), m_pActions[0]->reverse());
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Repeat
|
|
|
|
|
//
|
|
|
|
|
CCRepeat* CCRepeat::actionWithAction(cocos2d::CCFiniteTimeAction *pAction, unsigned int times)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
CCRepeat* pRepeat = new CCRepeat();
|
|
|
|
|
pRepeat->initWithAction(pAction, times);
|
|
|
|
|
pRepeat->autorelease();
|
|
|
|
|
|
|
|
|
|
return pRepeat;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCRepeat* CCRepeat::initWithAction(cocos2d::CCFiniteTimeAction *pAction, unsigned int times)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
ccTime d = pAction->getDuration() * times;
|
|
|
|
|
|
|
|
|
|
if (__super::initWithDuration(d))
|
|
|
|
|
{
|
|
|
|
|
m_uTimes = times;
|
|
|
|
|
m_pOther = pAction;
|
|
|
|
|
pAction->retain();
|
|
|
|
|
|
|
|
|
|
m_uTotal = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return this;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCRepeat::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
|
|
|
|
|
NSZone* pNewZone = NULL;
|
|
|
|
|
CCRepeat* pCopy = NULL;
|
|
|
|
|
if(pZone && pZone->m_pCopyObject)
|
|
|
|
|
{
|
|
|
|
|
//in case of being called at sub class
|
|
|
|
|
pCopy = dynamic_cast<CCRepeat*>(pZone->m_pCopyObject);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pCopy = new CCRepeat();
|
|
|
|
|
pZone = pNewZone = new NSZone(pCopy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__super::copyWithZone(pZone);
|
|
|
|
|
|
|
|
|
|
pCopy->initWithAction(static_cast<CCFiniteTimeAction*>(m_pOther->copy()->autorelease()), m_uTimes);
|
|
|
|
|
|
|
|
|
|
CCX_SAFE_DELETE(pNewZone);
|
|
|
|
|
return pCopy;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCRepeat::~CCRepeat(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
m_pOther->release();
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCRepeat::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
m_uTotal = 0;
|
|
|
|
|
__super::startWithTarget(pTarget);
|
|
|
|
|
m_pOther->startWithTarget(pTarget);
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCRepeat::stop(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
m_pOther->stop();
|
|
|
|
|
__super::stop();
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// issue #80. Instead of hooking step:, hook update: since it can be called by any
|
|
|
|
|
// container action like Repeat, Sequence, AccelDeccel, etc..
|
|
|
|
|
void CCRepeat::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
ccTime t = time * m_uTimes;
|
|
|
|
|
if (t > m_uTotal + 1)
|
|
|
|
|
{
|
|
|
|
|
m_pOther->update(1.0f);
|
|
|
|
|
m_uTotal++;
|
|
|
|
|
m_pOther->stop();
|
|
|
|
|
m_pOther->startWithTarget(m_pTarget);
|
|
|
|
|
|
|
|
|
|
// repeat is over?
|
|
|
|
|
if (m_uTotal == m_uTimes)
|
|
|
|
|
{
|
|
|
|
|
// so, set it in the original position
|
|
|
|
|
m_pOther->update(0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// no ? start next repeat with the right update
|
|
|
|
|
// to prevent jerk (issue #390)
|
|
|
|
|
m_pOther->update(t - m_uTotal);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
float r = fmodf(t, 1.0f);
|
|
|
|
|
|
|
|
|
|
// fix last repeat position
|
|
|
|
|
// else it could be 0.
|
|
|
|
|
if (time == 1.0f)
|
|
|
|
|
{
|
|
|
|
|
r = 1.0f;
|
|
|
|
|
m_uTotal++; // this is the added line
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_pOther->update(min(r, 1));
|
|
|
|
|
}
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CCRepeat::isDone(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
return m_uTotal == m_uTimes;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCRepeat::reverse(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
return CCRepeat::actionWithAction(m_pOther->reverse(), m_uTimes);
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Spawn
|
|
|
|
|
//
|
2010-08-06 14:44:17 +08:00
|
|
|
|
CCFiniteTimeAction* CCSpawn::actions(cocos2d::CCFiniteTimeAction *pAction1, ...)
|
2010-08-06 10:51:40 +08:00
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
va_list params;
|
|
|
|
|
va_start(params, pAction1);
|
|
|
|
|
|
|
|
|
|
CCFiniteTimeAction *pNow;
|
|
|
|
|
CCFiniteTimeAction *pPrev = pAction1;
|
|
|
|
|
|
|
|
|
|
while (pAction1)
|
|
|
|
|
{
|
|
|
|
|
pNow = va_arg(params, CCFiniteTimeAction*);
|
|
|
|
|
if (pNow)
|
|
|
|
|
{
|
|
|
|
|
pPrev = actionOneTwo(pPrev, pNow);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
va_end(params);
|
|
|
|
|
return pPrev;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-06 14:44:17 +08:00
|
|
|
|
CCSpawn* CCSpawn::actionOneTwo(cocos2d::CCFiniteTimeAction *pAction1, cocos2d::CCFiniteTimeAction *pAction2)
|
2010-08-06 10:51:40 +08:00
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
CCSpawn *pSpawn = new CCSpawn();
|
|
|
|
|
pSpawn->initOneTwo(pAction1, pAction2);
|
|
|
|
|
pSpawn->autorelease();
|
|
|
|
|
|
|
|
|
|
return pSpawn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCSpawn* CCSpawn:: initOneTwo(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2)
|
|
|
|
|
{
|
|
|
|
|
assert(pAction1 != NULL);
|
|
|
|
|
assert(pAction2 != NULL);
|
|
|
|
|
|
|
|
|
|
ccTime d1 = pAction1->getDuration();
|
|
|
|
|
ccTime d2 = pAction2->getDuration();
|
|
|
|
|
|
|
|
|
|
// __super::initWithDuration(fmaxf(d1, d2));
|
|
|
|
|
float maxd = (d1 >= d2 || _isnan(d2)) ? d1 : d2;
|
|
|
|
|
__super::initWithDuration(maxd);
|
|
|
|
|
|
|
|
|
|
m_pOne = pAction1;
|
|
|
|
|
m_pTwo = pAction2;
|
|
|
|
|
|
|
|
|
|
if (d1 > d2)
|
|
|
|
|
{
|
|
|
|
|
m_pTwo = CCSequence::actionOneTwo(pAction1, CCDelayTime::actionWithDuration(d1 - d2));
|
|
|
|
|
} else
|
|
|
|
|
if (d1 < d2)
|
|
|
|
|
{
|
|
|
|
|
m_pOne = CCSequence::actionOneTwo(pAction1, CCDelayTime::actionWithDuration(d2 - d1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pAction1->retain();
|
|
|
|
|
pAction2->retain();
|
|
|
|
|
return this;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCSpawn::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
NSZone* pNewZone = NULL;
|
|
|
|
|
CCSpawn* pCopy = NULL;
|
|
|
|
|
|
|
|
|
|
if(pZone && pZone->m_pCopyObject)
|
|
|
|
|
{
|
|
|
|
|
//in case of being called at sub class
|
|
|
|
|
pCopy = dynamic_cast<CCSpawn*>(pZone->m_pCopyObject);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pCopy = new CCSpawn();
|
|
|
|
|
pZone = pNewZone = new NSZone(pCopy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__super::copyWithZone(pZone);
|
|
|
|
|
|
|
|
|
|
pCopy->initOneTwo( dynamic_cast<CCFiniteTimeAction*>(m_pOne->copy()->autorelease()),
|
|
|
|
|
dynamic_cast<CCFiniteTimeAction*>(m_pTwo->copy()->autorelease()));
|
|
|
|
|
|
|
|
|
|
CCX_SAFE_DELETE(pNewZone);
|
|
|
|
|
return pCopy;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCSpawn::~CCSpawn(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
m_pOne->release();
|
|
|
|
|
m_pTwo->release();
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCSpawn::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
__super::startWithTarget(pTarget);
|
|
|
|
|
m_pOne->startWithTarget(pTarget);
|
|
|
|
|
m_pTwo->startWithTarget(pTarget);
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCSpawn::stop(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
m_pOne->stop();
|
|
|
|
|
m_pTwo->stop();
|
|
|
|
|
__super::stop();
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCSpawn::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
m_pOne->update(time);
|
|
|
|
|
m_pTwo->update(time);
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCSpawn::reverse(void)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
return CCSpawn::actionOneTwo(m_pOne->reverse(), m_pTwo->reverse());
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// RotateTo
|
|
|
|
|
//
|
|
|
|
|
CCRotateTo* CCRotateTo::actionWithDuration(cocos2d::ccTime duration, float fDeltaAngle)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
CCRotateTo* pRotateTo = new CCRotateTo();
|
|
|
|
|
pRotateTo->initWithDuration(duration, fDeltaAngle);
|
|
|
|
|
pRotateTo->autorelease();
|
|
|
|
|
|
|
|
|
|
return pRotateTo;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCRotateTo* CCRotateTo::initWithDuration(cocos2d::ccTime duration, float fDeltaAngle)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
if (__super::initWithDuration(duration))
|
|
|
|
|
{
|
|
|
|
|
m_fDstAngle = fDeltaAngle;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-06 10:51:40 +08:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCRotateTo::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
NSZone* pNewZone = NULL;
|
|
|
|
|
CCRotateTo* pCopy = NULL;
|
|
|
|
|
if(pZone && pZone->m_pCopyObject)
|
|
|
|
|
{
|
|
|
|
|
//in case of being called at sub class
|
|
|
|
|
pCopy = dynamic_cast<CCRotateTo*>(pZone->m_pCopyObject);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pCopy = new CCRotateTo();
|
|
|
|
|
pZone = pNewZone = new NSZone(pCopy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__super::copyWithZone(pZone);
|
|
|
|
|
|
|
|
|
|
pCopy->initWithDuration(m_fDuration, m_fDstAngle);
|
|
|
|
|
|
|
|
|
|
//Action *copy = [[[self class] allocWithZone: zone] initWithDuration:[self duration] angle: angle];
|
|
|
|
|
CCX_SAFE_DELETE(pNewZone);
|
|
|
|
|
return pCopy;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCRotateTo::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
__super::startWithTarget(pTarget);
|
|
|
|
|
|
|
|
|
|
m_fStartAngle = (dynamic_cast<CCNode*>(pTarget))->getRotation();
|
|
|
|
|
|
|
|
|
|
if (m_fStartAngle > 0)
|
|
|
|
|
{
|
|
|
|
|
m_fStartAngle = fmodf(m_fStartAngle, 360.0f);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_fStartAngle = fmodf(m_fStartAngle, -360.0f);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_fDiffAngle = m_fDstAngle - m_fStartAngle;
|
|
|
|
|
if (m_fDiffAngle > 180)
|
|
|
|
|
{
|
|
|
|
|
m_fDiffAngle -= 360;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (m_fDiffAngle < -180)
|
|
|
|
|
{
|
|
|
|
|
m_fDiffAngle += 360;
|
|
|
|
|
}
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCRotateTo::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
2010-08-06 14:44:17 +08:00
|
|
|
|
(dynamic_cast<CCNode*>(m_pTarget))->setRotation(m_fStartAngle + m_fDiffAngle * time);
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// RotateBy
|
|
|
|
|
//
|
|
|
|
|
CCRotateBy* CCRotateBy::actionWithDuration(cocos2d::ccTime duration, float fDeltaAngle)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
CCRotateBy *pRotateBy = new CCRotateBy();
|
|
|
|
|
pRotateBy->initWithDuration(duration, fDeltaAngle);
|
|
|
|
|
pRotateBy->autorelease();
|
|
|
|
|
|
|
|
|
|
return pRotateBy;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCRotateBy* CCRotateBy::initWithDuration(cocos2d::ccTime duration, float fDeltaAngle)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
if (__super::initWithDuration(duration))
|
|
|
|
|
{
|
|
|
|
|
m_fAngle = fDeltaAngle;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-06 10:51:40 +08:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCRotateBy::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
NSZone* pNewZone = NULL;
|
|
|
|
|
CCRotateBy* pCopy = NULL;
|
|
|
|
|
if(pZone && pZone->m_pCopyObject)
|
|
|
|
|
{
|
|
|
|
|
//in case of being called at sub class
|
|
|
|
|
pCopy = dynamic_cast<CCRotateBy*>(pZone->m_pCopyObject);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pCopy = new CCRotateBy();
|
|
|
|
|
pZone = pNewZone = new NSZone(pCopy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__super::copyWithZone(pZone);
|
|
|
|
|
|
|
|
|
|
pCopy->initWithDuration(m_fDuration, m_fAngle);
|
|
|
|
|
|
|
|
|
|
CCX_SAFE_DELETE(pNewZone);
|
|
|
|
|
return pCopy;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCRotateBy::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
__super::startWithTarget(pTarget);
|
|
|
|
|
m_fStartAngle = dynamic_cast<CCNode*>(pTarget)->getRotation();
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCRotateBy::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
// XXX: shall I add % 360
|
|
|
|
|
dynamic_cast<CCNode*>(m_pTarget)->setRotation(m_fStartAngle + m_fAngle * time);
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCRotateBy::reverse(void)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
return CCRotateBy::actionWithDuration(m_fDuration, -m_fAngle);
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// MoveTo
|
|
|
|
|
//
|
|
|
|
|
CCMoveTo* CCMoveTo::actionWithDuration(cocos2d::ccTime duration, cocos2d::CGPoint position)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
CCMoveTo *pMoveTo = new CCMoveTo();
|
|
|
|
|
pMoveTo->initWithDuration(duration, position);
|
|
|
|
|
pMoveTo->autorelease();
|
|
|
|
|
|
|
|
|
|
return pMoveTo;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCMoveTo* CCMoveTo::initWithDuration(cocos2d::ccTime duration, cocos2d::CGPoint position)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
if (__super::initWithDuration(duration))
|
|
|
|
|
{
|
|
|
|
|
m_endPosition = position;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-06 10:51:40 +08:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCMoveTo::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
NSZone* pNewZone = NULL;
|
|
|
|
|
CCMoveTo* pCopy = NULL;
|
|
|
|
|
if(pZone && pZone->m_pCopyObject)
|
|
|
|
|
{
|
|
|
|
|
//in case of being called at sub class
|
|
|
|
|
pCopy = dynamic_cast<CCMoveTo*>(pZone->m_pCopyObject);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pCopy = new CCMoveTo();
|
|
|
|
|
pZone = pNewZone = new NSZone(pCopy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__super::copyWithZone(pZone);
|
|
|
|
|
|
|
|
|
|
pCopy->initWithDuration(m_fDuration, m_endPosition);
|
|
|
|
|
|
|
|
|
|
CCX_SAFE_DELETE(pNewZone);
|
|
|
|
|
return pCopy;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-06 14:44:17 +08:00
|
|
|
|
void CCMoveTo::startWithTarget(NSObject *pTarget)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
__super::startWithTarget(pTarget);
|
|
|
|
|
m_startPosition = dynamic_cast<CCNode*>(pTarget)->getPosition();
|
|
|
|
|
m_delta = ccpSub(m_endPosition, m_startPosition);
|
2010-08-06 14:44:17 +08:00
|
|
|
|
}
|
|
|
|
|
|
2010-08-06 10:51:40 +08:00
|
|
|
|
void CCMoveTo::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
dynamic_cast<CCNode*>(m_pTarget)->setPosition(ccp(m_startPosition.x + m_delta.x * time,
|
|
|
|
|
m_startPosition.y + m_delta.y * time));
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// MoveBy
|
|
|
|
|
//
|
|
|
|
|
CCMoveBy* CCMoveBy::actionWithDuration(cocos2d::ccTime duration, cocos2d::CGPoint position)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
CCMoveBy *pMoveBy = new CCMoveBy();
|
|
|
|
|
pMoveBy->initWithDuration(duration, position);
|
|
|
|
|
pMoveBy->autorelease();
|
|
|
|
|
|
|
|
|
|
return pMoveBy;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCMoveBy* CCMoveBy::initWithDuration(cocos2d::ccTime duration, cocos2d::CGPoint position)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
if (CCIntervalAction::initWithDuration(duration))
|
|
|
|
|
{
|
|
|
|
|
m_delta = position;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-06 10:51:40 +08:00
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCMoveBy::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
2010-08-06 15:48:53 +08:00
|
|
|
|
NSZone* pNewZone = NULL;
|
|
|
|
|
CCMoveBy* pCopy = NULL;
|
|
|
|
|
if(pZone && pZone->m_pCopyObject)
|
|
|
|
|
{
|
|
|
|
|
//in case of being called at sub class
|
|
|
|
|
pCopy = dynamic_cast<CCMoveBy*>(pZone->m_pCopyObject);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pCopy = new CCMoveBy();
|
|
|
|
|
pZone = pNewZone = new NSZone(pCopy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__super::copyWithZone(pZone);
|
|
|
|
|
|
|
|
|
|
pCopy->initWithDuration(m_fDuration, m_delta);
|
|
|
|
|
|
|
|
|
|
CCX_SAFE_DELETE(pNewZone);
|
|
|
|
|
return pCopy;
|
2010-08-06 10:51:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCMoveBy::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCMoveBy::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// JumpBy
|
|
|
|
|
//
|
|
|
|
|
CCJumpBy* CCJumpBy::actionWithDuration(cocos2d::ccTime duration, cocos2d::CGPoint position, cocos2d::ccTime height, int jumps)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCJumpBy* CCJumpBy::initWithDuration(cocos2d::ccTime duration, cocos2d::CGPoint position, cocos2d::ccTime height, int jumps)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCJumpBy::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCJumpBy::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCJumpBy::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCJumpBy::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// JumpTo
|
|
|
|
|
//
|
|
|
|
|
void CCJumpTo::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Bezier cubic formula:
|
|
|
|
|
// ((1 - t) + t)3 = 1
|
|
|
|
|
// Expands to<74><6F>
|
|
|
|
|
// (1 - t)3 + 3t(1-t)2 + 3t2(1 - t) + t3 = 1
|
|
|
|
|
static inline float bezierat( float a, float b, float c, float d, ccTime t )
|
|
|
|
|
{
|
|
|
|
|
return (powf(1-t,3) * a +
|
|
|
|
|
3*t*(powf(1-t,2))*b +
|
|
|
|
|
3*powf(t,2)*(1-t)*c +
|
|
|
|
|
powf(t,3)*d );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// BezierBy
|
|
|
|
|
//
|
|
|
|
|
CCBezierBy* CCBezierBy::actionWithDuration(cocos2d::ccTime t, cocos2d::ccBezierConfig c)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCBezierBy* CCBezierBy::initWithDuration(cocos2d::ccTime t, cocos2d::ccBezierConfig c)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCBezierBy::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-06 14:44:17 +08:00
|
|
|
|
NSObject* CCBezierBy::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-06 10:51:40 +08:00
|
|
|
|
void CCBezierBy::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCBezierBy::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// BezierTo
|
|
|
|
|
//
|
|
|
|
|
void CCBezierTo::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// ScaleTo
|
|
|
|
|
//
|
|
|
|
|
CCScaleTo* CCScaleTo::actionWithDuration(cocos2d::ccTime duration, float s)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCScaleTo* CCScaleTo::initWithDuration(cocos2d::ccTime duration, float s)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCScaleTo* CCScaleTo::actionWithDuration(cocos2d::ccTime duration, float sx, float sy)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCScaleTo* CCScaleTo::initWithDuration(cocos2d::ccTime duration, float sx, float sy)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCScaleTo::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCScaleTo::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCScaleTo::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// ScaleBy
|
|
|
|
|
//
|
|
|
|
|
void CCScaleBy::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCScaleBy::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Blink
|
|
|
|
|
//
|
|
|
|
|
CCBlink* CCBlink::actionWithDuration(cocos2d::ccTime duration, unsigned int uBlinks)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCBlink* CCBlink::initWithDuration(cocos2d::ccTime duration, unsigned int uBlinks)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCBlink::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCBlink::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCBlink::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// FadeIn
|
|
|
|
|
//
|
|
|
|
|
void CCFadeIn::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCFadeIn::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// FadeOut
|
|
|
|
|
//
|
|
|
|
|
void CCFadeOut::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCFadeOut::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// FadeTo
|
|
|
|
|
//
|
|
|
|
|
CCFadeTo* CCFadeTo::actionWithDuration(cocos2d::ccTime duration, GLubyte opacity)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCFadeTo* CCFadeTo::initWithDuration(cocos2d::ccTime duration, GLubyte opacity)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCFadeTo::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCFadeTo::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCFadeTo::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// TintTo
|
|
|
|
|
//
|
|
|
|
|
CCTintTo* CCTintTo::actionWithDuration(cocos2d::ccTime duration, GLubyte red, GLubyte green, GLubyte blue)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCTintTo* CCTintTo::initWithDuration(cocos2d::ccTime duration, GLubyte red, GLubyte green, GLubyte blue)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCTintTo::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCTintTo::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCTintTo::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// TintBy
|
|
|
|
|
//
|
|
|
|
|
CCTintBy* CCTintBy::actionWithDuration(cocos2d::ccTime duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCTintBy* CCTintBy::initWithDuration(cocos2d::ccTime duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCTintBy::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCTintBy::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCTintBy::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCTintBy::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// DelayTime
|
|
|
|
|
//
|
|
|
|
|
void CCDelayTime::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCDelayTime::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// ReverseTime
|
|
|
|
|
//
|
|
|
|
|
CCReverseTime* CCReverseTime::actionWithAction(cocos2d::CCFiniteTimeAction *pAction)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCReverseTime* CCReverseTime::initWithAction(cocos2d::CCFiniteTimeAction *pAction)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCReverseTime::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCReverseTime::~CCReverseTime(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCReverseTime::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCReverseTime::stop(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCReverseTime::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCReverseTime::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Animate
|
|
|
|
|
//
|
|
|
|
|
CCAnimate* CCAnimate::actionWithAnimation(cocos2d::CCAnimation *pAnimation)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCAnimate* CCAnimate::initWithAnimation(cocos2d::CCAnimation *pAnimation)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCAnimate* CCAnimate::actionWithAnimation(cocos2d::CCAnimation *pAnimation, bool bRestoreOriginalFrame)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCAnimate* CCAnimate::initWithAnimation(cocos2d::CCAnimation *pAnimation, bool bRestoreOriginalFrame)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCAnimate* CCAnimate::actionWithDuration(cocos2d::ccTime duration, cocos2d::CCAnimation *pAnimation, bool bRestoreOriginalFrame)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCAnimate* CCAnimate::initWithDuration(cocos2d::ccTime duration, cocos2d::CCAnimation *pAnimation, bool bRestoreOriginalFrame)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NSObject* CCAnimate::copyWithZone(cocos2d::NSZone *pZone)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCAnimate::~CCAnimate(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCAnimate::startWithTarget(cocos2d::NSObject *pTarget)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCAnimate::stop(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CCAnimate::update(cocos2d::ccTime time)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCIntervalAction* CCAnimate::reverse(void)
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|