Merge branch 'gles20' of git://github.com/cocos2d/cocos2d-x into gles20

This commit is contained in:
dualface 2012-12-10 16:56:42 +08:00
commit d9abb15b9a
41 changed files with 402 additions and 303 deletions

View File

@ -41,32 +41,31 @@ NS_CC_BEGIN
// A list double-linked list used for "updates with priority"
typedef struct _listEntry
{
struct _listEntry *prev, *next;
CCObject *target; // not retained (retained by hashUpdateEntry)
int priority;
struct _listEntry *prev, *next;
CCObject *target; // not retained (retained by hashUpdateEntry)
int priority;
bool paused;
bool markedForDeletion; // selector will no longer be called and entry will be removed at end of the next tick
} tListEntry;
typedef struct _hashUpdateEntry
{
tListEntry **list; // Which list does it belong to ?
tListEntry *entry; // entry in the list
CCObject *target; // hash key (retained)
UT_hash_handle hh;
tListEntry **list; // Which list does it belong to ?
tListEntry *entry; // entry in the list
CCObject *target; // hash key (retained)
UT_hash_handle hh;
} tHashUpdateEntry;
// Hash Element used for "selectors with interval"
typedef struct _hashSelectorEntry
{
ccArray *timers;
ccArray *timers;
CCObject *target; // hash key (retained)
unsigned int timerIndex;
CCTimer *currentTimer;
bool currentTimerSalvaged;
bool paused;
UT_hash_handle hh;
unsigned int timerIndex;
CCTimer *currentTimer;
bool currentTimerSalvaged;
bool paused;
UT_hash_handle hh;
} tHashTimerEntry;
// implementation CCTimer
@ -83,7 +82,6 @@ CCTimer::CCTimer()
, m_fDelay(0.0f)
, m_nScriptHandler(0)
{
}
CCTimer* CCTimer::timerWithTarget(CCObject *pTarget, SEL_SCHEDULE pfnSelector)
@ -164,7 +162,7 @@ void CCTimer::update(float dt)
if (m_nScriptHandler)
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(this, m_fElapsed);
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(m_nScriptHandler, m_fElapsed);
}
m_fElapsed = 0;
}
@ -183,7 +181,7 @@ void CCTimer::update(float dt)
if (m_nScriptHandler)
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(this, m_fElapsed);
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(m_nScriptHandler, m_fElapsed);
}
m_fElapsed = m_fElapsed - m_fDelay;
@ -202,7 +200,7 @@ void CCTimer::update(float dt)
if (m_nScriptHandler)
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(this, m_fElapsed);
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(m_nScriptHandler, m_fElapsed);
}
m_fElapsed = 0;
@ -787,15 +785,16 @@ void CCScheduler::update(float dt)
// Iterate over all the Updates' selectors
tListEntry *pEntry, *pTmp;
CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
// updates with priority < 0
DL_FOREACH_SAFE(m_pUpdatesNegList, pEntry, pTmp)
{
if ((! pEntry->paused) && (! pEntry->markedForDeletion))
{
CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
if (pEngine != NULL && kScriptTypeJavascript == pEngine->getScriptType())
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(NULL, dt, (CCNode *)pEntry->target);
pEngine->executeSchedule(NULL, dt, (CCNode *)pEntry->target);
}
pEntry->target->update(dt);
@ -807,13 +806,12 @@ void CCScheduler::update(float dt)
{
if ((! pEntry->paused) && (! pEntry->markedForDeletion))
{
CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
if (pEngine != NULL && kScriptTypeJavascript == pEngine->getScriptType())
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(NULL, dt, (CCNode *)pEntry->target);
pEngine->executeSchedule(NULL, dt, (CCNode *)pEntry->target);
}
pEntry->target->update(dt);
pEntry->target->update(dt);
}
}
@ -822,13 +820,12 @@ void CCScheduler::update(float dt)
{
if ((! pEntry->paused) && (! pEntry->markedForDeletion))
{
CCScriptEngineProtocol* pEngine = CCScriptEngineManager::sharedManager()->getScriptEngine();
if (pEngine != NULL && kScriptTypeJavascript == pEngine->getScriptType())
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(NULL, dt, (CCNode *)pEntry->target);
pEngine->executeSchedule(NULL, dt, (CCNode *)pEntry->target);
}
pEntry->target->update(dt);
pEntry->target->update(dt);
}
}

View File

@ -35,6 +35,49 @@ THE SOFTWARE.
NS_CC_BEGIN
// Extra action for making a CCSequence or CCSpawn when only adding one action to it.
class ExtraAction : public CCFiniteTimeAction
{
public:
static ExtraAction* create();
virtual CCObject* copyWithZone(CCZone* pZone);
virtual ExtraAction* reverse(void);
virtual void update(float time);
virtual void step(float dt);
};
ExtraAction* ExtraAction::create()
{
ExtraAction* pRet = new ExtraAction();
if (pRet)
{
pRet->autorelease();
}
return pRet;
}
CCObject* ExtraAction::copyWithZone(CCZone* pZone)
{
CC_UNUSED_PARAM(pZone);
ExtraAction* pRet = new ExtraAction();
return pRet;
}
ExtraAction* ExtraAction::reverse(void)
{
return ExtraAction::create();
}
void ExtraAction::update(float time)
{
CC_UNUSED_PARAM(time);
}
void ExtraAction::step(float dt)
{
CC_UNUSED_PARAM(dt);
}
//
// IntervalAction
//
@ -156,42 +199,49 @@ CCSequence* CCSequence::createWithTwoActions(CCFiniteTimeAction *pActionOne, CCF
return pSequence;
}
CCFiniteTimeAction* CCSequence::create(CCFiniteTimeAction *pAction1, ...)
CCSequence* CCSequence::create(CCFiniteTimeAction *pAction1, ...)
{
va_list params;
va_start(params, pAction1);
CCFiniteTimeAction *pRet = CCSequence::createWithVariableList(pAction1, params);
CCSequence *pRet = CCSequence::createWithVariableList(pAction1, params);
va_end(params);
return pRet;
}
CCFiniteTimeAction* CCSequence::createWithVariableList(CCFiniteTimeAction *pAction1, va_list args)
CCSequence* CCSequence::createWithVariableList(CCFiniteTimeAction *pAction1, va_list args)
{
CCFiniteTimeAction *pNow;
CCFiniteTimeAction *pPrev = pAction1;
bool bOneAction = true;
while (pAction1)
{
pNow = va_arg(args, CCFiniteTimeAction*);
if (pNow)
{
pPrev = createWithTwoActions(pPrev, pNow);
bOneAction = false;
}
else
{
// If only one action is added to CCSequence, make up a CCSequence by adding a simplest finite time action.
if (bOneAction)
{
pPrev = createWithTwoActions(pPrev, ExtraAction::create());
}
break;
}
}
return pPrev;
return ((CCSequence*)pPrev);
}
CCFiniteTimeAction* CCSequence::create(CCArray* arrayOfActions)
CCSequence* CCSequence::create(CCArray* arrayOfActions)
{
CCFiniteTimeAction* pRet = NULL;
CCSequence* pRet = NULL;
do
{
unsigned int count = arrayOfActions->count();
@ -206,7 +256,12 @@ CCFiniteTimeAction* CCSequence::create(CCArray* arrayOfActions)
prev = createWithTwoActions(prev, (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(i));
}
}
pRet = prev;
else
{
// If only one action is added to CCSequence, make up a CCSequence by adding a simplest finite time action.
prev = createWithTwoActions(prev, ExtraAction::create());
}
pRet = (CCSequence*)prev;
}while (0);
return pRet;
}
@ -549,49 +604,70 @@ CCActionInterval *CCRepeatForever::reverse()
// Spawn
//
CCFiniteTimeAction* CCSpawn::create(CCFiniteTimeAction *pAction1, ...)
CCSpawn* CCSpawn::create(CCFiniteTimeAction *pAction1, ...)
{
va_list params;
va_start(params, pAction1);
CCFiniteTimeAction *pRet = CCSpawn::create(pAction1, params);
CCSpawn *pRet = CCSpawn::createWithVariableList(pAction1, params);
va_end(params);
return pRet;
}
CCFiniteTimeAction* CCSpawn::create(CCFiniteTimeAction *pAction1, va_list args)
CCSpawn* CCSpawn::createWithVariableList(CCFiniteTimeAction *pAction1, va_list args)
{
CCFiniteTimeAction *pNow;
CCFiniteTimeAction *pPrev = pAction1;
bool bOneAction = true;
while (pAction1)
{
pNow = va_arg(args, CCFiniteTimeAction*);
if (pNow)
{
pPrev = createWithTwoActions(pPrev, pNow);
bOneAction = false;
}
else
{
// If only one action is added to CCSpawn, make up a CCSpawn by adding a simplest finite time action.
if (bOneAction)
{
pPrev = createWithTwoActions(pPrev, ExtraAction::create());
}
break;
}
}
return pPrev;
return ((CCSpawn*)pPrev);
}
CCFiniteTimeAction* CCSpawn::create(CCArray *arrayOfActions)
CCSpawn* CCSpawn::create(CCArray *arrayOfActions)
{
CCFiniteTimeAction* prev = (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(0);
for (unsigned int i = 1; i < arrayOfActions->count(); ++i)
{
prev = createWithTwoActions(prev, (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(i));
}
return prev;
CCSpawn* pRet = NULL;
do
{
unsigned int count = arrayOfActions->count();
CC_BREAK_IF(count == 0);
CCFiniteTimeAction* prev = (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(0);
if (count > 1)
{
for (unsigned int i = 1; i < arrayOfActions->count(); ++i)
{
prev = createWithTwoActions(prev, (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(i));
}
}
else
{
// If only one action is added to CCSpawn, make up a CCSpawn by adding a simplest finite time action.
prev = createWithTwoActions(prev, ExtraAction::create());
}
pRet = (CCSpawn*)prev;
}while (0);
return pRet;
}
CCSpawn* CCSpawn::createWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2)

View File

@ -110,11 +110,11 @@ public:
public:
/** helper constructor to create an array of sequenceable actions */
static CCFiniteTimeAction* create(CCFiniteTimeAction *pAction1, ...);
static CCSequence* create(CCFiniteTimeAction *pAction1, ...);
/** helper constructor to create an array of sequenceable actions given an array */
static CCFiniteTimeAction* create(CCArray *arrayOfActions);
static CCSequence* create(CCArray *arrayOfActions);
/** helper constructor to create an array of sequence-able actions */
static CCFiniteTimeAction* createWithVariableList(CCFiniteTimeAction *pAction1, va_list args);
static CCSequence* createWithVariableList(CCFiniteTimeAction *pAction1, va_list args);
/** creates the action */
static CCSequence* createWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo);
@ -233,13 +233,13 @@ public:
public:
/** helper constructor to create an array of spawned actions */
static CCFiniteTimeAction* create(CCFiniteTimeAction *pAction1, ...);
static CCSpawn* create(CCFiniteTimeAction *pAction1, ...);
/** helper constructor to create an array of spawned actions */
static CCFiniteTimeAction* create(CCFiniteTimeAction *pAction1, va_list args);
static CCSpawn* createWithVariableList(CCFiniteTimeAction *pAction1, va_list args);
/** helper constructor to create an array of spawned actions given an array */
static CCFiniteTimeAction* create(CCArray *arrayOfActions);
static CCSpawn* create(CCArray *arrayOfActions);
/** creates the Spawn action */
static CCSpawn* createWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2);

View File

@ -81,6 +81,7 @@ CCNode::CCNode(void)
, m_bTransformDirty(true)
, m_bInverseDirty(true)
, m_nScriptHandler(0)
, m_nUpdateScriptHandler(0)
, m_pShaderProgram(NULL)
, m_uOrderOfArrival(0)
, m_eGLServerState(ccGLServerState(0))
@ -102,6 +103,10 @@ CCNode::~CCNode(void)
CCLOGINFO( "cocos2d: deallocing" );
unregisterScriptHandler();
if (m_nUpdateScriptHandler)
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->removeScriptHandler(m_nUpdateScriptHandler);
}
CC_SAFE_RELEASE(m_pActionManager);
CC_SAFE_RELEASE(m_pScheduler);
@ -946,6 +951,16 @@ void CCNode::unregisterScriptHandler(void)
}
}
void CCNode::scheduleUpdateWithPriorityLua(int nHandler, int priority)
{
if (m_nUpdateScriptHandler)
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->removeScriptHandler(m_nUpdateScriptHandler);
}
m_nUpdateScriptHandler = nHandler;
m_pScheduler->scheduleUpdateForTarget(this, priority, !m_bRunning);
}
void CCNode::setActionManager(CCActionManager* actionManager)
{
if( actionManager != m_pActionManager ) {
@ -1025,6 +1040,11 @@ void CCNode::scheduleUpdateWithPriority(int priority)
void CCNode::unscheduleUpdate()
{
m_pScheduler->unscheduleUpdateForTarget(this);
if (m_nUpdateScriptHandler)
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->removeScriptHandler(m_nUpdateScriptHandler);
m_nUpdateScriptHandler = 0;
}
}
void CCNode::schedule(SEL_SCHEDULE selector)
@ -1079,7 +1099,10 @@ void CCNode::pauseSchedulerAndActions()
// override me
void CCNode::update(float fDelta)
{
if (m_nUpdateScriptHandler)
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeSchedule(m_nUpdateScriptHandler, fDelta);
}
}
CCAffineTransform CCNode::nodeToParentTransform(void)

View File

@ -206,7 +206,8 @@ protected:
// script handler
int m_nScriptHandler;
int m_nUpdateScriptHandler;
// script type, lua or javascript
ccScriptType m_eScriptType;
@ -367,6 +368,9 @@ public:
/** Get children count */
unsigned int getChildrenCount(void);
void _setZOrder(int z);
/** Get script handler for onEnter/onExit event. */
inline int getScriptHandler() { return m_nScriptHandler; };
/** get/set Position for Lua (pass number faster than CCPoint object)
@ -379,7 +383,6 @@ public:
node:setPosition(x, y) -- pass x, y values to C++
node:setPositionX(x)
node:setPositionY(y)
node:setPositionInPixels(x, y) -- pass x, y values to C++
*/
const CCPoint& getPositionLua(void);
void getPosition(float* x, float* y);
@ -388,7 +391,6 @@ public:
void setPositionX(float x);
void setPositionY(float y);
void setPosition(float x, float y);
void _setZOrder(int z);
public:
CCNode(void);
@ -640,7 +642,7 @@ public:
delay is the amount of time the action will wait before execution
*/
void schedule(SEL_SCHEDULE selector, float interval, unsigned int repeat, float delay);
/**
Schedules a selector that runs only once, with a delay of 0 or larger
*/
@ -667,7 +669,7 @@ public:
/* Update will be called automatically every frame if "scheduleUpdate" is called, and the node is "live"
*/
virtual void update(float fDelta);
// transformation methods
/** Returns the matrix that transform the node's (local) space coordinates into the parent's space coordinates.
@ -720,7 +722,10 @@ public:
@since v0.7.1
*/
CCPoint convertTouchToNodeSpaceAR(CCTouch * touch);
/** Schedules for script. */
void scheduleUpdateWithPriorityLua(int nHandler, int priority);
private:
//! lazy allocs
void childrenAlloc(void);

View File

@ -141,9 +141,10 @@ unsigned char* CCFileUtils::getFileData(const char* pszFileName, const char* psz
string CCFileUtils::getWriteablePath()
{
// the path is: /data/data/ + package name
string dir("/data/data/");
const char *tmp = getPackageNameJNI();
// Fix for Nexus 10 (Android 4.2 multi-user environment)
// the path is retrieved through Java Context.getCacheDir() method
string dir("");
const char *tmp = getCacheDirectoryJNI();
if (tmp)
{

View File

@ -105,6 +105,7 @@ public class Cocos2dxGLSurfaceView extends GLSurfaceView {
Cocos2dxGLSurfaceView.this.mCocos2dxEditText.removeTextChangedListener(Cocos2dxGLSurfaceView.sCocos2dxTextInputWraper);
final InputMethodManager imm = (InputMethodManager) Cocos2dxGLSurfaceView.mCocos2dxGLSurfaceView.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(Cocos2dxGLSurfaceView.this.mCocos2dxEditText.getWindowToken(), 0);
Cocos2dxGLSurfaceView.this.requestFocus();
Log.d("GLSurfaceView", "HideSoftInput");
}
break;

View File

@ -47,6 +47,7 @@ public class Cocos2dxHelper {
private static Cocos2dxAccelerometer sCocos2dxAccelerometer;
private static boolean sAccelerometerEnabled;
private static String sPackageName;
private static String sCacheDirectory;
private static Cocos2dxHelperListener sCocos2dxHelperListener;
@ -60,6 +61,7 @@ public class Cocos2dxHelper {
Cocos2dxHelper.sCocos2dxHelperListener = pCocos2dxHelperListener;
Cocos2dxHelper.sPackageName = applicationInfo.packageName;
Cocos2dxHelper.sCacheDirectory = pContext.getCacheDir().getAbsolutePath();
Cocos2dxHelper.nativeSetApkPath(applicationInfo.sourceDir);
Cocos2dxHelper.nativeSetExternalAssetPath(Cocos2dxHelper.getAbsolutePathOnExternalStorage(applicationInfo, "assets/"));
@ -92,6 +94,10 @@ public class Cocos2dxHelper {
return Cocos2dxHelper.sPackageName;
}
public static String getCocos2dxCacheDirectory() {
return Cocos2dxHelper.sCacheDirectory;
}
public static String getCurrentLanguage() {
return Locale.getDefault().getLanguage();
}

View File

@ -28,6 +28,7 @@ import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.KeyEvent;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
@ -150,6 +151,10 @@ public class Cocos2dxTextInputWraper implements TextWatcher, OnEditorActionListe
}
*/
}
if (pActionID == EditorInfo.IME_ACTION_DONE) {
this.mCocos2dxGLSurfaceView.requestFocus();
}
return false;
}

View File

@ -21,7 +21,7 @@ using namespace std;
extern "C" {
string g_apkPath;
void Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetApkPath(JNIEnv* env, jobject thiz, jstring apkPath) {
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetApkPath(JNIEnv* env, jobject thiz, jstring apkPath) {
g_apkPath = JniHelper::jstring2string(apkPath);
}
@ -29,7 +29,7 @@ extern "C" {
return g_apkPath.c_str();
}
void Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetExternalAssetPath(JNIEnv* env, jobject thiz, jstring externalAssetPath) {
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetExternalAssetPath(JNIEnv* env, jobject thiz, jstring externalAssetPath) {
const char* externalAssetPathChars = env->GetStringUTFChars(externalAssetPath, NULL);
cocos2d::JniHelper::setExternalAssetPath(externalAssetPathChars);
env->ReleaseStringUTFChars(externalAssetPath, externalAssetPathChars);
@ -87,7 +87,7 @@ extern "C" {
}
}
void Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetEditTextDialogResult(JNIEnv * env, jobject obj, jbyteArray text) {
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxHelper_nativeSetEditTextDialogResult(JNIEnv * env, jobject obj, jbyteArray text) {
jsize size = env->GetArrayLength(text);
if (size > 0) {
@ -131,6 +131,22 @@ extern "C" {
return 0;
}
const char* getCacheDirectoryJNI() {
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "getCocos2dxCacheDirectory", "()Ljava/lang/String;")) {
jstring str = (jstring)t.env->CallStaticObjectMethod(t.classID, t.methodID);
t.env->DeleteLocalRef(t.classID);
CCString *ret = new CCString(JniHelper::jstring2string(str).c_str());
ret->autorelease();
t.env->DeleteLocalRef(str);
return ret->m_sString.c_str();
}
return 0;
}
const char* getCurrentLanguageJNI() {
JniMethodInfo t;

View File

@ -35,6 +35,7 @@ extern "C" {
extern void terminateProcessJNI();
extern const char * getCurrentLanguageJNI();
extern const char * getPackageNameJNI();
extern const char * getCacheDirectoryJNI();
extern void enableAccelerometerJNI();
extern void disableAccelerometerJNI();
extern void setAccelerometerIntervalJNI(float interval);

View File

@ -51,9 +51,6 @@ enum ccScriptType {
kScriptTypeJavascript
};
// #pragma mark -
// #pragma mark CCScriptHandlerEntry
class CCScriptHandlerEntry : public CCObject
{
public:
@ -86,9 +83,6 @@ protected:
* @{
*/
// #pragma mark -
// #pragma mark CCSchedulerScriptHandlerEntry
class CCSchedulerScriptHandlerEntry : public CCScriptHandlerEntry
{
public:
@ -128,8 +122,6 @@ private:
};
// #pragma mark -
// #pragma mark CCTouchScriptHandlerEntry
class CCTouchScriptHandlerEntry : public CCScriptHandlerEntry
{
@ -164,8 +156,6 @@ private:
bool m_bSwallowsTouches;
};
// #pragma mark -
// #pragma mark CCScriptEngineProtocol
// Don't make CCScriptEngineProtocol inherits from CCObject since setScriptEngine is invoked only once in AppDelegate.cpp,
// It will affect the lifecycle of ScriptCore instance, the autorelease pool will be destroyed before destructing ScriptCore.
@ -221,7 +211,7 @@ public:
/** execute a callfun event */
virtual int executeCallFuncActionEvent(CCCallFunc* pAction, CCObject* pTarget = NULL) = 0;
/** execute a schedule function */
virtual int executeSchedule(CCTimer* pTimer, float dt, CCNode* pNode = NULL) = 0;
virtual int executeSchedule(int nHandler, float dt, CCNode* pNode = NULL) = 0;
/** functions for executing touch event */
virtual int executeLayerTouchesEvent(CCLayer* pLayer, int eventType, CCSet *pTouches) = 0;

View File

@ -265,7 +265,7 @@ void RemoveTest::onEnter()
CCMoveBy* pMove = CCMoveBy::create(2, ccp(200, 0));
CCCallFunc* pCallback = CCCallFunc::create(this, callfunc_selector(RemoveTest::stopAction));
CCActionInterval* pSequence = (CCActionInterval*) CCSequence::create(pMove, pCallback, NULL);
CCActionInterval* pSequence = CCSequence::create(pMove, pCallback, NULL);
pSequence->setTag(kTagSequence);
CCSprite* pChild = CCSprite::create(s_pPathGrossini);

View File

@ -32,18 +32,18 @@ void SpriteEase::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
CCAction *a2 = m_grossini->runAction(CCRepeatForever::create((CCActionInterval*)seq1));
CCAction *a2 = m_grossini->runAction(CCRepeatForever::create(seq1));
a2->setTag(1);
CCAction *a1 = m_tamara->runAction(CCRepeatForever::create((CCActionInterval*)seq2));
CCAction *a1 = m_tamara->runAction(CCRepeatForever::create(seq2));
a1->setTag(1);
CCAction *a = m_kathia->runAction(CCRepeatForever::create((CCActionInterval*)seq3));
CCAction *a = m_kathia->runAction(CCRepeatForever::create(seq3));
a->setTag(1);
schedule(schedule_selector(SpriteEase::testStopAction), 6.25f);
@ -87,13 +87,13 @@ void SpriteEaseInOut::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create( move_ease_inout1, delay, move_ease_inout_back1, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create( move_ease_inout2, CCCA(delay), move_ease_inout_back2, CCCA(delay), NULL);
CCFiniteTimeAction* seq3 = CCSequence::create( move_ease_inout3, CCCA(delay), move_ease_inout_back3, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create( move_ease_inout1, delay, move_ease_inout_back1, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create( move_ease_inout2, CCCA(delay), move_ease_inout_back2, CCCA(delay), NULL);
CCSequence* seq3 = CCSequence::create( move_ease_inout3, CCCA(delay), move_ease_inout_back3, CCCA(delay), NULL);
m_tamara->runAction(CCRepeatForever::create((CCActionInterval*)seq1));
m_kathia->runAction(CCRepeatForever::create((CCActionInterval*)seq2));
m_grossini->runAction(CCRepeatForever::create((CCActionInterval*)seq3));
m_tamara->runAction(CCRepeatForever::create(seq1));
m_kathia->runAction(CCRepeatForever::create(seq2));
m_grossini->runAction(CCRepeatForever::create(seq3));
}
@ -123,14 +123,14 @@ void SpriteEaseExponential::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq1));
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq2));
m_kathia->runAction( CCRepeatForever::create((CCActionInterval*)seq3));
m_grossini->runAction( CCRepeatForever::create(seq1));
m_tamara->runAction( CCRepeatForever::create(seq2));
m_kathia->runAction( CCRepeatForever::create(seq3));
}
@ -156,13 +156,13 @@ void SpriteEaseExponentialInOut::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create( move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create( move_ease, delay, move_ease_back, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create( move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create( move_ease, delay, move_ease_back, CCCA(delay), NULL);
this->positionForTwo();
m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq1));
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq2));
m_grossini->runAction( CCRepeatForever::create(seq1));
m_tamara->runAction( CCRepeatForever::create(seq2));
}
@ -192,14 +192,14 @@ void SpriteEaseSine::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq1));
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq2));
m_kathia->runAction( CCRepeatForever::create((CCActionInterval*)seq3));
m_grossini->runAction( CCRepeatForever::create(seq1));
m_tamara->runAction( CCRepeatForever::create(seq2));
m_kathia->runAction( CCRepeatForever::create(seq3));
}
@ -226,13 +226,13 @@ void SpriteEaseSineInOut::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease, CCCA(delay), move_ease_back, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease, CCCA(delay), move_ease_back, CCCA(delay), NULL);
this->positionForTwo();
m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq1));
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq2));
m_grossini->runAction( CCRepeatForever::create(seq1));
m_tamara->runAction( CCRepeatForever::create(seq2));
}
@ -261,13 +261,13 @@ void SpriteEaseElastic::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq1));
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq2));
m_kathia->runAction( CCRepeatForever::create((CCActionInterval*)seq3));
m_grossini->runAction( CCRepeatForever::create(seq1));
m_tamara->runAction( CCRepeatForever::create(seq2));
m_kathia->runAction( CCRepeatForever::create(seq3));
}
@ -299,13 +299,13 @@ void SpriteEaseElasticInOut::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move_ease_inout1, delay, move_ease_inout_back1, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease_inout2, CCCA(delay), move_ease_inout_back2, CCCA(delay), NULL);
CCFiniteTimeAction* seq3 = CCSequence::create(move_ease_inout3, CCCA(delay), move_ease_inout_back3, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create(move_ease_inout1, delay, move_ease_inout_back1, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease_inout2, CCCA(delay), move_ease_inout_back2, CCCA(delay), NULL);
CCSequence* seq3 = CCSequence::create(move_ease_inout3, CCCA(delay), move_ease_inout_back3, CCCA(delay), NULL);
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq1));
m_kathia->runAction( CCRepeatForever::create((CCActionInterval*)seq2));
m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq3));
m_tamara->runAction( CCRepeatForever::create(seq1));
m_kathia->runAction( CCRepeatForever::create(seq2));
m_grossini->runAction( CCRepeatForever::create(seq3));
}
@ -336,13 +336,13 @@ void SpriteEaseBounce::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq1));
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq2));
m_kathia->runAction( CCRepeatForever::create((CCActionInterval*)seq3));
m_grossini->runAction( CCRepeatForever::create(seq1));
m_tamara->runAction( CCRepeatForever::create(seq2));
m_kathia->runAction( CCRepeatForever::create(seq3));
}
@ -370,13 +370,13 @@ void SpriteEaseBounceInOut::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease, CCCA(delay), move_ease_back, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease, CCCA(delay), move_ease_back, CCCA(delay), NULL);
this->positionForTwo();
m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq1));
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq2));
m_grossini->runAction( CCRepeatForever::create(seq1));
m_tamara->runAction( CCRepeatForever::create(seq2));
}
@ -406,13 +406,13 @@ void SpriteEaseBack::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
m_grossini->runAction(CCRepeatForever::create((CCActionInterval*)seq1));
m_tamara->runAction(CCRepeatForever::create((CCActionInterval*)seq2));
m_kathia->runAction(CCRepeatForever::create((CCActionInterval*)seq3));
m_grossini->runAction(CCRepeatForever::create(seq1));
m_tamara->runAction(CCRepeatForever::create(seq2));
m_kathia->runAction(CCRepeatForever::create(seq3));
}
@ -439,13 +439,13 @@ void SpriteEaseBackInOut::onEnter()
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease, CCCA(delay), move_ease_back, CCCA(delay), NULL);
CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease, CCCA(delay), move_ease_back, CCCA(delay), NULL);
this->positionForTwo();
m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq1));
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq2));
m_grossini->runAction( CCRepeatForever::create(seq1));
m_tamara->runAction( CCRepeatForever::create(seq2));
}
@ -472,10 +472,10 @@ void SpeedTest::onEnter()
CCActionInterval *rot1 = CCRotateBy::create(4, 360*2);
CCActionInterval *rot2 = rot1->reverse();
CCFiniteTimeAction* seq3_1 = CCSequence::create(jump2, jump1, NULL);
CCFiniteTimeAction* seq3_2 = CCSequence::create( rot1, rot2, NULL);
CCFiniteTimeAction* spawn = CCSpawn::create(seq3_1, seq3_2, NULL);
CCSpeed* action = CCSpeed::create(CCRepeatForever::create((CCActionInterval*)spawn), 1.0f);
CCSequence* seq3_1 = CCSequence::create(jump2, jump1, NULL);
CCSequence* seq3_2 = CCSequence::create( rot1, rot2, NULL);
CCSpawn* spawn = CCSpawn::create(seq3_1, seq3_2, NULL);
CCSpeed* action = CCSpeed::create(CCRepeatForever::create(spawn), 1.0f);
action->setTag(kTagAction1);
CCAction* action2 = (CCAction*)(action->copy()->autorelease());

View File

@ -598,7 +598,7 @@ void ActionBezier::onEnter()
CCActionInterval* bezierForward = CCBezierBy::create(3, bezier);
CCActionInterval* bezierBack = bezierForward->reverse();
CCAction* rep = CCRepeatForever::create((CCActionInterval*)CCSequence::create( bezierForward, bezierBack, NULL));
CCAction* rep = CCRepeatForever::create(CCSequence::create( bezierForward, bezierBack, NULL));
// sprite 2
@ -1028,7 +1028,7 @@ void ActionRotateToRepeat::onEnter()
CCActionInterval* act1 = CCRotateTo::create(1, 90);
CCActionInterval* act2 = CCRotateTo::create(1, 0);
CCActionInterval* seq = (CCActionInterval*)(CCSequence::create(act1, act2, NULL));
CCActionInterval* seq = CCSequence::create(act1, act2, NULL);
CCAction* rep1 = CCRepeatForever::create(seq);
CCActionInterval* rep2 = CCRepeat::create((CCFiniteTimeAction*)(seq->copy()->autorelease()), 10);
@ -1162,7 +1162,7 @@ void ActionReverseSequence2::onEnter()
tog1->autorelease();
tog2->autorelease();
CCFiniteTimeAction* seq = CCSequence::create( move1, tog1, move2, tog2, move1->reverse(), NULL);
CCActionInterval* action = CCRepeat::create((CCActionInterval*)(CCSequence::create( seq, seq->reverse(), NULL)), 3);
CCActionInterval* action = CCRepeat::create(CCSequence::create( seq, seq->reverse(), NULL), 3);
@ -1172,8 +1172,7 @@ void ActionReverseSequence2::onEnter()
CCActionInterval* move_tamara = CCMoveBy::create(1, ccp(100,0));
CCActionInterval* move_tamara2 = CCMoveBy::create(1, ccp(50,0));
CCActionInstant* hide = new CCHide();
hide->autorelease();
CCActionInstant* hide = CCHide::create();
CCFiniteTimeAction* seq_tamara = CCSequence::create( move_tamara, hide, move_tamara2, NULL);
CCFiniteTimeAction* seq_back = seq_tamara->reverse();
m_tamara->runAction( CCSequence::create( seq_tamara, seq_back, NULL));
@ -1200,7 +1199,7 @@ void ActionRepeat::onEnter()
CCSequence::create( CCPlace::create(ccp(60,60)), a1, NULL) ,
3);
CCAction* action2 = CCRepeatForever::create(
(CCActionInterval*)(CCSequence::create((CCActionInterval*)(a1->copy()->autorelease()), a1->reverse(), NULL))
CCSequence::create((CCActionInterval*)(a1->copy()->autorelease()), a1->reverse(), NULL)
);
m_kathia->runAction(action1);
@ -1224,31 +1223,31 @@ void ActionOrbit::onEnter()
centerSprites(3);
CCActionInterval* orbit1 = CCOrbitCamera::create(2,1, 0, 0, 180, 0, 0);
CCFiniteTimeAction* action1 = CCSequence::create(
CCSequence* action1 = CCSequence::create(
orbit1,
orbit1->reverse(),
NULL);
CCActionInterval* orbit2 = CCOrbitCamera::create(2,1, 0, 0, 180, -45, 0);
CCFiniteTimeAction* action2 = CCSequence::create(
CCSequence* action2 = CCSequence::create(
orbit2,
orbit2->reverse(),
NULL);
CCActionInterval* orbit3 = CCOrbitCamera::create(2,1, 0, 0, 180, 90, 0);
CCFiniteTimeAction* action3 = CCSequence::create(
CCSequence* action3 = CCSequence::create(
orbit3,
orbit3->reverse(),
NULL);
m_kathia->runAction(CCRepeatForever::create((CCActionInterval*)action1));
m_tamara->runAction(CCRepeatForever::create((CCActionInterval*)action2));
m_grossini->runAction(CCRepeatForever::create((CCActionInterval*)action3));
m_kathia->runAction(CCRepeatForever::create(action1));
m_tamara->runAction(CCRepeatForever::create(action2));
m_grossini->runAction(CCRepeatForever::create(action3));
CCActionInterval* move = CCMoveBy::create(3, ccp(100,-100));
CCActionInterval* move_back = move->reverse();
CCFiniteTimeAction* seq = CCSequence::create(move, move_back, NULL);
CCAction* rfe = CCRepeatForever::create((CCActionInterval*)seq);
CCSequence* seq = CCSequence::create(move, move_back, NULL);
CCAction* rfe = CCRepeatForever::create(seq);
m_kathia->runAction(rfe);
m_tamara->runAction((CCAction*)(rfe->copy()->autorelease()));
m_grossini->runAction((CCAction*)(rfe->copy()->autorelease()));
@ -1274,8 +1273,8 @@ void ActionFollow::onEnter()
m_grossini->setPosition(ccp(-200, s.height / 2));
CCActionInterval* move = CCMoveBy::create(2, ccp(s.width * 3, 0));
CCActionInterval* move_back = move->reverse();
CCFiniteTimeAction* seq = CCSequence::create(move, move_back, NULL);
CCAction* rep = CCRepeatForever::create((CCActionInterval*)seq);
CCSequence* seq = CCSequence::create(move, move_back, NULL);
CCAction* rep = CCRepeatForever::create(seq);
m_grossini->runAction(rep);

View File

@ -34,10 +34,10 @@ bool Bug1159Layer::init()
sprite_a->setPosition(ccp(0.0f, s.height/2));
addChild(sprite_a);
sprite_a->runAction(CCRepeatForever::create((CCActionInterval*) CCSequence::create(
CCMoveTo::create(1.0f, ccp(1024.0f, 384.0f)),
CCMoveTo::create(1.0f, ccp(0.0f, 384.0f)),
NULL)));
sprite_a->runAction(CCRepeatForever::create(CCSequence::create(
CCMoveTo::create(1.0f, ccp(1024.0f, 384.0f)),
CCMoveTo::create(1.0f, ccp(0.0f, 384.0f)),
NULL)));
CCLayerColor *sprite_b = CCLayerColor::create(ccc4(0, 0, 255, 255), 400, 400);
sprite_b->setAnchorPoint(ccp(0.5f, 0.5f));

View File

@ -29,12 +29,12 @@ MainLayer::MainLayer()
sprite->runAction( CCJumpTo::create(4, ccp(300,48), 100, 4) );
layer->runAction( CCRepeatForever::create(
(CCActionInterval*)( CCSequence::create(
CCFadeIn::create(1),
CCFadeOut::create(1),
NULL) )
) );
layer->runAction( CCRepeatForever::create(
CCSequence::create(
CCFadeIn::create(1),
CCFadeOut::create(1),
NULL)
));
}
void MainLayer::ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent)

View File

@ -217,7 +217,7 @@ CCAction* BasicTest::actionRotate()
CCAction* BasicTest::actionScale()
{
CCScaleBy *scale = CCScaleBy::create(1.33f, 1.5f);
return CCRepeatForever::create((CCActionInterval*)CCSequence::create(scale, scale->reverse(), NULL));
return CCRepeatForever::create(CCSequence::create(scale, scale->reverse(), NULL));
}
CCDrawNode* BasicTest::shape()

View File

@ -37,7 +37,7 @@ void Effect1::onEnter()
CCActionInterval* orbit = CCOrbitCamera::create(5, 1, 2, 0, 180, 0, -90);
CCActionInterval* orbit_back = orbit->reverse();
target->runAction( CCRepeatForever::create( (CCActionInterval *)(CCSequence::create( orbit, orbit_back, NULL) ) ) );
target->runAction( CCRepeatForever::create( CCSequence::create( orbit, orbit_back, NULL) ) );
target->runAction( CCSequence::create(lens, delay, reuse, waves, NULL) );
}
@ -79,7 +79,7 @@ void Effect2::onEnter()
// id orbit_back = [orbit reverse];
//
// [target runAction: [RepeatForever::create: [Sequence actions: orbit, orbit_back, nil]]];
target->runAction( (CCActionInterval *)(CCSequence::create( shaky, delay, reuse, shuffle, delay->copy()->autorelease(), turnoff, turnon, NULL) ) );
target->runAction(CCSequence::create( shaky, delay, reuse, shuffle, delay->copy()->autorelease(), turnoff, turnon, NULL) );
}
std::string Effect2::title()
@ -109,7 +109,7 @@ void Effect3::onEnter()
// moving background. Testing issue #244
CCActionInterval* move = CCMoveBy::create(3, ccp(200,0) );
bg->runAction(CCRepeatForever::create( (CCActionInterval *)(CCSequence::create(move, move->reverse(), NULL) ) ) );
bg->runAction(CCRepeatForever::create( CCSequence::create(move, move->reverse(), NULL) ));
}
std::string Effect3::title()
@ -155,7 +155,7 @@ void Effect4::onEnter()
CCLens3D* lens = CCLens3D::create(ccp(100,180), 150, ccg(32,24), 10);
CCActionInterval* move = CCJumpBy::create(5, ccp(380,0), 100, 4);
CCActionInterval* move_back = move->reverse();
CCActionInterval* seq = (CCActionInterval *)(CCSequence::create( move, move_back, NULL));
CCActionInterval* seq = CCSequence::create( move, move_back, NULL);
/* In cocos2d-iphone, the type of action's target is 'id', so it supports using the instance of 'CCLens3D' as its target.
While in cocos2d-x, the target of action only supports CCNode or its subclass,
@ -189,13 +189,13 @@ void Effect5::onEnter()
CCActionInterval* effect = CCLiquid::create(1, 20, ccg(32,24), 2);
CCActionInterval* stopEffect = (CCActionInterval *)( CCSequence::create(
CCActionInterval* stopEffect = CCSequence::create(
effect,
CCDelayTime::create(2),
CCStopGrid::create(),
// [DelayTime::create:2],
// [[effect copy] autorelease],
NULL) );
NULL);
CCNode* bg = getChildByTag(kTagBackground);
bg->runAction(stopEffect);
@ -222,7 +222,7 @@ void Issue631::onEnter()
{
EffectAdvanceTextLayer::onEnter();
CCActionInterval* effect = (CCActionInterval*)(CCSequence::create( CCDelayTime::create(2.0f), CCShaky3D::create(16, false, ccg(5, 5), 5.0f), NULL));
CCActionInterval* effect = CCSequence::create( CCDelayTime::create(2.0f), CCShaky3D::create(16, false, ccg(5, 5), 5.0f), NULL);
// cleanup
CCNode* bg = getChildByTag(kTagBackground);
@ -339,14 +339,14 @@ void EffectAdvanceTextLayer::onEnter(void)
grossini->setPosition( ccp(VisibleRect::left().x+VisibleRect::getVisibleRect().size.width/3.0f, VisibleRect::bottom().y+ 200) );
CCActionInterval* sc = CCScaleBy::create(2, 5);
CCActionInterval* sc_back = sc->reverse();
grossini->runAction( CCRepeatForever::create( (CCActionInterval*)(CCSequence::create(sc, sc_back, NULL)) ) );
grossini->runAction( CCRepeatForever::create(CCSequence::create(sc, sc_back, NULL) ) );
CCSprite* tamara = CCSprite::create("Images/grossinis_sister1.png");
bg->addChild(tamara, 1, kTagSprite2);
tamara->setPosition( ccp(VisibleRect::left().x+2*VisibleRect::getVisibleRect().size.width/3.0f,VisibleRect::bottom().y+200) );
CCActionInterval* sc2 = CCScaleBy::create(2, 5);
CCActionInterval* sc2_back = sc2->reverse();
tamara->runAction( CCRepeatForever::create( (CCActionInterval*)(CCSequence::create(sc2, sc2_back, NULL)) ) );
tamara->runAction( CCRepeatForever::create(CCSequence::create(sc2, sc2_back, NULL) ) );
CCLabelTTF* label = CCLabelTTF::create(title().c_str(), "Marker Felt", 28);

View File

@ -63,7 +63,7 @@ public:
CCActionInterval* flipx_back = flipx->reverse();
CCDelayTime* delay = CCDelayTime::create(2);
return (CCActionInterval*)(CCSequence::create(flipx, delay, flipx_back, NULL));
return CCSequence::create(flipx, delay, flipx_back, NULL);
}
};
@ -76,7 +76,7 @@ public:
CCActionInterval* flipy_back = flipy->reverse();
CCDelayTime* delay = CCDelayTime::create(2);
return (CCActionInterval*)(CCSequence::create(flipy, delay, flipy_back, NULL));
return CCSequence::create(flipy, delay, flipy_back, NULL);
}
};
@ -162,7 +162,7 @@ public:
CCActionInterval* shuffle_back = shuffle->reverse();
CCDelayTime* delay = CCDelayTime::create(2);
return (CCActionInterval*)(CCSequence::create(shuffle, delay, shuffle_back, NULL));
return CCSequence::create(shuffle, delay, shuffle_back, NULL);
}
};
@ -176,7 +176,7 @@ public:
CCActionInterval* back = fadeout->reverse();
CCDelayTime* delay = CCDelayTime::create(0.5f);
return (CCActionInterval*)(CCSequence::create(fadeout, delay, back, NULL));
return CCSequence::create(fadeout, delay, back, NULL);
}
};
@ -190,7 +190,7 @@ public:
CCActionInterval* back = fadeout->reverse();
CCDelayTime* delay = CCDelayTime::create(0.5f);
return (CCActionInterval*)(CCSequence::create(fadeout, delay, back, NULL));
return CCSequence::create(fadeout, delay, back, NULL);
}
};
@ -204,7 +204,7 @@ public:
CCActionInterval* back = fadeout->reverse();
CCDelayTime* delay = CCDelayTime::create(0.5f);
return (CCActionInterval*)(CCSequence::create(fadeout, delay, back, NULL));
return CCSequence::create(fadeout, delay, back, NULL);
}
};
@ -217,7 +217,7 @@ public:
CCActionInterval* back = fadeout->reverse();
CCDelayTime* delay = CCDelayTime::create(0.5f);
return (CCActionInterval*)(CCSequence::create(fadeout, delay, back, NULL));
return CCSequence::create(fadeout, delay, back, NULL);
}
};
@ -230,7 +230,7 @@ public:
CCActionInterval* back = fadeout->reverse();
CCDelayTime* delay = CCDelayTime::create(0.5f);
return (CCActionInterval*)(CCSequence::create(fadeout, delay, back, NULL));
return CCSequence::create(fadeout, delay, back, NULL);
}
};
@ -356,14 +356,14 @@ TextLayer::TextLayer(void)
grossini->setPosition( ccp(VisibleRect::left().x+VisibleRect::getVisibleRect().size.width/3,VisibleRect::center().y) );
CCActionInterval* sc = CCScaleBy::create(2, 5);
CCActionInterval* sc_back = sc->reverse();
grossini->runAction( CCRepeatForever::create((CCActionInterval*)(CCSequence::create(sc, sc_back, NULL)) ) );
grossini->runAction( CCRepeatForever::create(CCSequence::create(sc, sc_back, NULL) ) );
CCSprite* tamara = CCSprite::create(s_pPathSister1);
node->addChild(tamara, 1);
tamara->setPosition( ccp(VisibleRect::left().x+2*VisibleRect::getVisibleRect().size.width/3,VisibleRect::center().y) );
CCActionInterval* sc2 = CCScaleBy::create(2, 5);
CCActionInterval* sc2_back = sc2->reverse();
tamara->runAction( CCRepeatForever::create((CCActionInterval*)(CCSequence::create(sc2, sc2_back, NULL))) );
tamara->runAction( CCRepeatForever::create(CCSequence::create(sc2, sc2_back, NULL)) );
CCLabelTTF* label = CCLabelTTF::create((effectsList[actionIdx]).c_str(), "Marker Felt", 32);

View File

@ -55,10 +55,7 @@ IntervalLayer::IntervalLayer()
CCJumpBy* jump = CCJumpBy::create(3, ccp(s.width-80,0), 50, 4);
addChild(sprite);
sprite->runAction( CCRepeatForever::create(
(CCActionInterval*)(CCSequence::create(jump, jump->reverse(), NULL ))
)
);
sprite->runAction( CCRepeatForever::create(CCSequence::create(jump, jump->reverse(), NULL) ));
// pause button
CCMenuItem* item1 = CCMenuItemFont::create("Pause", this, menu_selector(IntervalLayer::onPause) );
CCMenu* menu = CCMenu::create(item1, NULL);

View File

@ -329,8 +329,8 @@ LabelAtlasColorTest::LabelAtlasColorTest()
CCActionInterval* fade = CCFadeOut::create(1.0f);
CCActionInterval* fade_in = fade->reverse();
CCFiniteTimeAction* seq = CCSequence::create(fade, fade_in, NULL);
CCAction* repeat = CCRepeatForever::create( (CCActionInterval*)seq );
CCSequence* seq = CCSequence::create(fade, fade_in, NULL);
CCAction* repeat = CCRepeatForever::create( seq );
label2->runAction( repeat );
m_time = 0;
@ -425,8 +425,8 @@ Atlas3::Atlas3()
addChild(label1, 0, kTagBitmapAtlas1);
CCActionInterval* fade = CCFadeOut::create(1.0f);
CCActionInterval* fade_in = fade->reverse();
CCFiniteTimeAction* seq = CCSequence::create(fade, fade_in, NULL);
CCAction* repeat = CCRepeatForever::create((CCActionInterval*)seq);
CCSequence* seq = CCSequence::create(fade, fade_in, NULL);
CCAction* repeat = CCRepeatForever::create(seq);
label1->runAction(repeat);
@ -519,16 +519,16 @@ Atlas4::Atlas4()
CCActionInterval* scale = CCScaleBy::create(2, 1.5f);
CCActionInterval* scale_back = scale->reverse();
CCFiniteTimeAction* scale_seq = CCSequence::create(scale, scale_back,NULL);
CCAction* scale_4ever = CCRepeatForever::create((CCActionInterval*)scale_seq);
CCSequence* scale_seq = CCSequence::create(scale, scale_back,NULL);
CCAction* scale_4ever = CCRepeatForever::create(scale_seq);
CCActionInterval* jump = CCJumpBy::create(0.5f, CCPointZero, 60, 1);
CCAction* jump_4ever = CCRepeatForever::create(jump);
CCActionInterval* fade_out = CCFadeOut::create(1);
CCActionInterval* fade_in = CCFadeIn::create(1);
CCFiniteTimeAction* seq = CCSequence::create(fade_out, fade_in, NULL);
CCAction* fade_4ever = CCRepeatForever::create((CCActionInterval*)seq);
CCSequence* seq = CCSequence::create(fade_out, fade_in, NULL);
CCAction* fade_4ever = CCRepeatForever::create(seq);
BChar->runAction(rot_4ever);
BChar->runAction(scale_4ever);
@ -1352,8 +1352,8 @@ LabelTTFA8Test::LabelTTFA8Test()
CCFadeOut *fadeOut = CCFadeOut::create(2);
CCFadeIn *fadeIn = CCFadeIn::create(2);
CCFiniteTimeAction *seq = CCSequence::create(fadeOut, fadeIn, NULL);
CCRepeatForever *forever = CCRepeatForever::create((CCActionInterval *)seq);
CCSequence *seq = CCSequence::create(fadeOut, fadeIn, NULL);
CCRepeatForever *forever = CCRepeatForever::create(seq);
label1->runAction(forever);
}

View File

@ -219,12 +219,12 @@ void LayerTest2::onEnter()
CCActionInterval* actionTint = CCTintBy::create(2, -255, -127, 0);
CCActionInterval* actionTintBack = actionTint->reverse();
CCActionInterval* seq1 = (CCActionInterval*)CCSequence::create( actionTint, actionTintBack, NULL);
CCActionInterval* seq1 = CCSequence::create( actionTint, actionTintBack, NULL);
layer1->runAction(seq1);
CCActionInterval* actionFade = CCFadeOut::create(2.0f);
CCActionInterval* actionFadeBack = actionFade->reverse();
CCActionInterval* seq2 = (CCActionInterval*)CCSequence::create(actionFade, actionFadeBack, NULL);
CCActionInterval* seq2 = CCSequence::create(actionFade, actionFadeBack, NULL);
layer2->runAction(seq2);
}
@ -357,7 +357,7 @@ void LayerIgnoreAnchorPointPos::onEnter()
CCMoveBy *move = CCMoveBy::create(2, ccp(100,2));
CCMoveBy * back = (CCMoveBy *)move->reverse();
CCSequence *seq = (CCSequence *)CCSequence::create(move, back, NULL);
CCSequence *seq = CCSequence::create(move, back, NULL);
l->runAction(CCRepeatForever::create(seq));
this->addChild(l, 0, kLayerIgnoreAnchorPoint);
@ -454,7 +454,7 @@ void LayerIgnoreAnchorPointScale::onEnter()
CCScaleBy *scale = CCScaleBy::create(2, 2);
CCScaleBy* back = (CCScaleBy*)scale->reverse();
CCSequence *seq = (CCSequence*)CCSequence::create(scale, back, NULL);
CCSequence *seq = CCSequence::create(scale, back, NULL);
l->runAction(CCRepeatForever::create(seq));

View File

@ -70,8 +70,8 @@ MenuLayerMainMenu::MenuLayerMainMenu()
CCActionInterval* color_action = CCTintBy::create(0.5f, 0, -255, -255);
CCActionInterval* color_back = color_action->reverse();
CCFiniteTimeAction* seq = CCSequence::create(color_action, color_back, NULL);
item8->runAction(CCRepeatForever::create((CCActionInterval*)seq));
CCSequence* seq = CCSequence::create(color_action, color_back, NULL);
item8->runAction(CCRepeatForever::create(seq));
CCMenu* menu = CCMenu::create( item1, item2, item3, item4, item5, item6, item7, item8, NULL);
menu->alignItemsVertically();
@ -327,10 +327,8 @@ MenuLayer3::MenuLayer3()
item3->setPosition( ccp(s.width/2, s.height/2 - 100) );
CCJumpBy* jump = CCJumpBy::create(3, ccp(400,0), 50, 4);
item2->runAction( CCRepeatForever::create(
(CCActionInterval*)(CCSequence::create( jump, jump->reverse(), NULL))
)
);
item2->runAction( CCRepeatForever::create(CCSequence::create( jump, jump->reverse(), NULL)));
CCActionInterval* spin1 = CCRotateBy::create(3, 360);
CCActionInterval* spin2 = (CCActionInterval*)(spin1->copy()->autorelease());
CCActionInterval* spin3 = (CCActionInterval*)(spin1->copy()->autorelease());
@ -515,7 +513,7 @@ void MenuLayerPriorityTest::disableMenuCallback(CCObject* pSender)
CCDelayTime *wait = CCDelayTime::create(5);
CCCallFunc *enable = CCCallFunc::create(this, callfunc_selector(MenuLayerPriorityTest::enableMenuCallback));
CCFiniteTimeAction* seq = CCSequence::create(wait, enable, NULL);
CCSequence* seq = CCSequence::create(wait, enable, NULL);
m_pMenu1->runAction(seq);
}

View File

@ -43,10 +43,10 @@ void MotionStreakTest1::onEnter()
CCAction* action1 = CCRepeatForever::create(a1);
CCActionInterval* motion = CCMoveBy::create(2, ccp(100,0) );
m_root->runAction( CCRepeatForever::create((CCActionInterval*)(CCSequence::create(motion, motion->reverse(), NULL)) ) );
m_root->runAction( CCRepeatForever::create(CCSequence::create(motion, motion->reverse(), NULL) ) );
m_root->runAction( action1 );
CCActionInterval *colorAction = CCRepeatForever::create((CCActionInterval *)CCSequence::create(
CCActionInterval *colorAction = CCRepeatForever::create(CCSequence::create(
CCTintTo::create(0.2f, 255, 0, 0),
CCTintTo::create(0.2f, 0, 255, 0),
CCTintTo::create(0.2f, 0, 0, 255),

View File

@ -186,15 +186,13 @@ void Test2::onEnter()
CCActionInterval* a1 = CCRotateBy::create(2, 360);
CCActionInterval* a2 = CCScaleBy::create(2, 2);
CCAction* action1 = CCRepeatForever::create(
(CCActionInterval*)(CCSequence::create(a1, a2, a2->reverse(), NULL))
);
CCAction* action1 = CCRepeatForever::create( CCSequence::create(a1, a2, a2->reverse(), NULL) );
CCAction* action2 = CCRepeatForever::create(
(CCActionInterval*)(CCSequence::create(
(CCActionInterval*)(a1->copy()->autorelease()),
(CCActionInterval*)(a2->copy()->autorelease()),
a2->reverse(),
NULL) )
CCSequence::create(
(CCActionInterval*)(a1->copy()->autorelease()),
(CCActionInterval*)(a2->copy()->autorelease()),
a2->reverse(),
NULL)
);
sp2->setAnchorPoint(ccp(0,0));
@ -266,9 +264,7 @@ Test5::Test5()
CCRotateBy* rot = CCRotateBy::create(2, 360);
CCActionInterval* rot_back = rot->reverse();
CCAction* forever = CCRepeatForever::create(
(CCActionInterval*)(CCSequence::create(rot, rot_back, NULL))
);
CCAction* forever = CCRepeatForever::create(CCSequence::create(rot, rot_back, NULL));
CCAction* forever2 = (CCAction*)(forever->copy()->autorelease());
forever->setTag(101);
forever2->setTag(102);
@ -323,8 +319,7 @@ Test6::Test6()
CCActionInterval* rot = CCRotateBy::create(2, 360);
CCActionInterval* rot_back = rot->reverse();
CCAction* forever1 = CCRepeatForever::create(
(CCActionInterval*)(CCSequence::create(rot, rot_back, NULL)));
CCAction* forever1 = CCRepeatForever::create(CCSequence::create(rot, rot_back, NULL));
CCAction* forever11 = (CCAction*)(forever1->copy()->autorelease());
CCAction* forever2 = (CCAction*)(forever1->copy()->autorelease());
@ -437,8 +432,8 @@ StressTest2::StressTest2()
CCActionInterval* move = CCMoveBy::create(3, ccp(350,0));
CCActionInterval* move_ease_inout3 = CCEaseInOut::create((CCActionInterval*)(move->copy()->autorelease()), 2.0f);
CCActionInterval* move_ease_inout_back3 = move_ease_inout3->reverse();
CCFiniteTimeAction* seq3 = CCSequence::create( move_ease_inout3, move_ease_inout_back3, NULL);
sp1->runAction( CCRepeatForever::create((CCActionInterval*)seq3) );
CCSequence* seq3 = CCSequence::create( move_ease_inout3, move_ease_inout_back3, NULL);
sp1->runAction( CCRepeatForever::create(seq3) );
sublayer->addChild(sp1, 1);
CCParticleFire* fire = CCParticleFire::create();
@ -527,8 +522,8 @@ NodeToWorld::NodeToWorld()
CCActionInterval* move = CCMoveBy::create(3, ccp(200,0));
CCActionInterval* move_back = move->reverse();
CCFiniteTimeAction* seq = CCSequence::create( move, move_back, NULL);
CCAction* fe2 = CCRepeatForever::create((CCActionInterval*)seq);
CCSequence* seq = CCSequence::create( move, move_back, NULL);
CCAction* fe2 = CCRepeatForever::create(seq);
back->runAction(fe2);
}

View File

@ -68,8 +68,8 @@ Parallax1::Parallax1()
CCActionInterval* goDown = goUp->reverse();
CCActionInterval* go = CCMoveBy::create(8, ccp(-1000,0) );
CCActionInterval* goBack = go->reverse();
CCFiniteTimeAction* seq = CCSequence::create(goUp, go, goDown, goBack, NULL);
voidNode->runAction( (CCRepeatForever::create((CCActionInterval*) seq) ));
CCSequence* seq = CCSequence::create(goUp, go, goDown, goBack, NULL);
voidNode->runAction( (CCRepeatForever::create(seq) ));
addChild( voidNode );
}

View File

@ -622,8 +622,8 @@ void ParallaxParticle::onEnter()
CCActionInterval* move = CCMoveBy::create(4, ccp(300,0));
CCActionInterval* move_back = move->reverse();
CCFiniteTimeAction* seq = CCSequence::create( move, move_back, NULL);
p->runAction(CCRepeatForever::create((CCActionInterval*)seq));
CCSequence* seq = CCSequence::create( move, move_back, NULL);
p->runAction(CCRepeatForever::create(seq));
}
std::string ParallaxParticle::title()
@ -1117,8 +1117,8 @@ void ParticleDemo::onEnter(void)
CCActionInterval* move = CCMoveBy::create(4, ccp(300,0) );
CCActionInterval* move_back = move->reverse();
CCFiniteTimeAction* seq = CCSequence::create( move, move_back, NULL);
m_background->runAction( CCRepeatForever::create((CCActionInterval*)seq) );
CCSequence* seq = CCSequence::create( move, move_back, NULL);
m_background->runAction( CCRepeatForever::create(seq) );
scheduleUpdate();

View File

@ -416,12 +416,12 @@ void performanceActions(CCSprite* pSprite)
float period = 0.5f + (rand() % 1000) / 500.0f;
CCRotateBy* rot = CCRotateBy::create(period, 360.0f * CCRANDOM_0_1());
CCActionInterval* rot_back = rot->reverse();
CCAction *permanentRotation = CCRepeatForever::create((CCActionInterval *)CCSequence::create(rot, rot_back, NULL));
CCAction *permanentRotation = CCRepeatForever::create(CCSequence::create(rot, rot_back, NULL));
pSprite->runAction(permanentRotation);
float growDuration = 0.5f + (rand() % 1000) / 500.0f;
CCActionInterval *grow = CCScaleBy::create(growDuration, 0.5f, 0.5f);
CCAction *permanentScaleLoop = CCRepeatForever::create((CCActionInterval *)CCSequence::create(grow, grow->reverse(), NULL));
CCAction *permanentScaleLoop = CCRepeatForever::create(CCSequence::create(grow, grow->reverse(), NULL));
pSprite->runAction(permanentScaleLoop);
}
@ -436,7 +436,7 @@ void performanceActions20(CCSprite* pSprite)
float period = 0.5f + (rand() % 1000) / 500.0f;
CCRotateBy* rot = CCRotateBy::create(period, 360.0f * CCRANDOM_0_1());
CCActionInterval* rot_back = rot->reverse();
CCAction *permanentRotation = CCRepeatForever::create((CCActionInterval *)CCSequence::create(rot, rot_back, NULL));
CCAction *permanentRotation = CCRepeatForever::create(CCSequence::create(rot, rot_back, NULL));
pSprite->runAction(permanentRotation);
float growDuration = 0.5f + (rand() % 1000) / 500.0f;

View File

@ -916,8 +916,8 @@ void SchedulerTimeScale::onEnter()
CCActionInterval *rot1 = CCRotateBy::create(4, 360*2);
CCActionInterval *rot2 = rot1->reverse();
CCFiniteTimeAction* seq3_1 = CCSequence::create(jump2, jump1, NULL);
CCFiniteTimeAction* seq3_2 = CCSequence::create(rot1, rot2, NULL);
CCSequence* seq3_1 = CCSequence::create(jump2, jump1, NULL);
CCSequence* seq3_2 = CCSequence::create(rot1, rot2, NULL);
CCFiniteTimeAction* spawn = CCSpawn::create(seq3_1, seq3_2, NULL);
CCRepeat* action = CCRepeat::create(spawn, 50);
@ -1010,8 +1010,8 @@ void TwoSchedulers::onEnter()
CCActionInterval *jump1 = CCJumpBy::create(4, ccp(0,0), 100, 4);
CCActionInterval *jump2 = jump1->reverse();
CCFiniteTimeAction* seq = CCSequence::create(jump2, jump1, NULL);
CCRepeatForever* action = CCRepeatForever::create((CCActionInterval *)seq);
CCSequence* seq = CCSequence::create(jump2, jump1, NULL);
CCRepeatForever* action = CCRepeatForever::create(seq);
//
// Center

View File

@ -1 +1 @@
d5652fa016340526f06bc8b58ec78bef1c779a36
b7746fdbd6cb5580fd339b86c93a81167b14e96c

View File

@ -321,7 +321,7 @@ void TextFieldTTFActionTest::onEnter()
m_nCharLimit = 12;
m_pTextFieldAction = CCRepeatForever::create(
(CCActionInterval*)CCSequence::create(
CCSequence::create(
CCFadeOut::create(0.25),
CCFadeIn::create(0.25),
0

View File

@ -328,8 +328,8 @@ void TextureMipMap::onEnter()
scale2->autorelease();
CCActionInterval* sc_back2 = scale2->reverse();
img0->runAction(CCRepeatForever::create((CCActionInterval*)(CCSequence::create(scale1, sc_back, NULL))));
img1->runAction(CCRepeatForever::create((CCActionInterval*)(CCSequence::create(scale2, sc_back2, NULL))));
img0->runAction(CCRepeatForever::create(CCSequence::create(scale1, sc_back, NULL)));
img1->runAction(CCRepeatForever::create(CCSequence::create(scale2, sc_back2, NULL)));
CCTextureCache::sharedTextureCache()->dumpCachedTextureInfo();
}
@ -379,8 +379,8 @@ void TexturePVRMipMap::onEnter()
scale2->autorelease();
CCActionInterval* sc_back2 = scale2->reverse();
imgMipMap->runAction(CCRepeatForever::create((CCActionInterval*)(CCSequence::create(scale1, sc_back, NULL))));
img->runAction(CCRepeatForever::create((CCActionInterval*)(CCSequence::create(scale2, sc_back2, NULL))));
imgMipMap->runAction(CCRepeatForever::create(CCSequence::create(scale1, sc_back, NULL)));
img->runAction(CCRepeatForever::create(CCSequence::create(scale2, sc_back2, NULL)));
}
CCTextureCache::sharedTextureCache()->dumpCachedTextureInfo();
}
@ -423,8 +423,8 @@ void TexturePVRMipMap2::onEnter()
scale2->autorelease();
CCActionInterval* sc_back2 = scale2->reverse();
imgMipMap->runAction(CCRepeatForever::create((CCActionInterval*)(CCSequence::create(scale1, sc_back, NULL))));
img->runAction(CCRepeatForever::create((CCActionInterval*)(CCSequence::create(scale2, sc_back2, NULL))));
imgMipMap->runAction(CCRepeatForever::create(CCSequence::create(scale1, sc_back, NULL)));
img->runAction(CCRepeatForever::create(CCSequence::create(scale2, sc_back2, NULL)));
CCTextureCache::sharedTextureCache()->dumpCachedTextureInfo();
}
@ -1321,7 +1321,7 @@ void TextureAlias::onEnter()
// scale them to show
CCScaleBy* sc = CCScaleBy::create(3, 8.0f);
CCScaleBy* sc_back = (CCScaleBy*) (sc->reverse());
CCRepeatForever* scaleforever = CCRepeatForever::create((CCActionInterval*) (CCSequence::create(sc, sc_back, NULL)));
CCRepeatForever* scaleforever = CCRepeatForever::create(CCSequence::create(sc, sc_back, NULL));
CCRepeatForever* scaleToo = (CCRepeatForever*) (scaleforever->copy());
scaleToo->autorelease();
@ -1420,8 +1420,8 @@ void TexturePixelFormat::onEnter()
CCFadeOut* fadeout = CCFadeOut::create(2);
CCFadeIn* fadein = CCFadeIn::create(2);
CCFiniteTimeAction* seq = CCSequence::create(CCDelayTime::create(2), fadeout, fadein, NULL);
CCRepeatForever* seq_4ever = CCRepeatForever::create((CCActionInterval*) seq);
CCSequence* seq = CCSequence::create(CCDelayTime::create(2), fadeout, fadein, NULL);
CCRepeatForever* seq_4ever = CCRepeatForever::create(seq);
CCRepeatForever* seq_4ever2 = (CCRepeatForever*) (seq_4ever->copy()); seq_4ever2->autorelease();
CCRepeatForever* seq_4ever3 = (CCRepeatForever*) (seq_4ever->copy()); seq_4ever3->autorelease();
CCRepeatForever* seq_4ever4 = (CCRepeatForever*) (seq_4ever->copy()); seq_4ever4->autorelease();
@ -1516,7 +1516,7 @@ void TextureAsync::onEnter()
CCScaleBy* scale = CCScaleBy::create(0.3f, 2);
CCScaleBy* scale_back = (CCScaleBy*)scale->reverse();
CCSequence* seq = (CCSequence*)CCSequence::create(scale, scale_back, NULL);
CCSequence* seq = CCSequence::create(scale, scale_back, NULL);
label->runAction(CCRepeatForever::create(seq));
scheduleOnce(schedule_selector(TextureAsync::loadImages), 1.0f);
@ -1603,7 +1603,7 @@ void TextureGlClamp::onEnter()
sprite->runAction(rotate);
CCScaleBy* scale = CCScaleBy::create(2, 0.04f);
CCScaleBy* scaleBack = (CCScaleBy*) (scale->reverse());
CCFiniteTimeAction* seq = CCSequence::create(scale, scaleBack, NULL);
CCSequence* seq = CCSequence::create(scale, scaleBack, NULL);
sprite->runAction(seq);
}
@ -1640,7 +1640,7 @@ void TextureGlRepeat::onEnter()
sprite->runAction(rotate);
CCScaleBy* scale = CCScaleBy::create(2, 0.04f);
CCScaleBy* scaleBack = (CCScaleBy*) (scale->reverse());
CCFiniteTimeAction* seq = CCSequence::create(scale, scaleBack, NULL);
CCSequence* seq = CCSequence::create(scale, scaleBack, NULL);
sprite->runAction(seq);
}

View File

@ -35,9 +35,9 @@ TileMapTest::TileMapTest()
CCScaleBy *scale = CCScaleBy::create(4, 0.8f);
CCActionInterval *scaleBack = scale->reverse();
CCFiniteTimeAction* seq = CCSequence::create(scale, scaleBack, NULL);
CCSequence* seq = CCSequence::create(scale, scaleBack, NULL);
map->runAction(CCRepeatForever::create((CCActionInterval *)seq));
map->runAction(CCRepeatForever::create(seq));
}
std::string TileMapTest::title()
@ -339,7 +339,7 @@ TMXReadWriteTest::TMXReadWriteTest()
CCActionInterval* fadein = CCFadeIn::create(2);
CCActionInterval* scaleback = CCScaleTo::create(1, 1);
CCActionInstant* finish = CCCallFuncN::create(this, callfuncN_selector(TMXReadWriteTest::removeSprite));
CCFiniteTimeAction* seq0 = CCSequence::create(move, rotate, scale, opacity, fadein, scaleback, finish, NULL);
CCSequence* seq0 = CCSequence::create(move, rotate, scale, opacity, fadein, scaleback, finish, NULL);
CCActionInterval* seq1 = (CCActionInterval*)(seq0->copy()->autorelease());
CCActionInterval* seq2 = (CCActionInterval*)(seq0->copy()->autorelease());
CCActionInterval* seq3 = (CCActionInterval*)(seq0->copy()->autorelease());
@ -818,8 +818,8 @@ TMXIsoZorder::TMXIsoZorder()
CCActionInterval* move = CCMoveBy::create(10, ccp(300,250));
CCActionInterval* back = move->reverse();
CCFiniteTimeAction* seq = CCSequence::create(move, back,NULL);
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*) seq) );
CCSequence* seq = CCSequence::create(move, back,NULL);
m_tamara->runAction( CCRepeatForever::create(seq) );
schedule( schedule_selector(TMXIsoZorder::repositionSprite) );
}
@ -884,8 +884,8 @@ TMXOrthoZorder::TMXOrthoZorder()
CCActionInterval* move = CCMoveBy::create(10, ccp(400,450));
CCActionInterval* back = move->reverse();
CCFiniteTimeAction* seq = CCSequence::create(move, back,NULL);
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq));
CCSequence* seq = CCSequence::create(move, back,NULL);
m_tamara->runAction( CCRepeatForever::create(seq));
schedule( schedule_selector(TMXOrthoZorder::repositionSprite));
}
@ -946,8 +946,8 @@ TMXIsoVertexZ::TMXIsoVertexZ()
CCActionInterval* move = CCMoveBy::create(10, ccpMult( ccp(300,250), 1/CC_CONTENT_SCALE_FACTOR() ) );
CCActionInterval* back = move->reverse();
CCFiniteTimeAction* seq = CCSequence::create(move, back,NULL);
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*) seq) );
CCSequence* seq = CCSequence::create(move, back,NULL);
m_tamara->runAction( CCRepeatForever::create(seq) );
schedule( schedule_selector(TMXIsoVertexZ::repositionSprite));
@ -1016,8 +1016,8 @@ TMXOrthoVertexZ::TMXOrthoVertexZ()
CCActionInterval* move = CCMoveBy::create(10, ccpMult( ccp(400,450), 1/CC_CONTENT_SCALE_FACTOR()));
CCActionInterval* back = move->reverse();
CCFiniteTimeAction* seq = CCSequence::create(move, back,NULL);
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq));
CCSequence* seq = CCSequence::create(move, back,NULL);
m_tamara->runAction( CCRepeatForever::create(seq));
schedule(schedule_selector(TMXOrthoVertexZ::repositionSprite));

View File

@ -712,18 +712,18 @@ int ScriptingCore::executeCallFuncActionEvent(CCCallFunc* pAction, CCObject* pTa
return 1;
}
int ScriptingCore::executeSchedule(CCTimer* pTimer, float dt, CCNode* pNode/* = NULL*/)
int ScriptingCore::executeSchedule(int nHandler, float dt, CCNode* pNode/* = NULL*/)
{
js_proxy_t * p;
JS_GET_PROXY(p, pNode);
if (!p) return 0;
jsval retval;
jsval dataVal = DOUBLE_TO_JSVAL(dt);
executeJSFunctionWithName(this->cx_, p->obj, "update", dataVal, retval);
return 1;
}

View File

@ -80,7 +80,7 @@ public:
virtual int executeMenuItemEvent(CCMenuItem* pMenuItem);
virtual int executeNotificationEvent(CCNotificationCenter* pNotificationCenter, const char* pszName);
virtual int executeCallFuncActionEvent(CCCallFunc* pAction, CCObject* pTarget = NULL);
virtual int executeSchedule(CCTimer* pTimer, float dt, CCNode* pNode = NULL);
virtual int executeSchedule(int nHandler, float dt, CCNode* pNode = NULL);
virtual int executeLayerTouchesEvent(CCLayer* pLayer, int eventType, CCSet *pTouches);
virtual int executeLayerTouchEvent(CCLayer* pLayer, int eventType, CCTouch *pTouch);
virtual int executeAccelerometerEvent(CCLayer* pLayer, CCAcceleration* pAccelerationValue);

View File

@ -374,19 +374,11 @@ int CCLuaEngine::executeCallFuncActionEvent(CCCallFunc* pAction, CCObject* pTarg
return ret;
}
int CCLuaEngine::executeSchedule(CCTimer* pTimer, float dt, CCNode* pNode/* = NULL*/)
int CCLuaEngine::executeSchedule(int nHandler, float dt, CCNode* pNode/* = NULL*/)
{
int ret = 0;
do
{
int nScriptHandler = pTimer->getScriptHandler();
CC_BREAK_IF(0 == nScriptHandler);
cleanStack();
pushFloat(dt);
ret = executeFunctionByHandler(nScriptHandler, 1);
} while (0);
return ret;
cleanStack();
pushFloat(dt);
return executeFunctionByHandler(nHandler, 1);
}
// functions for excute touch event

View File

@ -192,7 +192,7 @@ public:
virtual int executeMenuItemEvent(CCMenuItem* pMenuItem);
virtual int executeNotificationEvent(CCNotificationCenter* pNotificationCenter, const char* pszName);
virtual int executeCallFuncActionEvent(CCCallFunc* pAction, CCObject* pTarget = NULL);
virtual int executeSchedule(CCTimer* pTimer, float dt, CCNode* pNode = NULL);
virtual int executeSchedule(int nHandler, float dt, CCNode* pNode = NULL);
virtual int executeLayerTouchesEvent(CCLayer* pLayer, int eventType, CCSet *pTouches);
virtual int executeLayerTouchEvent(CCLayer* pLayer, int eventType, CCTouch *pTouch);
virtual int executeLayerKeypadEvent(CCLayer* pLayer, int eventType);

@ -1 +1 @@
Subproject commit e4761d02b363515a293adb637fd8ab4a99db9722
Subproject commit ab8a6c0823d396f4d1e2cfb5de2314da653c657f

View File

@ -63,8 +63,8 @@ class CCSequence : public CCActionInterval
CCObject* copyWithZone(CCZone* pZone);
CCActionInterval* reverse(void);
static CCFiniteTimeAction* createWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo);
static CCFiniteTimeAction* create(CCArray *actions);
static CCSequence* createWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo);
static CCSequence* create(CCArray *actions);
};
class CCRepeat : public CCActionInterval
@ -90,8 +90,8 @@ class CCSpawn : public CCActionInterval
CCObject* copyWithZone(CCZone* pZone);
CCActionInterval* reverse(void);
static CCFiniteTimeAction* createWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2);
static CCFiniteTimeAction* create(CCArray *actions);
static CCSpawn* createWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2);
static CCSpawn* create(CCArray *actions);
};
class CCRotateTo : public CCActionInterval

View File

@ -47,9 +47,6 @@ class CCNode : public CCObject
CCCamera* getCamera();
CCGridBase* getGrid();
void setGrid(CCGridBase* pGrid);
//CCPoint getAnchorPointInPixels();
//CCSize getContentSizeInPixels();
//void setContentSizeInPixels(CCSize sz);
CCPoint getAnchorPointInPoints();
bool isRunning();
CCNode* getParent();
@ -111,7 +108,7 @@ class CCNode : public CCObject
void removeFromParentAndCleanup(bool cleanup);
void removeChildByTag(int tag, bool cleanup);
void scheduleUpdate(void);
void scheduleUpdateWithPriorityLua(LUA_FUNCTION nHandler, int priority);
void unscheduleUpdate(void);
void registerScriptHandler(LUA_FUNCTION funcID);