diff --git a/.gitignore b/.gitignore index f06b24cbb6..de228548e9 100644 --- a/.gitignore +++ b/.gitignore @@ -47,8 +47,9 @@ local.properties # Ignore python compiled files *.pyc -# Ignore files build by airplay +# Ignore files build by airplay and marmalade build_*_xcode/ +build_*_vc10/ # Ignore files build by xcode *.mode*v* diff --git a/AUTHORS b/AUTHORS index 2252fe5a87..9541d8b9a9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -12,6 +12,12 @@ Developers: Rolando Abarca Javascript Binding and testjs + chenium + fix a bug that CCRenderTexture can not work when coming to foreground on Android + + 9re(Taro Kobayashi) + add Japanese language support + mingulov improve the speed of accessing to files from apk @@ -36,6 +42,7 @@ Developers: edbartley update MSVS and MAC projects to use project-relative path CCControl* should not respond to touches if the control is not visible + Some improvements for CCScrollView and CCTableView. Weeds use fontconfig to enhance font rendering on linux @@ -111,7 +118,7 @@ Developers: Mat Hopwood( Marmalade official engineer ) Marmalade support for gles20 branch - + Carlos Sessa implement the accelerometer module for Android port @@ -149,6 +156,13 @@ Developers: johnangel OpenGL framebuffer access violation fix. + Peter Farkas (fape) + contributes Marmalade port for gles20 branch + add Hungarian language support + + Tomoaki Shimizu (tks2shimizu) + Adding randomObject to CCDictionary. + Retired Core Developers: WenSheng Yang Author of windows port, CCTextField, diff --git a/CHANGELOG b/CHANGELOG index 6144697cf4..c2b6a5764a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,36 @@ +cocos2d-2.1beta3-x-2.1.0 @Dec.5 2012 + [all platforms] + Bug #1556: set a default texture for CCParticleFire, CCParticleFireworks, etc + Feature #1555: update to cocos2d-iphone v2.1 beta3 + Feature #1564: update tests to cocos2d-iphone v2.1beta3 + Feature #1572: add sample game WatermelonWithMe + Feature #1573: add sample game CocosDragonJS + Refactor #1545: remove the usage of NODE_FUNC and CREATE_FUNC + Refactor #1565: remove VS2008 support + Refactor #1576: update CCBReader to latest version of CocosBuilder + Refactor #1589: add CCBReader::setCCBRootPath() + [iOS] + Bug #1548: update libcurl header files to 7.26.0 on iOS + [android] + Bug #1551: add error handler when reading image data using libjpeg + Refactor #1558: improve the speed of accessing to files from apk + [marmalade] + Bug #1559: fix a bug that if a file in resource directory doesn't exist, it will not search from root directory + Bug #1571: add box2d rope to marmalade project + Bug #1590: JPEG and File fixes for marmalade + Feature #1557: Marmalade support + Refactor #1574: update marmalade languages + Refactor #1575: update samples/TestCpp to compatible with marmalade + Refactor #1578: create cocos2dx-ext marmalade project + Refactor #1591: add TestLua marmalade project + [javascript binding] + Bug #1577: fix a bug that touch events lost on Win32 when using JSBinding + Bug #1586: fix a crash in WatermelonWithMe + Bug #1588: rescheduleCallback support for JSBinding + Refactor #1570: improve the debugger for JSBinding + [lua binding] + Bug #1587: remove lua script handler in CCCallFunc's destructor + cocos2d-2.0-x-2.0.4 @Nov.2 2012 [all platforms] Bug #1473: fix a bug that CCScale9Sprite does not support rotated spriteframe in atlas diff --git a/CocosDenshion/marmalade/SimpleAudioEngine.cpp b/CocosDenshion/marmalade/SimpleAudioEngine.cpp index 6130d56a20..3880fb68c1 100644 --- a/CocosDenshion/marmalade/SimpleAudioEngine.cpp +++ b/CocosDenshion/marmalade/SimpleAudioEngine.cpp @@ -86,10 +86,10 @@ namespace CocosDenshion s_pEngine=0; } - for( SoundFxMap::iterator it = g_pSoundFxMap->begin(); it!=g_pSoundFxMap->end(); it++ ) { - if( it->second.data != 0 ) free( it->second.data ) ; - } if( g_pSoundFxMap ) { + for( SoundFxMap::iterator it = g_pSoundFxMap->begin(); it!=g_pSoundFxMap->end(); it++ ) + if( it->second.data != 0 ) free( it->second.data ) ; + delete g_pSoundFxMap ; g_pSoundFxMap = 0 ; } diff --git a/build-win32.bat b/build-win32.bat index ffd7c9f32c..a6a4b6104b 100644 --- a/build-win32.bat +++ b/build-win32.bat @@ -45,15 +45,17 @@ cd ".\Release.win32\" set CC_TEST_BIN=TestCpp.exe -set CC_TEST_RES=..\samples\TestCpp\Resources\*.* -set CC_HELLOWORLD_RES=..\samples\HelloCpp\Resources\*.* -set CC_HELLOLUA_RES=..\samples\HelloLua\Resources\*.* -set CC_TESTJS_RES=..\samples\TestJavascript\Resources\*.* +set CC_TEST_RES=..\samples\TestCpp\Resources +set CC_HELLOWORLD_RES=..\samples\HelloCpp\Resources +set CC_TESTLUA_RES=..\samples\TestLua\Resources +set CC_SIMPLEGAME_RES=..\samples\SimpleGame\Resources +set CC_HELLOLUA_RES=..\samples\HelloLua\Resources +set CC_JSB_SOURCES=..\scripting\javascript\bindings\js +set CC_TESTJS_RES=..\samples\TestJavascript\cocos2d-js-tests\tests +set CC_DRAGONJS_RES=..\samples\TestJavascript\cocos2d-js-tests\games\CocosDragonJS\Published files iOS +set CC_MOONWARRIORS_RES=..\samples\TestJavascript\cocos2d-js-tests\games\MoonWarriors +set CC_WATERMELONWITHME_RES=..\samples\TestJavascript\cocos2d-js-tests\games\WatermelonWithMe -if not exist "%CC_TEST_BIN%" ( - echo Can't find the binary "TestCpp.exe", is there build error? - goto ERROR -) echo./* echo.* Run cocos2d-win32 tests.exe and view Cocos2d-x Application Wizard for Visual Studio User Guide. @@ -62,7 +64,18 @@ echo. xcopy /E /Y /Q "%CC_TEST_RES%" . xcopy /E /Y /Q "%CC_HELLOWORLD_RES%" . xcopy /E /Y /Q "%CC_HELLOLUA_RES%" . +xcopy /E /Y /Q "%CC_TESTLUA_RES%" . +xcopy /E /Y /Q "%CC_SIMPLEGAME_RES%" . +xcopy /E /Y /Q "%CC_JSB_SOURCES%" . xcopy /E /Y /Q "%CC_TESTJS_RES%" . +xcopy /E /Y /Q "%CC_MOONWARRIORS_RES%" . +xcopy /E /Y /Q "%CC_WATERMELONWITHME_RES%" . +xcopy /E /Y /Q "%CC_DRAGONJS_RES%" . + +if not exist "%CC_TEST_BIN%" ( + echo Can't find the binary "TestCpp.exe", is there build error? + goto ERROR +) call "%CC_TEST_BIN%" start http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Cocos2d-x_Application_Wizard_for_Visual_Studio_User_Guide diff --git a/cocos2dx/actions/CCAction.cpp b/cocos2dx/actions/CCAction.cpp index 9f79a5954e..a0e5f7be30 100644 --- a/cocos2dx/actions/CCAction.cpp +++ b/cocos2dx/actions/CCAction.cpp @@ -48,11 +48,6 @@ CCAction::~CCAction() CCLOGINFO("cocos2d: deallocing"); } -CCAction * CCAction::action() -{ - return CCAction::create(); -} - CCAction* CCAction::create() { CCAction * pRet = new CCAction(); @@ -129,11 +124,6 @@ CCSpeed::~CCSpeed() CC_SAFE_RELEASE(m_pInnerAction); } -CCSpeed * CCSpeed::actionWithAction(CCActionInterval *pAction, float fSpeed) -{ - return CCSpeed::create(pAction, fSpeed); -} - CCSpeed* CCSpeed::create(CCActionInterval* pAction, float fSpeed) { CCSpeed *pRet = new CCSpeed(); @@ -221,11 +211,6 @@ CCFollow::~CCFollow() CC_SAFE_RELEASE(m_pobFollowedNode); } -CCFollow *CCFollow::actionWithTarget(CCNode *pFollowedNode, const CCRect& rect/* = CCRectZero*/) -{ - return CCFollow::create(pFollowedNode, rect); -} - CCFollow* CCFollow::create(CCNode *pFollowedNode, const CCRect& rect/* = CCRectZero*/) { CCFollow *pRet = new CCFollow(); diff --git a/cocos2dx/actions/CCAction.h b/cocos2dx/actions/CCAction.h index 3f9375a1c6..117c26b1e4 100644 --- a/cocos2dx/actions/CCAction.h +++ b/cocos2dx/actions/CCAction.h @@ -97,11 +97,6 @@ public: inline void setTag(int nTag) { m_nTag = nTag; } public: - /** Allocates and initializes the action - @deprecated: Please use create() instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCAction* action(); - /** Create an action */ static CCAction* create(); protected: @@ -184,11 +179,6 @@ public: } public: - /** creates the action - @deprecated: Please use create(CCActionInterval* float) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSpeed* actionWithAction(CCActionInterval *pAction, float fSpeed); - /** create the action */ static CCSpeed* create(CCActionInterval* pAction, float fSpeed); protected: @@ -232,11 +222,6 @@ public: virtual void stop(void); public: - /** creates the action with a set boundary, - It will work with no boundary if @param rect is equal to CCRectZero. - @deprecated: Please use create(CCNode*, const CCRect&) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFollow* actionWithTarget(CCNode *pFollowedNode, const CCRect& rect = CCRectZero); /** creates the action with a set boundary, It will work with no boundary if @param rect is equal to CCRectZero. */ diff --git a/cocos2dx/actions/CCActionCamera.cpp b/cocos2dx/actions/CCActionCamera.cpp index f166f0dda1..06cc2ace87 100644 --- a/cocos2dx/actions/CCActionCamera.cpp +++ b/cocos2dx/actions/CCActionCamera.cpp @@ -50,10 +50,6 @@ CCActionInterval * CCActionCamera::reverse() // // CCOrbitCamera // -CCOrbitCamera * CCOrbitCamera::actionWithDuration(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX) -{ - return CCOrbitCamera::create(t, radius, deltaRadius, angleZ, deltaAngleZ, angleX, deltaAngleX); -} CCOrbitCamera * CCOrbitCamera::create(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX) { diff --git a/cocos2dx/actions/CCActionCamera.h b/cocos2dx/actions/CCActionCamera.h index 23a80a1dc7..7042aab985 100644 --- a/cocos2dx/actions/CCActionCamera.h +++ b/cocos2dx/actions/CCActionCamera.h @@ -94,10 +94,6 @@ public: , m_fRadDeltaX(0.0) {} ~CCOrbitCamera(){} - /** creates a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCOrbitCamera* actionWithDuration(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX); /** creates a CCOrbitCamera action with radius, delta-radius, z, deltaZ, x, deltaX */ static CCOrbitCamera* create(float t, float radius, float deltaRadius, float angleZ, float deltaAngleZ, float angleX, float deltaAngleX); diff --git a/cocos2dx/actions/CCActionCatmullRom.cpp b/cocos2dx/actions/CCActionCatmullRom.cpp index 144fb4ec25..cd91296a5e 100644 --- a/cocos2dx/actions/CCActionCatmullRom.cpp +++ b/cocos2dx/actions/CCActionCatmullRom.cpp @@ -44,10 +44,6 @@ NS_CC_BEGIN; /* * Implementation of CCPointArray */ -CCPointArray* CCPointArray::arrayWithCapacity(unsigned int capacity) -{ - return CCPointArray::create(capacity); -} CCPointArray* CCPointArray::create(unsigned int capacity) { @@ -199,10 +195,6 @@ CCPoint ccCardinalSplineAt(CCPoint &p0, CCPoint &p1, CCPoint &p2, CCPoint &p3, f /* Implementation of CCCardinalSplineTo */ -CCCardinalSplineTo* CCCardinalSplineTo::actionWithDuration(float duration, cocos2d::CCPointArray *points, float tension) -{ - return CCCardinalSplineTo::create(duration, points, tension); -} CCCardinalSplineTo* CCCardinalSplineTo::create(float duration, cocos2d::CCPointArray *points, float tension) { @@ -327,11 +319,6 @@ CCActionInterval* CCCardinalSplineTo::reverse() /* CCCardinalSplineBy */ -CCCardinalSplineBy* CCCardinalSplineBy::actionWithDuration(float duration, cocos2d::CCPointArray *points, float tension) -{ - return CCCardinalSplineBy::create(duration, points, tension); -} - CCCardinalSplineBy* CCCardinalSplineBy::create(float duration, cocos2d::CCPointArray *points, float tension) { CCCardinalSplineBy *ret = new CCCardinalSplineBy(); @@ -411,10 +398,6 @@ void CCCardinalSplineBy::startWithTarget(cocos2d::CCNode *pTarget) /* CCCatmullRomTo */ -CCCatmullRomTo* CCCatmullRomTo::actionWithDuration(float dt, cocos2d::CCPointArray *points) -{ - return CCCatmullRomTo::create(dt, points); -} CCCatmullRomTo* CCCatmullRomTo::create(float dt, cocos2d::CCPointArray *points) { @@ -446,10 +429,6 @@ bool CCCatmullRomTo::initWithDuration(float dt, cocos2d::CCPointArray *points) /* CCCatmullRomBy */ -CCCatmullRomBy* CCCatmullRomBy::actionWithDuration(float dt, cocos2d::CCPointArray *points) -{ - return CCCatmullRomBy::create(dt, points); -} CCCatmullRomBy* CCCatmullRomBy::create(float dt, cocos2d::CCPointArray *points) { diff --git a/cocos2dx/actions/CCActionCatmullRom.h b/cocos2dx/actions/CCActionCatmullRom.h index 3fbbc66b46..1cbad7b34c 100644 --- a/cocos2dx/actions/CCActionCatmullRom.h +++ b/cocos2dx/actions/CCActionCatmullRom.h @@ -55,10 +55,6 @@ NS_CC_BEGIN; class CC_DLL CCPointArray : public CCNode { public: - /** creates and initializes a Points array with capacity - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCPointArray* arrayWithCapacity(unsigned int capacity); /** creates and initializes a Points array with capacity */ static CCPointArray* create(unsigned int capacity); @@ -114,10 +110,6 @@ private: class CC_DLL CCCardinalSplineTo : public CCActionInterval { public: - /** creates an action with a Cardinal Spline array of points and tension - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCCardinalSplineTo* actionWithDuration(float duration, CCPointArray* points, float tension); /** creates an action with a Cardinal Spline array of points and tension */ static CCCardinalSplineTo* create(float duration, CCPointArray* points, float tension); @@ -158,10 +150,6 @@ protected: class CC_DLL CCCardinalSplineBy : public CCCardinalSplineTo { public: - /** creates an action with a Cardinal Spline array of points and tension - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCCardinalSplineBy* actionWithDuration(float duration, CCPointArray* points, float tension); /** creates an action with a Cardinal Spline array of points and tension */ static CCCardinalSplineBy* create(float duration, CCPointArray* points, float tension); @@ -183,10 +171,6 @@ protected: class CC_DLL CCCatmullRomTo : public CCCardinalSplineTo { public: - /** creates an action with a Cardinal Spline array of points and tension - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCCatmullRomTo* actionWithDuration(float dt, CCPointArray* points); /** creates an action with a Cardinal Spline array of points and tension */ static CCCatmullRomTo* create(float dt, CCPointArray* points); @@ -203,10 +187,6 @@ public: class CC_DLL CCCatmullRomBy : public CCCardinalSplineBy { public: - /** creates an action with a Cardinal Spline array of points and tension - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCCatmullRomBy* actionWithDuration(float dt, CCPointArray* points); /** creates an action with a Cardinal Spline array of points and tension */ static CCCatmullRomBy* create(float dt, CCPointArray* points); diff --git a/cocos2dx/actions/CCActionEase.cpp b/cocos2dx/actions/CCActionEase.cpp index 3f7d75d627..cd45e893df 100644 --- a/cocos2dx/actions/CCActionEase.cpp +++ b/cocos2dx/actions/CCActionEase.cpp @@ -42,10 +42,6 @@ NS_CC_BEGIN // // EaseAction // -CCActionEase* CCActionEase::actionWithAction(CCActionInterval *pAction) -{ - return CCActionEase::create(pAction); -} CCActionEase* CCActionEase::create(CCActionInterval *pAction) { @@ -133,10 +129,6 @@ CCActionInterval* CCActionEase::reverse(void) // // EaseRateAction // -CCEaseRateAction* CCEaseRateAction::actionWithAction(CCActionInterval *pAction, float fRate) -{ - return CCEaseRateAction::create(pAction, fRate); -} CCEaseRateAction* CCEaseRateAction::create(CCActionInterval *pAction, float fRate) { @@ -200,10 +192,6 @@ CCActionInterval* CCEaseRateAction::reverse(void) // // EeseIn // -CCEaseIn* CCEaseIn::actionWithAction(CCActionInterval *pAction, float fRate) -{ - return CCEaseIn::create(pAction, fRate); -} CCEaseIn* CCEaseIn::create(CCActionInterval *pAction, float fRate) { @@ -257,11 +245,6 @@ CCActionInterval* CCEaseIn::reverse(void) // // EaseOut // -CCEaseOut* CCEaseOut::actionWithAction(CCActionInterval *pAction, float fRate) -{ - return CCEaseOut::create(pAction, fRate); -} - CCEaseOut* CCEaseOut::create(CCActionInterval *pAction, float fRate) { CCEaseOut *pRet = new CCEaseOut(); @@ -314,11 +297,6 @@ CCActionInterval* CCEaseOut::reverse() // // EaseInOut // -CCEaseInOut* CCEaseInOut::actionWithAction(CCActionInterval *pAction, float fRate) -{ - return CCEaseInOut::create(pAction, fRate); -} - CCEaseInOut* CCEaseInOut::create(CCActionInterval *pAction, float fRate) { CCEaseInOut *pRet = new CCEaseInOut(); @@ -380,11 +358,6 @@ CCActionInterval* CCEaseInOut::reverse(void) // // EaseExponentialIn // -CCEaseExponentialIn* CCEaseExponentialIn::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseExponentialIn::create(pAction); -} - CCEaseExponentialIn* CCEaseExponentialIn::create(CCActionInterval* pAction) { CCEaseExponentialIn *pRet = new CCEaseExponentialIn(); @@ -437,11 +410,6 @@ CCActionInterval* CCEaseExponentialIn::reverse(void) // // EaseExponentialOut // -CCEaseExponentialOut* CCEaseExponentialOut::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseExponentialOut::create(pAction); -} - CCEaseExponentialOut* CCEaseExponentialOut::create(CCActionInterval* pAction) { CCEaseExponentialOut *pRet = new CCEaseExponentialOut(); @@ -494,10 +462,6 @@ CCActionInterval* CCEaseExponentialOut::reverse(void) // // EaseExponentialInOut // -CCEaseExponentialInOut* CCEaseExponentialInOut::actionWithAction(CCActionInterval *pAction) -{ - return CCEaseExponentialInOut::create(pAction); -} CCEaseExponentialInOut* CCEaseExponentialInOut::create(CCActionInterval *pAction) { @@ -561,10 +525,6 @@ CCActionInterval* CCEaseExponentialInOut::reverse() // // EaseSineIn // -CCEaseSineIn* CCEaseSineIn::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseSineIn::create(pAction); -} CCEaseSineIn* CCEaseSineIn::create(CCActionInterval* pAction) { @@ -618,10 +578,6 @@ CCActionInterval* CCEaseSineIn::reverse(void) // // EaseSineOut // -CCEaseSineOut* CCEaseSineOut::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseSineOut::create(pAction); -} CCEaseSineOut* CCEaseSineOut::create(CCActionInterval* pAction) { @@ -675,10 +631,6 @@ CCActionInterval* CCEaseSineOut::reverse(void) // // EaseSineInOut // -CCEaseSineInOut* CCEaseSineInOut::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseSineInOut::create(pAction); -} CCEaseSineInOut* CCEaseSineInOut::create(CCActionInterval* pAction) { @@ -733,11 +685,6 @@ CCActionInterval* CCEaseSineInOut::reverse() // EaseElastic // -CCEaseElastic* CCEaseElastic::actionWithAction(CCActionInterval *pAction, float fPeriod/* = 0.3f*/) -{ - return CCEaseElastic::create(pAction, fPeriod); -} - CCEaseElastic* CCEaseElastic::create(CCActionInterval *pAction) { return CCEaseElastic::create(pAction, 0.3f); @@ -803,10 +750,6 @@ CCActionInterval* CCEaseElastic::reverse(void) // // EaseElasticIn // -CCEaseElasticIn* CCEaseElasticIn::actionWithAction(CCActionInterval *pAction, float fPeriod/* = 0.3f*/) -{ - return CCEaseElasticIn::create(pAction, fPeriod); -} CCEaseElasticIn* CCEaseElasticIn::create(CCActionInterval *pAction) { @@ -878,11 +821,6 @@ CCActionInterval* CCEaseElasticIn::reverse(void) // EaseElasticOut // -CCEaseElasticOut* CCEaseElasticOut::actionWithAction(CCActionInterval *pAction, float fPeriod/* = 0.3f*/) -{ - return CCEaseElasticOut::create(pAction, fPeriod); -} - CCEaseElasticOut* CCEaseElasticOut::create(CCActionInterval *pAction) { return CCEaseElasticOut::create(pAction, 0.3f); @@ -952,11 +890,6 @@ CCActionInterval* CCEaseElasticOut::reverse(void) // EaseElasticInOut // -CCEaseElasticInOut* CCEaseElasticInOut::actionWithAction(CCActionInterval *pAction, float fPeriod/* = 0.3f*/) -{ - return CCEaseElasticInOut::create(pAction, fPeriod); -} - CCEaseElasticInOut* CCEaseElasticInOut::create(CCActionInterval *pAction) { return CCEaseElasticInOut::create(pAction, 0.3f); @@ -1041,10 +974,6 @@ CCActionInterval* CCEaseElasticInOut::reverse(void) // // EaseBounce // -CCEaseBounce* CCEaseBounce::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseBounce::create(pAction); -} CCEaseBounce* CCEaseBounce::create(CCActionInterval* pAction) { @@ -1114,10 +1043,6 @@ CCActionInterval* CCEaseBounce::reverse() // // EaseBounceIn // -CCEaseBounceIn* CCEaseBounceIn::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseBounceIn::create(pAction); -} CCEaseBounceIn* CCEaseBounceIn::create(CCActionInterval* pAction) { @@ -1172,10 +1097,6 @@ CCActionInterval* CCEaseBounceIn::reverse(void) // // EaseBounceOut // -CCEaseBounceOut* CCEaseBounceOut::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseBounceOut::create(pAction); -} CCEaseBounceOut* CCEaseBounceOut::create(CCActionInterval* pAction) { @@ -1230,10 +1151,6 @@ CCActionInterval* CCEaseBounceOut::reverse(void) // // EaseBounceInOut // -CCEaseBounceInOut* CCEaseBounceInOut::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseBounceInOut::create(pAction); -} CCEaseBounceInOut* CCEaseBounceInOut::create(CCActionInterval* pAction) { @@ -1298,10 +1215,6 @@ CCActionInterval* CCEaseBounceInOut::reverse() // // EaseBackIn // -CCEaseBackIn* CCEaseBackIn::actionWithAction(CCActionInterval *pAction) -{ - return CCEaseBackIn::create(pAction); -} CCEaseBackIn* CCEaseBackIn::create(CCActionInterval *pAction) { @@ -1356,10 +1269,6 @@ CCActionInterval* CCEaseBackIn::reverse(void) // // EaseBackOut // -CCEaseBackOut* CCEaseBackOut::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseBackOut::create(pAction); -} CCEaseBackOut* CCEaseBackOut::create(CCActionInterval* pAction) { @@ -1416,10 +1325,6 @@ CCActionInterval* CCEaseBackOut::reverse(void) // // EaseBackInOut // -CCEaseBackInOut* CCEaseBackInOut::actionWithAction(CCActionInterval* pAction) -{ - return CCEaseBackInOut::create(pAction); -} CCEaseBackInOut* CCEaseBackInOut::create(CCActionInterval* pAction) { diff --git a/cocos2dx/actions/CCActionEase.h b/cocos2dx/actions/CCActionEase.h index 07f9c29109..9690e1cf9d 100644 --- a/cocos2dx/actions/CCActionEase.h +++ b/cocos2dx/actions/CCActionEase.h @@ -57,10 +57,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCActionEase* actionWithAction(CCActionInterval *pAction); /** creates the action */ static CCActionEase* create(CCActionInterval *pAction); @@ -90,10 +86,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** Creates the action with the inner action and the rate parameter - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseRateAction* actionWithAction(CCActionInterval* pAction, float fRate); /** Creates the action with the inner action and the rate parameter */ static CCEaseRateAction* create(CCActionInterval* pAction, float fRate); @@ -113,10 +105,6 @@ public: virtual CCActionInterval* reverse(void); virtual CCObject* copyWithZone(CCZone* pZone); public: - /** Creates the action with the inner action and the rate parameter - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseIn* actionWithAction(CCActionInterval* pAction, float fRate); /** Creates the action with the inner action and the rate parameter */ static CCEaseIn* create(CCActionInterval* pAction, float fRate); @@ -134,10 +122,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** Creates the action with the inner action and the rate parameter - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseOut* actionWithAction(CCActionInterval* pAction, float fRate); /** Creates the action with the inner action and the rate parameter */ static CCEaseOut* create(CCActionInterval* pAction, float fRate); @@ -155,10 +139,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** Creates the action with the inner action and the rate parameter - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseInOut* actionWithAction(CCActionInterval* pAction, float fRate); /** Creates the action with the inner action and the rate parameter */ static CCEaseInOut* create(CCActionInterval* pAction, float fRate); @@ -176,10 +156,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseExponentialIn* actionWithAction(CCActionInterval* pAction); /** creates the action */ static CCEaseExponentialIn* create(CCActionInterval* pAction); }; @@ -196,10 +172,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseExponentialOut* actionWithAction(CCActionInterval* pAction); /** creates the action */ static CCEaseExponentialOut* create(CCActionInterval* pAction); }; @@ -216,10 +188,6 @@ public: virtual CCActionInterval* reverse(); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseExponentialInOut* actionWithAction(CCActionInterval* pAction); /** creates the action */ static CCEaseExponentialInOut* create(CCActionInterval* pAction); @@ -237,10 +205,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseSineIn* actionWithAction(CCActionInterval* pAction); /** creates the action */ static CCEaseSineIn* create(CCActionInterval* pAction); }; @@ -257,10 +221,7 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseSineOut* actionWithAction(CCActionInterval* pAction); + /** creates the action */ static CCEaseSineOut* create(CCActionInterval* pAction); }; @@ -277,10 +238,7 @@ public: virtual CCActionInterval* reverse(); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseSineInOut* actionWithAction(CCActionInterval* pAction); + /** creates the action */ static CCEaseSineInOut* create(CCActionInterval* pAction); }; @@ -305,10 +263,7 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** Creates the action with the inner action and the period in radians (default is 0.3) - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseElastic* actionWithAction(CCActionInterval *pAction, float fPeriod = 0.3f); + /** Creates the action with the inner action and the period in radians (default is 0.3) */ static CCEaseElastic* create(CCActionInterval *pAction, float fPeriod); static CCEaseElastic* create(CCActionInterval *pAction); @@ -330,10 +285,7 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** Creates the action with the inner action and the period in radians (default is 0.3) - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseElasticIn* actionWithAction(CCActionInterval *pAction, float fPeriod = 0.3f); + /** Creates the action with the inner action and the period in radians (default is 0.3) */ static CCEaseElasticIn* create(CCActionInterval *pAction, float fPeriod); static CCEaseElasticIn* create(CCActionInterval *pAction); @@ -353,10 +305,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** Creates the action with the inner action and the period in radians (default is 0.3) - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseElasticOut* actionWithAction(CCActionInterval *pAction, float fPeriod = 0.3f); /** Creates the action with the inner action and the period in radians (default is 0.3) */ static CCEaseElasticOut* create(CCActionInterval *pAction, float fPeriod); @@ -377,10 +325,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** Creates the action with the inner action and the period in radians (default is 0.3) - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseElasticInOut* actionWithAction(CCActionInterval *pAction, float fPeriod = 0.3f); /** Creates the action with the inner action and the period in radians (default is 0.3) */ static CCEaseElasticInOut* create(CCActionInterval *pAction, float fPeriod); @@ -400,10 +344,7 @@ public: virtual CCActionInterval* reverse(); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseBounce* actionWithAction(CCActionInterval* pAction); + /** creates the action */ static CCEaseBounce* create(CCActionInterval* pAction); }; @@ -422,10 +363,7 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseBounceIn* actionWithAction(CCActionInterval* pAction); + /** creates the action */ static CCEaseBounceIn* create(CCActionInterval* pAction); }; @@ -444,10 +382,7 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseBounceOut* actionWithAction(CCActionInterval* pAction); + /** creates the action */ static CCEaseBounceOut* create(CCActionInterval* pAction); }; @@ -466,10 +401,7 @@ public: virtual CCActionInterval* reverse(); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseBounceInOut* actionWithAction(CCActionInterval* pAction); + /** creates the action */ static CCEaseBounceInOut* create(CCActionInterval* pAction); }; @@ -488,10 +420,7 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseBackIn* actionWithAction(CCActionInterval* pAction); + /** creates the action */ static CCEaseBackIn* create(CCActionInterval* pAction); }; @@ -510,10 +439,7 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseBackOut* actionWithAction(CCActionInterval* pAction); + /** creates the action */ static CCEaseBackOut* create(CCActionInterval* pAction); }; @@ -532,10 +458,7 @@ public: virtual CCActionInterval* reverse(); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCEaseBackInOut* actionWithAction(CCActionInterval* pAction); + /** creates the action */ static CCEaseBackInOut* create(CCActionInterval* pAction); }; diff --git a/cocos2dx/actions/CCActionGrid.cpp b/cocos2dx/actions/CCActionGrid.cpp index dcf753e2a0..9dc23e44f7 100644 --- a/cocos2dx/actions/CCActionGrid.cpp +++ b/cocos2dx/actions/CCActionGrid.cpp @@ -30,11 +30,6 @@ THE SOFTWARE. NS_CC_BEGIN // implementation of CCGridAction -CCGridAction* CCGridAction::actionWithSize(const ccGridSize& gridSize, float duration) -{ - return CCGridAction::create(gridSize, duration); -} - CCGridAction* CCGridAction::create(const ccGridSize& gridSize, float duration) { CCGridAction *pAction = new CCGridAction(); @@ -186,11 +181,6 @@ void CCTiledGrid3DAction::setTile(const ccGridSize& pos, const ccQuad3& coords) // implementation CCAccelDeccelAmplitude -CCAccelDeccelAmplitude* CCAccelDeccelAmplitude::actionWithAction(CCAction *pAction, float duration) -{ - return CCAccelDeccelAmplitude::create(pAction, duration); -} - CCAccelDeccelAmplitude* CCAccelDeccelAmplitude::create(CCAction *pAction, float duration) { CCAccelDeccelAmplitude *pRet = new CCAccelDeccelAmplitude(); @@ -254,11 +244,6 @@ CCActionInterval* CCAccelDeccelAmplitude::reverse(void) // implementation of AccelAmplitude -CCAccelAmplitude* CCAccelAmplitude::actionWithAction(CCAction *pAction, float duration) -{ - return CCAccelAmplitude::create(pAction, duration); -} - CCAccelAmplitude* CCAccelAmplitude::create(CCAction *pAction, float duration) { CCAccelAmplitude *pRet = new CCAccelAmplitude(); @@ -315,11 +300,6 @@ CCActionInterval* CCAccelAmplitude::reverse(void) // DeccelAmplitude -CCDeccelAmplitude* CCDeccelAmplitude::actionWithAction(CCAction *pAction, float duration) -{ - return CCDeccelAmplitude::create(pAction, duration); -} - CCDeccelAmplitude* CCDeccelAmplitude::create(CCAction *pAction, float duration) { CCDeccelAmplitude *pRet = new CCDeccelAmplitude(); @@ -388,11 +368,6 @@ void CCStopGrid::startWithTarget(CCNode *pTarget) } } -CCStopGrid* CCStopGrid::action(void) -{ - return CCStopGrid::create(); -} - CCStopGrid* CCStopGrid::create(void) { CCStopGrid* pAction = new CCStopGrid(); @@ -402,11 +377,6 @@ CCStopGrid* CCStopGrid::create(void) } // implementation of CCReuseGrid -CCReuseGrid* CCReuseGrid::actionWithTimes(int times) -{ - return CCReuseGrid::create(times); -} - CCReuseGrid* CCReuseGrid::create(int times) { CCReuseGrid *pAction = new CCReuseGrid(); diff --git a/cocos2dx/actions/CCActionGrid.h b/cocos2dx/actions/CCActionGrid.h index 3afaed4049..10fc77a784 100644 --- a/cocos2dx/actions/CCActionGrid.h +++ b/cocos2dx/actions/CCActionGrid.h @@ -51,10 +51,6 @@ public: virtual CCGridBase* getGrid(void); public: - /** creates the action with size and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCGridAction* actionWithSize(const ccGridSize& gridSize, float duration); /** creates the action with size and duration */ static CCGridAction* create(const ccGridSize& gridSize, float duration); protected: @@ -78,10 +74,6 @@ public: void setVertex(const ccGridSize& pos, const ccVertex3F& vertex); public: - /** creates the action with size and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCGrid3DAction* actionWithSize(const ccGridSize& gridSize, float duration); /** creates the action with size and duration */ static CCGrid3DAction* create(const ccGridSize& gridSize, float duration); }; @@ -101,10 +93,6 @@ public: virtual CCGridBase* getGrid(void); public: - /** creates the action with size and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTiledGrid3DAction* actionWithSize(const ccGridSize& gridSize, float duration); /** creates the action with size and duration */ static CCTiledGrid3DAction* create(const ccGridSize& gridSize, float duration); }; @@ -127,10 +115,6 @@ public: inline void setRate(float fRate) { m_fRate = fRate; } public: - /** creates the action with an inner action that has the amplitude property, and a duration time - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCAccelDeccelAmplitude* actionWithAction(CCAction *pAction, float duration); /** creates the action with an inner action that has the amplitude property, and a duration time */ static CCAccelDeccelAmplitude* create(CCAction *pAction, float duration); @@ -157,10 +141,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action with an inner action that has the amplitude property, and a duration time - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCAccelAmplitude* actionWithAction(CCAction *pAction, float duration); /** creates the action with an inner action that has the amplitude property, and a duration time */ static CCAccelAmplitude* create(CCAction *pAction, float duration); protected: @@ -186,10 +166,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action with an inner action that has the amplitude property, and a duration time - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCDeccelAmplitude* actionWithAction(CCAction *pAction, float duration); /** creates the action with an inner action that has the amplitude property, and a duration time */ static CCDeccelAmplitude* create(CCAction *pAction, float duration); @@ -209,10 +185,6 @@ public: virtual void startWithTarget(CCNode *pTarget); public: - /** Allocates and initializes the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCStopGrid* action(void); /** Allocates and initializes the action */ static CCStopGrid* create(void); }; @@ -227,10 +199,6 @@ public: virtual void startWithTarget(CCNode *pTarget); public: - /** creates an action with the number of times that the current grid will be reused - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCReuseGrid* actionWithTimes(int times); /** creates an action with the number of times that the current grid will be reused */ static CCReuseGrid* create(int times); protected: diff --git a/cocos2dx/actions/CCActionGrid3D.cpp b/cocos2dx/actions/CCActionGrid3D.cpp index a202c19e28..9c0790d011 100644 --- a/cocos2dx/actions/CCActionGrid3D.cpp +++ b/cocos2dx/actions/CCActionGrid3D.cpp @@ -31,11 +31,6 @@ THE SOFTWARE. NS_CC_BEGIN // implementation of CCWaves3D -CCWaves3D* CCWaves3D::actionWithWaves(int wav, float amp, const ccGridSize& gridSize, float duration) -{ - return CCWaves3D::create(wav, amp, gridSize, duration); -} - CCWaves3D* CCWaves3D::create(int wav, float amp, const ccGridSize& gridSize, float duration) { CCWaves3D *pAction = new CCWaves3D(); @@ -110,11 +105,6 @@ void CCWaves3D::update(float time) // implementation of CCFlipX3D -CCFlipX3D* CCFlipX3D::actionWithDuration(float duration) -{ - return CCFlipX3D::create(duration); -} - CCFlipX3D* CCFlipX3D::create(float duration) { CCFlipX3D *pAction = new CCFlipX3D(); @@ -241,11 +231,6 @@ void CCFlipX3D::update(float time) // implementation of FlipY3D -CCFlipY3D* CCFlipY3D::actionWithDuration(float duration) -{ - return CCFlipY3D::create(duration); -} - CCFlipY3D* CCFlipY3D::create(float duration) { CCFlipY3D *pAction = new CCFlipY3D(); @@ -355,11 +340,6 @@ void CCFlipY3D::update(float time) // implementation of Lens3D -CCLens3D* CCLens3D::actionWithPosition(const CCPoint& pos, float r, const ccGridSize& gridSize, float duration) -{ - return CCLens3D::create(pos, r, gridSize, duration); -} - CCLens3D* CCLens3D::create(const CCPoint& pos, float r, const ccGridSize& gridSize, float duration) { CCLens3D *pAction = new CCLens3D(); @@ -472,11 +452,6 @@ void CCLens3D::update(float time) // implementation of Ripple3D -CCRipple3D* CCRipple3D::actionWithPosition(const CCPoint& pos, float r, int wav, float amp, const ccGridSize& gridSize, float duration) -{ - return CCRipple3D::create(pos, r, wav, amp, gridSize, duration); -} - CCRipple3D* CCRipple3D::create(const CCPoint& pos, float r, int wav, float amp, const ccGridSize& gridSize, float duration) { CCRipple3D *pAction = new CCRipple3D(); @@ -566,11 +541,6 @@ void CCRipple3D::update(float time) // implementation of Shaky3D -CCShaky3D* CCShaky3D::actionWithRange(int range, bool shakeZ, const ccGridSize& gridSize, float duration) -{ - return CCShaky3D::create(range, shakeZ, gridSize, duration); -} - CCShaky3D* CCShaky3D::create(int range, bool shakeZ, const ccGridSize& gridSize, float duration) { CCShaky3D *pAction = new CCShaky3D(); @@ -650,11 +620,6 @@ void CCShaky3D::update(float time) // implementation of Liquid -CCLiquid* CCLiquid::actionWithWaves(int wav, float amp, const ccGridSize& gridSize, float duration) -{ - return CCLiquid::create(wav, amp, gridSize, duration); -} - CCLiquid* CCLiquid::create(int wav, float amp, const ccGridSize& gridSize, float duration) { CCLiquid *pAction = new CCLiquid(); @@ -729,11 +694,6 @@ void CCLiquid::update(float time) // implementation of Waves -CCWaves* CCWaves::actionWithWaves(int wav, float amp, bool h, bool v, const ccGridSize& gridSize, float duration) -{ - return CCWaves::create(wav, amp, h, v, gridSize, duration); -} - CCWaves* CCWaves::create(int wav, float amp, bool h, bool v, const ccGridSize& gridSize, float duration) { CCWaves *pAction = new CCWaves(); @@ -819,11 +779,6 @@ void CCWaves::update(float time) // implementation of Twirl -CCTwirl* CCTwirl::actionWithPosition(CCPoint pos, int t, float amp, const ccGridSize& gridSize, float duration) -{ - return CCTwirl::create(pos, t, amp, gridSize, duration); -} - CCTwirl* CCTwirl::create(CCPoint pos, int t, float amp, const ccGridSize& gridSize, float duration) { CCTwirl *pAction = new CCTwirl(); diff --git a/cocos2dx/actions/CCActionGrid3D.h b/cocos2dx/actions/CCActionGrid3D.h index 28ed8a9ab2..1ce83ae9a9 100644 --- a/cocos2dx/actions/CCActionGrid3D.h +++ b/cocos2dx/actions/CCActionGrid3D.h @@ -53,10 +53,6 @@ public: virtual void update(float time); public: - /** create the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCWaves3D* actionWithWaves(int wav, float amp, const ccGridSize& gridSize, float duration); /** create the action */ static CCWaves3D* create(int wav, float amp, const ccGridSize& gridSize, float duration); protected: @@ -76,10 +72,6 @@ public: virtual void update(float time); public: - /** creates the action with duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFlipX3D* actionWithDuration(float duration); /** creates the action with duration */ static CCFlipX3D* create(float duration); }; @@ -92,10 +84,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action with duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFlipY3D* actionWithDuration(float duration); /** creates the action with duration */ static CCFlipY3D* create(float duration); }; @@ -118,10 +106,6 @@ public: virtual void update(float time); public: - /** creates the action with center position, radius, a grid size and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLens3D* actionWithPosition(const CCPoint& pos, float r, const ccGridSize& gridSize, float duration); /** creates the action with center position, radius, a grid size and duration */ static CCLens3D* create(const CCPoint& pos, float r, const ccGridSize& gridSize, float duration); protected: @@ -156,11 +140,6 @@ public: virtual void update(float time); public: - /** creates the action with radius, number of waves, amplitude, a grid size and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCRipple3D* actionWithPosition(const CCPoint& pos, float r, int wav, float amp, - const ccGridSize& gridSize, float duration); /** creates the action with radius, number of waves, amplitude, a grid size and duration */ static CCRipple3D* create(const CCPoint& pos, float r, int wav, float amp, const ccGridSize& gridSize, float duration); @@ -183,10 +162,6 @@ public: virtual void update(float time); public: - /** creates the action with a range, shake Z vertices, a grid and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCShaky3D* actionWithRange(int range, bool shakeZ, const ccGridSize& gridSize, float duration); /** creates the action with a range, shake Z vertices, a grid and duration */ static CCShaky3D* create(int range, bool shakeZ, const ccGridSize& gridSize, float duration); protected: @@ -210,10 +185,6 @@ public: virtual void update(float time); public: - /** creates the action with amplitude, a grid and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLiquid* actionWithWaves(int wav, float amp, const ccGridSize& gridSize, float duration); /** creates the action with amplitude, a grid and duration */ static CCLiquid* create(int wav, float amp, const ccGridSize& gridSize, float duration); protected: @@ -239,11 +210,6 @@ public: virtual void update(float time); public: - /** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCWaves* actionWithWaves(int wav, float amp, bool h, bool v, const ccGridSize& gridSize, - float duration); /** initializes the action with amplitude, horizontal sin, vertical sin, a grid and duration */ static CCWaves* create(int wav, float amp, bool h, bool v, const ccGridSize& gridSize, @@ -278,12 +244,6 @@ public: virtual void update(float time); public: - /** creates the action with center position, number of twirls, amplitude, a grid size and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTwirl* actionWithPosition(CCPoint pos, int t, float amp, const ccGridSize& gridSize, - float duration); - /** creates the action with center position, number of twirls, amplitude, a grid size and duration */ static CCTwirl* create(CCPoint pos, int t, float amp, const ccGridSize& gridSize, float duration); diff --git a/cocos2dx/actions/CCActionInstant.cpp b/cocos2dx/actions/CCActionInstant.cpp index 2e0929a945..580d00927b 100644 --- a/cocos2dx/actions/CCActionInstant.cpp +++ b/cocos2dx/actions/CCActionInstant.cpp @@ -74,10 +74,6 @@ CCFiniteTimeAction * CCActionInstant::reverse() { // // Show // -CCShow* CCShow::action() -{ - return CCShow::create(); -} CCShow* CCShow::create() { @@ -118,11 +114,6 @@ CCObject* CCShow::copyWithZone(CCZone *pZone) { // // Hide // -CCHide * CCHide::action() -{ - return CCHide::create(); -} - CCHide * CCHide::create() { CCHide *pRet = new CCHide(); @@ -162,11 +153,6 @@ CCObject* CCHide::copyWithZone(CCZone *pZone) { // // ToggleVisibility // -CCToggleVisibility * CCToggleVisibility::action() -{ - return CCToggleVisibility::create(); -} - CCToggleVisibility * CCToggleVisibility::create() { CCToggleVisibility *pRet = new CCToggleVisibility(); @@ -205,10 +191,6 @@ CCObject* CCToggleVisibility::copyWithZone(CCZone *pZone) // // FlipX // -CCFlipX *CCFlipX::actionWithFlipX(bool x) -{ - return CCFlipX::create(x); -} CCFlipX *CCFlipX::create(bool x) { @@ -257,10 +239,6 @@ CCObject * CCFlipX::copyWithZone(CCZone *pZone) { // // FlipY // -CCFlipY * CCFlipY::actionWithFlipY(bool y) -{ - return CCFlipY::create(y); -} CCFlipY * CCFlipY::create(bool y) { @@ -309,10 +287,6 @@ CCObject* CCFlipY::copyWithZone(CCZone *pZone) { // // Place // -CCPlace* CCPlace::actionWithPosition(const CCPoint& pos) -{ - return CCPlace::create(pos); -} CCPlace* CCPlace::create(const CCPoint& pos) { @@ -357,12 +331,6 @@ void CCPlace::update(float time) { // // CallFunc // - -CCCallFunc * CCCallFunc::actionWithTarget(CCObject* pSelectorTarget, SEL_CallFunc selector) -{ - return CCCallFunc::create(pSelectorTarget, selector); -} - CCCallFunc * CCCallFunc::create(CCObject* pSelectorTarget, SEL_CallFunc selector) { CCCallFunc *pRet = new CCCallFunc(); @@ -406,6 +374,15 @@ bool CCCallFunc::initWithTarget(CCObject* pSelectorTarget) { return true; } +CCCallFunc::~CCCallFunc(void) +{ + if (m_nScriptHandler) + { + cocos2d::CCScriptEngineManager::sharedManager()->getScriptEngine()->removeScriptHandler(m_nScriptHandler); + } + CC_SAFE_RELEASE(m_pSelectorTarget); +} + CCObject * CCCallFunc::copyWithZone(CCZone *pZone) { CCZone* pNewZone = NULL; CCCallFunc* pRet = NULL; @@ -451,11 +428,6 @@ void CCCallFuncN::execute() { } } -CCCallFuncN * CCCallFuncN::actionWithTarget(CCObject* pSelectorTarget, SEL_CallFuncN selector) -{ - return CCCallFuncN::create(pSelectorTarget, selector); -} - CCCallFuncN * CCCallFuncN::create(CCObject* pSelectorTarget, SEL_CallFuncN selector) { CCCallFuncN *pRet = new CCCallFuncN(); @@ -515,10 +487,6 @@ CCObject * CCCallFuncN::copyWithZone(CCZone* zone) { // // CallFuncND // -CCCallFuncND * CCCallFuncND::actionWithTarget(CCObject* pSelectorTarget, SEL_CallFuncND selector, void* d) -{ - return CCCallFuncND::create(pSelectorTarget, selector, d); -} CCCallFuncND * CCCallFuncND::create(CCObject* pSelectorTarget, SEL_CallFuncND selector, void* d) { @@ -585,11 +553,6 @@ void CCCallFuncO::execute() { } } -CCCallFuncO * CCCallFuncO::actionWithTarget(CCObject* pSelectorTarget, SEL_CallFuncO selector, CCObject* pObject) -{ - return CCCallFuncO::create(pSelectorTarget, selector, pObject); -} - CCCallFuncO * CCCallFuncO::create(CCObject* pSelectorTarget, SEL_CallFuncO selector, CCObject* pObject) { CCCallFuncO *pRet = new CCCallFuncO(); diff --git a/cocos2dx/actions/CCActionInstant.h b/cocos2dx/actions/CCActionInstant.h index 334119446c..97ebd62d09 100644 --- a/cocos2dx/actions/CCActionInstant.h +++ b/cocos2dx/actions/CCActionInstant.h @@ -68,11 +68,6 @@ public: virtual CCFiniteTimeAction * reverse(void); virtual CCObject* copyWithZone(CCZone *pZone); public: - //override static method - /** Allocates and initializes the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCShow * action(); /** Allocates and initializes the action */ static CCShow * create(); @@ -93,11 +88,6 @@ public: virtual CCFiniteTimeAction * reverse(void); virtual CCObject* copyWithZone(CCZone *pZone); public: - //override static method - /** Allocates and initializes the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCHide * action(); /** Allocates and initializes the action */ static CCHide * create(); @@ -114,11 +104,6 @@ public: virtual void update(float time); virtual CCObject* copyWithZone(CCZone *pZone); public: - //override static method - /** Allocates and initializes the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCToggleVisibility * action(); /** Allocates and initializes the action */ static CCToggleVisibility * create(); @@ -136,11 +121,6 @@ public: {} virtual ~CCFlipX(){} - /** create the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFlipX * actionWithFlipX(bool x); - /** create the action */ static CCFlipX * create(bool x); @@ -166,11 +146,6 @@ public: :m_bFlipY(false) {} virtual ~CCFlipY(){} - - /** create the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFlipY * actionWithFlipY(bool y); /** create the action */ static CCFlipY * create(bool y); @@ -193,10 +168,7 @@ class CC_DLL CCPlace : public CCActionInstant // public: CCPlace(){} virtual ~CCPlace(){} - /** creates a Place action with a position - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCPlace * actionWithPosition(const CCPoint& pos); + /** creates a Place action with a position */ static CCPlace * create(const CCPoint& pos); /** Initializes a Place action with a position */ @@ -219,15 +191,7 @@ public: , m_nScriptHandler(0) { } - virtual ~CCCallFunc() - { - CC_SAFE_RELEASE(m_pSelectorTarget); - } - /** creates the action with the callback - @deprecated: This interface will be deprecated sooner or later. - typedef void (CCObject::*SEL_CallFunc)(); - */ - CC_DEPRECATED_ATTRIBUTE static CCCallFunc * actionWithTarget(CCObject* pSelectorTarget, SEL_CallFunc selector); + virtual ~CCCallFunc(); /** creates the action with the callback @@ -294,12 +258,6 @@ public: return id; } - /** creates the action with the callback - @deprecated: This interface will be deprecated sooner or later. - typedef void (CCObject::*SEL_CallFuncN)(CCNode*); - */ - CC_DEPRECATED_ATTRIBUTE static CCCallFuncN * actionWithTarget(CCObject* pSelectorTarget, SEL_CallFuncN selector); - /** creates the action with the callback typedef void (CCObject::*SEL_CallFuncN)(CCNode*); @@ -332,11 +290,6 @@ public: return id; } - /** creates the action with the callback and the data to pass as an argument - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCCallFuncND * actionWithTarget(CCObject* pSelectorTarget, SEL_CallFuncND selector, void* d); - /** creates the action with the callback and the data to pass as an argument */ static CCCallFuncND * create(CCObject* pSelectorTarget, SEL_CallFuncND selector, void* d); @@ -368,12 +321,6 @@ public: return id; } - /** creates the action with the callback - @deprecated: This interface will be deprecated sooner or later. - typedef void (CCObject::*SEL_CallFuncO)(CCObject*); - */ - CC_DEPRECATED_ATTRIBUTE static CCCallFuncO * actionWithTarget(CCObject* pSelectorTarget, SEL_CallFuncO selector, CCObject* pObject); - /** creates the action with the callback typedef void (CCObject::*SEL_CallFuncO)(CCObject*); diff --git a/cocos2dx/actions/CCActionInterval.cpp b/cocos2dx/actions/CCActionInterval.cpp index 0f341d9095..a2e4868c4f 100644 --- a/cocos2dx/actions/CCActionInterval.cpp +++ b/cocos2dx/actions/CCActionInterval.cpp @@ -38,11 +38,6 @@ NS_CC_BEGIN // // IntervalAction // -CCActionInterval* CCActionInterval::actionWithDuration(float d) -{ - return CCActionInterval::create(d); -} - CCActionInterval* CCActionInterval::create(float d) { CCActionInterval *pAction = new CCActionInterval(); @@ -151,10 +146,6 @@ CCActionInterval* CCActionInterval::reverse(void) // // Sequence // -CCSequence* CCSequence::actionOneTwo(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo) -{ - return CCSequence::createWithTwoActions(pActionOne, pActionTwo); -} CCSequence* CCSequence::createWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo) { @@ -165,18 +156,6 @@ CCSequence* CCSequence::createWithTwoActions(CCFiniteTimeAction *pActionOne, CCF return pSequence; } -CCFiniteTimeAction* CCSequence::actions(CCFiniteTimeAction *pAction1, ...) -{ - va_list params; - va_start(params, pAction1); - - CCFiniteTimeAction *pRet = CCSequence::create(pAction1, params); - - va_end(params); - - return pRet; -} - CCFiniteTimeAction* CCSequence::create(CCFiniteTimeAction *pAction1, ...) { va_list params; @@ -210,11 +189,6 @@ CCFiniteTimeAction* CCSequence::create(CCFiniteTimeAction *pAction1, va_list arg return pPrev; } -CCFiniteTimeAction* CCSequence::actionWithArray(CCArray* arrayOfActions) -{ - return CCSequence::create(arrayOfActions); -} - CCFiniteTimeAction* CCSequence::create(CCArray* arrayOfActions) { CCFiniteTimeAction* prev = (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(0); @@ -354,10 +328,6 @@ CCActionInterval* CCSequence::reverse(void) // // Repeat // -CCRepeat* CCRepeat::actionWithAction(CCFiniteTimeAction *pAction, unsigned int times) -{ - return CCRepeat::create(pAction, times); -} CCRepeat* CCRepeat::create(CCFiniteTimeAction *pAction, unsigned int times) { @@ -497,11 +467,6 @@ CCRepeatForever::~CCRepeatForever() CC_SAFE_RELEASE(m_pInnerAction); } -CCRepeatForever *CCRepeatForever::actionWithAction(CCActionInterval *pAction) -{ - return CCRepeatForever::create(pAction); -} - CCRepeatForever *CCRepeatForever::create(CCActionInterval *pAction) { CCRepeatForever *pRet = new CCRepeatForever(); @@ -573,17 +538,6 @@ CCActionInterval *CCRepeatForever::reverse() // // Spawn // -CCFiniteTimeAction* CCSpawn::actions(CCFiniteTimeAction *pAction1, ...) -{ - va_list params; - va_start(params, pAction1); - - CCFiniteTimeAction *pRet = CCSpawn::create(pAction1, params); - - va_end(params); - - return pRet; -} CCFiniteTimeAction* CCSpawn::create(CCFiniteTimeAction *pAction1, ...) { @@ -618,11 +572,6 @@ CCFiniteTimeAction* CCSpawn::create(CCFiniteTimeAction *pAction1, va_list args) return pPrev; } -CCFiniteTimeAction* CCSpawn::actionWithArray(CCArray *arrayOfActions) -{ - return CCSpawn::create(arrayOfActions); -} - CCFiniteTimeAction* CCSpawn::create(CCArray *arrayOfActions) { CCFiniteTimeAction* prev = (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(0); @@ -635,11 +584,6 @@ CCFiniteTimeAction* CCSpawn::create(CCArray *arrayOfActions) return prev; } -CCSpawn* CCSpawn::actionOneTwo(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2) -{ - return CCSpawn::createWithTwoActions(pAction1, pAction2); -} - CCSpawn* CCSpawn::createWithTwoActions(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2) { CCSpawn *pSpawn = new CCSpawn(); @@ -748,10 +692,6 @@ CCActionInterval* CCSpawn::reverse(void) // // RotateTo // -CCRotateTo* CCRotateTo::actionWithDuration(float fDuration, float fDeltaAngle) -{ - return CCRotateTo::create(fDuration, fDeltaAngle); -} CCRotateTo* CCRotateTo::create(float fDuration, float fDeltaAngle) { @@ -872,10 +812,6 @@ void CCRotateTo::update(float time) // // RotateBy // -CCRotateBy* CCRotateBy::actionWithDuration(float fDuration, float fDeltaAngle) -{ - return CCRotateBy::create(fDuration, fDeltaAngle); -} CCRotateBy* CCRotateBy::create(float fDuration, float fDeltaAngle) { @@ -966,10 +902,6 @@ CCActionInterval* CCRotateBy::reverse(void) // // MoveTo // -CCMoveTo* CCMoveTo::actionWithDuration(float duration, const CCPoint& position) -{ - return CCMoveTo::create(duration, position); -} CCMoveTo* CCMoveTo::create(float duration, const CCPoint& position) { @@ -1033,10 +965,6 @@ void CCMoveTo::update(float time) // // MoveBy // -CCMoveBy* CCMoveBy::actionWithDuration(float duration, const CCPoint& position) -{ - return CCMoveBy::create(duration, position); -} CCMoveBy* CCMoveBy::create(float duration, const CCPoint& position) { @@ -1096,11 +1024,6 @@ CCActionInterval* CCMoveBy::reverse(void) // // CCSkewTo // -CCSkewTo* CCSkewTo::actionWithDuration(float t, float sx, float sy) -{ - return CCSkewTo::create(t, sx, sy); -} - CCSkewTo* CCSkewTo::create(float t, float sx, float sy) { CCSkewTo *pSkewTo = new CCSkewTo(); @@ -1227,11 +1150,6 @@ CCSkewTo::CCSkewTo() // // CCSkewBy // -CCSkewBy* CCSkewBy::actionWithDuration(float t, float sx, float sy) -{ - return CCSkewBy::create(t, sx, sy); -} - CCSkewBy* CCSkewBy::create(float t, float sx, float sy) { CCSkewBy *pSkewBy = new CCSkewBy(); @@ -1282,10 +1200,6 @@ CCActionInterval* CCSkewBy::reverse() // // JumpBy // -CCJumpBy* CCJumpBy::actionWithDuration(float duration, const CCPoint& position, float height, unsigned int jumps) -{ - return CCJumpBy::create(duration, position, height, jumps); -} CCJumpBy* CCJumpBy::create(float duration, const CCPoint& position, float height, unsigned int jumps) { @@ -1361,10 +1275,6 @@ CCActionInterval* CCJumpBy::reverse(void) // // JumpTo // -CCJumpTo* CCJumpTo::actionWithDuration(float duration, const CCPoint& position, float height, int jumps) -{ - return CCJumpTo::create(duration, position, height, jumps); -} CCJumpTo* CCJumpTo::create(float duration, const CCPoint& position, float height, int jumps) { @@ -1419,10 +1329,6 @@ static inline float bezierat( float a, float b, float c, float d, float t ) // // BezierBy // -CCBezierBy* CCBezierBy::actionWithDuration(float t, const ccBezierConfig& c) -{ - return CCBezierBy::create(t, c); -} CCBezierBy* CCBezierBy::create(float t, const ccBezierConfig& c) { @@ -1508,10 +1414,6 @@ CCActionInterval* CCBezierBy::reverse(void) // // BezierTo // -CCBezierTo* CCBezierTo::actionWithDuration(float t, const ccBezierConfig& c) -{ - return CCBezierTo::create(t, c); -} CCBezierTo* CCBezierTo::create(float t, const ccBezierConfig& c) { @@ -1568,11 +1470,6 @@ void CCBezierTo::startWithTarget(CCNode *pTarget) // // ScaleTo // -CCScaleTo* CCScaleTo::actionWithDuration(float duration, float s) -{ - return CCScaleTo::create(duration, s); -} - CCScaleTo* CCScaleTo::create(float duration, float s) { CCScaleTo *pScaleTo = new CCScaleTo(); @@ -1595,11 +1492,6 @@ bool CCScaleTo::initWithDuration(float duration, float s) return false; } -CCScaleTo* CCScaleTo::actionWithDuration(float duration, float sx, float sy) -{ - return CCScaleTo::create(duration, sx, sy); -} - CCScaleTo* CCScaleTo::create(float duration, float sx, float sy) { CCScaleTo *pScaleTo = new CCScaleTo(); @@ -1667,15 +1559,6 @@ void CCScaleTo::update(float time) // // ScaleBy // -CCScaleBy* CCScaleBy::actionWithDuration(float duration, float s) -{ - return create(duration, s); -} - -CCScaleBy* CCScaleBy::actionWithDuration(float duration, float sx, float sy) -{ - return create(duration, sx, sy); -} CCScaleBy* CCScaleBy::create(float duration, float s) { @@ -1734,10 +1617,6 @@ CCActionInterval* CCScaleBy::reverse(void) // // Blink // -CCBlink* CCBlink::actionWithDuration(float duration, unsigned int uBlinks) -{ - return CCBlink::create(duration, uBlinks); -} CCBlink* CCBlink::create(float duration, unsigned int uBlinks) { @@ -1814,10 +1693,6 @@ CCActionInterval* CCBlink::reverse(void) // // FadeIn // -CCFadeIn* CCFadeIn::actionWithDuration(float d) -{ - return CCFadeIn::create(d); -} CCFadeIn* CCFadeIn::create(float d) { @@ -1869,10 +1744,6 @@ CCActionInterval* CCFadeIn::reverse(void) // // FadeOut // -CCFadeOut* CCFadeOut::actionWithDuration(float d) -{ - return CCFadeOut::create(d); -} CCFadeOut* CCFadeOut::create(float d) { @@ -1924,10 +1795,6 @@ CCActionInterval* CCFadeOut::reverse(void) // // FadeTo // -CCFadeTo* CCFadeTo::actionWithDuration(float duration, GLubyte opacity) -{ - return CCFadeTo::create(duration, opacity); -} CCFadeTo* CCFadeTo::create(float duration, GLubyte opacity) { @@ -1997,11 +1864,6 @@ void CCFadeTo::update(float time) // // TintTo // -CCTintTo* CCTintTo::actionWithDuration(float duration, GLubyte red, GLubyte green, GLubyte blue) -{ - return CCTintTo::create(duration, red, green, blue); -} - CCTintTo* CCTintTo::create(float duration, GLubyte red, GLubyte green, GLubyte blue) { CCTintTo *pTintTo = new CCTintTo(); @@ -2070,10 +1932,6 @@ void CCTintTo::update(float time) // // TintBy // -CCTintBy* CCTintBy::actionWithDuration(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue) -{ - return CCTintBy::create(duration, deltaRed, deltaGreen, deltaBlue); -} CCTintBy* CCTintBy::create(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue) { @@ -2154,11 +2012,6 @@ CCActionInterval* CCTintBy::reverse(void) // // DelayTime // -CCDelayTime* CCDelayTime::actionWithDuration(float d) -{ - return CCDelayTime::create(d); -} - CCDelayTime* CCDelayTime::create(float d) { CCDelayTime* pAction = new CCDelayTime(); @@ -2206,10 +2059,6 @@ CCActionInterval* CCDelayTime::reverse(void) // // ReverseTime // -CCReverseTime* CCReverseTime::actionWithAction(CCFiniteTimeAction *pAction) -{ - return CCReverseTime::create(pAction); -} CCReverseTime* CCReverseTime::create(CCFiniteTimeAction *pAction) { @@ -2301,11 +2150,6 @@ CCActionInterval* CCReverseTime::reverse(void) // // Animate // -CCAnimate* CCAnimate::actionWithAnimation(CCAnimation *pAnimation) -{ - return CCAnimate::create(pAnimation); -} - CCAnimate* CCAnimate::create(CCAnimation *pAnimation) { CCAnimate *pAnimate = new CCAnimate(); @@ -2498,11 +2342,6 @@ CCTargetedAction::~CCTargetedAction() CC_SAFE_RELEASE(m_pAction); } -CCTargetedAction* CCTargetedAction::actionWithTarget(CCNode* pTarget, CCFiniteTimeAction* pAction) -{ - return CCTargetedAction::create(pTarget, pAction); -} - CCTargetedAction* CCTargetedAction::create(CCNode* pTarget, CCFiniteTimeAction* pAction) { CCTargetedAction* p = new CCTargetedAction(); diff --git a/cocos2dx/actions/CCActionInterval.h b/cocos2dx/actions/CCActionInterval.h index b9ba35294a..7e3921b172 100644 --- a/cocos2dx/actions/CCActionInterval.h +++ b/cocos2dx/actions/CCActionInterval.h @@ -77,10 +77,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCActionInterval* actionWithDuration(float d); /** creates the action */ static CCActionInterval* create(float d); @@ -112,18 +108,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** helper constructor to create an array of sequenceable actions - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFiniteTimeAction* actions(CCFiniteTimeAction *pAction1, ...); - /** helper constructor to create an array of sequenceable actions given an array - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFiniteTimeAction* actionWithArray(CCArray *arrayOfActions); - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSequence* actionOneTwo(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo); /** helper constructor to create an array of sequenceable actions */ static CCFiniteTimeAction* create(CCFiniteTimeAction *pAction1, ...); @@ -174,10 +158,6 @@ public: } public: - /** creates a CCRepeat action. Times is an unsigned integer between 1 and pow(2,30) - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCRepeat* actionWithAction(CCFiniteTimeAction *pAction, unsigned int times); /** creates a CCRepeat action. Times is an unsigned integer between 1 and pow(2,30) */ static CCRepeat* create(CCFiniteTimeAction *pAction, unsigned int times); @@ -226,10 +206,7 @@ public: } public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCRepeatForever* actionWithAction(CCActionInterval *pAction); + /** creates the action */ static CCRepeatForever* create(CCActionInterval *pAction); protected: @@ -254,20 +231,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** helper constructor to create an array of spawned actions - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFiniteTimeAction* actions(CCFiniteTimeAction *pAction1, ...); - - /** helper constructor to create an array of spawned actions given an array - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFiniteTimeAction* actionWithArray(CCArray *arrayOfActions); - - /** creates the Spawn action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSpawn* actionOneTwo(CCFiniteTimeAction *pAction1, CCFiniteTimeAction *pAction2); /** helper constructor to create an array of spawned actions */ static CCFiniteTimeAction* create(CCFiniteTimeAction *pAction1, ...); @@ -293,10 +256,6 @@ protected: class CC_DLL CCRotateTo : public CCActionInterval { public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCRotateTo* actionWithDuration(float fDuration, float fDeltaAngle); /** creates the action */ static CCRotateTo* create(float fDuration, float fDeltaAngle); /** initializes the action */ @@ -325,10 +284,6 @@ protected: class CC_DLL CCRotateBy : public CCActionInterval { public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCRotateBy* actionWithDuration(float fDuration, float fDeltaAngle); /** creates the action */ static CCRotateBy* create(float fDuration, float fDeltaAngle); /** initializes the action */ @@ -362,10 +317,6 @@ public: virtual void update(float time); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMoveTo* actionWithDuration(float duration, const CCPoint& position); /** creates the action */ static CCMoveTo* create(float duration, const CCPoint& position); protected: @@ -389,10 +340,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMoveBy* actionWithDuration(float duration, const CCPoint& position); /** creates the action */ static CCMoveBy* create(float duration, const CCPoint& position); }; @@ -410,10 +357,6 @@ public: virtual void update(float time); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSkewTo* actionWithDuration(float t, float sx, float sy); /** creates the action */ static CCSkewTo* create(float t, float sx, float sy); @@ -439,10 +382,7 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSkewBy* actionWithDuration(float t, float deltaSkewX, float deltaSkewY); + /** creates the action */ static CCSkewBy* create(float t, float deltaSkewX, float deltaSkewY); }; @@ -461,10 +401,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCJumpBy* actionWithDuration(float duration, const CCPoint& position, float height, unsigned int jumps); /** creates the action */ static CCJumpBy* create(float duration, const CCPoint& position, float height, unsigned int jumps); protected: @@ -483,10 +419,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCJumpTo* actionWithDuration(float duration, const CCPoint& position, float height, int jumps); /** creates the action */ static CCJumpTo* create(float duration, const CCPoint& position, float height, int jumps); }; @@ -516,10 +448,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action with a duration and a bezier configuration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCBezierBy* actionWithDuration(float t, const ccBezierConfig& c); /** creates the action with a duration and a bezier configuration */ static CCBezierBy* create(float t, const ccBezierConfig& c); protected: @@ -537,10 +465,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action with a duration and a bezier configuration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCBezierTo* actionWithDuration(float t, const ccBezierConfig& c); /** creates the action with a duration and a bezier configuration */ static CCBezierTo* create(float t, const ccBezierConfig& c); @@ -567,15 +491,6 @@ public: virtual void update(float time); public: - /** creates the action with the same scale factor for X and Y - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScaleTo* actionWithDuration(float duration, float s); - - /** creates the action with and X factor and a Y factor - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScaleTo* actionWithDuration(float duration, float sx, float sy); /** creates the action with the same scale factor for X and Y */ static CCScaleTo* create(float duration, float s); @@ -603,15 +518,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action with the same scale factor for X and Y - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScaleBy* actionWithDuration(float duration, float s); - - /** creates the action with and X factor and a Y factor - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScaleBy* actionWithDuration(float duration, float sx, float sy); /** creates the action with the same scale factor for X and Y */ static CCScaleBy* create(float duration, float s); @@ -633,10 +539,7 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCBlink* actionWithDuration(float duration, unsigned int uBlinks); + /** creates the action */ static CCBlink* create(float duration, unsigned int uBlinks); @@ -659,10 +562,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFadeIn* actionWithDuration(float d); /** creates the action */ static CCFadeIn* create(float d); }; @@ -678,10 +577,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFadeOut* actionWithDuration(float d); /** creates the action */ static CCFadeOut* create(float d); @@ -701,10 +596,6 @@ public: virtual void update(float time); public: - /** creates an action with duration and opacity - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFadeTo* actionWithDuration(float duration, GLubyte opacity); /** creates an action with duration and opacity */ static CCFadeTo* create(float duration, GLubyte opacity); protected: @@ -727,10 +618,6 @@ public: virtual void update(float time); public: - /** creates an action with duration and color - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTintTo* actionWithDuration(float duration, GLubyte red, GLubyte green, GLubyte blue); /** creates an action with duration and color */ static CCTintTo* create(float duration, GLubyte red, GLubyte green, GLubyte blue); protected: @@ -753,10 +640,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates an action with duration and color - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTintBy* actionWithDuration(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue); /** creates an action with duration and color */ static CCTintBy* create(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue); protected: @@ -779,10 +662,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCDelayTime* actionWithDuration(float d); /** creates the action */ static CCDelayTime* create(float d); @@ -811,10 +690,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCReverseTime* actionWithAction(CCFiniteTimeAction *pAction); /** creates the action */ static CCReverseTime* create(CCFiniteTimeAction *pAction); protected: @@ -840,10 +715,6 @@ public: virtual CCActionInterval* reverse(void); public: - /** creates the action with an Animation and will restore the original frame when the animation is over - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCAnimate* actionWithAnimation(CCAnimation *pAnimation); /** creates the action with an Animation and will restore the original frame when the animation is over */ static CCAnimate* create(CCAnimation *pAnimation); CC_SYNTHESIZE_RETAIN(CCAnimation*, m_pAnimation, Animation) @@ -862,10 +733,7 @@ class CC_DLL CCTargetedAction : public CCActionInterval public: CCTargetedAction(); virtual ~CCTargetedAction(); - /** Create an action with the specified action and forced target - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTargetedAction* actionWithTarget(CCNode* pTarget, CCFiniteTimeAction* pAction); + /** Create an action with the specified action and forced target */ static CCTargetedAction* create(CCNode* pTarget, CCFiniteTimeAction* pAction); diff --git a/cocos2dx/actions/CCActionPageTurn3D.cpp b/cocos2dx/actions/CCActionPageTurn3D.cpp index fb932974d6..b4ba944548 100644 --- a/cocos2dx/actions/CCActionPageTurn3D.cpp +++ b/cocos2dx/actions/CCActionPageTurn3D.cpp @@ -27,11 +27,6 @@ THE SOFTWARE. NS_CC_BEGIN -CCPageTurn3D* CCPageTurn3D::actionWithSize(const ccGridSize& gridSize, float time) -{ - return CCPageTurn3D::create(gridSize, time); -} - CCPageTurn3D* CCPageTurn3D::create(const ccGridSize& gridSize, float time) { CCPageTurn3D *pAction = new CCPageTurn3D(); diff --git a/cocos2dx/actions/CCActionPageTurn3D.h b/cocos2dx/actions/CCActionPageTurn3D.h index 3f9117132e..e1aab07088 100644 --- a/cocos2dx/actions/CCActionPageTurn3D.h +++ b/cocos2dx/actions/CCActionPageTurn3D.h @@ -49,10 +49,7 @@ public: virtual void update(float time); public: - /** create the action - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCPageTurn3D* actionWithSize(const ccGridSize& gridSize, float time); + /** create the action */ static CCPageTurn3D* create(const ccGridSize& gridSize, float time); }; diff --git a/cocos2dx/actions/CCActionProgressTimer.cpp b/cocos2dx/actions/CCActionProgressTimer.cpp index 5c1ba81133..b90e4363f8 100644 --- a/cocos2dx/actions/CCActionProgressTimer.cpp +++ b/cocos2dx/actions/CCActionProgressTimer.cpp @@ -32,11 +32,6 @@ NS_CC_BEGIN // implementation of CCProgressTo -CCProgressTo* CCProgressTo::actionWithDuration(float duration, float fPercent) -{ - return CCProgressTo::create(duration, fPercent); -} - CCProgressTo* CCProgressTo::create(float duration, float fPercent) { CCProgressTo *pProgressTo = new CCProgressTo(); @@ -101,11 +96,6 @@ void CCProgressTo::update(float time) // implementation of CCProgressFromTo -CCProgressFromTo* CCProgressFromTo::actionWithDuration(float duration, float fFromPercentage, float fToPercentage) -{ - return CCProgressFromTo::create(duration, fFromPercentage, fToPercentage); -} - CCProgressFromTo* CCProgressFromTo::create(float duration, float fFromPercentage, float fToPercentage) { CCProgressFromTo *pProgressFromTo = new CCProgressFromTo(); diff --git a/cocos2dx/actions/CCActionProgressTimer.h b/cocos2dx/actions/CCActionProgressTimer.h index aa408c0960..88ca971d87 100644 --- a/cocos2dx/actions/CCActionProgressTimer.h +++ b/cocos2dx/actions/CCActionProgressTimer.h @@ -49,10 +49,6 @@ public: virtual void update(float time); public: - /** Creates and initializes with a duration and a percent - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCProgressTo* actionWithDuration(float duration, float fPercent); /** Creates and initializes with a duration and a percent */ static CCProgressTo* create(float duration, float fPercent); protected: @@ -76,10 +72,7 @@ public: virtual void update(float time); public: - /** Creates and initializes the action with a duration, a "from" percentage and a "to" percentage - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCProgressFromTo* actionWithDuration(float duration, float fFromPercentage, float fToPercentage); + /** Creates and initializes the action with a duration, a "from" percentage and a "to" percentage */ static CCProgressFromTo* create(float duration, float fFromPercentage, float fToPercentage); protected: diff --git a/cocos2dx/actions/CCActionTiledGrid.cpp b/cocos2dx/actions/CCActionTiledGrid.cpp index a3f77bc907..0e43616873 100644 --- a/cocos2dx/actions/CCActionTiledGrid.cpp +++ b/cocos2dx/actions/CCActionTiledGrid.cpp @@ -41,11 +41,6 @@ struct Tile // implementation of ShakyTiles3D -CCShakyTiles3D* CCShakyTiles3D::actionWithRange(int nRange, bool bShakeZ,const ccGridSize& gridSize, float duration) -{ - return CCShakyTiles3D::create(nRange, bShakeZ, gridSize, duration); -} - CCShakyTiles3D* CCShakyTiles3D::create(int nRange, bool bShakeZ,const ccGridSize& gridSize, float duration) { CCShakyTiles3D *pAction = new CCShakyTiles3D(); @@ -139,11 +134,6 @@ void CCShakyTiles3D::update(float time) // implementation of CCShatteredTiles3D -CCShatteredTiles3D* CCShatteredTiles3D::actionWithRange(int nRange, bool bShatterZ, const ccGridSize& gridSize, float duration) -{ - return CCShatteredTiles3D::create(nRange, bShatterZ, gridSize, duration); -} - CCShatteredTiles3D* CCShatteredTiles3D::create(int nRange, bool bShatterZ, const ccGridSize& gridSize, float duration) { CCShatteredTiles3D *pAction = new CCShatteredTiles3D(); @@ -243,11 +233,6 @@ void CCShatteredTiles3D::update(float time) // implementation of CCShuffleTiles -CCShuffleTiles* CCShuffleTiles::actionWithSeed(int s, const ccGridSize& gridSize, float duration) -{ - return CCShuffleTiles::create(s, gridSize, duration); -} - CCShuffleTiles* CCShuffleTiles::create(int s, const ccGridSize& gridSize, float duration) { CCShuffleTiles *pAction = new CCShuffleTiles(); @@ -412,11 +397,6 @@ void CCShuffleTiles::update(float time) // implementation of CCFadeOutTRTiles -CCFadeOutTRTiles* CCFadeOutTRTiles::actionWithSize(const ccGridSize& gridSize, float time) -{ - return CCFadeOutTRTiles::create( gridSize, time); -} - CCFadeOutTRTiles* CCFadeOutTRTiles::create(const ccGridSize& gridSize, float time) { CCFadeOutTRTiles *pAction = new CCFadeOutTRTiles(); @@ -505,10 +485,6 @@ void CCFadeOutTRTiles::update(float time) } // implementation of CCFadeOutBLTiles -CCFadeOutBLTiles* CCFadeOutBLTiles::actionWithSize(const ccGridSize& gridSize, float time) -{ - return CCFadeOutBLTiles::create(gridSize, time); -} CCFadeOutBLTiles* CCFadeOutBLTiles::create(const ccGridSize& gridSize, float time) { @@ -542,11 +518,6 @@ float CCFadeOutBLTiles::testFunc(const ccGridSize& pos, float time) // implementation of CCFadeOutUpTiles -CCFadeOutUpTiles* CCFadeOutUpTiles::actionWithSize(const ccGridSize& gridSize, float time) -{ - return CCFadeOutUpTiles::create(gridSize, time); -} - CCFadeOutUpTiles* CCFadeOutUpTiles::create(const ccGridSize& gridSize, float time) { CCFadeOutUpTiles *pAction = new CCFadeOutUpTiles(); @@ -591,10 +562,6 @@ void CCFadeOutUpTiles::transformTile(const ccGridSize& pos, float distance) } // implementation of CCFadeOutDownTiles -CCFadeOutDownTiles* CCFadeOutDownTiles::actionWithSize(const ccGridSize& gridSize, float time) -{ - return CCFadeOutDownTiles::create(gridSize, time); -} CCFadeOutDownTiles* CCFadeOutDownTiles::create(const ccGridSize& gridSize, float time) { @@ -627,10 +594,6 @@ float CCFadeOutDownTiles::testFunc(const ccGridSize& pos, float time) } // implementation of TurnOffTiles -CCTurnOffTiles* CCTurnOffTiles::actionWithSize(const ccGridSize& size, float d) -{ - return CCTurnOffTiles::create( size, d); -} CCTurnOffTiles* CCTurnOffTiles::create(const ccGridSize& size, float d) { @@ -646,11 +609,6 @@ CCTurnOffTiles* CCTurnOffTiles::create(const ccGridSize& size, float d) return pAction; } -CCTurnOffTiles* CCTurnOffTiles::actionWithSeed(int s, const ccGridSize& gridSize, float duration) -{ - return CCTurnOffTiles::create(s, gridSize, duration); -} - CCTurnOffTiles* CCTurnOffTiles::create(int s, const ccGridSize& gridSize, float duration) { CCTurnOffTiles *pAction = new CCTurnOffTiles(); @@ -781,11 +739,6 @@ void CCTurnOffTiles::update(float time) // implementation of CCWavesTiles3D -CCWavesTiles3D* CCWavesTiles3D::actionWithWaves(int wav, float amp, const ccGridSize& gridSize, float duration) -{ - return CCWavesTiles3D::create(wav, amp, gridSize, duration); -} - CCWavesTiles3D* CCWavesTiles3D::create(int wav, float amp, const ccGridSize& gridSize, float duration) { CCWavesTiles3D *pAction = new CCWavesTiles3D(); @@ -864,11 +817,6 @@ void CCWavesTiles3D::update(float time) // implementation of CCJumpTiles3D -CCJumpTiles3D* CCJumpTiles3D::actionWithJumps(int j, float amp, const ccGridSize& gridSize, float duration) -{ - return CCJumpTiles3D::create(j, amp, gridSize, duration); -} - CCJumpTiles3D* CCJumpTiles3D::create(int j, float amp, const ccGridSize& gridSize, float duration) { CCJumpTiles3D *pAction = new CCJumpTiles3D(); @@ -958,11 +906,6 @@ void CCJumpTiles3D::update(float time) // implementation of CCSplitRows -CCSplitRows* CCSplitRows::actionWithRows(int nRows, float duration) -{ - return CCSplitRows::create(nRows, duration); -} - CCSplitRows* CCSplitRows::create(int nRows, float duration) { CCSplitRows *pAction = new CCSplitRows(); @@ -1042,11 +985,6 @@ void CCSplitRows::update(float time) // implementation of CCSplitCols -CCSplitCols* CCSplitCols::actionWithCols(int nCols, float duration) -{ - return CCSplitCols::create(nCols, duration); -} - CCSplitCols* CCSplitCols::create(int nCols, float duration) { CCSplitCols *pAction = new CCSplitCols(); diff --git a/cocos2dx/actions/CCActionTiledGrid.h b/cocos2dx/actions/CCActionTiledGrid.h index 06bdd3abd6..e97f90ab7b 100644 --- a/cocos2dx/actions/CCActionTiledGrid.h +++ b/cocos2dx/actions/CCActionTiledGrid.h @@ -46,10 +46,6 @@ public: virtual void update(float time); public: - /** creates the action with a range, whether or not to shake Z vertices, a grid size, and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCShakyTiles3D* actionWithRange(int nRange, bool bShakeZ, const ccGridSize& gridSize, float duration); /** creates the action with a range, whether or not to shake Z vertices, a grid size, and duration */ static CCShakyTiles3D* create(int nRange, bool bShakeZ, const ccGridSize& gridSize, float duration); @@ -71,11 +67,6 @@ public: virtual void update(float time); public: - /** creates the action with a range, whether of not to shatter Z vertices, a grid size and duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCShatteredTiles3D* actionWithRange(int nRange, bool bShatterZ, const ccGridSize& gridSize, - float duration); /** creates the action with a range, whether of not to shatter Z vertices, a grid size and duration */ static CCShatteredTiles3D* create(int nRange, bool bShatterZ, const ccGridSize& gridSize, @@ -105,10 +96,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); public: - /** creates the action with a random seed, the grid size and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCShuffleTiles* actionWithSeed(int s, const ccGridSize& gridSize, float duration); /** creates the action with a random seed, the grid size and the duration */ static CCShuffleTiles* create(int s, const ccGridSize& gridSize, float duration); protected: @@ -131,10 +118,6 @@ public: virtual void update(float time); public: - /** creates the action with the grid size and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFadeOutTRTiles* actionWithSize(const ccGridSize& gridSize, float time); /** creates the action with the grid size and the duration */ static CCFadeOutTRTiles* create(const ccGridSize& gridSize, float time); @@ -149,10 +132,6 @@ public: virtual float testFunc(const ccGridSize& pos, float time); public: - /** creates the action with the grid size and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFadeOutBLTiles* actionWithSize(const ccGridSize& gridSize, float time); /** creates the action with the grid size and the duration */ static CCFadeOutBLTiles* create(const ccGridSize& gridSize, float time); @@ -168,10 +147,6 @@ public: virtual void transformTile(const ccGridSize& pos, float distance); public: - /** creates the action with the grid size and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFadeOutUpTiles* actionWithSize(const ccGridSize& gridSize, float time); /** creates the action with the grid size and the duration */ static CCFadeOutUpTiles* create(const ccGridSize& gridSize, float time); @@ -186,10 +161,6 @@ public: virtual float testFunc(const ccGridSize& pos, float time); public: - /** creates the action with the grid size and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCFadeOutDownTiles* actionWithSize(const ccGridSize& gridSize, float time); /** creates the action with the grid size and the duration */ static CCFadeOutDownTiles* create(const ccGridSize& gridSize, float time); @@ -213,14 +184,6 @@ public: virtual void update(float time); public: - /** creates the action with the grid size and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTurnOffTiles* actionWithSize(const ccGridSize& size, float d); - /** creates the action with a random seed, the grid size and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTurnOffTiles* actionWithSeed(int s, const ccGridSize& gridSize, float duration); /** creates the action with the grid size and the duration */ static CCTurnOffTiles* create(const ccGridSize& size, float d); @@ -252,10 +215,6 @@ public: virtual void update(float time); public: - /** creates the action with a number of waves, the waves amplitude, the grid size and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCWavesTiles3D* actionWithWaves(int wav, float amp, const ccGridSize& gridSize, float duration); /** creates the action with a number of waves, the waves amplitude, the grid size and the duration */ static CCWavesTiles3D* create(int wav, float amp, const ccGridSize& gridSize, float duration); protected: @@ -284,10 +243,7 @@ public: virtual void update(float time); public: - /** creates the action with the number of jumps, the sin amplitude, the grid size and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCJumpTiles3D* actionWithJumps(int j, float amp, const ccGridSize& gridSize, float duration); + /** creates the action with the number of jumps, the sin amplitude, the grid size and the duration */ static CCJumpTiles3D* create(int j, float amp, const ccGridSize& gridSize, float duration); protected: @@ -308,10 +264,7 @@ public : virtual void startWithTarget(CCNode *pTarget); public: - /** creates the action with the number of rows to split and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSplitRows* actionWithRows(int nRows, float duration); + /** creates the action with the number of rows to split and the duration */ static CCSplitRows* create(int nRows, float duration); protected: @@ -331,10 +284,6 @@ public: virtual void startWithTarget(CCNode *pTarget); public: - /** creates the action with the number of columns to split and the duration - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSplitCols* actionWithCols(int nCols, float duration); /** creates the action with the number of columns to split and the duration */ static CCSplitCols* create(int nCols, float duration); protected: diff --git a/cocos2dx/actions/CCActionTween.cpp b/cocos2dx/actions/CCActionTween.cpp index 6aefcd16fc..0608e79d80 100644 --- a/cocos2dx/actions/CCActionTween.cpp +++ b/cocos2dx/actions/CCActionTween.cpp @@ -27,11 +27,6 @@ THE SOFTWARE. NS_CC_BEGIN -CCActionTween* CCActionTween::actionWithDuration(float aDuration, const char* key, float from, float to) -{ - return CCActionTween::create(aDuration, key, from, to); -} - CCActionTween* CCActionTween::create(float aDuration, const char* key, float from, float to) { CCActionTween* pRet = new CCActionTween(); diff --git a/cocos2dx/actions/CCActionTween.h b/cocos2dx/actions/CCActionTween.h index 8fc4a7eb82..e44e74f648 100644 --- a/cocos2dx/actions/CCActionTween.h +++ b/cocos2dx/actions/CCActionTween.h @@ -62,10 +62,6 @@ public: class CC_DLL CCActionTween : public CCActionInterval { public: - /** creates an initializes the action with the property name (key), and the from and to parameters. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCActionTween* actionWithDuration(float aDuration, const char* key, float from, float to); /** creates an initializes the action with the property name (key), and the from and to parameters. */ static CCActionTween* create(float aDuration, const char* key, float from, float to); /** initializes the action with the property name (key), and the from and to parameters. */ diff --git a/cocos2dx/base_nodes/CCAtlasNode.cpp b/cocos2dx/base_nodes/CCAtlasNode.cpp index 3a9fce3fb1..bac4db2835 100644 --- a/cocos2dx/base_nodes/CCAtlasNode.cpp +++ b/cocos2dx/base_nodes/CCAtlasNode.cpp @@ -60,12 +60,6 @@ CCAtlasNode::~CCAtlasNode() CC_SAFE_RELEASE(m_pTextureAtlas); } -CCAtlasNode * CCAtlasNode::atlasWithTileFile(const char *tile, unsigned int tileWidth, unsigned int tileHeight, - unsigned int itemsToRender) -{ - return CCAtlasNode::create(tile, tileWidth, tileHeight, itemsToRender); -} - CCAtlasNode * CCAtlasNode::create(const char *tile, unsigned int tileWidth, unsigned int tileHeight, unsigned int itemsToRender) { diff --git a/cocos2dx/base_nodes/CCAtlasNode.h b/cocos2dx/base_nodes/CCAtlasNode.h index c239fa57d6..fe1bb53384 100644 --- a/cocos2dx/base_nodes/CCAtlasNode.h +++ b/cocos2dx/base_nodes/CCAtlasNode.h @@ -84,12 +84,6 @@ public: CCAtlasNode(); virtual ~CCAtlasNode(); - /** creates a CCAtlasNode with an Atlas file the width and height of each item and the quantity of items to render - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCAtlasNode * atlasWithTileFile(const char* tile,unsigned int tileWidth, unsigned int tileHeight, - unsigned int itemsToRender); - /** creates a CCAtlasNode with an Atlas file the width and height of each item and the quantity of items to render*/ static CCAtlasNode * create(const char* tile,unsigned int tileWidth, unsigned int tileHeight, unsigned int itemsToRender); diff --git a/cocos2dx/base_nodes/CCNode.cpp b/cocos2dx/base_nodes/CCNode.cpp index 830c0779fe..948575caa4 100644 --- a/cocos2dx/base_nodes/CCNode.cpp +++ b/cocos2dx/base_nodes/CCNode.cpp @@ -507,11 +507,6 @@ CCRect CCNode::boundingBox() return CCRectApplyAffineTransform(rect, nodeToParentTransform()); } -CCNode * CCNode::node(void) -{ - return CCNode::create(); -} - CCNode * CCNode::create(void) { CCNode * pRet = new CCNode(); diff --git a/cocos2dx/base_nodes/CCNode.h b/cocos2dx/base_nodes/CCNode.h index 2809257d4f..498e546405 100644 --- a/cocos2dx/base_nodes/CCNode.h +++ b/cocos2dx/base_nodes/CCNode.h @@ -397,12 +397,6 @@ public: const char* description(void); - /** allocates and initializes a node. - The node will be created as "autorelease". - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCNode * node(void); - /** allocates and initializes a node. The node will be created as "autorelease". */ diff --git a/cocos2dx/cocoa/CCArray.cpp b/cocos2dx/cocoa/CCArray.cpp index 7a6735eba0..226b364d29 100644 --- a/cocos2dx/cocoa/CCArray.cpp +++ b/cocos2dx/cocoa/CCArray.cpp @@ -40,11 +40,6 @@ CCArray::CCArray(unsigned int capacity) initWithCapacity(capacity); } -CCArray* CCArray::array() -{ - return CCArray::create(); -} - CCArray* CCArray::create() { CCArray* pArray = new CCArray(); @@ -61,11 +56,6 @@ CCArray* CCArray::create() return pArray; } -CCArray* CCArray::arrayWithObject(CCObject* pObject) -{ - return CCArray::createWithObject(pObject); -} - CCArray* CCArray::createWithObject(CCObject* pObject) { CCArray* pArray = new CCArray(); @@ -82,32 +72,6 @@ CCArray* CCArray::createWithObject(CCObject* pObject) return pArray; } -CCArray* CCArray::arrayWithObjects(CCObject* pObject, ...) -{ - va_list args; - va_start(args,pObject); - - CCArray* pArray = create(); - if (pArray && pObject) - { - pArray->addObject(pObject); - CCObject *i = va_arg(args, CCObject*); - while(i) - { - pArray->addObject(i); - i = va_arg(args, CCObject*); - } - } - else - { - CC_SAFE_DELETE(pArray); - } - - va_end(args); - - return pArray; -} - CCArray* CCArray::create(CCObject* pObject, ...) { va_list args; @@ -134,15 +98,17 @@ CCArray* CCArray::create(CCObject* pObject, ...) return pArray; } -CCArray* CCArray::arrayWithCapacity(unsigned int capacity) +CCArray* CCArray::createWithArray(CCArray* otherArray) { - return CCArray::createWithCapacity(capacity); + CCArray* pRet = (CCArray*)otherArray->copy(); + pRet->autorelease(); + return pRet; } CCArray* CCArray::createWithCapacity(unsigned int capacity) { CCArray* pArray = new CCArray(); - + if (pArray && pArray->initWithCapacity(capacity)) { pArray->autorelease(); @@ -151,27 +117,10 @@ CCArray* CCArray::createWithCapacity(unsigned int capacity) { CC_SAFE_DELETE(pArray); } - + return pArray; } -CCArray* CCArray::arrayWithArray(CCArray* otherArray) -{ - return CCArray::createWithArray(otherArray); -} - -CCArray* CCArray::createWithArray(CCArray* otherArray) -{ - CCArray* pRet = (CCArray*)otherArray->copy(); - pRet->autorelease(); - return pRet; -} - -CCArray* CCArray::arrayWithContentsOfFile(const char* pFileName) -{ - return CCArray::createWithContentsOfFile(pFileName); -} - CCArray* CCArray::createWithContentsOfFile(const char* pFileName) { CCArray* pRet = CCArray::createWithContentsOfFileThreadSafe(pFileName); @@ -184,11 +133,6 @@ CCArray* CCArray::createWithContentsOfFile(const char* pFileName) extern CCArray* ccFileUtils_arrayWithContentsOfFileThreadSafe(const char* pFileName); -CCArray* CCArray::arrayWithContentsOfFileThreadSafe(const char* pFileName) -{ - return CCArray::createWithContentsOfFileThreadSafe(pFileName); -} - CCArray* CCArray::createWithContentsOfFileThreadSafe(const char* pFileName) { return ccFileUtils_arrayWithContentsOfFileThreadSafe(pFileName); diff --git a/cocos2dx/cocoa/CCArray.h b/cocos2dx/cocoa/CCArray.h index 1f68f08351..fa92ab3998 100644 --- a/cocos2dx/cocoa/CCArray.h +++ b/cocos2dx/cocoa/CCArray.h @@ -114,42 +114,6 @@ class CC_DLL CCArray : public CCObject public: ~CCArray(); - /* static functions */ - /** Create an array - @deprecated: Please use create() instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCArray* array(); - /** Create an array with one object - @deprecated: Please use createWithObject(CCObject*) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCArray* arrayWithObject(CCObject* pObject); - /** Create an array with some objects - @deprecated: Please use create(CCObject*, ...) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCArray* arrayWithObjects(CCObject* pObject, ...); - /** Create an array with capacity - @deprecated: Please use createWithCapacity(unsigned int) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCArray* arrayWithCapacity(unsigned int capacity); - /** Create an array with an existing array - @deprecated: Please use createWithArray(CCArray*) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCArray* arrayWithArray(CCArray* otherArray); - /** - @brief Generate a CCArray pointer by file - @param pFileName The file name of *.plist file - @return The CCArray pointer generated from the file - @deprecated: Please use createWithContentsOfFile(const char*) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCArray* arrayWithContentsOfFile(const char* pFileName); - - /* - @brief The same meaning as arrayWithContentsOfFile(), but it doesn't call autorelease, so the - invoker should call release(). - @deprecated: Please use createWithContentsOfFileThreadSafe(const char*) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCArray* arrayWithContentsOfFileThreadSafe(const char* pFileName); - /** Create an array */ static CCArray* create(); /** Create an array with some objects */ diff --git a/cocos2dx/cocoa/CCDictionary.cpp b/cocos2dx/cocoa/CCDictionary.cpp index eafd729dba..0296c0213c 100644 --- a/cocos2dx/cocoa/CCDictionary.cpp +++ b/cocos2dx/cocoa/CCDictionary.cpp @@ -298,9 +298,27 @@ CCObject* CCDictionary::copyWithZone(CCZone* pZone) return pNewDict; } -CCDictionary* CCDictionary::dictionary() +CCObject* CCDictionary::randomObject() { - return CCDictionary::create(); + if (m_eDictType == kCCDictUnknown) + { + return NULL; + } + + CCObject* key = allKeys()->randomObject(); + + if (m_eDictType == kCCDictInt) + { + return objectForKey(((CCInteger*)key)->getValue()); + } + else if (m_eDictType == kCCDictStr) + { + return objectForKey(((CCString*)key)->getCString()); + } + else + { + return NULL; + } } CCDictionary* CCDictionary::create() @@ -313,11 +331,6 @@ CCDictionary* CCDictionary::create() return pRet; } -CCDictionary* CCDictionary::dictionaryWithDictionary(CCDictionary* srcDict) -{ - return CCDictionary::createWithDictionary(srcDict); -} - CCDictionary* CCDictionary::createWithDictionary(CCDictionary* srcDict) { CCDictionary* pNewDict = (CCDictionary*)srcDict->copy(); @@ -327,21 +340,11 @@ CCDictionary* CCDictionary::createWithDictionary(CCDictionary* srcDict) extern CCDictionary* ccFileUtils_dictionaryWithContentsOfFileThreadSafe(const char *pFileName); -CCDictionary* CCDictionary::dictionaryWithContentsOfFileThreadSafe(const char *pFileName) -{ - return CCDictionary::createWithContentsOfFileThreadSafe(pFileName); -} - CCDictionary* CCDictionary::createWithContentsOfFileThreadSafe(const char *pFileName) { return ccFileUtils_dictionaryWithContentsOfFileThreadSafe(pFileName); } -CCDictionary* CCDictionary::dictionaryWithContentsOfFile(const char *pFileName) -{ - return CCDictionary::createWithContentsOfFile(pFileName); -} - CCDictionary* CCDictionary::createWithContentsOfFile(const char *pFileName) { CCDictionary* pRet = createWithContentsOfFileThreadSafe(pFileName); diff --git a/cocos2dx/cocoa/CCDictionary.h b/cocos2dx/cocoa/CCDictionary.h index 18dc2b8f9c..556c8a2ba7 100644 --- a/cocos2dx/cocoa/CCDictionary.h +++ b/cocos2dx/cocoa/CCDictionary.h @@ -140,28 +140,9 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); - /* static functions */ - //@deprecated: Please use create() instead. This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCDictionary* dictionary(); - - //@deprecated: Please use createWithDictionary(CCDictionary*) instead. This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCDictionary* dictionaryWithDictionary(CCDictionary* srcDict); + /** Returns a random element */ + CCObject* randomObject(); - /** - @brief Generate a CCDictionary pointer by file - @param pFileName The file name of *.plist file - @return The CCDictionary pointer generated from the file - @deprecated: Please use createWithContentsOfFile(const char*) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCDictionary* dictionaryWithContentsOfFile(const char *pFileName); - - /* - @brief The same meaning as dictionaryWithContentsOfFile(), but it doesn't call autorelease, so the - invoker should call release(). - @deprecated: Please use createWithContentsOfFileThreadSafe(const char*) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCDictionary* dictionaryWithContentsOfFileThreadSafe(const char *pFileName); - static CCDictionary* create(); static CCDictionary* createWithDictionary(CCDictionary* srcDict); diff --git a/cocos2dx/cocoa/CCGeometry.cpp b/cocos2dx/cocoa/CCGeometry.cpp index c1ce95177d..371ea88950 100644 --- a/cocos2dx/cocoa/CCGeometry.cpp +++ b/cocos2dx/cocoa/CCGeometry.cpp @@ -67,11 +67,6 @@ bool CCPoint::equals(const CCPoint& target) const return ((x == target.x) && (y == target.y)); } -bool CCPoint::CCPointEqualToPoint(const CCPoint& point1, const CCPoint& point2) -{ - return point1.equals(point2); -} - // implementation of CCSize CCSize::CCSize(void) @@ -113,12 +108,6 @@ bool CCSize::equals(const CCSize& target) const return ((width == target.width) && (height == target.height)); } - -bool CCSize::CCSizeEqualToSize(const CCSize& size1, const CCSize& size2) -{ - return size1.equals(size2); -} - // implementation of CCRect CCRect::CCRect(void) @@ -218,25 +207,4 @@ bool CCRect::intersectsRect(const CCRect& rect) const rect.getMaxY() < getMinY()); } -bool CCRect::CCRectEqualToRect(const CCRect& rect1, const CCRect& rect2) -{ - return rect1.equals(rect2); -} - -bool CCRect::CCRectContainsPoint(const CCRect& rect, const CCPoint& point) -{ - return rect.containsPoint(point); -} - -bool CCRect::CCRectIntersectsRect(const CCRect& rectA, const CCRect& rectB) -{ - /* - return !(CCRectGetMaxX(rectA) < CCRectGetMinX(rectB)|| - CCRectGetMaxX(rectB) < CCRectGetMinX(rectA)|| - CCRectGetMaxY(rectA) < CCRectGetMinY(rectB)|| - CCRectGetMaxY(rectB) < CCRectGetMinY(rectA)); - */ - return rectA.intersectsRect(rectB); -} - NS_CC_END diff --git a/cocos2dx/cocoa/CCGeometry.h b/cocos2dx/cocoa/CCGeometry.h index d5db525dee..b61f452d7e 100644 --- a/cocos2dx/cocoa/CCGeometry.h +++ b/cocos2dx/cocoa/CCGeometry.h @@ -49,11 +49,6 @@ public: void setPoint(float x, float y); virtual CCObject* copyWithZone(CCZone* pZone); bool equals(const CCPoint& target) const; - -public: - /** @deprecated use CCPoint::equals(const CCPoint&) instead, like p1.equals(p2) - */ - CC_DEPRECATED_ATTRIBUTE static bool CCPointEqualToPoint(const CCPoint& point1, const CCPoint& point2); }; class CC_DLL CCSize : public CCObject @@ -70,10 +65,6 @@ public: void setSize(float width, float height); virtual CCObject* copyWithZone(CCZone* pZone); bool equals(const CCSize& target) const; - -public: - /** @deprecated use CCSize::equals(const CCSize&) instead, like size1.equals(size2) */ - CC_DEPRECATED_ATTRIBUTE static bool CCSizeEqualToSize(const CCSize& size1, const CCSize& size2); }; class CC_DLL CCRect : public CCObject @@ -98,14 +89,6 @@ public: bool equals(const CCRect& rect) const; bool containsPoint(const CCPoint& point) const; bool intersectsRect(const CCRect& rect) const; - -public: - /** @deprecated use CCRect::equals(const CCRect&) instead, like r1.equals(r2) */ - CC_DEPRECATED_ATTRIBUTE static bool CCRectEqualToRect(const CCRect& rect1, const CCRect& rect2); - /** @deprecated use CCRect::containsPoint(const CCPoint&) instead, like rect.containsPoint(point) */ - CC_DEPRECATED_ATTRIBUTE static bool CCRectContainsPoint(const CCRect& rect, const CCPoint& point); - /** @deprecated use CCRect::intersectsRect(const CCRect&) instead, like r1.intersectsRect(r2) */ - CC_DEPRECATED_ATTRIBUTE static bool CCRectIntersectsRect(const CCRect& rectA, const CCRect& rectB); }; diff --git a/cocos2dx/cocoa/CCInteger.h b/cocos2dx/cocoa/CCInteger.h index 309e5c4c9c..f412dd4a3a 100644 --- a/cocos2dx/cocoa/CCInteger.h +++ b/cocos2dx/cocoa/CCInteger.h @@ -17,12 +17,6 @@ public: : m_nValue(v) {} int getValue() const {return m_nValue;} - // @deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCInteger* integerWithInt(int v) - { - return CCInteger::create(v); - } - static CCInteger* create(int v) { CCInteger* pRet = new CCInteger(v); diff --git a/cocos2dx/cocoa/CCSet.cpp b/cocos2dx/cocoa/CCSet.cpp index f284d9c937..8ab306af56 100644 --- a/cocos2dx/cocoa/CCSet.cpp +++ b/cocos2dx/cocoa/CCSet.cpp @@ -52,18 +52,7 @@ CCSet::CCSet(const CCSet &rSetObject) CCSet::~CCSet(void) { - // call release() of elements - CCSetIterator iter; - for (iter = m_pSet->begin(); iter != m_pSet->end(); ++iter) - { - if (! (*iter)) - { - break; - } - - (*iter)->release(); - } - + removeAllObjects(); CC_SAFE_DELETE(m_pSet); } @@ -96,6 +85,20 @@ void CCSet::removeObject(CCObject *pObject) CC_SAFE_RELEASE(pObject); } +void CCSet::removeAllObjects() +{ + CCSetIterator it; + for (it = m_pSet->begin(); it != m_pSet->end(); ++it) + { + if (! (*it)) + { + break; + } + + (*it)->release(); + } +} + bool CCSet::containsObject(CCObject *pObject) { return m_pSet->find(pObject) != m_pSet->end(); diff --git a/cocos2dx/cocoa/CCSet.h b/cocos2dx/cocoa/CCSet.h index e6513c3685..9c6a621862 100644 --- a/cocos2dx/cocoa/CCSet.h +++ b/cocos2dx/cocoa/CCSet.h @@ -64,6 +64,10 @@ public: *@brief Remove the given element, nothing todo if no element equals pObject. */ void removeObject(CCObject *pObject); + /** + *@brief Remove all elements of the set + */ + void removeAllObjects(); /** *@brief Check if CCSet contains a element equals pObject. */ diff --git a/cocos2dx/cocoa/CCString.cpp b/cocos2dx/cocoa/CCString.cpp index f6ea6d8390..d22f5724ad 100644 --- a/cocos2dx/cocoa/CCString.cpp +++ b/cocos2dx/cocoa/CCString.cpp @@ -150,11 +150,6 @@ bool CCString::isEqual(const CCObject* pObject) return bRet; } -CCString* CCString::stringWithCString(const char* pStr) -{ - return CCString::create(pStr); -} - CCString* CCString::create(const std::string& str) { CCString* pRet = new CCString(str); @@ -162,18 +157,6 @@ CCString* CCString::create(const std::string& str) return pRet; } -CCString* CCString::stringWithString(const std::string& pStr) -{ - CCString* pRet = new CCString(pStr); - pRet->autorelease(); - return pRet; -} - -CCString* CCString::stringWithData(const unsigned char* pData, unsigned long nLen) -{ - return CCString::createWithData(pData, nLen); -} - CCString* CCString::createWithData(const unsigned char* pData, unsigned long nLen) { CCString* pRet = NULL; @@ -195,17 +178,6 @@ CCString* CCString::createWithData(const unsigned char* pData, unsigned long nLe return pRet; } -CCString* CCString::stringWithFormat(const char* format, ...) -{ - CCString* pRet = CCString::create(""); - va_list ap; - va_start(ap, format); - pRet->initWithFormatAndValist(format, ap); - va_end(ap); - - return pRet; -} - CCString* CCString::createWithFormat(const char* format, ...) { CCString* pRet = CCString::create(""); @@ -217,11 +189,6 @@ CCString* CCString::createWithFormat(const char* format, ...) return pRet; } -CCString* CCString::stringWithContentsOfFile(const char* pszFileName) -{ - return CCString::createWithContentsOfFile(pszFileName); -} - CCString* CCString::createWithContentsOfFile(const char* pszFileName) { unsigned long size = 0; diff --git a/cocos2dx/cocoa/CCString.h b/cocos2dx/cocoa/CCString.h index bb8f242528..895a96cf35 100644 --- a/cocos2dx/cocoa/CCString.h +++ b/cocos2dx/cocoa/CCString.h @@ -84,42 +84,6 @@ public: virtual CCObject* copyWithZone(CCZone* pZone); virtual bool isEqual(const CCObject* pObject); - /* static functions */ - /** create a string with c string - * @return A CCString pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCString* stringWithCString(const char* pStr); - - /** create a string with std::string - * @return A CCString pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - */ - CC_DEPRECATED_ATTRIBUTE static CCString* stringWithString(const std::string& str); - - /** create a string with format, it's similar with the c function 'sprintf', the default buffer size is (1024*100) bytes, - * if you want to change it, you should modify the kMaxStringLen macro in CCString.cpp file. - * @return A CCString pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCString* stringWithFormat(const char* format, ...); - - /** create a string with binary data - * @return A CCString pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCString* stringWithData(const unsigned char* pData, unsigned long nLen); - - /** create a string with a file, - * @return A CCString pointer which is an autorelease object pointer, - * it means that you needn't do a release operation unless you retain it. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCString* stringWithContentsOfFile(const char* pszFileName); - /** create a string with std string, you can also pass a c string pointer because the default constructor of std::string can access a c string pointer. * @return A CCString pointer which is an autorelease object pointer, * it means that you needn't do a release operation unless you retain it. diff --git a/cocos2dx/effects/CCGrid.cpp b/cocos2dx/effects/CCGrid.cpp index 78e896f11e..d9cff717f6 100644 --- a/cocos2dx/effects/CCGrid.cpp +++ b/cocos2dx/effects/CCGrid.cpp @@ -39,11 +39,6 @@ THE SOFTWARE. NS_CC_BEGIN // implementation of CCGridBase -CCGridBase* CCGridBase::gridWithSize(const ccGridSize& gridSize) -{ - return CCGridBase::create(gridSize); -} - CCGridBase* CCGridBase::create(const ccGridSize& gridSize) { CCGridBase *pGridBase = new CCGridBase(); @@ -63,11 +58,6 @@ CCGridBase* CCGridBase::create(const ccGridSize& gridSize) return pGridBase; } -CCGridBase* CCGridBase::gridWithSize(const ccGridSize& gridSize, CCTexture2D *texture, bool flipped) -{ - return CCGridBase::create(gridSize, texture, flipped); -} - CCGridBase* CCGridBase::create(const ccGridSize& gridSize, CCTexture2D *texture, bool flipped) { CCGridBase *pGridBase = new CCGridBase(); @@ -263,10 +253,6 @@ void CCGridBase::calculateVertexPoints(void) } // implementation of CCGrid3D -CCGrid3D* CCGrid3D::gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped) -{ - return CCGrid3D::create(gridSize, pTexture, bFlipped); -} CCGrid3D* CCGrid3D::create(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped) { @@ -288,11 +274,6 @@ CCGrid3D* CCGrid3D::create(const ccGridSize& gridSize, CCTexture2D *pTexture, bo return pRet; } -CCGrid3D* CCGrid3D::gridWithSize(const ccGridSize& gridSize) -{ - return CCGrid3D::create(gridSize); -} - CCGrid3D* CCGrid3D::create(const ccGridSize& gridSize) { CCGrid3D *pRet= new CCGrid3D(); @@ -486,11 +467,6 @@ CCTiledGrid3D::~CCTiledGrid3D(void) CC_SAFE_FREE(m_pIndices); } -CCTiledGrid3D* CCTiledGrid3D::gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped) -{ - return CCTiledGrid3D::create(gridSize, pTexture, bFlipped); -} - CCTiledGrid3D* CCTiledGrid3D::create(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped) { CCTiledGrid3D *pRet= new CCTiledGrid3D(); @@ -511,11 +487,6 @@ CCTiledGrid3D* CCTiledGrid3D::create(const ccGridSize& gridSize, CCTexture2D *pT return pRet; } -CCTiledGrid3D* CCTiledGrid3D::gridWithSize(const ccGridSize& gridSize) -{ - return CCTiledGrid3D::create(gridSize); -} - CCTiledGrid3D* CCTiledGrid3D::create(const ccGridSize& gridSize) { CCTiledGrid3D *pRet= new CCTiledGrid3D(); diff --git a/cocos2dx/effects/CCGrid.h b/cocos2dx/effects/CCGrid.h index 13b01271ca..dc1791af75 100644 --- a/cocos2dx/effects/CCGrid.h +++ b/cocos2dx/effects/CCGrid.h @@ -81,14 +81,6 @@ public: virtual void calculateVertexPoints(void); public: - /** create one Grid - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCGridBase* gridWithSize(const ccGridSize& gridSize, CCTexture2D *texture, bool flipped); - /** create one Grid - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCGridBase* gridWithSize(const ccGridSize& gridSize); /** create one Grid */ static CCGridBase* create(const ccGridSize& gridSize, CCTexture2D *texture, bool flipped); @@ -130,13 +122,6 @@ public: virtual void calculateVertexPoints(void); public: - /** @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCGrid3D* gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); - /** @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCGrid3D* gridWithSize(const ccGridSize& gridSize); - /** create one Grid */ static CCGrid3D* create(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); /** create one Grid */ @@ -171,8 +156,7 @@ public: virtual void calculateVertexPoints(void); public: - CC_DEPRECATED_ATTRIBUTE static CCTiledGrid3D* gridWithSize(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); - CC_DEPRECATED_ATTRIBUTE static CCTiledGrid3D* gridWithSize(const ccGridSize& gridSize); + /** create one Grid */ static CCTiledGrid3D* create(const ccGridSize& gridSize, CCTexture2D *pTexture, bool bFlipped); /** create one Grid */ diff --git a/cocos2dx/include/ccConfig.h b/cocos2dx/include/ccConfig.h index af8b942fc7..b558a50003 100644 --- a/cocos2dx/include/ccConfig.h +++ b/cocos2dx/include/ccConfig.h @@ -107,7 +107,7 @@ To enabled set it to 1. Disabled by default. Default value: 0.1f */ #ifndef CC_DIRECTOR_STATS_INTERVAL -#define CC_DIRECTOR_STATS_INTERVAL (0.1f) +#define CC_DIRECTOR_STATS_INTERVAL (0.5f) #endif /** @def CC_DIRECTOR_FPS_POSITION diff --git a/cocos2dx/label_nodes/CCLabelAtlas.cpp b/cocos2dx/label_nodes/CCLabelAtlas.cpp index 6ae995353d..5c07088777 100644 --- a/cocos2dx/label_nodes/CCLabelAtlas.cpp +++ b/cocos2dx/label_nodes/CCLabelAtlas.cpp @@ -41,10 +41,6 @@ THE SOFTWARE. NS_CC_BEGIN //CCLabelAtlas - Creation & Init -CCLabelAtlas* CCLabelAtlas::labelWithString(const char *string, const char *charMapFile, unsigned int itemWidth, int unsigned itemHeight, unsigned int startCharMap) -{ - return CCLabelAtlas::create(string, charMapFile, itemWidth, itemHeight, startCharMap); -} CCLabelAtlas* CCLabelAtlas::create(const char *string, const char *charMapFile, unsigned int itemWidth, int unsigned itemHeight, unsigned int startCharMap) { @@ -70,11 +66,6 @@ bool CCLabelAtlas::initWithString(const char *string, const char *charMapFile, u return false; } -CCLabelAtlas* CCLabelAtlas::labelWithString(const char *string, const char *fntFile) -{ - return CCLabelAtlas::create(string, fntFile); -} - CCLabelAtlas* CCLabelAtlas::create(const char *string, const char *fntFile) { CCLabelAtlas *ret = new CCLabelAtlas(); diff --git a/cocos2dx/label_nodes/CCLabelAtlas.h b/cocos2dx/label_nodes/CCLabelAtlas.h index 5c8918503e..45e562dc93 100644 --- a/cocos2dx/label_nodes/CCLabelAtlas.h +++ b/cocos2dx/label_nodes/CCLabelAtlas.h @@ -58,16 +58,6 @@ public: { m_sString.clear(); } - /** creates the CCLabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLabelAtlas * labelWithString(const char *string, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); - - /** creates the CCLabelAtlas with a string and a configuration file - @deprecated: This interface will be deprecated sooner or later. - @since v2.0 - */ - CC_DEPRECATED_ATTRIBUTE static CCLabelAtlas* labelWithString(const char *string, const char *fntFile); /** creates the CCLabelAtlas with a string, a char map file(the atlas), the width and height of each element and the starting char of the atlas */ static CCLabelAtlas * create(const char *string, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, unsigned int startCharMap); diff --git a/cocos2dx/label_nodes/CCLabelBMFont.cpp b/cocos2dx/label_nodes/CCLabelBMFont.cpp index 89ac4c5313..800054f751 100644 --- a/cocos2dx/label_nodes/CCLabelBMFont.cpp +++ b/cocos2dx/label_nodes/CCLabelBMFont.cpp @@ -388,11 +388,6 @@ void FNTConfigRemoveCache( void ) //BitmapFontConfiguration // -CCBMFontConfiguration * CCBMFontConfiguration::configurationWithFNTFile(const char *FNTfile) -{ - return CCBMFontConfiguration::create(FNTfile); -} - CCBMFontConfiguration * CCBMFontConfiguration::create(const char *FNTfile) { CCBMFontConfiguration * pRet = new CCBMFontConfiguration(); @@ -714,11 +709,6 @@ void CCLabelBMFont::purgeCachedData() FNTConfigRemoveCache(); } -CCLabelBMFont * CCLabelBMFont::node() -{ - return CCLabelBMFont::create(); -} - CCLabelBMFont * CCLabelBMFont::create() { CCLabelBMFont * pRet = new CCLabelBMFont(); @@ -746,11 +736,6 @@ CCLabelBMFont * CCLabelBMFont::create(const char *str, const char *fntFile) return CCLabelBMFont::create(str, fntFile, kCCLabelAutomaticWidth, kCCTextAlignmentLeft, CCPointZero); } -CCLabelBMFont *CCLabelBMFont::labelWithString(const char *str, const char *fntFile, float width/* = kCCLabelAutomaticWidth*/, CCTextAlignment alignment/* = kCCTextAlignmentLeft*/, CCPoint imageOffset/* = CCPointZero*/) -{ - return CCLabelBMFont::create(str, fntFile, width, alignment, imageOffset); -} - //LabelBMFont - Creation & Init CCLabelBMFont *CCLabelBMFont::create(const char *str, const char *fntFile, float width/* = kCCLabelAutomaticWidth*/, CCTextAlignment alignment/* = kCCTextAlignmentLeft*/, CCPoint imageOffset/* = CCPointZero*/) { diff --git a/cocos2dx/label_nodes/CCLabelBMFont.h b/cocos2dx/label_nodes/CCLabelBMFont.h index 4b79623b03..7de096c264 100644 --- a/cocos2dx/label_nodes/CCLabelBMFont.h +++ b/cocos2dx/label_nodes/CCLabelBMFont.h @@ -127,10 +127,6 @@ public: CCBMFontConfiguration(); virtual ~CCBMFontConfiguration(); const char * description(); - /** allocates a CCBMFontConfiguration with a FNT file - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCBMFontConfiguration * configurationWithFNTFile(const char *FNTfile); /** allocates a CCBMFontConfiguration with a FNT file */ static CCBMFontConfiguration * create(const char *FNTfile); @@ -224,10 +220,7 @@ public: @since v0.99.3 */ static void purgeCachedData(); - /** creates a bitmap font atlas with an initial string and the FNT file - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLabelBMFont * labelWithString(const char *str, const char *fntFile, float width = kCCLabelAutomaticWidth, CCTextAlignment alignment = kCCTextAlignmentLeft, CCPoint imageOffset = CCPointZero); + /** creates a bitmap font atlas with an initial string and the FNT file */ static CCLabelBMFont * create(const char *str, const char *fntFile, float width, CCTextAlignment alignment, CCPoint imageOffset); @@ -237,11 +230,6 @@ public: static CCLabelBMFont * create(const char *str, const char *fntFile); - /** Creates an label. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLabelBMFont * node(); - /** Creates an label. */ static CCLabelBMFont * create(); diff --git a/cocos2dx/label_nodes/CCLabelTTF.cpp b/cocos2dx/label_nodes/CCLabelTTF.cpp index 953f68ae5d..0ea2c715f3 100644 --- a/cocos2dx/label_nodes/CCLabelTTF.cpp +++ b/cocos2dx/label_nodes/CCLabelTTF.cpp @@ -72,36 +72,18 @@ CCLabelTTF * CCLabelTTF::create() return pRet; } -CCLabelTTF * CCLabelTTF::labelWithString(const char *string, const char *fontName, float fontSize) -{ - return CCLabelTTF::create(string, fontName, fontSize); -} - CCLabelTTF * CCLabelTTF::create(const char *string, const char *fontName, float fontSize) { return CCLabelTTF::create(string, fontName, fontSize, CCSizeZero, kCCTextAlignmentCenter, kCCVerticalTextAlignmentTop); } -CCLabelTTF * CCLabelTTF::labelWithString(const char *string, const CCSize& dimensions, CCTextAlignment hAlignment, const char *fontName, float fontSize) -{ - return CCLabelTTF::create(string, fontName, fontSize, - dimensions, hAlignment, kCCVerticalTextAlignmentTop); -} - CCLabelTTF * CCLabelTTF::create(const char *string, const char *fontName, float fontSize, const CCSize& dimensions, CCTextAlignment hAlignment) { return CCLabelTTF::create(string, fontName, fontSize, dimensions, hAlignment, kCCVerticalTextAlignmentTop); } -CCLabelTTF* CCLabelTTF::labelWithString(const char *string, const cocos2d::CCSize &dimensions, - CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment, - const char *fontName, float fontSize) -{ - return CCLabelTTF::create(string, fontName, fontSize, dimensions, hAlignment, vAlignment); -} - CCLabelTTF* CCLabelTTF::create(const char *string, const char *fontName, float fontSize, const CCSize &dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment) diff --git a/cocos2dx/label_nodes/CCLabelTTF.h b/cocos2dx/label_nodes/CCLabelTTF.h index 6c4fcce416..096f30e29d 100644 --- a/cocos2dx/label_nodes/CCLabelTTF.h +++ b/cocos2dx/label_nodes/CCLabelTTF.h @@ -50,22 +50,6 @@ public: virtual ~CCLabelTTF(); const char* description(); - /** creates a CCLabelTTF with a font name and font size in points - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLabelTTF * labelWithString(const char *string, const char *fontName, float fontSize); - - /** creates a CCLabelTTF from a fontname, horizontal alignment, dimension in points, and font size in points. - @deprecated: This interface will be deprecated sooner or later. - @since v1.0 - */ - CC_DEPRECATED_ATTRIBUTE static CCLabelTTF * labelWithString(const char *string, const CCSize& dimensions, CCTextAlignment hAlignment, const char *fontName, float fontSize); - - /** creates a CCLabel from a fontname, alignment, dimension in points and font size in points - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLabelTTF * labelWithString(const char *string, const CCSize& dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment, const char *fontName, float fontSize); - /** creates a CCLabelTTF with a font name and font size in points @since v2.0.1 */ diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index 2094c3cbb9..5cc22057e2 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -46,7 +46,9 @@ CCLayer::CCLayer() : m_bTouchEnabled(false) , m_bAccelerometerEnabled(false) , m_bKeypadEnabled(false) -, m_pScriptHandlerEntry(NULL) +,m_pScriptTouchHandlerEntry(NULL) +,m_pScriptKeypadHandlerEntry(NULL) +,m_pScriptAccelerateHandlerEntry(NULL) , m_eTouchMode(kCCTouchesAllAtOnce) , m_nTouchPriority(0) { @@ -57,6 +59,8 @@ CCLayer::CCLayer() CCLayer::~CCLayer() { unregisterScriptTouchHandler(); + unregisterScriptKeypadHandler(); + unregisterScriptAccelerateHandler(); } bool CCLayer::init() @@ -75,11 +79,6 @@ bool CCLayer::init() return bRet; } -CCLayer *CCLayer::node() -{ - return CCLayer::create(); -} - CCLayer *CCLayer::create() { CCLayer *pRet = new CCLayer(); @@ -102,19 +101,19 @@ void CCLayer::registerWithTouchDispatcher() CCTouchDispatcher* pDispatcher = CCDirector::sharedDirector()->getTouchDispatcher(); // Using LuaBindings - if (m_pScriptHandlerEntry) + if (m_pScriptTouchHandlerEntry) { - if (m_pScriptHandlerEntry->isMultiTouches()) + if (m_pScriptTouchHandlerEntry->isMultiTouches()) { pDispatcher->addStandardDelegate(this, 0); - LUALOG("[LUA] Add multi-touches event handler: %d", m_pScriptHandlerEntry->getHandler()); + LUALOG("[LUA] Add multi-touches event handler: %d", m_pScriptTouchHandlerEntry->getHandler()); } else { pDispatcher->addTargetedDelegate(this, - m_pScriptHandlerEntry->getPriority(), - m_pScriptHandlerEntry->getSwallowsTouches()); - LUALOG("[LUA] Add touch event handler: %d", m_pScriptHandlerEntry->getHandler()); + m_pScriptTouchHandlerEntry->getPriority(), + m_pScriptTouchHandlerEntry->getSwallowsTouches()); + LUALOG("[LUA] Add touch event handler: %d", m_pScriptTouchHandlerEntry->getHandler()); } } else @@ -130,13 +129,13 @@ void CCLayer::registerWithTouchDispatcher() void CCLayer::registerScriptTouchHandler(int nHandler, bool bIsMultiTouches, int nPriority, bool bSwallowsTouches) { unregisterScriptTouchHandler(); - m_pScriptHandlerEntry = CCTouchScriptHandlerEntry::create(nHandler, bIsMultiTouches, nPriority, bSwallowsTouches); - m_pScriptHandlerEntry->retain(); + m_pScriptTouchHandlerEntry = CCTouchScriptHandlerEntry::create(nHandler, bIsMultiTouches, nPriority, bSwallowsTouches); + m_pScriptTouchHandlerEntry->retain(); } void CCLayer::unregisterScriptTouchHandler(void) { - CC_SAFE_RELEASE_NULL(m_pScriptHandlerEntry); + CC_SAFE_RELEASE_NULL(m_pScriptTouchHandlerEntry); } int CCLayer::excuteScriptTouchHandler(int nEventType, CCTouch *pTouch) @@ -262,6 +261,17 @@ void CCLayer::didAccelerate(CCAcceleration* pAccelerationValue) } } +void CCLayer::registerScriptAccelerateHandler(int nHandler) +{ + unregisterScriptAccelerateHandler(); + m_pScriptAccelerateHandlerEntry = CCScriptHandlerEntry::create(nHandler); + m_pScriptAccelerateHandlerEntry->retain(); +} + +void CCLayer::unregisterScriptAccelerateHandler(void) +{ + CC_SAFE_RELEASE_NULL(m_pScriptAccelerateHandlerEntry); +} /// isKeypadEnabled getter bool CCLayer::isKeypadEnabled() @@ -290,6 +300,34 @@ void CCLayer::setKeypadEnabled(bool enabled) } } +void CCLayer::registerScriptKeypadHandler(int nHandler) +{ + unregisterScriptKeypadHandler(); + m_pScriptKeypadHandlerEntry = CCScriptHandlerEntry::create(nHandler); + m_pScriptKeypadHandlerEntry->retain(); +} + +void CCLayer::unregisterScriptKeypadHandler(void) +{ + CC_SAFE_RELEASE_NULL(m_pScriptKeypadHandlerEntry); +} + +void CCLayer::keyBackClicked(void) +{ + if (m_pScriptKeypadHandlerEntry) + { + CCScriptEngineManager::sharedManager()->getScriptEngine()->executeLayerKeypadEvent(this, kTypeBackClicked); + } +} + +void CCLayer::keyMenuClicked(void) +{ + if (m_pScriptKeypadHandlerEntry) + { + CCScriptEngineManager::sharedManager()->getScriptEngine()->executeLayerKeypadEvent(this, kTypeMenuClicked); + } +} + /// Callbacks void CCLayer::onEnter() { @@ -522,11 +560,6 @@ CCLayerColor* CCLayerColor::create() return pRet; } -CCLayerColor * CCLayerColor::layerWithColor(const ccColor4B& color, GLfloat width, GLfloat height) -{ - return CCLayerColor::create(color,width,height); -} - CCLayerColor * CCLayerColor::create(const ccColor4B& color, GLfloat width, GLfloat height) { CCLayerColor * pLayer = new CCLayerColor(); @@ -539,11 +572,6 @@ CCLayerColor * CCLayerColor::create(const ccColor4B& color, GLfloat width, GLflo return NULL; } -CCLayerColor * CCLayerColor::layerWithColor(const ccColor4B& color) -{ - return CCLayerColor::create(color); -} - CCLayerColor * CCLayerColor::create(const ccColor4B& color) { CCLayerColor * pLayer = new CCLayerColor(); @@ -655,11 +683,6 @@ void CCLayerColor::draw() // CCLayerGradient // -CCLayerGradient* CCLayerGradient::layerWithColor(const ccColor4B& start, const ccColor4B& end) -{ - return CCLayerGradient::create(start, end); -} - CCLayerGradient* CCLayerGradient::create(const ccColor4B& start, const ccColor4B& end) { CCLayerGradient * pLayer = new CCLayerGradient(); @@ -672,11 +695,6 @@ CCLayerGradient* CCLayerGradient::create(const ccColor4B& start, const ccColor4B return NULL; } -CCLayerGradient* CCLayerGradient::layerWithColor(const ccColor4B& start, const ccColor4B& end, const CCPoint& v) -{ - return CCLayerGradient::create(start, end, v); -} - CCLayerGradient* CCLayerGradient::create(const ccColor4B& start, const ccColor4B& end, const CCPoint& v) { CCLayerGradient * pLayer = new CCLayerGradient(); @@ -866,23 +884,6 @@ CCLayerMultiplex::~CCLayerMultiplex() CC_SAFE_RELEASE(m_pLayers); } -CCLayerMultiplex * CCLayerMultiplex::layerWithLayers(CCLayer * layer, ...) -{ - va_list args; - va_start(args,layer); - - CCLayerMultiplex * pMultiplexLayer = new CCLayerMultiplex(); - if(pMultiplexLayer && pMultiplexLayer->initWithLayers(layer, args)) - { - pMultiplexLayer->autorelease(); - va_end(args); - return pMultiplexLayer; - } - va_end(args); - CC_SAFE_DELETE(pMultiplexLayer); - return NULL; -} - CCLayerMultiplex * CCLayerMultiplex::create(CCLayer * layer, ...) { va_list args; @@ -900,11 +901,6 @@ CCLayerMultiplex * CCLayerMultiplex::create(CCLayer * layer, ...) return NULL; } -CCLayerMultiplex * CCLayerMultiplex::layerWithLayer(CCLayer* layer) -{ - return CCLayerMultiplex::createWithLayer(layer); -} - CCLayerMultiplex * CCLayerMultiplex::createWithLayer(CCLayer* layer) { return CCLayerMultiplex::create(layer, NULL); @@ -953,6 +949,10 @@ bool CCLayerMultiplex::initWithLayers(CCLayer *layer, va_list params) { if (CCLayer::init()) { + m_pLayers = CCArray::createWithCapacity(5); + m_pLayers->retain(); + m_pLayers->addObject(layer); + CCLayer *l = va_arg(params,CCLayer*); while( l ) { m_pLayers->addObject(l); @@ -969,14 +969,17 @@ bool CCLayerMultiplex::initWithLayers(CCLayer *layer, va_list params) bool CCLayerMultiplex::initWithArray(CCArray* arrayOfLayers) { - m_pLayers = CCArray::createWithCapacity(arrayOfLayers->count()); - m_pLayers->addObjectsFromArray(arrayOfLayers); - m_pLayers->retain(); + if (CCLayer::init()) + { + m_pLayers = CCArray::createWithCapacity(arrayOfLayers->count()); + m_pLayers->addObjectsFromArray(arrayOfLayers); + m_pLayers->retain(); - m_nEnabledLayer = 0; - this->addChild((CCNode*)m_pLayers->objectAtIndex(m_nEnabledLayer)); - - return true; + m_nEnabledLayer = 0; + this->addChild((CCNode*)m_pLayers->objectAtIndex(m_nEnabledLayer)); + return true; + } + return false; } void CCLayerMultiplex::switchTo(unsigned int n) diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h index 53a3493edf..67872e072e 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.h @@ -63,9 +63,7 @@ public: CCLayer(); virtual ~CCLayer(); virtual bool init(); - - // @deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCLayer *node(void); + /** create one layer */ static CCLayer *create(void); @@ -86,6 +84,8 @@ public: virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent); virtual void didAccelerate(CCAcceleration* pAccelerationValue); + void registerScriptAccelerateHandler(int nHandler); + void unregisterScriptAccelerateHandler(void); /** If isTouchEnabled, this method is called onEnter. Override it to change the way CCLayer receives touch events. @@ -133,8 +133,18 @@ public: */ virtual bool isKeypadEnabled(); virtual void setKeypadEnabled(bool value); + + /** Register keypad events handler */ + void registerScriptKeypadHandler(int nHandler); + /** Unregister keypad events handler */ + void unregisterScriptKeypadHandler(void); + + virtual void keyBackClicked(void); + virtual void keyMenuClicked(void); - inline CCTouchScriptHandlerEntry* getScriptHandlerEntry() { return m_pScriptHandlerEntry; }; + inline CCTouchScriptHandlerEntry* getScriptTouchHandlerEntry() { return m_pScriptTouchHandlerEntry; }; + inline CCScriptHandlerEntry* getScriptKeypadHandlerEntry() { return m_pScriptKeypadHandlerEntry; }; + inline CCScriptHandlerEntry* getScriptAccelerateHandlerEntry() { return m_pScriptAccelerateHandlerEntry; }; protected: bool m_bTouchEnabled; bool m_bAccelerometerEnabled; @@ -142,7 +152,9 @@ protected: private: // Script touch events handler - CCTouchScriptHandlerEntry* m_pScriptHandlerEntry; + CCTouchScriptHandlerEntry* m_pScriptTouchHandlerEntry; + CCScriptHandlerEntry* m_pScriptKeypadHandlerEntry; + CCScriptHandlerEntry* m_pScriptAccelerateHandlerEntry; int m_nTouchPriority; ccTouchesMode m_eTouchMode; @@ -173,15 +185,6 @@ public: virtual void draw(); virtual void setContentSize(const CCSize & var); - /** creates a CCLayer with color, width and height in Points - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLayerColor * layerWithColor(const ccColor4B& color, GLfloat width, GLfloat height); - /** creates a CCLayer with color. Width and height are the window size. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLayerColor * layerWithColor(const ccColor4B& color); - //@deprecated: This interface will be deprecated sooner or later. static CCLayerColor* node(); @@ -247,16 +250,6 @@ class CC_DLL CCLayerGradient : public CCLayerColor { public: - /** Creates a full-screen CCLayer with a gradient between start and end. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLayerGradient* layerWithColor(const ccColor4B& start, const ccColor4B& end); - - /** Creates a full-screen CCLayer with a gradient between start and end in the direction of v. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLayerGradient* layerWithColor(const ccColor4B& start, const ccColor4B& end, const CCPoint& v); - /** Creates a full-screen CCLayer with a gradient between start and end. */ static CCLayerGradient* create(const ccColor4B& start, const ccColor4B& end); @@ -309,18 +302,6 @@ public: CCLayerMultiplex(); virtual ~CCLayerMultiplex(); - /** creates a CCLayerMultiplex with one or more layers using a variable argument list. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLayerMultiplex * layerWithLayers(CCLayer* layer, ... ); - - /** - * lua script can not init with undetermined number of variables - * so add these functions to be used with lua. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCLayerMultiplex * layerWithLayer(CCLayer* layer); - /** creates a CCLayerMultiplex with one or more layers using a variable argument list. */ static CCLayerMultiplex * create(CCLayer* layer, ... ); @@ -338,9 +319,9 @@ public: The current (old) layer will be removed from it's parent with 'cleanup:YES'. */ - /** initializes a CCMultiplexLayer with an array of layers - @since v2.1 - */ + /** initializes a CCMultiplexLayer with an array of layers + @since v2.1 + */ bool initWithArray(CCArray* arrayOfLayers); void switchTo(unsigned int n); @@ -353,8 +334,8 @@ public: static CCLayerMultiplex* node(); static CCLayerMultiplex* create(); - /** creates a CCMultiplexLayer with an array of layers. - @since v2.1 + /** creates a CCMultiplexLayer with an array of layers. + @since v2.1 */ static CCLayerMultiplex* createWithArray(CCArray* arrayOfLayers); }; diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCScene.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCScene.cpp index ccda2f7ef3..99e69d0505 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCScene.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCScene.cpp @@ -54,11 +54,6 @@ bool CCScene::init() return bRet; } -CCScene *CCScene::node() -{ - return CCScene::create(); -} - CCScene *CCScene::create() { CCScene *pRet = new CCScene(); diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCScene.h b/cocos2dx/layers_scenes_transitions_nodes/CCScene.h index 2bdd133762..31632ec07a 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCScene.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCScene.h @@ -52,7 +52,7 @@ public: CCScene(); virtual ~CCScene(); bool init(); - CC_DEPRECATED_ATTRIBUTE static CCScene *node(void); + static CCScene *create(void); }; diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp index 0adc5d5238..a72815e04e 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.cpp @@ -52,11 +52,6 @@ CCTransitionScene::~CCTransitionScene() m_pOutScene->release(); } -CCTransitionScene * CCTransitionScene::transitionWithDuration(float t, CCScene *scene) -{ - return CCTransitionScene::create(t,scene); -} - CCTransitionScene * CCTransitionScene::create(float t, CCScene *scene) { CCTransitionScene * pScene = new CCTransitionScene(); @@ -205,11 +200,6 @@ CCTransitionSceneOriented::~CCTransitionSceneOriented() { } -CCTransitionSceneOriented * CCTransitionSceneOriented::transitionWithDuration(float t, CCScene *scene, tOrientation orientation) -{ - return CCTransitionSceneOriented::create(t,scene,orientation); -} - CCTransitionSceneOriented * CCTransitionSceneOriented::create(float t, CCScene *scene, tOrientation orientation) { CCTransitionSceneOriented * pScene = new CCTransitionSceneOriented(); @@ -246,20 +236,6 @@ CCTransitionRotoZoom* CCTransitionRotoZoom::create(float t, CCScene* scene) return NULL; } - -CCTransitionRotoZoom* CCTransitionRotoZoom::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionRotoZoom* pScene = new CCTransitionRotoZoom(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - CCTransitionRotoZoom::~CCTransitionRotoZoom() { } @@ -320,20 +296,6 @@ CCTransitionJumpZoom* CCTransitionJumpZoom::create(float t, CCScene* scene) return NULL; } - -CCTransitionJumpZoom* CCTransitionJumpZoom::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionJumpZoom* pScene = new CCTransitionJumpZoom(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionJumpZoom::onEnter() { CCTransitionScene::onEnter(); @@ -389,20 +351,6 @@ CCTransitionMoveInL* CCTransitionMoveInL::create(float t, CCScene* scene) return NULL; } - -CCTransitionMoveInL* CCTransitionMoveInL::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionMoveInL* pScene = new CCTransitionMoveInL(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionMoveInL::onEnter() { CCTransitionScene::onEnter(); @@ -460,20 +408,6 @@ CCTransitionMoveInR* CCTransitionMoveInR::create(float t, CCScene* scene) return NULL; } - -CCTransitionMoveInR* CCTransitionMoveInR::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionMoveInR* pScene = new CCTransitionMoveInR(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionMoveInR::initScenes() { CCSize s = CCDirector::sharedDirector()->getWinSize(); @@ -502,20 +436,6 @@ CCTransitionMoveInT* CCTransitionMoveInT::create(float t, CCScene* scene) return NULL; } - -CCTransitionMoveInT* CCTransitionMoveInT::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionMoveInT* pScene = new CCTransitionMoveInT(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionMoveInT::initScenes() { CCSize s = CCDirector::sharedDirector()->getWinSize(); @@ -544,20 +464,6 @@ CCTransitionMoveInB* CCTransitionMoveInB::create(float t, CCScene* scene) return NULL; } - -CCTransitionMoveInB* CCTransitionMoveInB::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionMoveInB* pScene = new CCTransitionMoveInB(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionMoveInB::initScenes() { CCSize s = CCDirector::sharedDirector()->getWinSize(); @@ -577,36 +483,11 @@ void CCTransitionMoveInB::initScenes() CCTransitionSlideInL::CCTransitionSlideInL() { } + CCTransitionSlideInL::~CCTransitionSlideInL() { } -CCTransitionSlideInL* CCTransitionSlideInL::create(float t, CCScene* scene) -{ - CCTransitionSlideInL* pScene = new CCTransitionSlideInL(); - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - - -CCTransitionSlideInL* CCTransitionSlideInL::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionSlideInL* pScene = new CCTransitionSlideInL(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionSlideInL::onEnter() { CCTransitionScene::onEnter(); @@ -646,9 +527,19 @@ CCActionInterval* CCTransitionSlideInL::action() CCActionInterval* CCTransitionSlideInL::easeActionWithAction(CCActionInterval* action) { return CCEaseOut::create(action, 2.0f); -// return [EaseElasticOut actionWithAction:action period:0.4f]; } +CCTransitionSlideInL* CCTransitionSlideInL::create(float t, CCScene* scene) +{ + CCTransitionSlideInL* pScene = new CCTransitionSlideInL(); + if(pScene && pScene->initWithDuration(t, scene)) + { + pScene->autorelease(); + return pScene; + } + CC_SAFE_DELETE(pScene); + return NULL; +} // // SlideInR @@ -672,20 +563,6 @@ CCTransitionSlideInR* CCTransitionSlideInR::create(float t, CCScene* scene) return NULL; } - -CCTransitionSlideInR* CCTransitionSlideInR::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionSlideInR* pScene = new CCTransitionSlideInR(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionSlideInR::sceneOrder() { m_bIsInSceneOnTop = true; @@ -727,20 +604,6 @@ CCTransitionSlideInT* CCTransitionSlideInT::create(float t, CCScene* scene) return NULL; } - -CCTransitionSlideInT* CCTransitionSlideInT::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionSlideInT* pScene = new CCTransitionSlideInT(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionSlideInT::sceneOrder() { m_bIsInSceneOnTop = false; @@ -781,20 +644,6 @@ CCTransitionSlideInB* CCTransitionSlideInB::create(float t, CCScene* scene) return NULL; } - -CCTransitionSlideInB* CCTransitionSlideInB::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionSlideInB* pScene = new CCTransitionSlideInB(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionSlideInB::sceneOrder() { m_bIsInSceneOnTop = true; @@ -835,20 +684,6 @@ CCTransitionShrinkGrow* CCTransitionShrinkGrow::create(float t, CCScene* scene) return NULL; } - -CCTransitionShrinkGrow* CCTransitionShrinkGrow::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionShrinkGrow* pScene = new CCTransitionShrinkGrow(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionShrinkGrow::onEnter() { CCTransitionScene::onEnter(); @@ -935,11 +770,6 @@ void CCTransitionFlipX::onEnter() m_pOutScene->runAction(outA); } -CCTransitionFlipX* CCTransitionFlipX::transitionWithDuration(float t, CCScene* s, tOrientation o) -{ - return CCTransitionFlipX::create(t, s, o); -} - CCTransitionFlipX* CCTransitionFlipX::create(float t, CCScene* s, tOrientation o) { CCTransitionFlipX* pScene = new CCTransitionFlipX(); @@ -1010,11 +840,6 @@ void CCTransitionFlipY::onEnter() } -CCTransitionFlipY* CCTransitionFlipY::transitionWithDuration(float t, CCScene* s, tOrientation o) -{ - return CCTransitionFlipY::create(t, s, o); -} - CCTransitionFlipY* CCTransitionFlipY::create(float t, CCScene* s, tOrientation o) { CCTransitionFlipY* pScene = new CCTransitionFlipY(); @@ -1085,11 +910,6 @@ void CCTransitionFlipAngular::onEnter() m_pOutScene->runAction(outA); } -CCTransitionFlipAngular* CCTransitionFlipAngular::transitionWithDuration(float t, CCScene* s, tOrientation o) -{ - return CCTransitionFlipAngular::create(t, s, o); -} - CCTransitionFlipAngular* CCTransitionFlipAngular::create(float t, CCScene* s, tOrientation o) { CCTransitionFlipAngular* pScene = new CCTransitionFlipAngular(); @@ -1168,11 +988,6 @@ void CCTransitionZoomFlipX::onEnter() m_pOutScene->runAction(outA); } -CCTransitionZoomFlipX* CCTransitionZoomFlipX::transitionWithDuration(float t, CCScene* s, tOrientation o) -{ - return CCTransitionZoomFlipX::create(t, s, o); -} - CCTransitionZoomFlipX* CCTransitionZoomFlipX::create(float t, CCScene* s, tOrientation o) { CCTransitionZoomFlipX* pScene = new CCTransitionZoomFlipX(); @@ -1252,11 +1067,6 @@ void CCTransitionZoomFlipY::onEnter() m_pOutScene->runAction(outA); } -CCTransitionZoomFlipY* CCTransitionZoomFlipY::transitionWithDuration(float t, CCScene* s, tOrientation o) -{ - return CCTransitionZoomFlipY::create(t, s, o); -} - CCTransitionZoomFlipY* CCTransitionZoomFlipY::create(float t, CCScene* s, tOrientation o) { CCTransitionZoomFlipY* pScene = new CCTransitionZoomFlipY(); @@ -1338,11 +1148,6 @@ void CCTransitionZoomFlipAngular::onEnter() m_pOutScene->runAction(outA); } -CCTransitionZoomFlipAngular* CCTransitionZoomFlipAngular::transitionWithDuration(float t, CCScene* s, tOrientation o) -{ - return CCTransitionZoomFlipAngular::create(t, s, o); -} - CCTransitionZoomFlipAngular* CCTransitionZoomFlipAngular::create(float t, CCScene* s, tOrientation o) { CCTransitionZoomFlipAngular* pScene = new CCTransitionZoomFlipAngular(); @@ -1367,11 +1172,6 @@ CCTransitionFade::~CCTransitionFade() { } -CCTransitionFade * CCTransitionFade::transitionWithDuration(float duration, CCScene *scene, const ccColor3B& color) -{ - return CCTransitionFade::create(duration, scene, color); -} - CCTransitionFade * CCTransitionFade::create(float duration, CCScene *scene, const ccColor3B& color) { CCTransitionFade * pTransition = new CCTransitionFade(); @@ -1452,20 +1252,6 @@ CCTransitionCrossFade* CCTransitionCrossFade::create(float t, CCScene* scene) return NULL; } - -CCTransitionCrossFade* CCTransitionCrossFade::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionCrossFade* pScene = new CCTransitionCrossFade(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionCrossFade:: draw() { // override draw since both scenes (textures) are rendered in 1 scene @@ -1574,20 +1360,6 @@ CCTransitionTurnOffTiles* CCTransitionTurnOffTiles::create(float t, CCScene* sce return NULL; } - -CCTransitionTurnOffTiles* CCTransitionTurnOffTiles::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionTurnOffTiles* pScene = new CCTransitionTurnOffTiles(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - // override addScenes, and change the order void CCTransitionTurnOffTiles::sceneOrder() { @@ -1644,20 +1416,6 @@ CCTransitionSplitCols* CCTransitionSplitCols::create(float t, CCScene* scene) return NULL; } - -CCTransitionSplitCols* CCTransitionSplitCols::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionSplitCols* pScene = new CCTransitionSplitCols(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionSplitCols::onEnter() { CCTransitionScene::onEnter(); @@ -1684,7 +1442,6 @@ void CCTransitionSplitCols::onEnter() ); } - CCActionInterval* CCTransitionSplitCols:: action() { return CCSplitCols::create(3, m_fDuration/2.0f); @@ -1703,10 +1460,16 @@ CCActionInterval* CCTransitionSplitCols::easeActionWithAction(CCActionInterval * CCTransitionSplitRows::CCTransitionSplitRows() { } + CCTransitionSplitRows::~CCTransitionSplitRows() { } +CCActionInterval* CCTransitionSplitRows::action() +{ + return CCSplitRows::create(3, m_fDuration/2.0f); +} + CCTransitionSplitRows* CCTransitionSplitRows::create(float t, CCScene* scene) { CCTransitionSplitRows* pScene = new CCTransitionSplitRows(); @@ -1719,25 +1482,6 @@ CCTransitionSplitRows* CCTransitionSplitRows::create(float t, CCScene* scene) return NULL; } - -CCTransitionSplitRows* CCTransitionSplitRows::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionSplitRows* pScene = new CCTransitionSplitRows(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - -CCActionInterval* CCTransitionSplitRows::action() -{ - return CCSplitRows::create(3, m_fDuration/2.0f); -} - // // FadeTR Transition // @@ -1760,20 +1504,6 @@ CCTransitionFadeTR* CCTransitionFadeTR::create(float t, CCScene* scene) return NULL; } - -CCTransitionFadeTR* CCTransitionFadeTR::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionFadeTR* pScene = new CCTransitionFadeTR(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionFadeTR::sceneOrder() { m_bIsInSceneOnTop = false; @@ -1837,20 +1567,6 @@ CCTransitionFadeBL* CCTransitionFadeBL::create(float t, CCScene* scene) return NULL; } - -CCTransitionFadeBL* CCTransitionFadeBL::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionFadeBL* pScene = new CCTransitionFadeBL(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - CCActionInterval* CCTransitionFadeBL::actionWithSize(const ccGridSize& size) { return CCFadeOutBLTiles::create(size, m_fDuration); @@ -1862,6 +1578,7 @@ CCActionInterval* CCTransitionFadeBL::actionWithSize(const ccGridSize& size) CCTransitionFadeUp::CCTransitionFadeUp() { } + CCTransitionFadeUp::~CCTransitionFadeUp() { } @@ -1878,20 +1595,6 @@ CCTransitionFadeUp* CCTransitionFadeUp::create(float t, CCScene* scene) return NULL; } - -CCTransitionFadeUp* CCTransitionFadeUp::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionFadeUp* pScene = new CCTransitionFadeUp(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - CCActionInterval* CCTransitionFadeUp::actionWithSize(const ccGridSize& size) { return CCFadeOutUpTiles::create(size, m_fDuration); @@ -1919,20 +1622,6 @@ CCTransitionFadeDown* CCTransitionFadeDown::create(float t, CCScene* scene) return NULL; } - -CCTransitionFadeDown* CCTransitionFadeDown::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionFadeDown* pScene = new CCTransitionFadeDown(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - CCActionInterval* CCTransitionFadeDown::actionWithSize(const ccGridSize& size) { return CCFadeOutDownTiles::create(size, m_fDuration); diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.h b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.h index 5c36db996a..39a2387676 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCTransition.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCTransition.h @@ -96,11 +96,6 @@ public: virtual void onExit(); virtual void cleanup(); - /** creates a base transition with duration and incoming scene - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTransitionScene * transitionWithDuration(float t, CCScene *scene); - /** creates a base transition with duration and incoming scene */ static CCTransitionScene * create(float t, CCScene *scene); @@ -132,11 +127,6 @@ public: CCTransitionSceneOriented(); virtual ~CCTransitionSceneOriented(); - /** creates a base transition with duration and incoming scene - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTransitionSceneOriented * transitionWithDuration(float t,CCScene* scene, tOrientation orientation); - /** creates a base transition with duration and incoming scene */ static CCTransitionSceneOriented * create(float t,CCScene* scene, tOrientation orientation); @@ -154,7 +144,6 @@ public: virtual ~CCTransitionRotoZoom(); virtual void onEnter(); - CC_DEPRECATED_ATTRIBUTE static CCTransitionRotoZoom* transitionWithDuration(float t, CCScene* scene); static CCTransitionRotoZoom* create(float t, CCScene* scene); }; @@ -168,7 +157,6 @@ public: virtual ~CCTransitionJumpZoom(); virtual void onEnter(); - CC_DEPRECATED_ATTRIBUTE static CCTransitionJumpZoom* transitionWithDuration(float t, CCScene* scene); static CCTransitionJumpZoom* create(float t, CCScene* scene); }; @@ -189,7 +177,6 @@ public: virtual void onEnter(); - CC_DEPRECATED_ATTRIBUTE static CCTransitionMoveInL* transitionWithDuration(float t, CCScene* scene); static CCTransitionMoveInL* create(float t, CCScene* scene); }; @@ -203,7 +190,6 @@ public: virtual ~CCTransitionMoveInR(); virtual void initScenes(); - CC_DEPRECATED_ATTRIBUTE static CCTransitionMoveInR* transitionWithDuration(float t, CCScene* scene); static CCTransitionMoveInR* create(float t, CCScene* scene); }; @@ -217,7 +203,6 @@ public: virtual ~CCTransitionMoveInT(); virtual void initScenes(); - CC_DEPRECATED_ATTRIBUTE static CCTransitionMoveInT* transitionWithDuration(float t, CCScene* scene); static CCTransitionMoveInT* create(float t, CCScene* scene); }; @@ -231,7 +216,6 @@ public: virtual ~CCTransitionMoveInB(); virtual void initScenes(); - CC_DEPRECATED_ATTRIBUTE static CCTransitionMoveInB* transitionWithDuration(float t, CCScene* scene); static CCTransitionMoveInB* create(float t, CCScene* scene); }; @@ -253,7 +237,6 @@ public: virtual CCActionInterval* easeActionWithAction(CCActionInterval * action); - CC_DEPRECATED_ATTRIBUTE static CCTransitionSlideInL* transitionWithDuration(float t, CCScene* scene); static CCTransitionSlideInL* create(float t, CCScene* scene); protected: virtual void sceneOrder(); @@ -273,7 +256,6 @@ public: /** returns the action that will be performed by the incoming and outgoing scene */ virtual CCActionInterval* action(void); - CC_DEPRECATED_ATTRIBUTE static CCTransitionSlideInR* transitionWithDuration(float t, CCScene* scene); static CCTransitionSlideInR* create(float t, CCScene* scene); protected: virtual void sceneOrder(); @@ -293,7 +275,6 @@ public: /** returns the action that will be performed by the incoming and outgoing scene */ virtual CCActionInterval* action(void); - CC_DEPRECATED_ATTRIBUTE static CCTransitionSlideInB* transitionWithDuration(float t, CCScene* scene); static CCTransitionSlideInB* create(float t, CCScene* scene); protected: virtual void sceneOrder(); @@ -313,7 +294,6 @@ public: /** returns the action that will be performed by the incoming and outgoing scene */ virtual CCActionInterval* action(void); - CC_DEPRECATED_ATTRIBUTE static CCTransitionSlideInT* transitionWithDuration(float t, CCScene* scene); static CCTransitionSlideInT* create(float t, CCScene* scene); protected: virtual void sceneOrder(); @@ -331,7 +311,6 @@ public: virtual void onEnter(); virtual CCActionInterval* easeActionWithAction(CCActionInterval * action); - CC_DEPRECATED_ATTRIBUTE static CCTransitionShrinkGrow* transitionWithDuration(float t, CCScene* scene); static CCTransitionShrinkGrow* create(float t, CCScene* scene); }; @@ -347,8 +326,6 @@ public: virtual void onEnter(); - // @deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCTransitionFlipX* transitionWithDuration(float t, CCScene* s, tOrientation o = kCCTransitionOrientationRightOver); static CCTransitionFlipX* create(float t, CCScene* s, tOrientation o); static CCTransitionFlipX* create(float t, CCScene* s); }; @@ -365,8 +342,6 @@ public: virtual void onEnter(); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCTransitionFlipY* transitionWithDuration(float t, CCScene* s, tOrientation o = kCCTransitionOrientationUpOver); static CCTransitionFlipY* create(float t, CCScene* s, tOrientation o); static CCTransitionFlipY* create(float t, CCScene* s); }; @@ -382,9 +357,7 @@ public: virtual ~CCTransitionFlipAngular(); virtual void onEnter(); - - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCTransitionFlipAngular* transitionWithDuration(float t, CCScene* s, tOrientation o = kCCTransitionOrientationRightOver); + static CCTransitionFlipAngular* create(float t, CCScene* s, tOrientation o); static CCTransitionFlipAngular* create(float t, CCScene* s); }; @@ -401,8 +374,6 @@ public: virtual void onEnter(); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCTransitionZoomFlipX* transitionWithDuration(float t, CCScene* s, tOrientation o = kCCTransitionOrientationRightOver); static CCTransitionZoomFlipX* create(float t, CCScene* s, tOrientation o); static CCTransitionZoomFlipX* create(float t, CCScene* s); }; @@ -419,8 +390,6 @@ public: virtual void onEnter(); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCTransitionZoomFlipY* transitionWithDuration(float t, CCScene* s, tOrientation o = kCCTransitionOrientationUpOver); static CCTransitionZoomFlipY* create(float t, CCScene* s, tOrientation o); static CCTransitionZoomFlipY* create(float t, CCScene* s); }; @@ -437,8 +406,6 @@ public: virtual void onEnter(); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCTransitionZoomFlipAngular* transitionWithDuration(float t, CCScene* s, tOrientation o = kCCTransitionOrientationRightOver); static CCTransitionZoomFlipAngular* create(float t, CCScene* s, tOrientation o); static CCTransitionZoomFlipAngular* create(float t, CCScene* s); }; @@ -455,14 +422,8 @@ public: CCTransitionFade(); virtual ~CCTransitionFade(); - - /** creates the transition with a duration and with an RGB color - * Example: FadeTransition::transitionWithDuration(2, scene, ccc3(255,0,0); // red color - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTransitionFade* transitionWithDuration(float duration,CCScene* scene, const ccColor3B& color = ccBLACK); - /** creates the transition with a duration and with an RGB color + /** creates the transition with a duration and with an RGB color * Example: FadeTransition::create(2, scene, ccc3(255,0,0); // red color */ static CCTransitionFade* create(float duration,CCScene* scene, const ccColor3B& color); @@ -492,7 +453,6 @@ public : virtual void onExit(); public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionCrossFade* transitionWithDuration(float t, CCScene* scene); static CCTransitionCrossFade* create(float t, CCScene* scene); }; @@ -509,7 +469,6 @@ public : virtual CCActionInterval * easeActionWithAction(CCActionInterval * action); public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionTurnOffTiles* transitionWithDuration(float t, CCScene* scene); static CCTransitionTurnOffTiles* create(float t, CCScene* scene); protected: virtual void sceneOrder(); @@ -529,7 +488,7 @@ public: virtual CCActionInterval * easeActionWithAction(CCActionInterval * action); public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionSplitCols* transitionWithDuration(float t, CCScene* scene); + static CCTransitionSplitCols* create(float t, CCScene* scene); }; @@ -545,7 +504,7 @@ public: virtual CCActionInterval* action(void); public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionSplitRows* transitionWithDuration(float t, CCScene* scene); + static CCTransitionSplitRows* create(float t, CCScene* scene); }; @@ -562,7 +521,7 @@ public: virtual CCActionInterval* easeActionWithAction(CCActionInterval * action); public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionFadeTR* transitionWithDuration(float t, CCScene* scene); + static CCTransitionFadeTR* create(float t, CCScene* scene); protected: virtual void sceneOrder(); @@ -579,7 +538,7 @@ public: virtual CCActionInterval* actionWithSize(const ccGridSize& size); public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionFadeBL* transitionWithDuration(float t, CCScene* scene); + static CCTransitionFadeBL* create(float t, CCScene* scene); }; @@ -594,7 +553,7 @@ public: virtual CCActionInterval* actionWithSize(const ccGridSize& size); public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionFadeUp* transitionWithDuration(float t, CCScene* scene); + static CCTransitionFadeUp* create(float t, CCScene* scene); }; @@ -609,7 +568,7 @@ public: virtual CCActionInterval* actionWithSize(const ccGridSize& size); public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionFadeDown* transitionWithDuration(float t, CCScene* scene); + static CCTransitionFadeDown* create(float t, CCScene* scene); }; diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp index 706c1d425f..1155b93ad9 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp @@ -40,11 +40,6 @@ CCTransitionPageTurn::~CCTransitionPageTurn() { } -CCTransitionPageTurn * CCTransitionPageTurn::transitionWithDuration(float t, CCScene *scene, bool backwards) -{ - return CCTransitionPageTurn::create(t,scene,backwards); -} - /** creates a base transition with duration and incoming scene */ CCTransitionPageTurn * CCTransitionPageTurn::create(float t, CCScene *scene, bool backwards) { diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.h b/cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.h index 63f7c3771f..0ec265386c 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCTransitionPageTurn.h @@ -55,14 +55,6 @@ public: CCTransitionPageTurn(); virtual ~CCTransitionPageTurn(); - /** - * Creates a base transition with duration and incoming scene. - * If back is true then the effect is reversed to appear as if the incoming - * scene is being turned from left over the outgoing scene. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTransitionPageTurn* transitionWithDuration(float t,CCScene* scene,bool backwards); - /** * Creates a base transition with duration and incoming scene. * If back is true then the effect is reversed to appear as if the incoming diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.cpp index e56641d20e..22fb3c513f 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.cpp @@ -60,20 +60,6 @@ CCTransitionProgress* CCTransitionProgress::create(float t, CCScene* scene) return NULL; } - -CCTransitionProgress* CCTransitionProgress::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionProgress* pScene = new CCTransitionProgress(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - // CCTransitionProgress void CCTransitionProgress::onEnter() { @@ -178,20 +164,6 @@ CCTransitionProgressRadialCCW* CCTransitionProgressRadialCCW::create(float t, CC return NULL; } - -CCTransitionProgressRadialCCW* CCTransitionProgressRadialCCW::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionProgressRadialCCW* pScene = new CCTransitionProgressRadialCCW(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - // CCTransitionProgressRadialCW CCTransitionProgressRadialCW* CCTransitionProgressRadialCW::create(float t, CCScene* scene) { @@ -205,20 +177,6 @@ CCTransitionProgressRadialCW* CCTransitionProgressRadialCW::create(float t, CCSc return NULL; } - -CCTransitionProgressRadialCW* CCTransitionProgressRadialCW::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionProgressRadialCW* pScene = new CCTransitionProgressRadialCW(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - CCProgressTimer* CCTransitionProgressRadialCW::progressTimerNodeWithRenderTexture(CCRenderTexture* texture) { CCSize size = CCDirector::sharedDirector()->getWinSize(); @@ -251,20 +209,6 @@ CCTransitionProgressHorizontal* CCTransitionProgressHorizontal::create(float t, return NULL; } - -CCTransitionProgressHorizontal* CCTransitionProgressHorizontal::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionProgressHorizontal* pScene = new CCTransitionProgressHorizontal(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - CCProgressTimer* CCTransitionProgressHorizontal::progressTimerNodeWithRenderTexture(CCRenderTexture* texture) { CCSize size = CCDirector::sharedDirector()->getWinSize(); @@ -298,20 +242,6 @@ CCTransitionProgressVertical* CCTransitionProgressVertical::create(float t, CCSc return NULL; } - -CCTransitionProgressVertical* CCTransitionProgressVertical::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionProgressVertical* pScene = new CCTransitionProgressVertical(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - CCProgressTimer* CCTransitionProgressVertical::progressTimerNodeWithRenderTexture(CCRenderTexture* texture) { CCSize size = CCDirector::sharedDirector()->getWinSize(); @@ -346,20 +276,6 @@ CCTransitionProgressInOut* CCTransitionProgressInOut::create(float t, CCScene* s return NULL; } - -CCTransitionProgressInOut* CCTransitionProgressInOut::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionProgressInOut* pScene = new CCTransitionProgressInOut(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - void CCTransitionProgressInOut::sceneOrder() { m_bIsInSceneOnTop = false; @@ -406,20 +322,6 @@ CCTransitionProgressOutIn* CCTransitionProgressOutIn::create(float t, CCScene* s return NULL; } - -CCTransitionProgressOutIn* CCTransitionProgressOutIn::transitionWithDuration(float t, CCScene* scene) -{ - CCTransitionProgressOutIn* pScene = new CCTransitionProgressOutIn(); - - if(pScene && pScene->initWithDuration(t, scene)) - { - pScene->autorelease(); - return pScene; - } - CC_SAFE_DELETE(pScene); - return NULL; -} - CCProgressTimer* CCTransitionProgressOutIn::progressTimerNodeWithRenderTexture(CCRenderTexture* texture) { CCSize size = CCDirector::sharedDirector()->getWinSize(); diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.h b/cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.h index 65dcf3a928..681dc49727 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.h +++ b/cocos2dx/layers_scenes_transitions_nodes/CCTransitionProgress.h @@ -42,7 +42,6 @@ class CCRenderTexture; class CC_DLL CCTransitionProgress : public CCTransitionScene { public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionProgress* transitionWithDuration(float t, CCScene* scene); static CCTransitionProgress* create(float t, CCScene* scene); CCTransitionProgress(); @@ -64,7 +63,6 @@ protected: class CC_DLL CCTransitionProgressRadialCCW : public CCTransitionProgress { public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressRadialCCW* transitionWithDuration(float t, CCScene* scene); static CCTransitionProgressRadialCCW* create(float t, CCScene* scene); protected: virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture); @@ -78,7 +76,6 @@ protected: class CC_DLL CCTransitionProgressRadialCW : public CCTransitionProgress { public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressRadialCW* transitionWithDuration(float t, CCScene* scene); static CCTransitionProgressRadialCW* create(float t, CCScene* scene); protected: virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture); @@ -91,7 +88,7 @@ protected: class CC_DLL CCTransitionProgressHorizontal : public CCTransitionProgress { public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressHorizontal* transitionWithDuration(float t, CCScene* scene); + static CCTransitionProgressHorizontal* create(float t, CCScene* scene); protected: virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture); @@ -101,7 +98,7 @@ protected: class CC_DLL CCTransitionProgressVertical : public CCTransitionProgress { public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressVertical* transitionWithDuration(float t, CCScene* scene); + static CCTransitionProgressVertical* create(float t, CCScene* scene); protected: virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture); @@ -111,7 +108,7 @@ protected: class CC_DLL CCTransitionProgressInOut : public CCTransitionProgress { public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressInOut* transitionWithDuration(float t, CCScene* scene); + static CCTransitionProgressInOut* create(float t, CCScene* scene); protected: virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture); @@ -122,7 +119,7 @@ protected: class CC_DLL CCTransitionProgressOutIn : public CCTransitionProgress { public: - CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressOutIn* transitionWithDuration(float t, CCScene* scene); + static CCTransitionProgressOutIn* create(float t, CCScene* scene); protected: virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture); diff --git a/cocos2dx/menu_nodes/CCMenu.cpp b/cocos2dx/menu_nodes/CCMenu.cpp index 9273988670..571eaf7081 100644 --- a/cocos2dx/menu_nodes/CCMenu.cpp +++ b/cocos2dx/menu_nodes/CCMenu.cpp @@ -59,28 +59,11 @@ enum //CCMenu // -CCMenu* CCMenu::node() -{ - return CCMenu::create(); -} - CCMenu* CCMenu::create() { return CCMenu::create(NULL, NULL); } -CCMenu * CCMenu::menuWithItems(CCMenuItem* item, ...) -{ - va_list args; - va_start(args,item); - - CCMenu *pRet = CCMenu::createWithItems(item, args); - - va_end(args); - - return pRet; -} - CCMenu * CCMenu::create(CCMenuItem* item, ...) { va_list args; @@ -89,15 +72,10 @@ CCMenu * CCMenu::create(CCMenuItem* item, ...) CCMenu *pRet = CCMenu::createWithItems(item, args); va_end(args); - + return pRet; } -CCMenu* CCMenu::menuWithArray(CCArray* pArrayOfItems) -{ - return CCMenu::createWithArray(pArrayOfItems); -} - CCMenu* CCMenu::createWithArray(CCArray* pArrayOfItems) { CCMenu *pRet = new CCMenu(); @@ -113,11 +91,6 @@ CCMenu* CCMenu::createWithArray(CCArray* pArrayOfItems) return pRet; } -CCMenu* CCMenu::menuWithItem(CCMenuItem* item) -{ - return CCMenu::createWithItem(item); -} - CCMenu* CCMenu::createWithItems(CCMenuItem* item, va_list args) { CCArray* pArray = NULL; diff --git a/cocos2dx/menu_nodes/CCMenu.h b/cocos2dx/menu_nodes/CCMenu.h index c925d4e9d4..f74e37198a 100644 --- a/cocos2dx/menu_nodes/CCMenu.h +++ b/cocos2dx/menu_nodes/CCMenu.h @@ -69,28 +69,6 @@ public: {} virtual ~CCMenu(){} - /** creates an empty CCMenu - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenu* node(); - - /** creates a CCMenu with it's items - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenu* menuWithItems(CCMenuItem* item, ...); - - /** creates a CCMenu with a NSArray of CCMenuItem objects - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenu* menuWithArray(CCArray* pArrayOfItems); - - /** creates a CCMenu with it's item, then use addChild() to add - * other items. It is used for script, it can't init with undetermined - * number of variables. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenu* menuWithItem(CCMenuItem* item); - /** creates an empty CCMenu */ static CCMenu* create(); diff --git a/cocos2dx/menu_nodes/CCMenuItem.cpp b/cocos2dx/menu_nodes/CCMenuItem.cpp index 397e9fb40e..a2235d0607 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.cpp +++ b/cocos2dx/menu_nodes/CCMenuItem.cpp @@ -50,11 +50,6 @@ const unsigned int kDisableTag = 0x3; // CCMenuItem // -CCMenuItem* CCMenuItem::itemWithTarget(CCObject *rec, SEL_MenuHandler selector) -{ - return CCMenuItem::create(rec, selector); -} - CCMenuItem* CCMenuItem::create() { return CCMenuItem::create(NULL, NULL); @@ -187,11 +182,6 @@ void CCMenuItemLabel::setLabel(CCNode* var) m_pLabel = var; } -CCMenuItemLabel * CCMenuItemLabel::itemWithLabel(CCNode*label, CCObject* target, SEL_MenuHandler selector) -{ - return CCMenuItemLabel::create(label, target, selector); -} - CCMenuItemLabel * CCMenuItemLabel::create(CCNode*label, CCObject* target, SEL_MenuHandler selector) { CCMenuItemLabel *pRet = new CCMenuItemLabel(); @@ -200,11 +190,6 @@ CCMenuItemLabel * CCMenuItemLabel::create(CCNode*label, CCObject* target, SEL_Me return pRet; } -CCMenuItemLabel* CCMenuItemLabel::itemWithLabel(CCNode *label) -{ - return CCMenuItemLabel::create(label); -} - CCMenuItemLabel* CCMenuItemLabel::create(CCNode *label) { CCMenuItemLabel *pRet = new CCMenuItemLabel(); @@ -320,21 +305,11 @@ ccColor3B CCMenuItemLabel::getColor() //CCMenuItemAtlasFont // -CCMenuItemAtlasFont * CCMenuItemAtlasFont::itemWithString(const char *value, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap) -{ - return CCMenuItemAtlasFont::create(value, charMapFile, itemWidth, itemHeight, startCharMap); -} - CCMenuItemAtlasFont * CCMenuItemAtlasFont::create(const char *value, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap) { return CCMenuItemAtlasFont::create(value, charMapFile, itemWidth, itemHeight, startCharMap, NULL, NULL); } -CCMenuItemAtlasFont * CCMenuItemAtlasFont::itemWithString(const char *value, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap, CCObject* target, SEL_MenuHandler selector) -{ - return CCMenuItemAtlasFont::create(value, charMapFile, itemWidth, itemHeight, startCharMap, target, selector); -} - CCMenuItemAtlasFont * CCMenuItemAtlasFont::create(const char *value, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap, CCObject* target, SEL_MenuHandler selector) { CCMenuItemAtlasFont *pRet = new CCMenuItemAtlasFont(); @@ -384,11 +359,6 @@ const char * CCMenuItemFont::fontName() return _fontName.c_str(); } -CCMenuItemFont * CCMenuItemFont::itemWithString(const char *value, CCObject* target, SEL_MenuHandler selector) -{ - return CCMenuItemFont::create(value, target, selector); -} - CCMenuItemFont * CCMenuItemFont::create(const char *value, CCObject* target, SEL_MenuHandler selector) { CCMenuItemFont *pRet = new CCMenuItemFont(); @@ -397,11 +367,6 @@ CCMenuItemFont * CCMenuItemFont::create(const char *value, CCObject* target, SEL return pRet; } -CCMenuItemFont * CCMenuItemFont::itemWithString(const char *value) -{ - return CCMenuItemFont::create(value); -} - CCMenuItemFont * CCMenuItemFont::create(const char *value) { CCMenuItemFont *pRet = new CCMenuItemFont(); @@ -578,31 +543,16 @@ ccColor3B CCMenuItemSprite::getColor() return dynamic_cast(m_pNormalImage)->getColor(); } -CCMenuItemSprite * CCMenuItemSprite::itemWithNormalSprite(CCNode* normalSprite, CCNode* selectedSprite, CCNode* disabledSprite) -{ - return CCMenuItemSprite::create(normalSprite, selectedSprite, disabledSprite); -} - CCMenuItemSprite * CCMenuItemSprite::create(CCNode* normalSprite, CCNode* selectedSprite, CCNode* disabledSprite) { return CCMenuItemSprite::create(normalSprite, selectedSprite, disabledSprite, NULL, NULL); } -CCMenuItemSprite * CCMenuItemSprite::itemWithNormalSprite(CCNode* normalSprite, CCNode* selectedSprite, CCObject* target, SEL_MenuHandler selector) -{ - return CCMenuItemSprite::create(normalSprite, selectedSprite, target, selector); -} - CCMenuItemSprite * CCMenuItemSprite::create(CCNode* normalSprite, CCNode* selectedSprite, CCObject* target, SEL_MenuHandler selector) { return CCMenuItemSprite::create(normalSprite, selectedSprite, NULL, target, selector); } -CCMenuItemSprite * CCMenuItemSprite::itemWithNormalSprite(CCNode *normalSprite, CCNode *selectedSprite, CCNode *disabledSprite, CCObject *target, SEL_MenuHandler selector) -{ - return CCMenuItemSprite::create(normalSprite, selectedSprite, disabledSprite, target, selector); -} - CCMenuItemSprite * CCMenuItemSprite::create(CCNode *normalSprite, CCNode *selectedSprite, CCNode *disabledSprite, CCObject *target, SEL_MenuHandler selector) { CCMenuItemSprite *pRet = new CCMenuItemSprite(); @@ -709,11 +659,6 @@ void CCMenuItemSprite::updateImagesVisibility() /// CCMenuItemImage /// -CCMenuItemImage* CCMenuItemImage::node() -{ - return CCMenuItemImage::create(); -} - CCMenuItemImage* CCMenuItemImage::create() { CCMenuItemImage *pRet = new CCMenuItemImage(); @@ -730,31 +675,17 @@ bool CCMenuItemImage::init(void) { return initWithNormalImage(NULL, NULL, NULL, NULL, NULL); } -CCMenuItemImage * CCMenuItemImage::itemWithNormalImage(const char *normalImage, const char *selectedImage) -{ - return CCMenuItemImage::create(normalImage, selectedImage); -} CCMenuItemImage * CCMenuItemImage::create(const char *normalImage, const char *selectedImage) { return CCMenuItemImage::create(normalImage, selectedImage, NULL, NULL, NULL); } -CCMenuItemImage * CCMenuItemImage::itemWithNormalImage(const char *normalImage, const char *selectedImage, CCObject* target, SEL_MenuHandler selector) -{ - return CCMenuItemImage::create(normalImage, selectedImage, target, selector); -} - CCMenuItemImage * CCMenuItemImage::create(const char *normalImage, const char *selectedImage, CCObject* target, SEL_MenuHandler selector) { return CCMenuItemImage::create(normalImage, selectedImage, NULL, target, selector); } -CCMenuItemImage * CCMenuItemImage::itemWithNormalImage(const char *normalImage, const char *selectedImage, const char *disabledImage, CCObject* target, SEL_MenuHandler selector) -{ - return CCMenuItemImage::create(normalImage, selectedImage, disabledImage, target, selector); -} - CCMenuItemImage * CCMenuItemImage::create(const char *normalImage, const char *selectedImage, const char *disabledImage, CCObject* target, SEL_MenuHandler selector) { CCMenuItemImage *pRet = new CCMenuItemImage(); @@ -767,11 +698,6 @@ CCMenuItemImage * CCMenuItemImage::create(const char *normalImage, const char *s return NULL; } -CCMenuItemImage * CCMenuItemImage::itemWithNormalImage(const char *normalImage, const char *selectedImage, const char *disabledImage) -{ - return CCMenuItemImage::create(normalImage, selectedImage, disabledImage); -} - CCMenuItemImage * CCMenuItemImage::create(const char *normalImage, const char *selectedImage, const char *disabledImage) { CCMenuItemImage *pRet = new CCMenuItemImage(); @@ -840,17 +766,6 @@ CCArray* CCMenuItemToggle::getSubItems() return m_pSubItems; } -CCMenuItemToggle * CCMenuItemToggle::itemWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...) -{ - va_list args; - va_start(args, item); - CCMenuItemToggle *pRet = new CCMenuItemToggle(); - pRet->initWithTarget(target, selector, item, args); - pRet->autorelease(); - va_end(args); - return pRet; -} - CCMenuItemToggle * CCMenuItemToggle::createWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...) { va_list args; @@ -888,11 +803,6 @@ bool CCMenuItemToggle::initWithTarget(CCObject* target, SEL_MenuHandler selector return true; } -CCMenuItemToggle* CCMenuItemToggle::itemWithItem(CCMenuItem *item) -{ - return CCMenuItemToggle::create(item); -} - CCMenuItemToggle* CCMenuItemToggle::create(CCMenuItem *item) { CCMenuItemToggle *pRet = new CCMenuItemToggle(); @@ -904,8 +814,8 @@ CCMenuItemToggle* CCMenuItemToggle::create(CCMenuItem *item) bool CCMenuItemToggle::initWithItem(CCMenuItem *item) { CCMenuItem::initWithTarget(NULL, NULL); - this->m_pSubItems = CCArray::create(); - this->m_pSubItems->retain(); + setSubItems(CCArray::create()); + if (item) { m_pSubItems->addObject(item); } diff --git a/cocos2dx/menu_nodes/CCMenuItem.h b/cocos2dx/menu_nodes/CCMenuItem.h index 8625439ab3..6f39fe5036 100644 --- a/cocos2dx/menu_nodes/CCMenuItem.h +++ b/cocos2dx/menu_nodes/CCMenuItem.h @@ -68,10 +68,7 @@ public: , m_nScriptTapHandler(0) {} virtual ~CCMenuItem(); - /** Creates a CCMenuItem with a target/selector - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItem * itemWithTarget(CCObject *rec, SEL_MenuHandler selector); + /** Creates a CCMenuItem with no target/selector */ static CCMenuItem* create(); /** Creates a CCMenuItem with a target/selector */ @@ -125,14 +122,6 @@ public: , m_fOriginalScale(0.0) {} virtual ~CCMenuItemLabel(); - /** creates a CCMenuItemLabel with a Label, target and selector - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemLabel * itemWithLabel(CCNode*label, CCObject* target, SEL_MenuHandler selector); - /** creates a CCMenuItemLabel with a Label. Target and selector will be nil - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemLabel* itemWithLabel(CCNode *label); /** creates a CCMenuItemLabel with a Label, target and selector */ static CCMenuItemLabel * create(CCNode*label, CCObject* target, SEL_MenuHandler selector); @@ -172,14 +161,6 @@ class CC_DLL CCMenuItemAtlasFont : public CCMenuItemLabel public: CCMenuItemAtlasFont(){} virtual ~CCMenuItemAtlasFont(){} - /** creates a menu item from a string and atlas with a target/selector - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemAtlasFont* itemWithString(const char *value, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap); - /** creates a menu item from a string and atlas. Use it with MenuItemToggle - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemAtlasFont* itemWithString(const char *value, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap, CCObject* target, SEL_MenuHandler selector); /** creates a menu item from a string and atlas with a target/selector */ static CCMenuItemAtlasFont* create(const char *value, const char *charMapFile, int itemWidth, int itemHeight, char startCharMap); @@ -206,14 +187,6 @@ public: static void setFontName(const char *name); /** get the default font name */ static const char *fontName(); - /** creates a menu item from a string without target/selector. To be used with CCMenuItemToggle - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemFont * itemWithString(const char *value); - /** creates a menu item from a string with a target/selector - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemFont * itemWithString(const char *value, CCObject* target, SEL_MenuHandler selector); /** creates a menu item from a string without target/selector. To be used with CCMenuItemToggle */ static CCMenuItemFont * create(const char *value); @@ -270,18 +243,6 @@ public: ,m_pSelectedImage(NULL) ,m_pDisabledImage(NULL) {} - /** creates a menu item with a normal, selected and disabled image - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemSprite * itemWithNormalSprite(CCNode* normalSprite, CCNode* selectedSprite, CCNode* disabledSprite = NULL); - /** creates a menu item with a normal and selected image with target/selector - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemSprite * itemWithNormalSprite(CCNode* normalSprite, CCNode* selectedSprite, CCObject* target, SEL_MenuHandler selector); - /** creates a menu item with a normal,selected and disabled image with target/selector - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemSprite * itemWithNormalSprite(CCNode* normalSprite, CCNode* selectedSprite, CCNode* disabledSprite, CCObject* target, SEL_MenuHandler selector); /** creates a menu item with a normal, selected and disabled image*/ static CCMenuItemSprite * create(CCNode* normalSprite, CCNode* selectedSprite, CCNode* disabledSprite = NULL); @@ -325,22 +286,6 @@ class CC_DLL CCMenuItemImage : public CCMenuItemSprite public: CCMenuItemImage(){} virtual ~CCMenuItemImage(){} - /** creates a menu item with a normal and selected image - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemImage* itemWithNormalImage(const char *normalImage, const char *selectedImage); - /** creates a menu item with a normal,selected and disabled image - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemImage* itemWithNormalImage(const char *normalImage, const char *selectedImage, const char *disabledImage); - /** creates a menu item with a normal and selected image with target/selector - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemImage* itemWithNormalImage(const char *normalImage, const char *selectedImage, CCObject* target, SEL_MenuHandler selector); - /** creates a menu item with a normal,selected and disabled image with target/selector - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemImage* itemWithNormalImage(const char *normalImage, const char *selectedImage, const char *disabledImage, CCObject* target, SEL_MenuHandler selector); /** creates a menu item with a normal and selected image*/ static CCMenuItemImage* create(const char *normalImage, const char *selectedImage); @@ -360,10 +305,6 @@ public: void setSelectedSpriteFrame(CCSpriteFrame* frame); /** sets the sprite frame for the disabled image */ void setDisabledSpriteFrame(CCSpriteFrame* frame); - /** Creates an CCMenuItemImage. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemImage* node(); /** Creates an CCMenuItemImage. */ @@ -395,11 +336,6 @@ public: {} virtual ~CCMenuItemToggle(); - /** creates a menu item from a list of items with a target/selector - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemToggle* itemWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...); - /** creates a menu item from a list of items with a target/selector */ static CCMenuItemToggle* createWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, ...); @@ -408,12 +344,6 @@ public: /** initializes a menu item from a list of items with a target selector */ bool initWithTarget(CCObject* target, SEL_MenuHandler selector, CCMenuItem* item, va_list args); - - // The follow methods offered to lua - /** creates a menu item with a item - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMenuItemToggle* itemWithItem(CCMenuItem *item); /** creates a menu item with a item */ static CCMenuItemToggle* create(CCMenuItem *item); diff --git a/cocos2dx/misc_nodes/CCMotionStreak.cpp b/cocos2dx/misc_nodes/CCMotionStreak.cpp index 476d894b2d..7751c0f75a 100644 --- a/cocos2dx/misc_nodes/CCMotionStreak.cpp +++ b/cocos2dx/misc_nodes/CCMotionStreak.cpp @@ -66,11 +66,6 @@ CCMotionStreak::~CCMotionStreak() CC_SAFE_FREE(m_pTexCoords); } -CCMotionStreak* CCMotionStreak::streakWithFade(float fade, float minSeg, float stroke, ccColor3B color, const char* path) -{ - return CCMotionStreak::create(fade, minSeg, stroke, color, path); -} - CCMotionStreak* CCMotionStreak::create(float fade, float minSeg, float stroke, ccColor3B color, const char* path) { CCMotionStreak *pRet = new CCMotionStreak(); @@ -84,11 +79,6 @@ CCMotionStreak* CCMotionStreak::create(float fade, float minSeg, float stroke, c return NULL; } -CCMotionStreak* CCMotionStreak::streakWithFade(float fade, float minSeg, float stroke, ccColor3B color, CCTexture2D* texture) -{ - return CCMotionStreak::create(fade, minSeg, stroke, color, texture); -} - CCMotionStreak* CCMotionStreak::create(float fade, float minSeg, float stroke, ccColor3B color, CCTexture2D* texture) { CCMotionStreak *pRet = new CCMotionStreak(); diff --git a/cocos2dx/misc_nodes/CCMotionStreak.h b/cocos2dx/misc_nodes/CCMotionStreak.h index db108fe380..599f13e1ff 100644 --- a/cocos2dx/misc_nodes/CCMotionStreak.h +++ b/cocos2dx/misc_nodes/CCMotionStreak.h @@ -45,14 +45,6 @@ class CC_DLL CCMotionStreak : public CCNode, public CCTextureProtocol, public CC public: CCMotionStreak(); virtual ~CCMotionStreak(); - /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMotionStreak* streakWithFade(float fade, float minSeg, float stroke, ccColor3B color, const char* path); - /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCMotionStreak* streakWithFade(float fade, float minSeg, float stroke, ccColor3B color, CCTexture2D* texture); /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */ static CCMotionStreak* create(float fade, float minSeg, float stroke, ccColor3B color, const char* path); diff --git a/cocos2dx/misc_nodes/CCProgressTimer.cpp b/cocos2dx/misc_nodes/CCProgressTimer.cpp index 55d0085e37..06f6c9b7cb 100644 --- a/cocos2dx/misc_nodes/CCProgressTimer.cpp +++ b/cocos2dx/misc_nodes/CCProgressTimer.cpp @@ -56,11 +56,6 @@ CCProgressTimer::CCProgressTimer() ,m_bReverseDirection(false) {} -CCProgressTimer* CCProgressTimer::progressWithSprite(CCSprite* sp) -{ - return CCProgressTimer::create(sp); -} - CCProgressTimer* CCProgressTimer::create(CCSprite* sp) { CCProgressTimer *pProgressTimer = new CCProgressTimer(); diff --git a/cocos2dx/misc_nodes/CCProgressTimer.h b/cocos2dx/misc_nodes/CCProgressTimer.h index e90f2dc08d..e0a6822bad 100644 --- a/cocos2dx/misc_nodes/CCProgressTimer.h +++ b/cocos2dx/misc_nodes/CCProgressTimer.h @@ -87,10 +87,6 @@ public: inline void setReverseDirection(bool value) { m_bReverseDirection = value; }; public: - /** Creates a progress timer with the sprite as the shape the timer goes through - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCProgressTimer* progressWithSprite(CCSprite* sp); /** Creates a progress timer with the sprite as the shape the timer goes through */ static CCProgressTimer* create(CCSprite* sp); protected: diff --git a/cocos2dx/misc_nodes/CCRenderTexture.cpp b/cocos2dx/misc_nodes/CCRenderTexture.cpp index 51044cc47c..b3e5f08550 100644 --- a/cocos2dx/misc_nodes/CCRenderTexture.cpp +++ b/cocos2dx/misc_nodes/CCRenderTexture.cpp @@ -59,12 +59,19 @@ CCRenderTexture::CCRenderTexture() , m_nClearStencil(0) , m_bAutoDraw(false) { +#if CC_ENABLE_CACHE_TEXTURE_DATA // Listen this event to save render texture before come to background. // Then it can be restored after coming to foreground on Android. CCNotificationCenter::sharedNotificationCenter()->addObserver(this, - callfuncO_selector(CCRenderTexture::listenToBackground), - EVENT_COME_TO_BACKGROUND, - NULL); + callfuncO_selector(CCRenderTexture::listenToBackground), + EVENT_COME_TO_BACKGROUND, + NULL); + + CCNotificationCenter::sharedNotificationCenter()->addObserver(this, + callfuncO_selector(CCRenderTexture::listenToForeground), + EVNET_COME_TO_FOREGROUND, // this is misspelt + NULL); +#endif } CCRenderTexture::~CCRenderTexture() @@ -78,29 +85,59 @@ CCRenderTexture::~CCRenderTexture() glDeleteRenderbuffers(1, &m_uDepthRenderBufffer); } CC_SAFE_DELETE(m_pUITextureImage); - + +#if CC_ENABLE_CACHE_TEXTURE_DATA CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, EVENT_COME_TO_BACKGROUND); + CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, EVNET_COME_TO_FOREGROUND); +#endif } void CCRenderTexture::listenToBackground(cocos2d::CCObject *obj) { #if CC_ENABLE_CACHE_TEXTURE_DATA - CC_SAFE_DELETE(m_pUITextureImage); // to get the rendered texture data - m_pUITextureImage = newCCImage(); - + m_pUITextureImage = newCCImage(false); if (m_pUITextureImage) { const CCSize& s = m_pTexture->getContentSizeInPixels(); VolatileTexture::addDataTexture(m_pTexture, m_pUITextureImage->getData(), kTexture2DPixelFormat_RGBA8888, s); - } + + if ( m_pTextureCopy ) + { + VolatileTexture::addDataTexture(m_pTextureCopy, m_pUITextureImage->getData(), kTexture2DPixelFormat_RGBA8888, s); + } + } else { CCLOG("Cache rendertexture failed!"); } + + glDeleteFramebuffers(1, &m_uFBO); + m_uFBO = 0; +#endif +} + +void CCRenderTexture::listenToForeground(cocos2d::CCObject *obj) +{ +#if CC_ENABLE_CACHE_TEXTURE_DATA + // -- regenerate frame buffer object and attach the texture + glGetIntegerv(GL_FRAMEBUFFER_BINDING, &m_nOldFBO); + + glGenFramebuffers(1, &m_uFBO); + glBindFramebuffer(GL_FRAMEBUFFER, m_uFBO); + + m_pTexture->setAliasTexParameters(); + + if ( m_pTextureCopy ) + { + m_pTextureCopy->setAliasTexParameters(); + } + + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_pTexture->getName(), 0); + glBindFramebuffer(GL_FRAMEBUFFER, m_nOldFBO); #endif } @@ -166,11 +203,6 @@ void CCRenderTexture::setAutoDraw(bool bAutoDraw) m_bAutoDraw = bAutoDraw; } -CCRenderTexture * CCRenderTexture::renderTextureWithWidthAndHeight(int w, int h, CCTexture2DPixelFormat eFormat) -{ - return CCRenderTexture::create(w, h, eFormat); -} - CCRenderTexture * CCRenderTexture::create(int w, int h, CCTexture2DPixelFormat eFormat) { CCRenderTexture *pRet = new CCRenderTexture(); @@ -184,11 +216,6 @@ CCRenderTexture * CCRenderTexture::create(int w, int h, CCTexture2DPixelFormat e return NULL; } -CCRenderTexture * CCRenderTexture::renderTextureWithWidthAndHeight(int w ,int h, CCTexture2DPixelFormat eFormat, GLuint uDepthStencilFormat) -{ - return CCRenderTexture::create(w, h, eFormat, uDepthStencilFormat); -} - CCRenderTexture * CCRenderTexture::create(int w ,int h, CCTexture2DPixelFormat eFormat, GLuint uDepthStencilFormat) { CCRenderTexture *pRet = new CCRenderTexture(); @@ -202,11 +229,6 @@ CCRenderTexture * CCRenderTexture::create(int w ,int h, CCTexture2DPixelFormat e return NULL; } -CCRenderTexture * CCRenderTexture::renderTextureWithWidthAndHeight(int w, int h) -{ - return CCRenderTexture::create(w, h); -} - CCRenderTexture * CCRenderTexture::create(int w, int h) { CCRenderTexture *pRet = new CCRenderTexture(); @@ -590,7 +612,7 @@ bool CCRenderTexture::saveToFile(const char *szFilePath) { bool bRet = false; - CCImage *pImage = newCCImage(); + CCImage *pImage = newCCImage(true); if (pImage) { bRet = pImage->saveToFile(szFilePath, kCCImageFormatJPEG); @@ -605,7 +627,7 @@ bool CCRenderTexture::saveToFile(const char *fileName, tCCImageFormat format) CCAssert(format == kCCImageFormatJPEG || format == kCCImageFormatPNG, "the image can only be saved as JPG or PNG format"); - CCImage *pImage = newCCImage(); + CCImage *pImage = newCCImage(true); if (pImage) { std::string fullpath = CCFileUtils::sharedFileUtils()->getWriteablePath() + fileName; @@ -619,7 +641,7 @@ bool CCRenderTexture::saveToFile(const char *fileName, tCCImageFormat format) } /* get buffer as CCImage */ -CCImage* CCRenderTexture::newCCImage() +CCImage* CCRenderTexture::newCCImage(bool flipImage) { CCAssert(m_ePixelFormat == kCCTexture2DPixelFormat_RGBA8888, "only RGBA8888 can be saved as image"); @@ -656,16 +678,24 @@ CCImage* CCRenderTexture::newCCImage() glReadPixels(0,0,nSavedBufferWidth, nSavedBufferHeight,GL_RGBA,GL_UNSIGNED_BYTE, pTempData); this->end(); - // to get the actual texture data - // #640 the image read from rendertexture is dirty - for (int i = 0; i < nSavedBufferHeight; ++i) + if ( flipImage ) // -- flip is only required when saving image to file { - memcpy(&pBuffer[i * nSavedBufferWidth * 4], - &pTempData[(nSavedBufferHeight - i - 1) * nSavedBufferWidth * 4], - nSavedBufferWidth * 4); - } + // to get the actual texture data + // #640 the image read from rendertexture is dirty + for (int i = 0; i < nSavedBufferHeight; ++i) + { + memcpy(&pBuffer[i * nSavedBufferWidth * 4], + &pTempData[(nSavedBufferHeight - i - 1) * nSavedBufferWidth * 4], + nSavedBufferWidth * 4); + } - pImage->initWithImageData(pBuffer, nSavedBufferWidth * nSavedBufferHeight * 4, CCImage::kFmtRawData, nSavedBufferWidth, nSavedBufferHeight, 8); + pImage->initWithImageData(pBuffer, nSavedBufferWidth * nSavedBufferHeight * 4, CCImage::kFmtRawData, nSavedBufferWidth, nSavedBufferHeight, 8); + } + else + { + pImage->initWithImageData(pTempData, nSavedBufferWidth * nSavedBufferHeight * 4, CCImage::kFmtRawData, nSavedBufferWidth, nSavedBufferHeight, 8); + } + } while (0); CC_SAFE_DELETE_ARRAY(pBuffer); diff --git a/cocos2dx/misc_nodes/CCRenderTexture.h b/cocos2dx/misc_nodes/CCRenderTexture.h index 26aff3e68d..0093deda57 100644 --- a/cocos2dx/misc_nodes/CCRenderTexture.h +++ b/cocos2dx/misc_nodes/CCRenderTexture.h @@ -66,21 +66,6 @@ public: virtual void visit(); virtual void draw(); - /** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCRenderTexture * renderTextureWithWidthAndHeight(int w ,int h, CCTexture2DPixelFormat eFormat, GLuint uDepthStencilFormat); - - /** creates a RenderTexture object with width and height in Points and a pixel format, only RGB and RGBA formats are valid - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCRenderTexture * renderTextureWithWidthAndHeight(int w, int h, CCTexture2DPixelFormat eFormat); - - /** creates a RenderTexture object with width and height in Points, pixel format is RGBA8888 - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCRenderTexture * renderTextureWithWidthAndHeight(int w, int h); - /** initializes a RenderTexture object with width and height in Points and a pixel format( only RGB and RGBA formats are valid ) and depthStencil format*/ static CCRenderTexture * create(int w ,int h, CCTexture2DPixelFormat eFormat, GLuint uDepthStencilFormat); @@ -128,7 +113,7 @@ public: /* creates a new CCImage from with the texture's data. Caller is responsible for releasing it by calling delete. */ - CCImage* newCCImage(); + CCImage* newCCImage(bool flipImage = true); /** saves the texture into a file using JPEG format. The file will be saved in the Documents folder. Returns YES if the operation is successful. @@ -145,6 +130,11 @@ public: */ void listenToBackground(CCObject *obj); + /** Listen "come to foreground" message and restore the frame buffer object + It only has effect on Android. + */ + void listenToForeground(CCObject *obj); + /** Valid flags: GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT. They can be OR'ed. Valid when "autoDraw is YES. */ unsigned int getClearFlags() const; void setClearFlags(unsigned int uClearFlags); diff --git a/cocos2dx/particle_nodes/CCParticleBatchNode.cpp b/cocos2dx/particle_nodes/CCParticleBatchNode.cpp index 84f3523574..5765c42f09 100644 --- a/cocos2dx/particle_nodes/CCParticleBatchNode.cpp +++ b/cocos2dx/particle_nodes/CCParticleBatchNode.cpp @@ -58,10 +58,6 @@ CCParticleBatchNode::~CCParticleBatchNode() /* * creation with CCTexture2D */ -CCParticleBatchNode* CCParticleBatchNode::batchNodeWithTexture(CCTexture2D *tex, unsigned int capacity/* = kCCParticleDefaultCapacity*/) -{ - return CCParticleBatchNode::createWithTexture(tex, capacity); -} CCParticleBatchNode* CCParticleBatchNode::createWithTexture(CCTexture2D *tex, unsigned int capacity/* = kCCParticleDefaultCapacity*/) { @@ -78,10 +74,6 @@ CCParticleBatchNode* CCParticleBatchNode::createWithTexture(CCTexture2D *tex, un /* * creation with File Image */ -CCParticleBatchNode* CCParticleBatchNode::batchNodeWithFile(const char* imageFile, unsigned int capacity/* = kCCParticleDefaultCapacity*/) -{ - return CCParticleBatchNode::create(imageFile, capacity); -} CCParticleBatchNode* CCParticleBatchNode::create(const char* imageFile, unsigned int capacity/* = kCCParticleDefaultCapacity*/) { diff --git a/cocos2dx/particle_nodes/CCParticleBatchNode.h b/cocos2dx/particle_nodes/CCParticleBatchNode.h index b02594273d..da4f0224be 100644 --- a/cocos2dx/particle_nodes/CCParticleBatchNode.h +++ b/cocos2dx/particle_nodes/CCParticleBatchNode.h @@ -70,16 +70,6 @@ public: CCParticleBatchNode(); virtual ~CCParticleBatchNode(); - /** initializes the particle system with CCTexture2D, a capacity of particles, which particle system to use - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCParticleBatchNode* batchNodeWithTexture(CCTexture2D *tex, unsigned int capacity = kCCParticleDefaultCapacity); - - /** initializes the particle system with the name of a file on disk (for a list of supported formats look at the CCTexture2D class), a capacity of particles - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCParticleBatchNode* batchNodeWithFile(const char* fileImage, unsigned int capacity = kCCParticleDefaultCapacity); - /** initializes the particle system with CCTexture2D, a capacity of particles, which particle system to use */ static CCParticleBatchNode* createWithTexture(CCTexture2D *tex, unsigned int capacity = kCCParticleDefaultCapacity); diff --git a/cocos2dx/particle_nodes/CCParticleExamples.cpp b/cocos2dx/particle_nodes/CCParticleExamples.cpp index 4dfa5740ec..687cb18d49 100644 --- a/cocos2dx/particle_nodes/CCParticleExamples.cpp +++ b/cocos2dx/particle_nodes/CCParticleExamples.cpp @@ -55,11 +55,6 @@ static CCTexture2D* getDefaultTexture() return pTexture; } -CCParticleFire* CCParticleFire::node() -{ - return CCParticleFire::create(); -} - CCParticleFire* CCParticleFire::create() { CCParticleFire* pRet = new CCParticleFire(); @@ -164,10 +159,6 @@ bool CCParticleFire::initWithTotalParticles(unsigned int numberOfParticles) // // ParticleFireworks // -CCParticleFireworks* CCParticleFireworks::node() -{ - return CCParticleFireworks::create(); -} CCParticleFireworks* CCParticleFireworks::create() { @@ -270,12 +261,6 @@ bool CCParticleFireworks::initWithTotalParticles(unsigned int numberOfParticles) // // ParticleSun // - -CCParticleSun* CCParticleSun::node() -{ - return CCParticleSun::create(); -} - CCParticleSun* CCParticleSun::create() { CCParticleSun* pRet = new CCParticleSun(); @@ -383,11 +368,6 @@ bool CCParticleSun::initWithTotalParticles(unsigned int numberOfParticles) // ParticleGalaxy // -CCParticleGalaxy* CCParticleGalaxy::node() -{ - return CCParticleGalaxy::create(); -} - CCParticleGalaxy* CCParticleGalaxy::create() { CCParticleGalaxy* pRet = new CCParticleGalaxy(); @@ -497,11 +477,6 @@ bool CCParticleGalaxy::initWithTotalParticles(unsigned int numberOfParticles) // ParticleFlower // -CCParticleFlower* CCParticleFlower::node() -{ - return CCParticleFlower::create(); -} - CCParticleFlower* CCParticleFlower::create() { CCParticleFlower* pRet = new CCParticleFlower(); @@ -610,11 +585,6 @@ bool CCParticleFlower::initWithTotalParticles(unsigned int numberOfParticles) // ParticleMeteor // -CCParticleMeteor * CCParticleMeteor::node() -{ - return create(); -} - CCParticleMeteor * CCParticleMeteor::create() { CCParticleMeteor *pRet = new CCParticleMeteor(); @@ -724,11 +694,6 @@ bool CCParticleMeteor::initWithTotalParticles(unsigned int numberOfParticles) // ParticleSpiral // -CCParticleSpiral* CCParticleSpiral::node() -{ - return CCParticleSpiral::create(); -} - CCParticleSpiral* CCParticleSpiral::create() { CCParticleSpiral* pRet = new CCParticleSpiral(); @@ -838,11 +803,6 @@ bool CCParticleSpiral::initWithTotalParticles(unsigned int numberOfParticles) // ParticleExplosion // -CCParticleExplosion* CCParticleExplosion::node() -{ - return CCParticleExplosion::create(); -} - CCParticleExplosion* CCParticleExplosion::create() { CCParticleExplosion* pRet = new CCParticleExplosion(); @@ -951,11 +911,6 @@ bool CCParticleExplosion::initWithTotalParticles(unsigned int numberOfParticles) // ParticleSmoke // -CCParticleSmoke* CCParticleSmoke::node() -{ - return CCParticleSmoke::create(); -} - CCParticleSmoke* CCParticleSmoke::create() { CCParticleSmoke* pRet = new CCParticleSmoke(); @@ -1061,11 +1016,6 @@ bool CCParticleSmoke::initWithTotalParticles(unsigned int numberOfParticles) // CCParticleSnow // -CCParticleSnow* CCParticleSnow::node() -{ - return CCParticleSnow::create(); -} - CCParticleSnow* CCParticleSnow::create() { CCParticleSnow* pRet = new CCParticleSnow(); @@ -1173,10 +1123,6 @@ bool CCParticleSnow::initWithTotalParticles(unsigned int numberOfParticles) // // CCParticleRain // -CCParticleRain* CCParticleRain::node() -{ - return CCParticleRain::create(); -} CCParticleRain* CCParticleRain::create() { diff --git a/cocos2dx/particle_nodes/CCParticleExamples.h b/cocos2dx/particle_nodes/CCParticleExamples.h index 9a640f058f..2dad1f3b6b 100644 --- a/cocos2dx/particle_nodes/CCParticleExamples.h +++ b/cocos2dx/particle_nodes/CCParticleExamples.h @@ -43,8 +43,6 @@ public: virtual ~CCParticleFire(){} bool init(){ return initWithTotalParticles(250); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleFire* node(); static CCParticleFire* create(); static CCParticleFire* createWithTotalParticles(unsigned int numberOfParticles); @@ -58,8 +56,6 @@ public: virtual ~CCParticleFireworks(){} bool init(){ return initWithTotalParticles(1500); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleFireworks* node(); static CCParticleFireworks* create(); static CCParticleFireworks* createWithTotalParticles(unsigned int numberOfParticles); @@ -73,8 +69,6 @@ public: virtual ~CCParticleSun(){} bool init(){ return initWithTotalParticles(350); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleSun* node(); static CCParticleSun* create(); static CCParticleSun* createWithTotalParticles(unsigned int numberOfParticles); @@ -88,8 +82,6 @@ public: virtual ~CCParticleGalaxy(){} bool init(){ return initWithTotalParticles(200); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleGalaxy* node(); static CCParticleGalaxy* create(); static CCParticleGalaxy* createWithTotalParticles(unsigned int numberOfParticles); @@ -103,8 +95,6 @@ public: virtual ~CCParticleFlower(){} bool init(){ return initWithTotalParticles(250); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleFlower* node(); static CCParticleFlower* create(); static CCParticleFlower* createWithTotalParticles(unsigned int numberOfParticles); @@ -118,7 +108,7 @@ public: virtual ~CCParticleMeteor(){} bool init(){ return initWithTotalParticles(150); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - CC_DEPRECATED_ATTRIBUTE static CCParticleMeteor * node(); + static CCParticleMeteor * create(); static CCParticleMeteor* createWithTotalParticles(unsigned int numberOfParticles); }; @@ -131,8 +121,6 @@ public: virtual ~CCParticleSpiral(){} bool init(){ return initWithTotalParticles(500); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleSpiral* node(); static CCParticleSpiral* create(); static CCParticleSpiral* createWithTotalParticles(unsigned int numberOfParticles); @@ -146,8 +134,6 @@ public: virtual ~CCParticleExplosion(){} bool init(){ return initWithTotalParticles(700); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleExplosion* node(); static CCParticleExplosion* create(); static CCParticleExplosion* createWithTotalParticles(unsigned int numberOfParticles); @@ -161,8 +147,6 @@ public: virtual ~CCParticleSmoke(){} bool init(){ return initWithTotalParticles(200); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleSmoke* node(); static CCParticleSmoke* create(); static CCParticleSmoke* createWithTotalParticles(unsigned int numberOfParticles); @@ -176,8 +160,6 @@ public: virtual ~CCParticleSnow(){} bool init(){ return initWithTotalParticles(700); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleSnow* node(); static CCParticleSnow* create(); static CCParticleSnow* createWithTotalParticles(unsigned int numberOfParticles); @@ -191,8 +173,6 @@ public: virtual ~CCParticleRain(){} bool init(){ return initWithTotalParticles(1000); } virtual bool initWithTotalParticles(unsigned int numberOfParticles); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleRain* node(); static CCParticleRain* create(); static CCParticleRain* createWithTotalParticles(unsigned int numberOfParticles); diff --git a/cocos2dx/particle_nodes/CCParticleSystem.cpp b/cocos2dx/particle_nodes/CCParticleSystem.cpp index 2ef119c603..fc41843fd7 100644 --- a/cocos2dx/particle_nodes/CCParticleSystem.cpp +++ b/cocos2dx/particle_nodes/CCParticleSystem.cpp @@ -134,10 +134,6 @@ CCParticleSystem::CCParticleSystem() m_tBlendFunc.dst = CC_BLEND_DST; } // implementation CCParticleSystem -CCParticleSystem * CCParticleSystem::particleWithFile(const char *plistFile) -{ - return CCParticleSystem::create(plistFile); -} CCParticleSystem * CCParticleSystem::create(const char *plistFile) { diff --git a/cocos2dx/particle_nodes/CCParticleSystem.h b/cocos2dx/particle_nodes/CCParticleSystem.h index 5608667fce..e60aba4caf 100644 --- a/cocos2dx/particle_nodes/CCParticleSystem.h +++ b/cocos2dx/particle_nodes/CCParticleSystem.h @@ -367,13 +367,6 @@ public: public: CCParticleSystem(); virtual ~CCParticleSystem(); - /** creates an initializes a CCParticleSystem from a plist file. - This plist files can be created manually or with Particle Designer: - http://particledesigner.71squared.com/ - @deprecated: This interface will be deprecated sooner or later. - @since v0.99.3 - */ - CC_DEPRECATED_ATTRIBUTE static CCParticleSystem * particleWithFile(const char *plistFile); /** creates an initializes a CCParticleSystem from a plist file. This plist files can be created manually or with Particle Designer: diff --git a/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp b/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp index 7104a5ad78..e5125be14e 100644 --- a/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp +++ b/cocos2dx/particle_nodes/CCParticleSystemQuad.cpp @@ -103,10 +103,6 @@ CCParticleSystemQuad::~CCParticleSystemQuad() } // implementation CCParticleSystemQuad -CCParticleSystemQuad * CCParticleSystemQuad::particleWithFile(const char *plistFile) -{ - return CCParticleSystemQuad::create(plistFile); -} CCParticleSystemQuad * CCParticleSystemQuad::create(const char *plistFile) { @@ -593,11 +589,6 @@ void CCParticleSystemQuad::setBatchNode(CCParticleBatchNode * batchNode) } } -CCParticleSystemQuad * CCParticleSystemQuad::node() -{ - return CCParticleSystemQuad::create(); -} - CCParticleSystemQuad * CCParticleSystemQuad::create() { CCParticleSystemQuad *pParticleSystemQuad = new CCParticleSystemQuad(); if (pParticleSystemQuad && pParticleSystemQuad->init()) diff --git a/cocos2dx/particle_nodes/CCParticleSystemQuad.h b/cocos2dx/particle_nodes/CCParticleSystemQuad.h index e546bffdf1..dbec79987a 100644 --- a/cocos2dx/particle_nodes/CCParticleSystemQuad.h +++ b/cocos2dx/particle_nodes/CCParticleSystemQuad.h @@ -66,12 +66,6 @@ public: CCParticleSystemQuad(); virtual ~CCParticleSystemQuad(); - /** creates an initializes a CCParticleSystemQuad from a plist file. - This plist files can be created manually or with Particle Designer: - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCParticleSystemQuad * particleWithFile(const char *plistFile); - /** creates an initializes a CCParticleSystemQuad from a plist file. This plist files can be created manually or with Particle Designer: */ @@ -106,9 +100,6 @@ public: */ void listenBackToForeground(CCObject *obj); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParticleSystemQuad * node(); - static CCParticleSystemQuad * create(); static CCParticleSystemQuad * createWithTotalParticles(unsigned int numberOfParticles); private: diff --git a/cocos2dx/platform/CCCommon.h b/cocos2dx/platform/CCCommon.h index 0ac1f5b754..72340ee036 100644 --- a/cocos2dx/platform/CCCommon.h +++ b/cocos2dx/platform/CCCommon.h @@ -64,7 +64,9 @@ typedef enum LanguageType kLanguageGerman, kLanguageSpanish, kLanguageRussian, - kLanguageKorean + kLanguageKorean, + kLanguageJapanese, + kLanguageHungarian } ccLanguageType; // end of platform group diff --git a/cocos2dx/platform/android/CCApplication.cpp b/cocos2dx/platform/android/CCApplication.cpp index 2d2a76047a..67b9b42e01 100644 --- a/cocos2dx/platform/android/CCApplication.cpp +++ b/cocos2dx/platform/android/CCApplication.cpp @@ -112,6 +112,14 @@ ccLanguageType CCApplication::getCurrentLanguage() { ret = kLanguageKorean; } + else if (0 == strcmp("ja", pLanguageName)) + { + ret = kLanguageJapanese; + } + else if (0 == strcmp("hu", pLanguageName)) + { + ret = kLanguageHungarian; + } return ret; } diff --git a/cocos2dx/platform/blackberry/CCApplication.cpp b/cocos2dx/platform/blackberry/CCApplication.cpp index 5efe65864c..f855796735 100644 --- a/cocos2dx/platform/blackberry/CCApplication.cpp +++ b/cocos2dx/platform/blackberry/CCApplication.cpp @@ -147,10 +147,18 @@ ccLanguageType CCApplication::getCurrentLanguage() { ret_language = kLanguageRussian; } - else if (strcmp(language, "ko") == 0) + else if (strcmp(language, "ko") == 0) { ret_language = kLanguageKorean; } + else if (strcmp(language, "ja") == 0) + { + ret_language = kLanguageJapanese; + } + else if (strcmp(language, "hu") == 0) + { + ret_language = kLanguageHungarian; + } free(language); free(country); diff --git a/cocos2dx/platform/ios/CCApplication.mm b/cocos2dx/platform/ios/CCApplication.mm index 56233311d3..7927944b8d 100644 --- a/cocos2dx/platform/ios/CCApplication.mm +++ b/cocos2dx/platform/ios/CCApplication.mm @@ -107,6 +107,12 @@ ccLanguageType CCApplication::getCurrentLanguage() else if ([languageCode isEqualToString:@"ko"]){ ret = kLanguageKorean; } + else if ([languageCode isEqualToString:@"ja"]){ + ret = kLanguageJapanese; + } + else if ([languageCode isEqualToString:@"hu"]){ + ret = kLanguageHungarian; + } return ret; } diff --git a/cocos2dx/platform/linux/CCApplication.cpp b/cocos2dx/platform/linux/CCApplication.cpp index 86c2352c02..397b6f7ea9 100644 --- a/cocos2dx/platform/linux/CCApplication.cpp +++ b/cocos2dx/platform/linux/CCApplication.cpp @@ -100,8 +100,60 @@ CCApplication* CCApplication::sharedApplication() ccLanguageType CCApplication::getCurrentLanguage() { - //TODO - return kLanguageEnglish; + char *pLanguageName = getenv("LANG"); + ccLanguageType ret = kLanguageEnglish; + if (!pLanguageName) + { + return kLanguageEnglish; + } + strtok(pLanguageName, "_"); + if (!pLanguageName) + { + return kLanguageEnglish; + } + + if (0 == strcmp("zh", pLanguageName)) + { + ret = kLanguageChinese; + } + else if (0 == strcmp("en", pLanguageName)) + { + ret = kLanguageEnglish; + } + else if (0 == strcmp("fr", pLanguageName)) + { + ret = kLanguageFrench; + } + else if (0 == strcmp("it", pLanguageName)) + { + ret = kLanguageItalian; + } + else if (0 == strcmp("de", pLanguageName)) + { + ret = kLanguageGerman; + } + else if (0 == strcmp("es", pLanguageName)) + { + ret = kLanguageSpanish; + } + else if (0 == strcmp("ru", pLanguageName)) + { + ret = kLanguageRussian; + } + else if (0 == strcmp("ko", pLanguageName)) + { + ret = kLanguageKorean; + } + else if (0 == strcmp("ja", pLanguageName)) + { + ret = kLanguageJapanese; + } + else if (0 == strcmp("hu", pLanguageName)) + { + ret = kLanguageHungarian; + } + + return ret; } NS_CC_END diff --git a/cocos2dx/platform/linux/CCEGLView.cpp b/cocos2dx/platform/linux/CCEGLView.cpp index 6cabdcb5ac..75ca2e83cd 100644 --- a/cocos2dx/platform/linux/CCEGLView.cpp +++ b/cocos2dx/platform/linux/CCEGLView.cpp @@ -181,7 +181,7 @@ void CCEGLView::setFrameSize(float width, float height) case 16: { /* Updates video mode */ - eResult = (glfwOpenWindow(width, height, 5, 6, 5, 0, 16, 0, (int)u32GLFWFlags) != false) ? true : false; + eResult = (glfwOpenWindow(width, height, 5, 6, 5, 0, 16, 8, (int)u32GLFWFlags) != false) ? true : false; break; } @@ -190,7 +190,7 @@ void CCEGLView::setFrameSize(float width, float height) case 24: { /* Updates video mode */ - eResult = (glfwOpenWindow(width, height, 8, 8, 8, 0, 16, 0, (int)u32GLFWFlags) != false) ? true : false; + eResult = (glfwOpenWindow(width, height, 8, 8, 8, 0, 16, 8, (int)u32GLFWFlags) != false) ? true : false; break; } @@ -200,7 +200,7 @@ void CCEGLView::setFrameSize(float width, float height) case 32: { /* Updates video mode */ - eResult = (glfwOpenWindow(width, height, 8, 8, 8, 8, 16, 0, (int)u32GLFWFlags) != GL_FALSE) ? true :false; + eResult = (glfwOpenWindow(width, height, 8, 8, 8, 8, 16, 8, (int)u32GLFWFlags) != GL_FALSE) ? true :false; break; } } @@ -320,6 +320,10 @@ bool CCEGLView::initGL() { CCLog("OpenGL 2.0 not supported\n"); } + + // Enable point size by default on linux. + glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); + return true; } diff --git a/cocos2dx/platform/mac/CCApplication.mm b/cocos2dx/platform/mac/CCApplication.mm index 8c2a985d25..866fa1ba36 100755 --- a/cocos2dx/platform/mac/CCApplication.mm +++ b/cocos2dx/platform/mac/CCApplication.mm @@ -113,6 +113,12 @@ ccLanguageType CCApplication::getCurrentLanguage() else if ([languageCode isEqualToString:@"ko"]){ ret = kLanguageKorean; } + else if ([languageCode isEqualToString:@"ja"]){ + ret = kLanguageJapanese; + } + else if ([languageCode isEqualToString:@"hu"]){ + ret = kLanguageHungarian; + } return ret; } diff --git a/cocos2dx/platform/marmalade/CCApplication.cpp b/cocos2dx/platform/marmalade/CCApplication.cpp index 94e4d6e485..25370cea71 100644 --- a/cocos2dx/platform/marmalade/CCApplication.cpp +++ b/cocos2dx/platform/marmalade/CCApplication.cpp @@ -177,6 +177,14 @@ ccLanguageType CCApplication::getCurrentLanguage() currentLanguage = kLanguageKorean; break; + case S3E_DEVICE_LANGUAGE_JAPANESE: + currentLanguage = kLanguageJapanese; + break; + + case S3E_DEVICE_LANGUAGE_HUNGARIAN: + currentLanguage = kLanguageHungarian; + break; + default: currentLanguage = kLanguageEnglish; break; diff --git a/cocos2dx/platform/marmalade/CCImage.cpp b/cocos2dx/platform/marmalade/CCImage.cpp index c06afa8747..c620f42a0c 100644 --- a/cocos2dx/platform/marmalade/CCImage.cpp +++ b/cocos2dx/platform/marmalade/CCImage.cpp @@ -552,77 +552,77 @@ bool CCImage::initWithImageData(void * pData, int nHeight, int nBitsPerComponent) { - bool bRet = false; - do - { - CC_BREAK_IF(! pData || nDataLen <= 0); - - if (kFmtPng == eFmt) - { - bRet = _initWithPngData(pData, nDataLen); - break; - } - else if (kFmtJpg == eFmt) - { - bRet = _initWithJpgData(pData, nDataLen); - break; - } - else if (kFmtTiff == eFmt) - { - bRet = _initWithTiffData(pData, nDataLen); - break; - } - else if (kFmtRawData == eFmt) - { - bRet = _initWithRawData(pData, nDataLen, nWidth, nHeight, nBitsPerComponent); - break; - } - else - { - // if it is a png file buffer. - if (nDataLen > 8) - { - unsigned char* pHead = (unsigned char*)pData; - if ( pHead[0] == 0x89 - && pHead[1] == 0x50 - && pHead[2] == 0x4E - && pHead[3] == 0x47 - && pHead[4] == 0x0D - && pHead[5] == 0x0A - && pHead[6] == 0x1A - && pHead[7] == 0x0A) - { - bRet = _initWithPngData(pData, nDataLen); - break; - } - } - - // if it is a tiff file buffer. - if (nDataLen > 2) - { - unsigned char* pHead = (unsigned char*)pData; - if ( (pHead[0] == 0x49 && pHead[1] == 0x49) - || (pHead[0] == 0x4d && pHead[1] == 0x4d) - ) - { - bRet = _initWithTiffData(pData, nDataLen); - break; - } - } - - // if it is a jpeg file buffer. - if (nDataLen > 2) - { - unsigned char* pHead = (unsigned char*)pData; - if ( pHead[0] == 0xff - && pHead[1] == 0xd8) - { - bRet = _initWithJpgData(pData, nDataLen); - break; - } - } - } - } while (0); + bool bRet = false; + do + { + CC_BREAK_IF(! pData || nDataLen <= 0); + + if (kFmtPng == eFmt) + { + bRet = _initWithPngData(pData, nDataLen); + break; + } + else if (kFmtJpg == eFmt) + { + bRet = _initWithJpgData(pData, nDataLen); + break; + } + else if (kFmtTiff == eFmt) + { + bRet = _initWithTiffData(pData, nDataLen); + break; + } + else if (kFmtRawData == eFmt) + { + bRet = _initWithRawData(pData, nDataLen, nWidth, nHeight, nBitsPerComponent); + break; + } + else + { + // if it is a png file buffer. + if (nDataLen > 8) + { + unsigned char* pHead = (unsigned char*)pData; + if ( pHead[0] == 0x89 + && pHead[1] == 0x50 + && pHead[2] == 0x4E + && pHead[3] == 0x47 + && pHead[4] == 0x0D + && pHead[5] == 0x0A + && pHead[6] == 0x1A + && pHead[7] == 0x0A) + { + bRet = _initWithPngData(pData, nDataLen); + break; + } + } + + // if it is a tiff file buffer. + if (nDataLen > 2) + { + unsigned char* pHead = (unsigned char*)pData; + if ( (pHead[0] == 0x49 && pHead[1] == 0x49) + || (pHead[0] == 0x4d && pHead[1] == 0x4d) + ) + { + bRet = _initWithTiffData(pData, nDataLen); + break; + } + } + + // if it is a jpeg file buffer. + if (nDataLen > 2) + { + unsigned char* pHead = (unsigned char*)pData; + if ( pHead[0] == 0xff + && pHead[1] == 0xd8) + { + bRet = _initWithJpgData(pData, nDataLen); + break; + } + } + } + } while (0); return bRet; } @@ -630,99 +630,84 @@ bool CCImage::_initWithJpgData(void * data, int nSize) { IW_CALLSTACK("CCImage::_initWithJpgData"); - bool bRet = false; + /* these are standard libjpeg structures for reading(decompression) */ + struct jpeg_decompress_struct cinfo; + struct jpeg_error_mgr jerr; + /* libjpeg data structure for storing one row, that is, scanline of an image */ + JSAMPROW row_pointer[1] = {0}; + unsigned long location = 0; + unsigned int i = 0; - s3eFile* pFile = s3eFileOpenFromMemory(data, nSize); - - IwAssert(GAME, pFile); - - jpeg_decompress_struct cinfo; - bzero(&cinfo, sizeof(cinfo)); - - JSAMPARRAY buffer; /* Output row buffer */ - int row_stride; /* physical row width in output buffer */ - - jpeg_source_mgr srcmgr; - - srcmgr.bytes_in_buffer = nSize; - srcmgr.next_input_byte = (JOCTET*) data; - srcmgr.init_source = CCImageHelper::JPEGInitSource; - srcmgr.fill_input_buffer = CCImageHelper::JPEGFillInputBuffer; - srcmgr.skip_input_data = CCImageHelper::JPEGSkipInputData; - srcmgr.resync_to_restart = jpeg_resync_to_restart; - srcmgr.term_source = CCImageHelper::JPEGTermSource; - - jpeg_error_mgr jerr; - cinfo.err = jpeg_std_error(&jerr); - - jpeg_create_decompress(&cinfo); - cinfo.src = &srcmgr; - - jpeg_read_header(&cinfo, TRUE); - jpeg_start_decompress(&cinfo); - - /* JSAMPLEs per row in output buffer */ - row_stride = cinfo.output_width * cinfo.output_components; - - /* Make a one-row-high sample array that will go away when done with image */ - buffer = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); - - int copy_rows = (int)cinfo.output_height; - int copy_width = (int)cinfo.output_width; - - if (copy_width < 0 || copy_rows < 0) + bool bRet = false; + do { - printf("jpeg is fully off screen\n"); - return bRet; - } - int startx=0; - int starty=0; - int bytesPerPix = 4; - m_pData = new unsigned char[copy_rows * copy_width * bytesPerPix]; - memset(m_pData,0, copy_rows * copy_width * bytesPerPix); - // init image info - m_bPreMulti = false; - m_bHasAlpha = false; - m_nHeight = copy_rows; - m_nWidth = copy_width; - m_nBitsPerComponent = bytesPerPix; - unsigned char *dst = m_pData; - unsigned char *pData = m_pData; + /* here we set up the standard libjpeg error handler */ + cinfo.err = jpeg_std_error( &jerr ); - while (cinfo.output_scanline < cinfo.output_height)// count through the image - { - /* jpeg_read_scanlines expects an array of pointers to scanlines. - * Here the array is only one element long, but you could ask for - * more than one scanline at a time if that's more convenient. - */ - (void) jpeg_read_scanlines(&cinfo, buffer, 1); + /* setup decompression process and source, then read JPEG header */ + jpeg_create_decompress( &cinfo ); - if (starty-- <= 0)// count down from start - { - if (copy_rows-- > 0) + jpeg_source_mgr srcmgr; + + srcmgr.bytes_in_buffer = nSize; + srcmgr.next_input_byte = (JOCTET*) data; + srcmgr.init_source = CCImageHelper::JPEGInitSource; + srcmgr.fill_input_buffer = CCImageHelper::JPEGFillInputBuffer; + srcmgr.skip_input_data = CCImageHelper::JPEGSkipInputData; + srcmgr.resync_to_restart = jpeg_resync_to_restart; + srcmgr.term_source = CCImageHelper::JPEGTermSource; + cinfo.src = &srcmgr; +// jpeg_mem_src( &cinfo, (unsigned char *) data, nSize ); + + /* reading the image header which contains image information */ + jpeg_read_header( &cinfo, true ); + + // we only support RGB or grayscale + if (cinfo.jpeg_color_space != JCS_RGB) + { + if (cinfo.jpeg_color_space == JCS_GRAYSCALE || cinfo.jpeg_color_space == JCS_YCbCr) { - for (int xx=startx; xx < copy_width; xx++) - { - uint8 r = buffer[0][xx*3+0]; - uint8 b = buffer[0][xx*3+1]; - uint8 g = buffer[0][xx*3+2]; - - *dst++ = r; - *dst++ = b; - *dst++ = g; - *dst++ = 255; - } - } + cinfo.out_color_space = JCS_RGB; + } + } + else + { + break; } - } - (void) jpeg_finish_decompress(&cinfo); - jpeg_destroy_decompress(&cinfo); + /* Start decompression jpeg here */ + jpeg_start_decompress( &cinfo ); - printf("jpeg display done\n"); + /* init image info */ + m_nWidth = (short)(cinfo.image_width); + m_nHeight = (short)(cinfo.image_height); + m_bHasAlpha = false; + m_bPreMulti = false; + m_nBitsPerComponent = 8; + row_pointer[0] = new unsigned char[cinfo.output_width*cinfo.output_components]; + CC_BREAK_IF(! row_pointer[0]); - bRet = true; + m_pData = new unsigned char[cinfo.output_width*cinfo.output_height*cinfo.output_components]; + CC_BREAK_IF(! m_pData); + + /* now actually read the jpeg into the raw buffer */ + /* read one scan line at a time */ + while( cinfo.output_scanline < cinfo.image_height ) + { + jpeg_read_scanlines( &cinfo, row_pointer, 1 ); + for( i=0; i - @@ -106,10 +105,11 @@ - + + @@ -217,12 +217,11 @@ - @@ -236,10 +235,11 @@ - + + @@ -251,6 +251,7 @@ + diff --git a/cocos2dx/proj.linux/.project b/cocos2dx/proj.linux/.project index 52dac3939c..ea9f34c306 100755 --- a/cocos2dx/proj.linux/.project +++ b/cocos2dx/proj.linux/.project @@ -101,11 +101,6 @@ 1 PARENT-1-PROJECT_LOC/CCDirector.cpp - - CCDrawingPrimitives.cpp - 1 - PARENT-1-PROJECT_LOC/CCDrawingPrimitives.cpp - CCScheduler.cpp 1 @@ -131,6 +126,11 @@ 1 PARENT-1-PROJECT_LOC/cocos2d.cpp + + draw_nodes + 2 + PARENT-1-PROJECT_LOC/draw_nodes + effects 2 diff --git a/cocos2dx/proj.linux/Makefile b/cocos2dx/proj.linux/Makefile index 14b2ca16a6..478b067126 100644 --- a/cocos2dx/proj.linux/Makefile +++ b/cocos2dx/proj.linux/Makefile @@ -174,7 +174,7 @@ SHAREDLIBS += -L../../cocos2dx/platform/third_party/linux/glew-1.7.0/glew-1.7.0/ debug: CCFLAGS += -g3 -O0 debug: CXXFLAGS += -g3 -O0 -debug: DEFINES += -DDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION +debug: DEFINES += -DDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION -DCOCOS2D_DEBUG=1 debug: $(TARGET) release: CCFLAGS += -O3 diff --git a/cocos2dx/script_support/CCScriptSupport.h b/cocos2dx/script_support/CCScriptSupport.h index a5ea4a8c44..63257fb3f6 100644 --- a/cocos2dx/script_support/CCScriptSupport.h +++ b/cocos2dx/script_support/CCScriptSupport.h @@ -29,6 +29,7 @@ #include "CCAccelerometer.h" #include "touch_dispatcher/CCTouch.h" #include "cocoa/CCSet.h" +#include "CCAccelerometer.h" #include #include #include @@ -226,6 +227,9 @@ public: virtual int executeLayerTouchesEvent(CCLayer* pLayer, int eventType, CCSet *pTouches) = 0; virtual int executeLayerTouchEvent(CCLayer* pLayer, int eventType, CCTouch *pTouch) = 0; + /** functions for keypad event */ + virtual int executeLayerKeypadEvent(CCLayer* pLayer, int eventType) = 0; + /** execute a accelerometer event */ virtual int executeAccelerometerEvent(CCLayer* pLayer, CCAcceleration* pAccelerationValue) = 0; }; diff --git a/cocos2dx/shaders/CCGLProgram.cpp b/cocos2dx/shaders/CCGLProgram.cpp index d87a822ed4..f41bff55fc 100644 --- a/cocos2dx/shaders/CCGLProgram.cpp +++ b/cocos2dx/shaders/CCGLProgram.cpp @@ -458,11 +458,6 @@ void CCGLProgram::setUniformsForBuiltins() } } -void CCGLProgram::setUniformForModelViewProjectionMatrix() -{ - setUniformsForBuiltins(); -} - void CCGLProgram::reset() { m_uVertShader = m_uFragShader = 0; diff --git a/cocos2dx/shaders/CCGLProgram.h b/cocos2dx/shaders/CCGLProgram.h index 47ec85dcba..a48fcfc525 100644 --- a/cocos2dx/shaders/CCGLProgram.h +++ b/cocos2dx/shaders/CCGLProgram.h @@ -152,9 +152,6 @@ public: /** will update the builtin uniforms if they are different than the previous call for this same shader program. */ void setUniformsForBuiltins(); - /** Deprecated alias for setUniformsForBuiltins */ - CC_DEPRECATED_ATTRIBUTE void setUniformForModelViewProjectionMatrix(); - /** returns the vertexShader error log */ const char* vertexShaderLog(); /** returns the fragmentShader error log */ diff --git a/cocos2dx/shaders/ccShader_PositionColorLengthTexture_frag.h b/cocos2dx/shaders/ccShader_PositionColorLengthTexture_frag.h index 80470e273c..803664a506 100644 --- a/cocos2dx/shaders/ccShader_PositionColorLengthTexture_frag.h +++ b/cocos2dx/shaders/ccShader_PositionColorLengthTexture_frag.h @@ -20,9 +20,9 @@ */ " \n\ -#extension GL_OES_standard_derivatives : enable \n\ - \n\ #ifdef GL_ES \n\ +// #extension GL_OES_standard_derivatives : enable \n\ + \n\ varying mediump vec4 v_color; \n\ varying mediump vec2 v_texcoord; \n\ #else \n\ @@ -32,10 +32,10 @@ varying vec2 v_texcoord; \n\ \n\ void main() \n\ { \n\ -#if defined GL_OES_standard_derivatives \n\ - gl_FragColor = v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord)); \n\ -#else \n\ +// #if defined GL_OES_standard_derivatives \n\ + // gl_FragColor = v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord)); \n\ +// #else \n\ gl_FragColor = v_color*step(0.0, 1.0 - length(v_texcoord)); \n\ -#endif \n\ +// #endif \n\ } \n\ "; diff --git a/cocos2dx/sprite_nodes/CCAnimation.cpp b/cocos2dx/sprite_nodes/CCAnimation.cpp index f52527dbc5..96076ea83b 100644 --- a/cocos2dx/sprite_nodes/CCAnimation.cpp +++ b/cocos2dx/sprite_nodes/CCAnimation.cpp @@ -81,11 +81,6 @@ CCObject* CCAnimationFrame::copyWithZone(CCZone* pZone) // implementation of CCAnimation -CCAnimation* CCAnimation::animation(void) -{ - return CCAnimation::create(); -} - CCAnimation* CCAnimation::create(void) { CCAnimation *pAnimation = new CCAnimation(); @@ -95,11 +90,6 @@ CCAnimation* CCAnimation::create(void) return pAnimation; } -CCAnimation* CCAnimation::animationWithSpriteFrames(CCArray *frames, float delay/* = 0.0f*/) -{ - return CCAnimation::createWithSpriteFrames(frames, delay); -} - CCAnimation* CCAnimation::createWithSpriteFrames(CCArray *frames, float delay/* = 0.0f*/) { CCAnimation *pAnimation = new CCAnimation(); @@ -109,11 +99,6 @@ CCAnimation* CCAnimation::createWithSpriteFrames(CCArray *frames, float delay/* return pAnimation; } -CCAnimation* CCAnimation::animationWithAnimationFrames(CCArray* arrayOfAnimationFrameNames, float delayPerUnit, unsigned int loops) -{ - return CCAnimation::create(arrayOfAnimationFrameNames, delayPerUnit, loops); -} - CCAnimation* CCAnimation::create(CCArray* arrayOfAnimationFrameNames, float delayPerUnit, unsigned int loops) { CCAnimation *pAnimation = new CCAnimation(); diff --git a/cocos2dx/sprite_nodes/CCAnimation.h b/cocos2dx/sprite_nodes/CCAnimation.h index 8bf9dc8949..cd05f0f127 100644 --- a/cocos2dx/sprite_nodes/CCAnimation.h +++ b/cocos2dx/sprite_nodes/CCAnimation.h @@ -89,25 +89,6 @@ public: ~CCAnimation(void); public: /** Creates an animation - @deprecated: This interface will be deprecated sooner or later. - @since v0.99.5 - */ - CC_DEPRECATED_ATTRIBUTE static CCAnimation* animation(void); - - /* Creates an animation with an array of CCSpriteFrame and a delay between frames in seconds. - The frames will be added with one "delay unit". - @deprecated: This interface will be deprecated sooner or later. - @since v0.99.5 - */ - CC_DEPRECATED_ATTRIBUTE static CCAnimation* animationWithSpriteFrames(CCArray* arrayOfSpriteFrameNames, float delay = 0.0f); - - /* Creates an animation with an array of CCAnimationFrame, the delay per units in seconds and and how many times it should be executed. - @deprecated: This interface will be deprecated sooner or later. - @since v2.0 - */ - CC_DEPRECATED_ATTRIBUTE static CCAnimation* animationWithAnimationFrames(CCArray *arrayOfAnimationFrameNames, float delayPerUnit, unsigned int loops); - - /** Creates an animation @since v0.99.5 */ static CCAnimation* create(void); diff --git a/cocos2dx/sprite_nodes/CCSprite.cpp b/cocos2dx/sprite_nodes/CCSprite.cpp index c63860c480..6c1d627402 100644 --- a/cocos2dx/sprite_nodes/CCSprite.cpp +++ b/cocos2dx/sprite_nodes/CCSprite.cpp @@ -57,12 +57,6 @@ NS_CC_BEGIN #define RENDER_IN_SUBPIXEL(__ARGS__) (ceil(__ARGS__)) #endif - -CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture) -{ - return CCSprite::createWithTexture(pTexture); -} - CCSprite* CCSprite::createWithTexture(CCTexture2D *pTexture) { CCSprite *pobSprite = new CCSprite(); @@ -75,11 +69,6 @@ CCSprite* CCSprite::createWithTexture(CCTexture2D *pTexture) return NULL; } -CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture, const CCRect& rect) -{ - return CCSprite::createWithTexture(pTexture, rect); -} - CCSprite* CCSprite::createWithTexture(CCTexture2D *pTexture, const CCRect& rect) { CCSprite *pobSprite = new CCSprite(); @@ -92,11 +81,6 @@ CCSprite* CCSprite::createWithTexture(CCTexture2D *pTexture, const CCRect& rect) return NULL; } -CCSprite* CCSprite::spriteWithFile(const char *pszFileName) -{ - return CCSprite::create(pszFileName); -} - CCSprite* CCSprite::create(const char *pszFileName) { CCSprite *pobSprite = new CCSprite(); @@ -109,11 +93,6 @@ CCSprite* CCSprite::create(const char *pszFileName) return NULL; } -CCSprite* CCSprite::spriteWithFile(const char *pszFileName, const CCRect& rect) -{ - return CCSprite::create(pszFileName, rect); -} - CCSprite* CCSprite::create(const char *pszFileName, const CCRect& rect) { CCSprite *pobSprite = new CCSprite(); @@ -126,11 +105,6 @@ CCSprite* CCSprite::create(const char *pszFileName, const CCRect& rect) return NULL; } -CCSprite* CCSprite::spriteWithSpriteFrame(CCSpriteFrame *pSpriteFrame) -{ - return CCSprite::createWithSpriteFrame(pSpriteFrame); -} - CCSprite* CCSprite::createWithSpriteFrame(CCSpriteFrame *pSpriteFrame) { CCSprite *pobSprite = new CCSprite(); @@ -143,11 +117,6 @@ CCSprite* CCSprite::createWithSpriteFrame(CCSpriteFrame *pSpriteFrame) return NULL; } -CCSprite* CCSprite::spriteWithSpriteFrameName(const char *pszSpriteFrameName) -{ - return CCSprite::createWithSpriteFrameName(pszSpriteFrameName); -} - CCSprite* CCSprite::createWithSpriteFrameName(const char *pszSpriteFrameName) { CCSpriteFrame *pFrame = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(pszSpriteFrameName); @@ -161,11 +130,6 @@ CCSprite* CCSprite::createWithSpriteFrameName(const char *pszSpriteFrameName) return createWithSpriteFrame(pFrame); } -CCSprite* CCSprite::node() -{ - return CCSprite::create(); -} - CCSprite* CCSprite::create() { CCSprite *pSprite = new CCSprite(); diff --git a/cocos2dx/sprite_nodes/CCSprite.h b/cocos2dx/sprite_nodes/CCSprite.h index cc6251e324..fe0f0c14c9 100644 --- a/cocos2dx/sprite_nodes/CCSprite.h +++ b/cocos2dx/sprite_nodes/CCSprite.h @@ -125,18 +125,6 @@ public: inline void setBlendFunc(ccBlendFunc blendFunc) { m_sBlendFunc = blendFunc; } public: - /** Creates an sprite with a texture. - The rect used will be the size of the texture. - The offset will be (0,0). - @deprecated: Please use createWithTexture(CCTexture2D*) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSprite* spriteWithTexture(CCTexture2D *pTexture); - - /** Creates an sprite with a texture and a rect. - The offset will be (0,0). - @deprecated: Please use createWithTexture(CCTexture2D*, const CCRect&) instead, This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSprite* spriteWithTexture(CCTexture2D *pTexture, const CCRect& rect); /** Creates an sprite with a texture. The rect used will be the size of the texture. @@ -149,19 +137,6 @@ public: */ static CCSprite* createWithTexture(CCTexture2D *pTexture, const CCRect& rect); - /** Creates an sprite with an sprite frame. - @deprecated: Please use createWithSpriteFrame(CCSpriteFrame*) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSprite* spriteWithSpriteFrame(CCSpriteFrame *pSpriteFrame); - - /** Creates an sprite with an sprite frame name. - An CCSpriteFrame will be fetched from the CCSpriteFrameCache by name. - If the CCSpriteFrame doesn't exist it will raise an exception. - @deprecated: Please use createWithSpriteFrameName(const char*) instead. This interface will be deprecated sooner or later. - @since v0.9 - */ - CC_DEPRECATED_ATTRIBUTE static CCSprite* spriteWithSpriteFrameName(const char *pszSpriteFrameName); - /** Creates an sprite with an sprite frame. */ static CCSprite* createWithSpriteFrame(CCSpriteFrame *pSpriteFrame); @@ -171,19 +146,6 @@ public: @since v0.9 */ static CCSprite* createWithSpriteFrameName(const char *pszSpriteFrameName); - - /** Creates an sprite with an image filename. - The rect used will be the size of the image. - The offset will be (0,0). - @deprecated: Please use create(const char*) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSprite* spriteWithFile(const char *pszFileName); - - /** Creates an sprite with an image filename and a rect. - The offset will be (0,0). - @deprecated: Please use create(const char*, const CCRect&) instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSprite* spriteWithFile(const char *pszFileName, const CCRect& rect); /** Creates an sprite with an image filename. The rect used will be the size of the image. @@ -196,10 +158,6 @@ public: */ static CCSprite* create(const char *pszFileName, const CCRect& rect); - /** Creates an sprite. - @deprecated: Please use create() instead. This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSprite* node(); /** Creates an sprite. */ static CCSprite* create(); diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp index 897dd5ce9f..43218b8329 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.cpp @@ -46,11 +46,6 @@ NS_CC_BEGIN * creation with CCTexture2D */ -CCSpriteBatchNode* CCSpriteBatchNode::batchNodeWithTexture(CCTexture2D* tex, unsigned int capacity/* = kDefaultSpriteBatchCapacity*/) -{ - return CCSpriteBatchNode::createWithTexture(tex, capacity); -} - CCSpriteBatchNode* CCSpriteBatchNode::createWithTexture(CCTexture2D* tex, unsigned int capacity/* = kDefaultSpriteBatchCapacity*/) { CCSpriteBatchNode *batchNode = new CCSpriteBatchNode(); @@ -63,10 +58,6 @@ CCSpriteBatchNode* CCSpriteBatchNode::createWithTexture(CCTexture2D* tex, unsign /* * creation with File Image */ -CCSpriteBatchNode* CCSpriteBatchNode::batchNodeWithFile(const char *fileImage, unsigned int capacity/* = kDefaultSpriteBatchCapacity*/) -{ - return CCSpriteBatchNode::create(fileImage, capacity); -} CCSpriteBatchNode* CCSpriteBatchNode::create(const char *fileImage, unsigned int capacity/* = kDefaultSpriteBatchCapacity*/) { diff --git a/cocos2dx/sprite_nodes/CCSpriteBatchNode.h b/cocos2dx/sprite_nodes/CCSpriteBatchNode.h index 83cd585935..399af2b02b 100644 --- a/cocos2dx/sprite_nodes/CCSpriteBatchNode.h +++ b/cocos2dx/sprite_nodes/CCSpriteBatchNode.h @@ -81,19 +81,6 @@ public: inline CCArray* getDescendants(void) { return m_pobDescendants; } - /** creates a CCSpriteBatchNode with a texture2d and capacity of children. - The capacity will be increased in 33% in runtime if it run out of space. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSpriteBatchNode* batchNodeWithTexture(CCTexture2D* tex, unsigned int capacity = kDefaultSpriteBatchCapacity); - - /** creates a CCSpriteBatchNode with a file image (.png, .jpeg, .pvr, etc) and capacity of children. - The capacity will be increased in 33% in runtime if it run out of space. - The file will be loaded using the TextureMgr. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSpriteBatchNode* batchNodeWithFile(const char* fileImage, unsigned int capacity = kDefaultSpriteBatchCapacity); - /** creates a CCSpriteBatchNode with a texture2d and capacity of children. The capacity will be increased in 33% in runtime if it run out of space. */ diff --git a/cocos2dx/sprite_nodes/CCSpriteFrame.cpp b/cocos2dx/sprite_nodes/CCSpriteFrame.cpp index 8277ae2ee6..7b4d816e2d 100644 --- a/cocos2dx/sprite_nodes/CCSpriteFrame.cpp +++ b/cocos2dx/sprite_nodes/CCSpriteFrame.cpp @@ -31,25 +31,6 @@ NS_CC_BEGIN // implementation of CCSpriteFrame -CCSpriteFrame* CCSpriteFrame::frameWithTexture(CCTexture2D *pobTexture, const CCRect& rect) -{ - return CCSpriteFrame::createWithTexture(pobTexture, rect); -} - -CCSpriteFrame* CCSpriteFrame::createWithTexture(CCTexture2D *pobTexture, const CCRect& rect) -{ - CCSpriteFrame *pSpriteFrame = new CCSpriteFrame();; - pSpriteFrame->initWithTexture(pobTexture, rect); - pSpriteFrame->autorelease(); - - return pSpriteFrame; -} - -CCSpriteFrame* CCSpriteFrame::frameWithTextureFilename(const char* filename, const CCRect& rect) -{ - return CCSpriteFrame::create(filename, rect); -} - CCSpriteFrame* CCSpriteFrame::create(const char* filename, const CCRect& rect) { CCSpriteFrame *pSpriteFrame = new CCSpriteFrame();; @@ -59,9 +40,13 @@ CCSpriteFrame* CCSpriteFrame::create(const char* filename, const CCRect& rect) return pSpriteFrame; } -CCSpriteFrame* CCSpriteFrame::frameWithTexture(CCTexture2D* pobTexture, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize) +CCSpriteFrame* CCSpriteFrame::createWithTexture(CCTexture2D *pobTexture, const CCRect& rect) { - return CCSpriteFrame::createWithTexture(pobTexture, rect, rotated, offset, originalSize); + CCSpriteFrame *pSpriteFrame = new CCSpriteFrame();; + pSpriteFrame->initWithTexture(pobTexture, rect); + pSpriteFrame->autorelease(); + + return pSpriteFrame; } CCSpriteFrame* CCSpriteFrame::createWithTexture(CCTexture2D* pobTexture, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize) @@ -73,11 +58,6 @@ CCSpriteFrame* CCSpriteFrame::createWithTexture(CCTexture2D* pobTexture, const C return pSpriteFrame; } -CCSpriteFrame* CCSpriteFrame::frameWithTextureFilename(const char* filename, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize) -{ - return CCSpriteFrame::create(filename, rect, rotated, offset, originalSize); -} - CCSpriteFrame* CCSpriteFrame::create(const char* filename, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize) { CCSpriteFrame *pSpriteFrame = new CCSpriteFrame();; diff --git a/cocos2dx/sprite_nodes/CCSpriteFrame.h b/cocos2dx/sprite_nodes/CCSpriteFrame.h index 4eecbcb11a..40642f8393 100644 --- a/cocos2dx/sprite_nodes/CCSpriteFrame.h +++ b/cocos2dx/sprite_nodes/CCSpriteFrame.h @@ -95,30 +95,6 @@ public: ~CCSpriteFrame(void); virtual CCObject* copyWithZone(CCZone *pZone); - /** Create a CCSpriteFrame with a texture, rect in points. - @deprecated: This interface will be deprecated sooner or later. - It is assumed that the frame was not trimmed. - */ - CC_DEPRECATED_ATTRIBUTE static CCSpriteFrame* frameWithTexture(CCTexture2D* pobTexture, const CCRect& rect); - - /** Create a CCSpriteFrame with a texture filename, rect in points. - It is assumed that the frame was not trimmed. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSpriteFrame* frameWithTextureFilename(const char* filename, const CCRect& rect); - - /** Create a CCSpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. - The originalSize is the size in points of the frame before being trimmed. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSpriteFrame* frameWithTexture(CCTexture2D* pobTexture, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize); - - /** Create a CCSpriteFrame with a texture filename, rect, rotated, offset and originalSize in pixels. - The originalSize is the size in pixels of the frame before being trimmed. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCSpriteFrame* frameWithTextureFilename(const char* filename, const CCRect& rect, bool rotated, const CCPoint& offset, const CCSize& originalSize); - /** Create a CCSpriteFrame with a texture filename, rect in points. It is assumed that the frame was not trimmed. */ diff --git a/cocos2dx/textures/CCTextureAtlas.cpp b/cocos2dx/textures/CCTextureAtlas.cpp index 45147fa13c..6c9c9cc1f4 100644 --- a/cocos2dx/textures/CCTextureAtlas.cpp +++ b/cocos2dx/textures/CCTextureAtlas.cpp @@ -103,10 +103,6 @@ void CCTextureAtlas::setQuads(ccV3F_C4B_T2F_Quad *var) } // TextureAtlas - alloc & init -CCTextureAtlas * CCTextureAtlas::textureAtlasWithFile(const char* file, unsigned int capacity) -{ - return CCTextureAtlas::create(file, capacity); -} CCTextureAtlas * CCTextureAtlas::create(const char* file, unsigned int capacity) { @@ -120,11 +116,6 @@ CCTextureAtlas * CCTextureAtlas::create(const char* file, unsigned int capacity) return NULL; } -CCTextureAtlas * CCTextureAtlas::textureAtlasWithTexture(CCTexture2D *texture, unsigned int capacity) -{ - return CCTextureAtlas::createWithTexture(texture, capacity); -} - CCTextureAtlas * CCTextureAtlas::createWithTexture(CCTexture2D *texture, unsigned int capacity) { CCTextureAtlas * pTextureAtlas = new CCTextureAtlas(); diff --git a/cocos2dx/textures/CCTextureAtlas.h b/cocos2dx/textures/CCTextureAtlas.h index 0f90c8d4a5..6fc20ecc80 100644 --- a/cocos2dx/textures/CCTextureAtlas.h +++ b/cocos2dx/textures/CCTextureAtlas.h @@ -80,12 +80,6 @@ public: const char* description(); - /** creates a TextureAtlas with an filename and with an initial capacity for Quads. - * The TextureAtlas capacity can be increased in runtime. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTextureAtlas * textureAtlasWithFile(const char* file , unsigned int capacity); - /** creates a TextureAtlas with an filename and with an initial capacity for Quads. * The TextureAtlas capacity can be increased in runtime. */ @@ -98,13 +92,6 @@ public: */ bool initWithFile(const char* file, unsigned int capacity); - /** creates a TextureAtlas with a previously initialized Texture2D object, and - * with an initial capacity for n Quads. - * The TextureAtlas capacity can be increased in runtime. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTextureAtlas * textureAtlasWithTexture(CCTexture2D *texture, unsigned int capacity); - /** creates a TextureAtlas with a previously initialized Texture2D object, and * with an initial capacity for n Quads. * The TextureAtlas capacity can be increased in runtime. diff --git a/cocos2dx/textures/CCTexturePVR.cpp b/cocos2dx/textures/CCTexturePVR.cpp index 3cbfdb30b0..3cd36ef356 100644 --- a/cocos2dx/textures/CCTexturePVR.cpp +++ b/cocos2dx/textures/CCTexturePVR.cpp @@ -634,11 +634,6 @@ bool CCTexturePVR::initWithContentsOfFile(const char* path) return true; } -CCTexturePVR * CCTexturePVR::pvrTextureWithContentsOfFile(const char* path) -{ - return CCTexturePVR::create(path); -} - CCTexturePVR * CCTexturePVR::create(const char* path) { CCTexturePVR * pTexture = new CCTexturePVR(); diff --git a/cocos2dx/textures/CCTexturePVR.h b/cocos2dx/textures/CCTexturePVR.h index 1e750525a9..964c482338 100644 --- a/cocos2dx/textures/CCTexturePVR.h +++ b/cocos2dx/textures/CCTexturePVR.h @@ -96,9 +96,6 @@ public: /** initializes a CCTexturePVR with a path */ bool initWithContentsOfFile(const char* path); - /** creates and initializes a CCTexturePVR with a path - @deprecated This interface will be deprecated when js-binding is stable. */ - CC_DEPRECATED_ATTRIBUTE static CCTexturePVR* pvrTextureWithContentsOfFile(const char* path); /** creates and initializes a CCTexturePVR with a path */ static CCTexturePVR* create(const char* path); diff --git a/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.cpp b/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.cpp index bc3e4cff03..a5f1ee6df7 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.cpp +++ b/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.cpp @@ -65,11 +65,6 @@ CCParallaxNode::~CCParallaxNode() } } -CCParallaxNode * CCParallaxNode::node() -{ - return CCParallaxNode::create(); -} - CCParallaxNode * CCParallaxNode::create() { CCParallaxNode *pRet = new CCParallaxNode(); diff --git a/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.h b/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.h index d503cd153a..30917ff6c4 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.h +++ b/cocos2dx/tilemap_parallax_nodes/CCParallaxNode.h @@ -55,8 +55,7 @@ public: */ CCParallaxNode(); virtual ~CCParallaxNode(); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCParallaxNode * node(); + static CCParallaxNode * create(); virtual void addChild(CCNode * child, unsigned int z, const CCPoint& parallaxRatio, const CCPoint& positionOffset); // super methods diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.cpp b/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.cpp index f9d15d11a5..6d348ab69f 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.cpp +++ b/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.cpp @@ -38,10 +38,6 @@ NS_CC_BEGIN // CCTMXLayer - init & alloc & dealloc -CCTMXLayer * CCTMXLayer::layerWithTilesetInfo(CCTMXTilesetInfo *tilesetInfo, CCTMXLayerInfo *layerInfo, CCTMXMapInfo *mapInfo) -{ - return CCTMXLayer::create(tilesetInfo, layerInfo, mapInfo); -} CCTMXLayer * CCTMXLayer::create(CCTMXTilesetInfo *tilesetInfo, CCTMXLayerInfo *layerInfo, CCTMXMapInfo *mapInfo) { diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.h b/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.h index 6a74f07d6b..ca7107afc1 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.h +++ b/cocos2dx/tilemap_parallax_nodes/CCTMXLayer.h @@ -88,10 +88,6 @@ class CC_DLL CCTMXLayer : public CCSpriteBatchNode public: CCTMXLayer(); virtual ~CCTMXLayer(); - /** creates a CCTMXLayer with an tileset info, a layer info and a map info - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTMXLayer * layerWithTilesetInfo(CCTMXTilesetInfo *tilesetInfo, CCTMXLayerInfo *layerInfo, CCTMXMapInfo *mapInfo); /** creates a CCTMXLayer with an tileset info, a layer info and a map info */ static CCTMXLayer * create(CCTMXTilesetInfo *tilesetInfo, CCTMXLayerInfo *layerInfo, CCTMXMapInfo *mapInfo); diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.cpp b/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.cpp index 9e17faac78..c78866bdc3 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.cpp +++ b/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.cpp @@ -32,10 +32,6 @@ THE SOFTWARE. NS_CC_BEGIN // implementation CCTMXTiledMap -CCTMXTiledMap * CCTMXTiledMap::tiledMapWithTMXFile(const char *tmxFile) -{ - return CCTMXTiledMap::create(tmxFile); -} CCTMXTiledMap * CCTMXTiledMap::create(const char *tmxFile) { @@ -49,11 +45,6 @@ CCTMXTiledMap * CCTMXTiledMap::create(const char *tmxFile) return NULL; } -CCTMXTiledMap* CCTMXTiledMap::tiledMapWithXML(const char* tmxString, const char* resourcePath) -{ - return CCTMXTiledMap::createWithXML(tmxString, resourcePath); -} - CCTMXTiledMap* CCTMXTiledMap::createWithXML(const char* tmxString, const char* resourcePath) { CCTMXTiledMap *pRet = new CCTMXTiledMap(); diff --git a/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.h b/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.h index 184c857e2a..26374530f7 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.h +++ b/cocos2dx/tilemap_parallax_nodes/CCTMXTiledMap.h @@ -122,16 +122,6 @@ public: CCTMXTiledMap(); virtual ~CCTMXTiledMap(); - /** creates a TMX Tiled Map with a TMX file. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTMXTiledMap* tiledMapWithTMXFile(const char *tmxFile); - - /** initializes a TMX Tiled Map with a TMX formatted XML string and a path to TMX resources - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTMXTiledMap* tiledMapWithXML(const char* tmxString, const char* resourcePath); - /** creates a TMX Tiled Map with a TMX file.*/ static CCTMXTiledMap* create(const char *tmxFile); diff --git a/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.cpp b/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.cpp index c0968b1c1b..ccdf03ef34 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.cpp +++ b/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.cpp @@ -36,11 +36,6 @@ NS_CC_BEGIN // implementation CCTileMapAtlas -CCTileMapAtlas * CCTileMapAtlas::tileMapAtlasWithTileFile(const char *tile, const char *mapFile, int tileWidth, int tileHeight) -{ - return CCTileMapAtlas::create(tile, mapFile, tileWidth, tileHeight); -} - CCTileMapAtlas * CCTileMapAtlas::create(const char *tile, const char *mapFile, int tileWidth, int tileHeight) { CCTileMapAtlas *pRet = new CCTileMapAtlas(); diff --git a/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.h b/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.h index 5dd5742246..4cacc72f3d 100644 --- a/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.h +++ b/cocos2dx/tilemap_parallax_nodes/CCTileMapAtlas.h @@ -61,11 +61,6 @@ class CC_DLL CCTileMapAtlas : public CCAtlasNode public: CCTileMapAtlas(); virtual ~CCTileMapAtlas(); - /** creates a CCTileMap with a tile file (atlas) with a map file and the width and height of each tile in points. - The tile file will be loaded using the TextureMgr. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCTileMapAtlas * tileMapAtlasWithTileFile(const char *tile, const char *mapFile, int tileWidth, int tileHeight); /** creates a CCTileMap with a tile file (atlas) with a map file and the width and height of each tile in points. The tile file will be loaded using the TextureMgr. diff --git a/cocos2dx/touch_dispatcher/CCTouch.h b/cocos2dx/touch_dispatcher/CCTouch.h index e1accc5564..1083e25114 100644 --- a/cocos2dx/touch_dispatcher/CCTouch.h +++ b/cocos2dx/touch_dispatcher/CCTouch.h @@ -52,18 +52,6 @@ public: CCPoint getLocationInView() const; /** returns the previous touch location in screen coordinates */ CCPoint getPreviousLocationInView() const; - - /** returns the current touch location in screen coordinates - @deprecated: use CCTouch::getLocationInView() instead. - CCTouch::getLocation() is recommended, it will return OpenGL coordinate. - */ - CC_DEPRECATED_ATTRIBUTE CCPoint locationInView() { return m_point; } - - /** returns the current previous location in screen coordinates - @deprecated: use CCTouch::getPreviousLocationInView() instead. - CCTouch::getPreviousLocation() is recommended, it will return OpenGL coordinate. - */ - CC_DEPRECATED_ATTRIBUTE CCPoint previousLocationInView() { return m_prevPoint; } void setTouchInfo(int id, float x, float y) { diff --git a/document/doxygen.config b/document/doxygen.config index af4736f0e6..5adc36c084 100644 --- a/document/doxygen.config +++ b/document/doxygen.config @@ -32,7 +32,7 @@ PROJECT_NAME = cocos2d-x # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 2.0.3 +PROJECT_NUMBER = 2.1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer @@ -676,12 +676,11 @@ WARN_LOGFILE = # with spaces. INPUT = ../cocos2dx \ - ../cocos2dx/platform \ - ../CocosDenshion/include \ + ../cocos2dx/platform \ + ../CocosDenshion/include \ ../document \ ../extensions \ - ../scripting/lua/cocos2dx_support \ - + ../scripting/lua/cocos2dx_support # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is diff --git a/extensions/CCBReader/CCBReader.cpp b/extensions/CCBReader/CCBReader.cpp index df869a72c3..5586b32225 100644 --- a/extensions/CCBReader/CCBReader.cpp +++ b/extensions/CCBReader/CCBReader.cpp @@ -134,9 +134,9 @@ CCBReader::~CCBReader() { this->mCCNodeLoaderLibrary->release(); - mOwnerOutletNodes->release(); - mOwnerOutletNames.clear(); - mOwnerCallbackNodes->release(); + mOwnerOutletNodes->release(); + mOwnerOutletNames.clear(); + mOwnerCallbackNodes->release(); mOwnerCallbackNames.clear(); // Clear string cache. @@ -149,6 +149,17 @@ CCBReader::~CCBReader() { setAnimationManagers(NULL); } +void CCBReader::setCCBRootPath(const char* pCCBRootPath) +{ + CCAssert(pCCBRootPath != NULL, ""); + mCCBRootPath = pCCBRootPath; +} + +const std::string& CCBReader::getCCBRootPath() const +{ + return mCCBRootPath; +} + bool CCBReader::init() { // Setup action manager @@ -234,10 +245,10 @@ CCNode* CCBReader::readNodeGraphFromFile(const char *pCCBFileName, CCObject *pOw strCCBFileName += strSuffix; } - const char *pPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(strCCBFileName.c_str()); + std::string strPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath(strCCBFileName.c_str()); unsigned long size = 0; - unsigned char * pBytes = CCFileUtils::sharedFileUtils()->getFileData(pPath, "rb", &size); + unsigned char * pBytes = CCFileUtils::sharedFileUtils()->getFileData(strPath.c_str(), "rb", &size); CCData *data = new CCData(pBytes, size); CC_SAFE_DELETE_ARRAY(pBytes); @@ -281,13 +292,13 @@ CCNode* CCBReader::readNodeGraphFromData(CCData *pData, CCObject *pOwner, const CCDICT_FOREACH(animationManagers, pElement) { CCNode* pNode = (CCNode*)pElement->getIntKey(); - CCBAnimationManager* manager = (CCBAnimationManager*)animationManagers->objectForKey((intptr_t)pNode); - pNode->setUserObject(manager); - - if (jsControlled) - { - mNodesWithAnimationManagers->addObject(pNode); - mAnimationManagersForNodes->addObject(manager); + CCBAnimationManager* manager = (CCBAnimationManager*)animationManagers->objectForKey((intptr_t)pNode); + pNode->setUserObject(manager); + + if (jsControlled) + { + mNodesWithAnimationManagers->addObject(pNode); + mAnimationManagersForNodes->addObject(manager); } } @@ -403,24 +414,24 @@ bool CCBReader::readBool() { return 0 == this->readByte() ? false : true; } -std::string CCBReader::readUTF8() -{ - std::string ret; - - int b0 = this->readByte(); - int b1 = this->readByte(); - - int numBytes = b0 << 8 | b1; - - char* pStr = (char*)malloc(numBytes+1); - memcpy(pStr, mBytes+mCurrentByte, numBytes); - pStr[numBytes] = '\0'; - ret = pStr; - free(pStr); - - mCurrentByte += numBytes; - - return ret; +std::string CCBReader::readUTF8() +{ + std::string ret; + + int b0 = this->readByte(); + int b1 = this->readByte(); + + int numBytes = b0 << 8 | b1; + + char* pStr = (char*)malloc(numBytes+1); + memcpy(pStr, mBytes+mCurrentByte, numBytes); + pStr[numBytes] = '\0'; + ret = pStr; + free(pStr); + + mCurrentByte += numBytes; + + return ret; } bool CCBReader::getBit() { @@ -744,12 +755,14 @@ CCBKeyframe* CCBReader::readKeyframe(int type) if (spriteSheet.length() == 0) { + spriteFile = mCCBRootPath + spriteFile; CCTexture2D *texture = CCTextureCache::sharedTextureCache()->addImage(spriteFile.c_str()); CCRect bounds = CCRectMake(0, 0, texture->getContentSize().width, texture->getContentSize().height); spriteFrame = CCSpriteFrame::createWithTexture(texture, bounds); } else { + spriteSheet = mCCBRootPath + spriteSheet; CCSpriteFrameCache* frameCache = CCSpriteFrameCache::sharedSpriteFrameCache(); // Load the sprite sheet only if it is not loaded @@ -895,15 +908,7 @@ CCArray* CCBReader::getAnimationManagersForNodes() { float CCBReader::getResolutionScale() { - // Init resolution scale - if (CCApplication::sharedApplication()->getTargetPlatform() == kTargetIpad) - { - return 2; - } - else - { - return 1; - } + return 1; } NS_CC_EXT_END; diff --git a/extensions/CCBReader/CCBReader.h b/extensions/CCBReader/CCBReader.h index 0a922f25cc..c78022c1b4 100644 --- a/extensions/CCBReader/CCBReader.h +++ b/extensions/CCBReader/CCBReader.h @@ -195,7 +195,7 @@ private: std::vector mOwnerCallbackNames; CCArray* mOwnerCallbackNodes; - + std::string mCCBRootPath; bool init(); public: CCBReader(CCNodeLoaderLibrary *pCCNodeLoaderLibrary, CCBMemberVariableAssigner *pCCBMemberVariableAssigner = NULL, CCBSelectorResolver *pCCBSelectorResolver = NULL, CCNodeLoaderListener *pCCNodeLoaderListener = NULL); @@ -203,6 +203,9 @@ public: virtual ~CCBReader(); CCBReader(); + void setCCBRootPath(const char* pCCBRootPath); + const std::string& getCCBRootPath() const; + CCNode* readNodeGraphFromFile(const char *pCCBFileName); CCNode* readNodeGraphFromFile(const char *pCCBFileName, CCObject *pOwner); CCNode* readNodeGraphFromFile(const char *pCCBFileName, CCObject *pOwner, const CCSize &parentSize); diff --git a/extensions/CCBReader/CCNodeLoader.cpp b/extensions/CCBReader/CCNodeLoader.cpp index 7a731bb759..b248decf1f 100644 --- a/extensions/CCBReader/CCNodeLoader.cpp +++ b/extensions/CCBReader/CCNodeLoader.cpp @@ -269,7 +269,7 @@ void CCNodeLoader::parseProperties(CCNode * pNode, CCNode * pParent, CCBReader * } case kCCBPropTypeFntFile: { - std::string fntFile = this->parsePropTypeFntFile(pNode, pParent, pCCBReader); + std::string fntFile = pCCBReader->getCCBRootPath() + this->parsePropTypeFntFile(pNode, pParent, pCCBReader); if(setProp) { this->onHandlePropTypeFntFile(pNode, pParent, propertyName.c_str(), fntFile.c_str(), pCCBReader); @@ -521,6 +521,7 @@ CCSpriteFrame * CCNodeLoader::parsePropTypeSpriteFrame(CCNode * pNode, CCNode * { if (spriteSheet.length() == 0) { + spriteFile = pCCBReader->getCCBRootPath() + spriteFile; CCTexture2D * texture = CCTextureCache::sharedTextureCache()->addImage(spriteFile.c_str()); CCRect bounds = CCRectMake(0, 0, texture->getContentSize().width, texture->getContentSize().height); spriteFrame = CCSpriteFrame::createWithTexture(texture, bounds); @@ -528,7 +529,7 @@ CCSpriteFrame * CCNodeLoader::parsePropTypeSpriteFrame(CCNode * pNode, CCNode * else { CCSpriteFrameCache * frameCache = CCSpriteFrameCache::sharedSpriteFrameCache(); - + spriteSheet = pCCBReader->getCCBRootPath() + spriteSheet; // Load the sprite sheet only if it is not loaded if (pCCBReader->getLoadedSpriteSheet().find(spriteSheet) == pCCBReader->getLoadedSpriteSheet().end()) { @@ -549,7 +550,7 @@ CCSpriteFrame * CCNodeLoader::parsePropTypeSpriteFrame(CCNode * pNode, CCNode * } CCAnimation * CCNodeLoader::parsePropTypeAnimation(CCNode * pNode, CCNode * pParent, CCBReader * pCCBReader) { - std::string animationFile = pCCBReader->readCachedString(); + std::string animationFile = pCCBReader->getCCBRootPath() + pCCBReader->readCachedString(); std::string animation = pCCBReader->readCachedString(); CCAnimation * ccAnimation = NULL; @@ -573,7 +574,7 @@ CCAnimation * CCNodeLoader::parsePropTypeAnimation(CCNode * pNode, CCNode * pPar } CCTexture2D * CCNodeLoader::parsePropTypeTexture(CCNode * pNode, CCNode * pParent, CCBReader * pCCBReader) { - std::string spriteFile = pCCBReader->readCachedString(); + std::string spriteFile = pCCBReader->getCCBRootPath() + pCCBReader->readCachedString(); if (spriteFile.length() > 0) { @@ -813,7 +814,7 @@ BlockCCControlData * CCNodeLoader::parsePropTypeBlockCCControl(CCNode * pNode, C } CCNode * CCNodeLoader::parsePropTypeCCBFile(CCNode * pNode, CCNode * pParent, CCBReader * pCCBReader) { - std::string ccbFileName = pCCBReader->readCachedString(); + std::string ccbFileName = pCCBReader->getCCBRootPath() + pCCBReader->readCachedString(); /* Change path extension to .ccbi. */ std::string ccbFileWithoutPathExtension = CCBReader::deletePathExtension(ccbFileName.c_str()); diff --git a/extensions/GUI/CCControlExtension/CCControlButton.cpp b/extensions/GUI/CCControlExtension/CCControlButton.cpp index 7ac5a99e2d..5f9a1bd9f8 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.cpp +++ b/extensions/GUI/CCControlExtension/CCControlButton.cpp @@ -143,11 +143,6 @@ bool CCControlButton::initWithLabelAndBackgroundSprite(CCNode* node, CCScale9Spr } } -CCControlButton* CCControlButton::buttonWithLabelAndBackgroundSprite(CCNode* label, CCScale9Sprite* backgroundSprite) -{ - return CCControlButton::create(label, backgroundSprite); -} - CCControlButton* CCControlButton::create(CCNode* label, CCScale9Sprite* backgroundSprite) { CCControlButton *pRet = new CCControlButton(); @@ -162,11 +157,6 @@ bool CCControlButton::initWithTitleAndFontNameAndFontSize(string title, const ch return initWithLabelAndBackgroundSprite(label, CCScale9Sprite::create()); } -CCControlButton* CCControlButton::buttonWithTitleAndFontNameAndFontSize(string title, const char * fontName, float fontSize) -{ - return CCControlButton::create(title, fontName, fontSize); -} - CCControlButton* CCControlButton::create(string title, const char * fontName, float fontSize) { CCControlButton *pRet = new CCControlButton(); @@ -181,11 +171,6 @@ bool CCControlButton::initWithBackgroundSprite(CCScale9Sprite* sprite) return initWithLabelAndBackgroundSprite(label, sprite); } -CCControlButton* CCControlButton::buttonWithBackgroundSprite(CCScale9Sprite* sprite) -{ - return CCControlButton::create(sprite); -} - CCControlButton* CCControlButton::create(CCScale9Sprite* sprite) { CCControlButton *pRet = new CCControlButton(); @@ -747,9 +732,4 @@ CCControlButton* CCControlButton::create() return NULL; } -CCControlButton* CCControlButton::node() -{ - return CCControlButton::create(); -} - NS_CC_EXT_END diff --git a/extensions/GUI/CCControlExtension/CCControlButton.h b/extensions/GUI/CCControlExtension/CCControlButton.h index 68f28aded2..bc57244fa9 100644 --- a/extensions/GUI/CCControlExtension/CCControlButton.h +++ b/extensions/GUI/CCControlExtension/CCControlButton.h @@ -121,21 +121,15 @@ public: public: virtual bool init(); virtual bool initWithLabelAndBackgroundSprite(CCNode* label, CCScale9Sprite* backgroundSprite); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCControlButton* buttonWithLabelAndBackgroundSprite(CCNode* label, CCScale9Sprite* backgroundSprite); + static CCControlButton* create(CCNode* label, CCScale9Sprite* backgroundSprite); virtual bool initWithTitleAndFontNameAndFontSize(std::string title, const char * fontName, float fontSize); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCControlButton* buttonWithTitleAndFontNameAndFontSize(std::string title, const char * fontName, float fontSize); static CCControlButton* create(std::string title, const char * fontName, float fontSize); virtual bool initWithBackgroundSprite(CCScale9Sprite* sprite); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCControlButton* buttonWithBackgroundSprite(CCScale9Sprite* sprite); - static CCControlButton* create(CCScale9Sprite* sprite); //events @@ -245,7 +239,6 @@ public: */ virtual void setBackgroundSpriteFrameForState(CCSpriteFrame * spriteFrame, CCControlState state); - CC_DEPRECATED_ATTRIBUTE static CCControlButton * node(); static CCControlButton* create(); }; diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index 0943a2f9ce..d0a65c9234 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -123,11 +123,6 @@ bool CCControlColourPicker::init() return false; } -CCControlColourPicker* CCControlColourPicker::colourPicker() -{ - return CCControlColourPicker::create(); -} - CCControlColourPicker* CCControlColourPicker::create() { CCControlColourPicker *pRet = new CCControlColourPicker(); diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.h b/extensions/GUI/CCControlExtension/CCControlColourPicker.h index 804f3465c3..b9445f3449 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.h @@ -61,8 +61,6 @@ protected: CC_SYNTHESIZE_RETAIN(CCSprite*, m_background, Background) public: - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCControlColourPicker* colourPicker(); static CCControlColourPicker* create(); diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp index 846762ab07..1277e01d21 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.cpp @@ -50,11 +50,6 @@ CCControlHuePicker::~CCControlHuePicker() CC_SAFE_RELEASE(m_slider); } -CCControlHuePicker* CCControlHuePicker::pickerWithTargetAndPos(CCNode* target, CCPoint pos) -{ - return CCControlHuePicker::create(target, pos); -} - CCControlHuePicker* CCControlHuePicker::create(CCNode* target, CCPoint pos) { CCControlHuePicker *pRet = new CCControlHuePicker(); diff --git a/extensions/GUI/CCControlExtension/CCControlHuePicker.h b/extensions/GUI/CCControlExtension/CCControlHuePicker.h index 7bd9f02789..9466894b32 100644 --- a/extensions/GUI/CCControlExtension/CCControlHuePicker.h +++ b/extensions/GUI/CCControlExtension/CCControlHuePicker.h @@ -63,8 +63,7 @@ public: CCControlHuePicker(); virtual ~CCControlHuePicker(); virtual bool initWithTargetAndPos(CCNode* target, CCPoint pos); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCControlHuePicker* pickerWithTargetAndPos(CCNode* target, CCPoint pos); + static CCControlHuePicker* create(CCNode* target, CCPoint pos); virtual void setEnabled(bool enabled); protected: diff --git a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp index afad478f94..fc8fa18921 100644 --- a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.cpp @@ -79,11 +79,6 @@ bool CCControlSaturationBrightnessPicker::initWithTargetAndPos(CCNode* target, C } } -CCControlSaturationBrightnessPicker* CCControlSaturationBrightnessPicker::pickerWithTargetAndPos(CCNode* target, CCPoint pos) -{ - return CCControlSaturationBrightnessPicker::create(target, pos); -} - CCControlSaturationBrightnessPicker* CCControlSaturationBrightnessPicker::create(CCNode* target, CCPoint pos) { CCControlSaturationBrightnessPicker *pRet = new CCControlSaturationBrightnessPicker(); diff --git a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h index 300e901b88..9e0a5dec53 100644 --- a/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h +++ b/extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.h @@ -68,8 +68,6 @@ public: virtual ~CCControlSaturationBrightnessPicker(); virtual bool initWithTargetAndPos(CCNode* target, CCPoint pos); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCControlSaturationBrightnessPicker* pickerWithTargetAndPos(CCNode* target, CCPoint pos); static CCControlSaturationBrightnessPicker* create(CCNode* target, CCPoint pos); virtual void setEnabled(bool enabled); diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.cpp b/extensions/GUI/CCControlExtension/CCControlSlider.cpp index bd79f931bb..df9c7e6793 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSlider.cpp @@ -54,11 +54,6 @@ CCControlSlider::~CCControlSlider() CC_SAFE_RELEASE(m_backgroundSprite); } -CCControlSlider* CCControlSlider::sliderWithFiles(const char* bgFile, const char* progressFile, const char* thumbFile) -{ - return CCControlSlider::create(bgFile, progressFile, thumbFile); -} - CCControlSlider* CCControlSlider::create(const char* bgFile, const char* progressFile, const char* thumbFile) { // Prepare background for slider @@ -73,11 +68,6 @@ CCControlSlider* CCControlSlider::create(const char* bgFile, const char* progres return CCControlSlider::create(backgroundSprite, progressSprite, thumbSprite); } -CCControlSlider* CCControlSlider::sliderWithSprites(CCSprite * backgroundSprite, CCSprite* pogressSprite, CCSprite* thumbSprite) -{ - return CCControlSlider::create(backgroundSprite, pogressSprite, thumbSprite); -} - CCControlSlider* CCControlSlider::create(CCSprite * backgroundSprite, CCSprite* pogressSprite, CCSprite* thumbSprite) { CCControlSlider *pRet = new CCControlSlider(); diff --git a/extensions/GUI/CCControlExtension/CCControlSlider.h b/extensions/GUI/CCControlExtension/CCControlSlider.h index 84ab207bcb..446d2cfa0e 100644 --- a/extensions/GUI/CCControlExtension/CCControlSlider.h +++ b/extensions/GUI/CCControlExtension/CCControlSlider.h @@ -82,23 +82,6 @@ public: */ virtual bool initWithSprites(CCSprite * backgroundSprite, CCSprite* progressSprite, CCSprite* thumbSprite); - - /** - * Creates slider with a background filename, a progress filename and a - * thumb image filename. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCControlSlider* sliderWithFiles(const char* bgFile, const char* progressFile, const char* thumbFile); - - /** - * Creates a slider with a given background sprite and a progress bar and a - * thumb item. - *@deprecated: This interface will be deprecated sooner or later. - * @see initWithBackgroundSprite:progressSprite:thumbMenuItem: - */ - CC_DEPRECATED_ATTRIBUTE static CCControlSlider* sliderWithSprites(CCSprite * backgroundSprite, CCSprite* pogressSprite, CCSprite* thumbSprite); - - /** * Creates slider with a background filename, a progress filename and a * thumb image filename. diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp index f324a51a59..5670fb846e 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.cpp +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.cpp @@ -279,11 +279,6 @@ bool CCControlSwitch::initWithMaskSprite(CCSprite *maskSprite, CCSprite * onSpri return initWithMaskSprite(maskSprite, onSprite, offSprite, thumbSprite, NULL, NULL); } -CCControlSwitch* CCControlSwitch::switchWithMaskSprite(CCSprite *maskSprite, CCSprite * onSprite, CCSprite * offSprite, CCSprite * thumbSprite) -{ - return CCControlSwitch::create(maskSprite, onSprite, offSprite, thumbSprite); -} - CCControlSwitch* CCControlSwitch::create(CCSprite *maskSprite, CCSprite * onSprite, CCSprite * offSprite, CCSprite * thumbSprite) { CCControlSwitch* pRet = new CCControlSwitch(); @@ -328,11 +323,6 @@ bool CCControlSwitch::initWithMaskSprite(CCSprite *maskSprite, CCSprite * onSpri return false; } -CCControlSwitch* CCControlSwitch::switchWithMaskSprite(CCSprite *maskSprite, CCSprite * onSprite, CCSprite * offSprite, CCSprite * thumbSprite, CCLabelTTF* onLabel, CCLabelTTF* offLabel) -{ - return CCControlSwitch::create(maskSprite, onSprite, offSprite, thumbSprite, onLabel, offLabel); -} - CCControlSwitch* CCControlSwitch::create(CCSprite *maskSprite, CCSprite * onSprite, CCSprite * offSprite, CCSprite * thumbSprite, CCLabelTTF* onLabel, CCLabelTTF* offLabel) { CCControlSwitch* pRet = new CCControlSwitch(); diff --git a/extensions/GUI/CCControlExtension/CCControlSwitch.h b/extensions/GUI/CCControlExtension/CCControlSwitch.h index a17f8a08be..c2116f1039 100644 --- a/extensions/GUI/CCControlExtension/CCControlSwitch.h +++ b/extensions/GUI/CCControlExtension/CCControlSwitch.h @@ -54,11 +54,6 @@ public: /** Initializes a switch with a mask sprite, on/off sprites for on/off states and a thumb sprite. */ bool initWithMaskSprite(CCSprite *maskSprite, CCSprite * onSprite, CCSprite * offSprite, CCSprite * thumbSprite); - /** Creates a switch with a mask sprite, on/off sprites for on/off states and a thumb sprite. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCControlSwitch* switchWithMaskSprite(CCSprite *maskSprite, CCSprite * onSprite, CCSprite * offSprite, CCSprite * thumbSprite); - /** Creates a switch with a mask sprite, on/off sprites for on/off states and a thumb sprite. */ static CCControlSwitch* create(CCSprite *maskSprite, CCSprite * onSprite, CCSprite * offSprite, CCSprite * thumbSprite); @@ -66,11 +61,6 @@ public: /** Initializes a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. */ bool initWithMaskSprite(CCSprite *maskSprite, CCSprite * onSprite, CCSprite * offSprite, CCSprite * thumbSprite, CCLabelTTF* onLabel, CCLabelTTF* offLabel); - /** Creates a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCControlSwitch* switchWithMaskSprite(CCSprite *maskSprite, CCSprite * onSprite, CCSprite * offSprite, CCSprite * thumbSprite, CCLabelTTF* onLabel, CCLabelTTF* offLabel); - /** Creates a switch with a mask sprite, on/off sprites for on/off states, a thumb sprite and an on/off labels. */ static CCControlSwitch* create(CCSprite *maskSprite, CCSprite * onSprite, CCSprite * offSprite, CCSprite * thumbSprite, CCLabelTTF* onLabel, CCLabelTTF* offLabel); diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp index d1387220c5..2f54d9ca03 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.cpp @@ -427,11 +427,6 @@ bool CCScale9Sprite::initWithFile(const char* file, CCRect rect, CCRect capInse return pReturn; } -CCScale9Sprite* CCScale9Sprite::spriteWithFile(const char* file, CCRect rect, CCRect capInsets) -{ - return CCScale9Sprite::create(file, rect, capInsets); -} - CCScale9Sprite* CCScale9Sprite::create(const char* file, CCRect rect, CCRect capInsets) { CCScale9Sprite* pReturn = new CCScale9Sprite(); @@ -451,11 +446,6 @@ bool CCScale9Sprite::initWithFile(const char* file, CCRect rect) return pReturn; } -CCScale9Sprite* CCScale9Sprite::spriteWithFile(const char* file, CCRect rect) -{ - return CCScale9Sprite::create(file, rect); -} - CCScale9Sprite* CCScale9Sprite::create(const char* file, CCRect rect) { CCScale9Sprite* pReturn = new CCScale9Sprite(); @@ -475,11 +465,6 @@ bool CCScale9Sprite::initWithFile(CCRect capInsets, const char* file) return pReturn; } -CCScale9Sprite* CCScale9Sprite::spriteWithFile(CCRect capInsets, const char* file) -{ - return CCScale9Sprite::create(capInsets, file); -} - CCScale9Sprite* CCScale9Sprite::create(CCRect capInsets, const char* file) { CCScale9Sprite* pReturn = new CCScale9Sprite(); @@ -499,11 +484,6 @@ bool CCScale9Sprite::initWithFile(const char* file) } -CCScale9Sprite* CCScale9Sprite::spriteWithFile(const char* file) -{ - return CCScale9Sprite::create(file); -} - CCScale9Sprite* CCScale9Sprite::create(const char* file) { CCScale9Sprite* pReturn = new CCScale9Sprite(); @@ -525,11 +505,6 @@ bool CCScale9Sprite::initWithSpriteFrame(CCSpriteFrame* spriteFrame, CCRect capI return pReturn; } -CCScale9Sprite* CCScale9Sprite::spriteWithSpriteFrame(CCSpriteFrame* spriteFrame, CCRect capInsets) -{ - return CCScale9Sprite::createWithSpriteFrame(spriteFrame, capInsets); -} - CCScale9Sprite* CCScale9Sprite::createWithSpriteFrame(CCSpriteFrame* spriteFrame, CCRect capInsets) { CCScale9Sprite* pReturn = new CCScale9Sprite(); @@ -548,12 +523,6 @@ bool CCScale9Sprite::initWithSpriteFrame(CCSpriteFrame* spriteFrame) return pReturn; } - -CCScale9Sprite* CCScale9Sprite::spriteWithSpriteFrame(CCSpriteFrame* spriteFrame) -{ - return CCScale9Sprite::createWithSpriteFrame(spriteFrame); -} - CCScale9Sprite* CCScale9Sprite::createWithSpriteFrame(CCSpriteFrame* spriteFrame) { CCScale9Sprite* pReturn = new CCScale9Sprite(); @@ -575,11 +544,6 @@ bool CCScale9Sprite::initWithSpriteFrameName(const char* spriteFrameName, CCRect return pReturn; } -CCScale9Sprite* CCScale9Sprite::spriteWithSpriteFrameName(const char* spriteFrameName, CCRect capInsets) -{ - return CCScale9Sprite::createWithSpriteFrameName(spriteFrameName, capInsets); -} - CCScale9Sprite* CCScale9Sprite::createWithSpriteFrameName(const char* spriteFrameName, CCRect capInsets) { CCScale9Sprite* pReturn = new CCScale9Sprite(); @@ -598,11 +562,6 @@ bool CCScale9Sprite::initWithSpriteFrameName(const char* spriteFrameName) return pReturn; } -CCScale9Sprite* CCScale9Sprite::spriteWithSpriteFrameName(const char* spriteFrameName) -{ - return CCScale9Sprite::createWithSpriteFrameName(spriteFrameName); -} - CCScale9Sprite* CCScale9Sprite::createWithSpriteFrameName(const char* spriteFrameName) { CCScale9Sprite* pReturn = new CCScale9Sprite(); @@ -628,11 +587,6 @@ CCScale9Sprite* CCScale9Sprite::resizableSpriteWithCapInsets(CCRect capInsets) return NULL; } -CCScale9Sprite* CCScale9Sprite::node() -{ - return CCScale9Sprite::create(); -} - CCScale9Sprite* CCScale9Sprite::create() { CCScale9Sprite *pReturn = new CCScale9Sprite(); diff --git a/extensions/GUI/CCControlExtension/CCScale9Sprite.h b/extensions/GUI/CCControlExtension/CCScale9Sprite.h index 3bddeed826..5724f1f793 100644 --- a/extensions/GUI/CCControlExtension/CCScale9Sprite.h +++ b/extensions/GUI/CCControlExtension/CCScale9Sprite.h @@ -122,15 +122,6 @@ public: */ virtual bool initWithFile(const char* file, CCRect rect, CCRect capInsets); - /** - * Creates a 9-slice sprite with a texture file, a delimitation zone and - * with the specified cap insets. - * - * @see initWithFile:rect:centerRegion: - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScale9Sprite* spriteWithFile(const char* file, CCRect rect, CCRect capInsets); - /** * Creates a 9-slice sprite with a texture file, a delimitation zone and * with the specified cap insets. @@ -153,15 +144,6 @@ public: */ virtual bool initWithFile(const char* file, CCRect rect); - /** - * Creates a 9-slice sprite with a texture file and a delimitation zone. The - * texture will be broken down into a 3×3 grid of equal blocks. - * - * @see initWithFile:rect: - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScale9Sprite* spriteWithFile(const char* file, CCRect rect); - /** * Creates a 9-slice sprite with a texture file and a delimitation zone. The * texture will be broken down into a 3×3 grid of equal blocks. @@ -181,15 +163,7 @@ public: * @param capInsets The values to use for the cap insets. */ virtual bool initWithFile(CCRect capInsets, const char* file); - - /** - * Creates a 9-slice sprite with a texture file. The whole texture will be - * broken down into a 3×3 grid of equal blocks. - * - * @see initWithFile:capInsets: - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScale9Sprite* spriteWithFile(CCRect capInsets, const char* file); + /** * Creates a 9-slice sprite with a texture file. The whole texture will be * broken down into a 3×3 grid of equal blocks. @@ -209,15 +183,6 @@ public: * @param file The name of the texture file. */ virtual bool initWithFile(const char* file); - - /** - * Creates a 9-slice sprite with a texture file. The whole texture will be - * broken down into a 3×3 grid of equal blocks. - * - * @see initWithFile: - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScale9Sprite* spriteWithFile(const char* file); /** * Creates a 9-slice sprite with a texture file. The whole texture will be @@ -238,19 +203,8 @@ public: * @param capInsets The values to use for the cap insets. */ virtual bool initWithSpriteFrame(CCSpriteFrame* spriteFrame, CCRect capInsets); - - /** - * Creates a 9-slice sprite with an sprite frame and the centre of its zone. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @see initWithSpriteFrame:centerRegion: - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScale9Sprite* spriteWithSpriteFrame(CCSpriteFrame* spriteFrame, CCRect capInsets); - /** + /** * Creates a 9-slice sprite with an sprite frame and the centre of its zone. * Once the sprite is created, you can then call its "setContentSize:" method * to resize the sprite will all it's 9-slice goodness intract. @@ -268,17 +222,6 @@ public: * @param spriteFrame The sprite frame object. */ virtual bool initWithSpriteFrame(CCSpriteFrame* spriteFrame); - - /** - * Creates a 9-slice sprite with an sprite frame. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @see initWithSpriteFrame: - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScale9Sprite* spriteWithSpriteFrame(CCSpriteFrame* spriteFrame); /** * Creates a 9-slice sprite with an sprite frame. @@ -301,19 +244,8 @@ public: * @param capInsets The values to use for the cap insets. */ virtual bool initWithSpriteFrameName(const char*spriteFrameName, CCRect capInsets); - /** - * Creates a 9-slice sprite with an sprite frame name and the centre of its - * zone. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @see initWithSpriteFrameName:centerRegion: - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScale9Sprite* spriteWithSpriteFrameName(const char*spriteFrameName, CCRect capInsets); - /** + /** * Creates a 9-slice sprite with an sprite frame name and the centre of its * zone. * Once the sprite is created, you can then call its "setContentSize:" method @@ -333,17 +265,6 @@ public: * @param spriteFrameName The sprite frame name. */ virtual bool initWithSpriteFrameName(const char*spriteFrameName); - - /** - * Creates a 9-slice sprite with an sprite frame name. - * Once the sprite is created, you can then call its "setContentSize:" method - * to resize the sprite will all it's 9-slice goodness intract. - * It respects the anchorPoint too. - * - * @see initWithSpriteFrameName: - @deprecated: This interface will be deprecated sooner or later. - */ - CC_DEPRECATED_ATTRIBUTE static CCScale9Sprite* spriteWithSpriteFrameName(const char*spriteFrameName); /** * Creates a 9-slice sprite with an sprite frame name. @@ -365,9 +286,6 @@ public: */ CCScale9Sprite* resizableSpriteWithCapInsets(CCRect capInsets); - //@deprecated: This interface will be deprecated sooner or later. - CC_DEPRECATED_ATTRIBUTE static CCScale9Sprite* node(); - static CCScale9Sprite* create(); // optional diff --git a/extensions/GUI/CCScrollView/CCScrollView.cpp b/extensions/GUI/CCScrollView/CCScrollView.cpp index 2a29c9cde2..204c1d54c0 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.cpp +++ b/extensions/GUI/CCScrollView/CCScrollView.cpp @@ -67,11 +67,6 @@ CCScrollView::~CCScrollView() m_pTouches->release(); } -CCScrollView* CCScrollView::viewWithViewSize(CCSize size, CCNode* container/* = NULL*/) -{ - return CCScrollView::create(size, container); -} - CCScrollView* CCScrollView::create(CCSize size, CCNode* container/* = NULL*/) { CCScrollView* pRet = new CCScrollView(); @@ -86,11 +81,6 @@ CCScrollView* CCScrollView::create(CCSize size, CCNode* container/* = NULL*/) return pRet; } -CCScrollView* CCScrollView::node() -{ - return CCScrollView::create(); -} - CCScrollView* CCScrollView::create() { CCScrollView* pRet = new CCScrollView(); @@ -346,8 +336,8 @@ void CCScrollView::relocateContainer(bool animated) newY = oldPoint.y; if (m_eDirection == kCCScrollViewDirectionBoth || m_eDirection == kCCScrollViewDirectionHorizontal) { - newX = MIN(newX, max.x); newX = MAX(newX, min.x); + newX = MIN(newX, max.x); } if (m_eDirection == kCCScrollViewDirectionBoth || m_eDirection == kCCScrollViewDirectionVertical) @@ -403,12 +393,17 @@ void CCScrollView::deaccelerateScrolling(float dt) newY = MIN(m_pContainer->getPosition().y, maxInset.y); newY = MAX(newY, minInset.y); + newX = m_pContainer->getPosition().x; + newY = m_pContainer->getPosition().y; + m_tScrollDistance = ccpSub(m_tScrollDistance, ccp(newX - m_pContainer->getPosition().x, newY - m_pContainer->getPosition().y)); m_tScrollDistance = ccpMult(m_tScrollDistance, SCROLL_DEACCEL_RATE); this->setContentOffset(ccp(newX,newY)); if ((fabsf(m_tScrollDistance.x) <= SCROLL_DEACCEL_DIST && fabsf(m_tScrollDistance.y) <= SCROLL_DEACCEL_DIST) || + newY > maxInset.y || newY < minInset.y || + newX > maxInset.x || newX < minInset.x || newX == maxInset.x || newX == minInset.x || newY == maxInset.y || newY == minInset.y) { @@ -662,20 +657,14 @@ void CCScrollView::ccTouchMoved(CCTouch* touch, CCEvent* event) default: break; } - - m_pContainer->setPosition(ccpAdd(m_pContainer->getPosition(), moveDistance)); maxInset = m_fMaxInset; minInset = m_fMinInset; - - - //check to see if offset lies within the inset bounds - newX = MIN(m_pContainer->getPosition().x, maxInset.x); - newX = MAX(newX, minInset.x); - newY = MIN(m_pContainer->getPosition().y, maxInset.y); - newY = MAX(newY, minInset.y); - - m_tScrollDistance = ccpSub(moveDistance, ccp(newX - m_pContainer->getPosition().x, newY - m_pContainer->getPosition().y)); + + newX = m_pContainer->getPosition().x + moveDistance.x; + newY = m_pContainer->getPosition().y + moveDistance.y; + + m_tScrollDistance = moveDistance; this->setContentOffset(ccp(newX, newY)); } } diff --git a/extensions/GUI/CCScrollView/CCScrollView.h b/extensions/GUI/CCScrollView/CCScrollView.h index b10b282b0e..7a1784faf9 100644 --- a/extensions/GUI/CCScrollView/CCScrollView.h +++ b/extensions/GUI/CCScrollView/CCScrollView.h @@ -66,14 +66,6 @@ public: bool init(); virtual void registerWithTouchDispatcher(); - /** - * Returns an autoreleased scroll view object. - * @deprecated: This interface will be deprecated sooner or later. - * @param size view size - * @param container parent object - * @return autoreleased scroll view object - */ - CC_DEPRECATED_ATTRIBUTE static CCScrollView* viewWithViewSize(CCSize size, CCNode* container = NULL); /** * Returns an autoreleased scroll view object. @@ -84,15 +76,6 @@ public: */ static CCScrollView* create(CCSize size, CCNode* container = NULL); - /** - * Returns an autoreleased scroll view object. - * @deprecated: This interface will be deprecated sooner or later. - * @param size view size - * @param container parent object - * @return autoreleased scroll view object - */ - CC_DEPRECATED_ATTRIBUTE static CCScrollView* node(); - /** * Returns an autoreleased scroll view object. * diff --git a/extensions/GUI/CCScrollView/CCTableView.cpp b/extensions/GUI/CCScrollView/CCTableView.cpp index 0e970d1577..1f7fecf3dd 100644 --- a/extensions/GUI/CCScrollView/CCTableView.cpp +++ b/extensions/GUI/CCScrollView/CCTableView.cpp @@ -72,6 +72,7 @@ CCTableView::CCTableView() , m_pCellsFreed(NULL) , m_pDataSource(NULL) , m_pTableViewDelegate(NULL) +, m_pTouchedCell(NULL) , m_eOldDirection(kCCScrollViewDirectionNone) { @@ -387,6 +388,11 @@ void CCTableView::scrollViewDidScroll(CCScrollView* view) return; } + if (m_pTableViewDelegate) + { + m_pTableViewDelegate->scrollViewDidScroll(this); + } + unsigned int startIdx = 0, endIdx = 0, idx = 0, maxIdx = 0; CCPoint offset = ccpMult(this->getContentOffset(), -1); maxIdx = MAX(uCountOfItems-1, 0); @@ -486,24 +492,69 @@ void CCTableView::ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) if (!this->isVisible()) { return; } - if (m_pTouches->count() == 1 && !this->isTouchMoved()) { + + if (m_pTouchedCell) { + m_pTableViewDelegate->tableCellUnhighlight(this, m_pTouchedCell); + m_pTableViewDelegate->tableCellTouched(this, m_pTouchedCell); + + m_pTouchedCell = NULL; + } + + CCScrollView::ccTouchEnded(pTouch, pEvent); +} + +bool CCTableView::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent) +{ + if (!this->isVisible()) { + return false; + } + + bool touchResult = CCScrollView::ccTouchBegan(pTouch, pEvent); + + if(m_pTouches->count() == 1) { unsigned int index; - CCTableViewCell *cell; CCPoint point; point = this->getContainer()->convertTouchToNodeSpace(pTouch); + if (m_eVordering == kCCTableViewFillTopDown) { CCSize cellSize = m_pDataSource->cellSizeForTable(this); point.y -= cellSize.height; } - index = this->_indexFromOffset(point); - cell = this->_cellWithIndex(index); - if (cell) { - m_pTableViewDelegate->tableCellTouched(this, cell); + index = this->_indexFromOffset(point); + m_pTouchedCell = this->_cellWithIndex(index); + + if (m_pTouchedCell) { + m_pTableViewDelegate->tableCellHighlight(this, m_pTouchedCell); } } - CCScrollView::ccTouchEnded(pTouch, pEvent); + else if(m_pTouchedCell) { + m_pTableViewDelegate->tableCellUnhighlight(this, m_pTouchedCell); + m_pTouchedCell = NULL; + } + + return touchResult; +} + +void CCTableView::ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent) +{ + CCScrollView::ccTouchMoved(pTouch, pEvent); + + if (m_pTouchedCell && isTouchMoved()) { + m_pTableViewDelegate->tableCellUnhighlight(this, m_pTouchedCell); + m_pTouchedCell = NULL; + } +} + +void CCTableView::ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) +{ + CCScrollView::ccTouchCancelled(pTouch, pEvent); + + if (m_pTouchedCell) { + m_pTableViewDelegate->tableCellUnhighlight(this, m_pTouchedCell); + m_pTouchedCell = NULL; + } } NS_CC_EXT_END diff --git a/extensions/GUI/CCScrollView/CCTableView.h b/extensions/GUI/CCScrollView/CCTableView.h index 3aa6f32a28..04853db517 100644 --- a/extensions/GUI/CCScrollView/CCTableView.h +++ b/extensions/GUI/CCScrollView/CCTableView.h @@ -54,6 +54,22 @@ public: * @param cell cell that is touched */ virtual void tableCellTouched(CCTableView* table, CCTableViewCell* cell) = 0; + + /** + * Delegate to respond a table cell press event. + * + * @param table table contains the given cell + * @param cell cell that is pressed + */ + virtual void tableCellHighlight(CCTableView* table, CCTableViewCell* cell){}; + + /** + * Delegate to respond a table cell release event + * + * @param table table contains the given cell + * @param cell cell that is pressed + */ + virtual void tableCellUnhighlight(CCTableView* table, CCTableViewCell* cell){}; }; @@ -176,10 +192,15 @@ public: virtual void scrollViewDidScroll(CCScrollView* view); virtual void scrollViewDidZoom(CCScrollView* view) {} + + virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent); + virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent); virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent); + virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent); protected: + CCTableViewCell *m_pTouchedCell; /** * vertical direction of cell filling */ diff --git a/external/chipmunk/include/chipmunk/chipmunk_types.h b/external/chipmunk/include/chipmunk/chipmunk_types.h index 03ef6b5be6..5124d4868f 100644 --- a/external/chipmunk/include/chipmunk/chipmunk_types.h +++ b/external/chipmunk/include/chipmunk/chipmunk_types.h @@ -1,4 +1,4 @@ -//#include +#include #ifdef __APPLE__ #include "TargetConditionals.h" diff --git a/samples/CocosDragonJS/Classes/AppDelegate.cpp b/samples/CocosDragonJS/Classes/AppDelegate.cpp index 45305b9db6..5f35c9fabb 100644 --- a/samples/CocosDragonJS/Classes/AppDelegate.cpp +++ b/samples/CocosDragonJS/Classes/AppDelegate.cpp @@ -25,18 +25,32 @@ bool AppDelegate::applicationDidFinishLaunching() // initialize director CCDirector *pDirector = CCDirector::sharedDirector(); pDirector->setOpenGLView(CCEGLView::sharedOpenGLView()); + pDirector->setProjection(kCCDirectorProjection2D); CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize(); CCSize designSize = CCSizeMake(320, 480); + CCSize resourceSize = CCSizeMake(320, 480); -// if (screenSize.height > 320) -// { -// CCSize resourceSize = CCSizeMake(640, 960); -// CCFileUtils::sharedFileUtils()->setResourceDirectory("hd"); -// pDirector->setContentScaleFactor(resourceSize.height/designSize.height); -// } + if (screenSize.height > 768) + { + resourceSize = CCSizeMake(1536, 2048); + CCFileUtils::sharedFileUtils()->setResourceDirectory("resources-ipadhd"); + } + else if (screenSize.height > 640) + { + resourceSize = CCSizeMake(768, 1536); + CCFileUtils::sharedFileUtils()->setResourceDirectory("resources-ipad"); + } + else if (screenSize.height > 320) + { + resourceSize = CCSizeMake(640, 960); + CCFileUtils::sharedFileUtils()->setResourceDirectory("resources-iphonehd"); + + } + + pDirector->setContentScaleFactor(resourceSize.height/designSize.height); CCEGLView::sharedOpenGLView()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionNoBorder); diff --git a/samples/CocosDragonJS/proj.android/AndroidManifest.xml b/samples/CocosDragonJS/proj.android/AndroidManifest.xml index 3c1cb33748..3abb0f46fe 100644 --- a/samples/CocosDragonJS/proj.android/AndroidManifest.xml +++ b/samples/CocosDragonJS/proj.android/AndroidManifest.xml @@ -7,7 +7,6 @@ ", Default="", Value = "" +DeviceMainsPower = Type=bool, Default="false", Value = "false" +DeviceName = Type=string, Default="My Computer", Value = "My Computer" +DeviceOS = Type=string, Allowed="NONE" "SYMBIAN" "BREW" "WINDOWS" "WINMOBILE" "LINUX" "WIPI" "NDS" "ARM_SEMIH" "NUCLEUS" "NGI" "WINCE" "SHARPEMP" "OSX" "IPHONE" "UIQ" "PS3" "X360" "BADA" "ANDROID" "WEBOS" "QNX", Default="NONE", Value = "NONE" +DeviceOSVersion = Type=string, Default="", Value = "" +DeviceOSVersionNumber = Type=int, Default="0", Value = "0" +DevicePhoneNumber = Type=string, Default="0044123456789", Value = "0044123456789" +DeviceTimezone = Type=string, Default="SYSTEM", Value = "SYSTEM" +DeviceTotalRAM = Type=int, Min=0.000000, Max=2097151.000000, Default="1048576", Value = "1048576" +DeviceUniqueID = Type=string, Default="SIMULATOR_ID", Value = "SIMULATOR_ID" +DeviceUniqueIDInt = Type=int, Default="01234567890", Value = "01234567890" +FileTotalStorageSize = Type=int, Min=0.000000, Max=2147483648.000000, Default="67108864", Value = "67108864" +FileUseSeparateRomRam = Type=bool, Default="true", Value = "true" +FileUseTotalStorageSize = Type=bool, Default="false", Value = "false" +GLAPI = Type=string, Allowed="None" "GLES 1.0 Common-Lite Profile from Imagination POWERVR(TM)" "GLES 1.1 Common-Lite Profile from Imagination POWERVR(TM)" "GLES 1.0 Common Profile from Imagination POWERVR(TM)" "GLES 1.1 Common Profile from Imagination POWERVR(TM)" "GLES 2.0 from Imagination POWERVR(TM)" "Obey [S3E] SysGlesVersion .icf setting" "GLES 1.1 Common Profile from Qualcomm Snapdragon(TM)" "GLES 2.0 from Qualcomm Snapdragon(TM)" "GLES 2.0 ANGLE", Default="Obey [S3E] SysGlesVersion .icf setting", Value = "Obey [S3E] SysGlesVersion .icf setting" +GLDontUseHiddenWindow = Type=bool, Default="false", Value = "false" +GLTerminateOnSuspend = Type=bool, Default="false", Value = "false" +GLUsePVRVFrame = Type=bool, Default="false", Value = "false" +KeyboardHasAlpha = Type=bool, Default="true", Value = "true" +KeyboardHasDirection = Type=bool, Default="true", Value = "true" +KeyboardHasKeypad = Type=bool, Default="true", Value = "true" +KeyboardNumpadRotation = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0" +LicenseExpiryDate = Type=int, Min=0.000000, Max=999999995904.000000, Default="0", Value = "0" +LicenseMinutesRemaining = Type=int, Min=0.000000, Max=10000000.000000, Default="0", Value = "0" +LicenseStatus = Type=string, Allowed="EXPIRED" "DEMO" "USECOUNT" "EXPIRYDATE" "EXPIRYMINSUSE" "PURCHASE" "SUBSCRIPTION" "UPGRADE" "NONCOMMERCIAL", Default="NONCOMMERCIAL", Value = "NONCOMMERCIAL" +LicenseUsesRemaining = Type=int, Min=0.000000, Max=10000000.000000, Default="0", Value = "0" +LocationAltitude = Type=float, Min=-2000.000000, Max=100000.000000, Default="60.0", Value = "60.0" +LocationAvailable = Type=bool, Default="true", Value = "true" +LocationHeading = Type=float, Min=0.000000, Max=359.000000, Default="0.0", Value = "0.0" +LocationHorizontalAccuracy = Type=float, Min=0.000000, Max=100000.000000, Default="20.0", Value = "20.0" +LocationLatitude = Type=float, Min=-90.000000, Max=90.000000, Default="51.511791", Value = "51.511791" +LocationLongitude = Type=float, Min=-180.000000, Max=180.000000, Default="-0.191084", Value = "-0.191084" +LocationSpeed = Type=float, Min=0.000000, Max=10000.000000, Default="0", Value = "0" +LocationVerticalAccuracy = Type=float, Min=0.000000, Max=100000.000000, Default="100.0", Value = "100.0" +MacOSSimulatorCustomSettings = Type=string, Default="", Value = "" +MacOSSimulatorDevices_ANDROID = Type=string, Allowed="Samsung Galaxy S:480x800:512" "HTC Sensation XL:480x800:768" "Samsung Galaxy Note:800x1280:1024" "Motorola Droid Razr:540x960:1024" "Kindle Fire:1024x600:512" "Samsung Galaxy Tab:1024x600:512", Default="Samsung Galaxy S:480x800:512", Value = "Samsung Galaxy S:480x800:512" +MacOSSimulatorDevices_IPHONE = Type=string, Allowed="iPhone 3GS:320x480:256" "iPhone 4:640x960:512" "iPad 2:768x1024:512", Default="iPhone 3GS:320x480:256", Value = "iPhone 3GS:320x480:256" +MacOSSimulatorPlatforms = Type=string, Allowed="IPHONE" "ANDROID", Default="IPHONE", Value = "IPHONE" +MacOSSimulatorUseCustomSettings = Type=bool, Default="true", Value = "true" +MemoryPoison = Type=bool, Default="true", Value = "true" +MemoryPoisonAlloc = Type=int, Min=0.000000, Max=255.000000, Default="170", Value = "170" +MemoryPoisonFree = Type=int, Min=0.000000, Max=255.000000, Default="221", Value = "221" +MemoryPoisonInit = Type=int, Min=0.000000, Max=255.000000, Default="204", Value = "204" +PointerAvailable = Type=bool, Default="true", Value = "true" +PointerMultiSimulationMode = Type=bool, Default="false", Value = "false" +PointerMultiTouchAvailable = Type=bool, Default="false", Value = "false" +PointerStylusType = Type=string, Allowed="INVALID" "STYLUS" "FINGER", Default="INVALID", Value = "INVALID" +PointerType = Type=string, Allowed="INVALID" "MOUSE" "STYLUS", Default="MOUSE", Value = "MOUSE" +SMSEnabled = Type=bool, Default="true", Value = "true" +SMSReceiveEnabled = Type=bool, Default="true", Value = "true" +SocketDNSDelay = Type=int, Min=0.000000, Max=30000.000000, Default="0", Value = "0" +SocketHTTPProxy = Type=string, Default="", Value = "" +SocketHostName = Type=string, Default="", Value = "" +SocketNetworkAvailable = Type=bool, Default="true", Value = "true" +SocketNetworkLoss = Type=bool, Default="false", Value = "false" +SocketNetworkType = Type=string, Allowed="NONE" "UNKNOWN" "LAN" "WLAN" "GPRS" "UMTS" "EVDO" "CDMA2000" "HSDPA" "WIMAX" "BLUETOOTH" "EDGE" "CDMA" "IDEN" "LTE" "EHRPD" "HSPAPLUS", Default="LAN", Value = "LAN" +SocketRecvLimit = Type=int, Min=0.000000, Max=1000000.000000, Default="0", Value = "0" +SocketSendLimit = Type=int, Min=0.000000, Max=1000000.000000, Default="0", Value = "0" +SoundEnabled = Type=bool, Default="true", Value = "true" +SoundRecordEnabled = Type=bool, Default="true", Value = "true" +SoundSampleRate = Type=int, Allowed="8192" "11025" "16000" "22050" "44100", Default="22050", Value = "22050" +SoundStereo = Type=bool, Default="true", Value = "true" +SoundVolumeDefault = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256" +SurfaceDisableWhenGLIsActive = Type=bool, Default="false", Value = "false" +SurfaceDoubleBuffer = Type=bool, Default="false", Value = "false" +SurfaceHeight = Type=int, Min=128.000000, Max=4096.000000, Default="480", Value = "320" +SurfacePitch = Type=int, Min=0.000000, Max=8192.000000, Default="0", Value = "0" +SurfacePixelType = Type=string, Allowed="RGB444" "RGB555" "RGB565" "RGB666" "RGB888" "BGR444" "BGR555" "BGR565" "BGR666" "BGR888", Default="RGB565", Value = "RGB565" +SurfacePredefinedResolution = Type=string, Allowed="176x200" "176x208" "240x320 (QVGA Portrait)" "240x400" "320x240 (QVGA Landscape)" "320x400" "320x480 (iPhone Portrait)" "400x240" "480x320 (iPhone Landscape)" "360x640 (qHD Portrait)" "640x360 (qHD Landscape)" "480x640 (VGA Portrait)" "480x800 (WVGA Portrait)" "640x480 (VGA Landscape)" "800x400" "800x480 (WVGA Landscape)" "640x960 (iPhone 4 Portrait)" "960x640 (iPhone 4 Landscape)" "1024x600 (Playbook Landscape)" "600x1024 (Playbook Portrait)" "768x1024 (iPad Portrait)" "1024x768 (iPad Landscape)" "2048x1536 (iPad Retina Landscape)" "1536x2048 (iPad Retina Portrait)", Default="320x480 (iPhone Portrait)", Value = "176x200" +SurfaceRotation = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0" +SurfaceUnalign = Type=bool, Default="true", Value = "true" +SurfaceUseMultiBuffers = Type=bool, Default="true", Value = "true" +SurfaceWidth = Type=int, Min=128.000000, Max=4096.000000, Default="320", Value = "480" +SymbianSoundLatency = Type=int, Min=20.000000, Max=1400.000000, Default="120", Value = "120" +ThreadEnabled = Type=bool, Default="true", Value = "true" +TimerAccuracy = Type=int, Min=0.000000, Max=1000.000000, Default="0", Value = "0" +TimerHiRes = Type=bool, Default="false", Value = "false" +TimerLocaltimeOffsetHours = Type=string, Allowed="-12" "-11" "-10" "-9" "-8" "-7" "-6" "-5" "-4" "-3" "-2" "-1" "0" "+1" "+2" "+3" "+4" "+5" "+6" "+7" "+8" "+9" "+10" "+11" "+12" "+13" "SYSTEM", Default="SYSTEM", Value = "SYSTEM" +VibraEnabled = Type=bool, Default="true", Value = "true" +Video3GPP = Type=bool, Default="false", Value = "false" +VideoJPEG = Type=bool, Default="true", Value = "true" +VideoMPEG4 = Type=bool, Default="true", Value = "true" +VideoVolumeDefault = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256" diff --git a/samples/HelloCpp/proj.android/AndroidManifest.xml b/samples/HelloCpp/proj.android/AndroidManifest.xml index bccf7836f9..103c803f69 100644 --- a/samples/HelloCpp/proj.android/AndroidManifest.xml +++ b/samples/HelloCpp/proj.android/AndroidManifest.xml @@ -7,7 +7,6 @@ ", Default="", Value = "" +DeviceMainsPower = Type=bool, Default="false", Value = "false" +DeviceName = Type=string, Default="My Computer", Value = "My Computer" +DeviceOS = Type=string, Allowed="NONE" "SYMBIAN" "BREW" "WINDOWS" "WINMOBILE" "LINUX" "WIPI" "NDS" "ARM_SEMIH" "NUCLEUS" "NGI" "WINCE" "SHARPEMP" "OSX" "IPHONE" "UIQ" "PS3" "X360" "BADA" "ANDROID" "WEBOS" "QNX", Default="NONE", Value = "NONE" +DeviceOSVersion = Type=string, Default="", Value = "" +DeviceOSVersionNumber = Type=int, Default="0", Value = "0" +DevicePhoneNumber = Type=string, Default="0044123456789", Value = "0044123456789" +DeviceTimezone = Type=string, Default="SYSTEM", Value = "SYSTEM" +DeviceTotalRAM = Type=int, Min=0.000000, Max=2097151.000000, Default="1048576", Value = "1048576" +DeviceUniqueID = Type=string, Default="SIMULATOR_ID", Value = "SIMULATOR_ID" +DeviceUniqueIDInt = Type=int, Default="01234567890", Value = "01234567890" +FileTotalStorageSize = Type=int, Min=0.000000, Max=2147483648.000000, Default="67108864", Value = "67108864" +FileUseSeparateRomRam = Type=bool, Default="true", Value = "true" +FileUseTotalStorageSize = Type=bool, Default="false", Value = "false" +GLAPI = Type=string, Allowed="None" "GLES 1.0 Common-Lite Profile from Imagination POWERVR(TM)" "GLES 1.1 Common-Lite Profile from Imagination POWERVR(TM)" "GLES 1.0 Common Profile from Imagination POWERVR(TM)" "GLES 1.1 Common Profile from Imagination POWERVR(TM)" "GLES 2.0 from Imagination POWERVR(TM)" "Obey [S3E] SysGlesVersion .icf setting" "GLES 1.1 Common Profile from Qualcomm Snapdragon(TM)" "GLES 2.0 from Qualcomm Snapdragon(TM)" "GLES 2.0 ANGLE", Default="Obey [S3E] SysGlesVersion .icf setting", Value = "Obey [S3E] SysGlesVersion .icf setting" +GLDontUseHiddenWindow = Type=bool, Default="false", Value = "false" +GLTerminateOnSuspend = Type=bool, Default="false", Value = "false" +GLUsePVRVFrame = Type=bool, Default="false", Value = "false" +KeyboardHasAlpha = Type=bool, Default="true", Value = "true" +KeyboardHasDirection = Type=bool, Default="true", Value = "true" +KeyboardHasKeypad = Type=bool, Default="true", Value = "true" +KeyboardNumpadRotation = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0" +LicenseExpiryDate = Type=int, Min=0.000000, Max=999999995904.000000, Default="0", Value = "0" +LicenseMinutesRemaining = Type=int, Min=0.000000, Max=10000000.000000, Default="0", Value = "0" +LicenseStatus = Type=string, Allowed="EXPIRED" "DEMO" "USECOUNT" "EXPIRYDATE" "EXPIRYMINSUSE" "PURCHASE" "SUBSCRIPTION" "UPGRADE" "NONCOMMERCIAL", Default="NONCOMMERCIAL", Value = "NONCOMMERCIAL" +LicenseUsesRemaining = Type=int, Min=0.000000, Max=10000000.000000, Default="0", Value = "0" +LocationAltitude = Type=float, Min=-2000.000000, Max=100000.000000, Default="60.0", Value = "60.0" +LocationAvailable = Type=bool, Default="true", Value = "true" +LocationHeading = Type=float, Min=0.000000, Max=359.000000, Default="0.0", Value = "0.0" +LocationHorizontalAccuracy = Type=float, Min=0.000000, Max=100000.000000, Default="20.0", Value = "20.0" +LocationLatitude = Type=float, Min=-90.000000, Max=90.000000, Default="51.511791", Value = "51.511791" +LocationLongitude = Type=float, Min=-180.000000, Max=180.000000, Default="-0.191084", Value = "-0.191084" +LocationSpeed = Type=float, Min=0.000000, Max=10000.000000, Default="0", Value = "0" +LocationVerticalAccuracy = Type=float, Min=0.000000, Max=100000.000000, Default="100.0", Value = "100.0" +MacOSSimulatorCustomSettings = Type=string, Default="", Value = "" +MacOSSimulatorDevices_ANDROID = Type=string, Allowed="Samsung Galaxy S:480x800:512" "HTC Sensation XL:480x800:768" "Samsung Galaxy Note:800x1280:1024" "Motorola Droid Razr:540x960:1024" "Kindle Fire:1024x600:512" "Samsung Galaxy Tab:1024x600:512", Default="Samsung Galaxy S:480x800:512", Value = "Samsung Galaxy S:480x800:512" +MacOSSimulatorDevices_IPHONE = Type=string, Allowed="iPhone 3GS:320x480:256" "iPhone 4:640x960:512" "iPad 2:768x1024:512", Default="iPhone 3GS:320x480:256", Value = "iPhone 3GS:320x480:256" +MacOSSimulatorPlatforms = Type=string, Allowed="IPHONE" "ANDROID", Default="IPHONE", Value = "IPHONE" +MacOSSimulatorUseCustomSettings = Type=bool, Default="true", Value = "true" +MemoryPoison = Type=bool, Default="true", Value = "true" +MemoryPoisonAlloc = Type=int, Min=0.000000, Max=255.000000, Default="170", Value = "170" +MemoryPoisonFree = Type=int, Min=0.000000, Max=255.000000, Default="221", Value = "221" +MemoryPoisonInit = Type=int, Min=0.000000, Max=255.000000, Default="204", Value = "204" +PointerAvailable = Type=bool, Default="true", Value = "true" +PointerMultiSimulationMode = Type=bool, Default="false", Value = "false" +PointerMultiTouchAvailable = Type=bool, Default="false", Value = "false" +PointerStylusType = Type=string, Allowed="INVALID" "STYLUS" "FINGER", Default="INVALID", Value = "INVALID" +PointerType = Type=string, Allowed="INVALID" "MOUSE" "STYLUS", Default="MOUSE", Value = "MOUSE" +SMSEnabled = Type=bool, Default="true", Value = "true" +SMSReceiveEnabled = Type=bool, Default="true", Value = "true" +SocketDNSDelay = Type=int, Min=0.000000, Max=30000.000000, Default="0", Value = "0" +SocketHTTPProxy = Type=string, Default="", Value = "" +SocketHostName = Type=string, Default="", Value = "" +SocketNetworkAvailable = Type=bool, Default="true", Value = "true" +SocketNetworkLoss = Type=bool, Default="false", Value = "false" +SocketNetworkType = Type=string, Allowed="NONE" "UNKNOWN" "LAN" "WLAN" "GPRS" "UMTS" "EVDO" "CDMA2000" "HSDPA" "WIMAX" "BLUETOOTH" "EDGE" "CDMA" "IDEN" "LTE" "EHRPD" "HSPAPLUS", Default="LAN", Value = "LAN" +SocketRecvLimit = Type=int, Min=0.000000, Max=1000000.000000, Default="0", Value = "0" +SocketSendLimit = Type=int, Min=0.000000, Max=1000000.000000, Default="0", Value = "0" +SoundEnabled = Type=bool, Default="true", Value = "true" +SoundRecordEnabled = Type=bool, Default="true", Value = "true" +SoundSampleRate = Type=int, Allowed="8192" "11025" "16000" "22050" "44100", Default="22050", Value = "22050" +SoundStereo = Type=bool, Default="true", Value = "true" +SoundVolumeDefault = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256" +SurfaceDisableWhenGLIsActive = Type=bool, Default="false", Value = "false" +SurfaceDoubleBuffer = Type=bool, Default="false", Value = "false" +SurfaceHeight = Type=int, Min=128.000000, Max=4096.000000, Default="480", Value = "320" +SurfacePitch = Type=int, Min=0.000000, Max=8192.000000, Default="0", Value = "0" +SurfacePixelType = Type=string, Allowed="RGB444" "RGB555" "RGB565" "RGB666" "RGB888" "BGR444" "BGR555" "BGR565" "BGR666" "BGR888", Default="RGB565", Value = "RGB565" +SurfacePredefinedResolution = Type=string, Allowed="176x200" "176x208" "240x320 (QVGA Portrait)" "240x400" "320x240 (QVGA Landscape)" "320x400" "320x480 (iPhone Portrait)" "400x240" "480x320 (iPhone Landscape)" "360x640 (qHD Portrait)" "640x360 (qHD Landscape)" "480x640 (VGA Portrait)" "480x800 (WVGA Portrait)" "640x480 (VGA Landscape)" "800x400" "800x480 (WVGA Landscape)" "640x960 (iPhone 4 Portrait)" "960x640 (iPhone 4 Landscape)" "1024x600 (Playbook Landscape)" "600x1024 (Playbook Portrait)" "768x1024 (iPad Portrait)" "1024x768 (iPad Landscape)" "2048x1536 (iPad Retina Landscape)" "1536x2048 (iPad Retina Portrait)", Default="320x480 (iPhone Portrait)", Value = "176x200" +SurfaceRotation = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0" +SurfaceUnalign = Type=bool, Default="true", Value = "true" +SurfaceUseMultiBuffers = Type=bool, Default="true", Value = "true" +SurfaceWidth = Type=int, Min=128.000000, Max=4096.000000, Default="320", Value = "480" +SymbianSoundLatency = Type=int, Min=20.000000, Max=1400.000000, Default="120", Value = "120" +ThreadEnabled = Type=bool, Default="true", Value = "true" +TimerAccuracy = Type=int, Min=0.000000, Max=1000.000000, Default="0", Value = "0" +TimerHiRes = Type=bool, Default="false", Value = "false" +TimerLocaltimeOffsetHours = Type=string, Allowed="-12" "-11" "-10" "-9" "-8" "-7" "-6" "-5" "-4" "-3" "-2" "-1" "0" "+1" "+2" "+3" "+4" "+5" "+6" "+7" "+8" "+9" "+10" "+11" "+12" "+13" "SYSTEM", Default="SYSTEM", Value = "SYSTEM" +VibraEnabled = Type=bool, Default="true", Value = "true" +Video3GPP = Type=bool, Default="false", Value = "false" +VideoJPEG = Type=bool, Default="true", Value = "true" +VideoMPEG4 = Type=bool, Default="true", Value = "true" +VideoVolumeDefault = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256" diff --git a/samples/HelloLua/proj.android/AndroidManifest.xml b/samples/HelloLua/proj.android/AndroidManifest.xml index fdd48d278c..37349bfbc1 100644 --- a/samples/HelloLua/proj.android/AndroidManifest.xml +++ b/samples/HelloLua/proj.android/AndroidManifest.xml @@ -7,7 +7,7 @@ + android:icon="@drawable/icon"> setOpenGLView(CCEGLView::sharedOpenGLView()); + pDirector->setProjection(kCCDirectorProjection2D); // Set the design resolution CCEGLView::sharedOpenGLView()->setDesignResolutionSize(320, 480, kResolutionShowAll); @@ -43,7 +44,7 @@ bool AppDelegate::applicationDidFinishLaunching() CCScriptEngineProtocol *pEngine = ScriptingCore::getInstance(); CCScriptEngineManager::sharedManager()->setScriptEngine(pEngine); - ScriptingCore::getInstance()->runScript("MoonWarriors-native.js"); + ScriptingCore::getInstance()->runScript("MoonWarriors-jsb.js"); return true; } diff --git a/samples/MoonWarriors/proj.android/AndroidManifest.xml b/samples/MoonWarriors/proj.android/AndroidManifest.xml index a7e2802621..cdbd044720 100644 --- a/samples/MoonWarriors/proj.android/AndroidManifest.xml +++ b/samples/MoonWarriors/proj.android/AndroidManifest.xml @@ -7,7 +7,6 @@ setString("current language is Spanish"); break; - case kLanguageKorean: + case kLanguageKorean: labelLanguage->setString("current language is Korean"); break; + case kLanguageJapanese: + labelLanguage->setString("current language is Japanese"); + break; + case kLanguageHungarian: + labelLanguage->setString("current language is Hungarian"); + break; } addChild(labelLanguage); diff --git a/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp b/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp index ba808490ef..c4128d42c1 100644 --- a/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp +++ b/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.cpp @@ -5,74 +5,81 @@ enum { kTagAnimationDance = 1, }; -#define MAX_TESTS 13 static int sceneIdx = -1; CCLayer* nextSchedulerTest(); CCLayer* backSchedulerTest(); CCLayer* restartSchedulerTest(); + +TESTLAYER_CREATE_FUNC(SchedulerTimeScale) +TESTLAYER_CREATE_FUNC(TwoSchedulers) +TESTLAYER_CREATE_FUNC(SchedulerAutoremove) +TESTLAYER_CREATE_FUNC(SchedulerPauseResume) +TESTLAYER_CREATE_FUNC(SchedulerPauseResumeAll) +TESTLAYER_CREATE_FUNC(SchedulerPauseResumeAllUser) +TESTLAYER_CREATE_FUNC(SchedulerUnscheduleAll) +TESTLAYER_CREATE_FUNC(SchedulerUnscheduleAllHard) +TESTLAYER_CREATE_FUNC(SchedulerUnscheduleAllUserLevel) +TESTLAYER_CREATE_FUNC(SchedulerSchedulesAndRemove) +TESTLAYER_CREATE_FUNC(SchedulerUpdate) +TESTLAYER_CREATE_FUNC(SchedulerUpdateAndCustom) +TESTLAYER_CREATE_FUNC(SchedulerUpdateFromCustom) +TESTLAYER_CREATE_FUNC(RescheduleSelector) +TESTLAYER_CREATE_FUNC(SchedulerDelayAndRepeat) + +static NEWTESTFUNC createFunctions[] = { + CF(SchedulerTimeScale), + CF(TwoSchedulers), + CF(SchedulerAutoremove), + CF(SchedulerPauseResume), + CF(SchedulerPauseResumeAll), + CF(SchedulerPauseResumeAllUser), + CF(SchedulerUnscheduleAll), + CF(SchedulerUnscheduleAllHard), + CF(SchedulerUnscheduleAllUserLevel), + CF(SchedulerSchedulesAndRemove), + CF(SchedulerUpdate), + CF(SchedulerUpdateAndCustom), + CF(SchedulerUpdateFromCustom), + CF(RescheduleSelector), + CF(SchedulerDelayAndRepeat) +}; -CCLayer* createSchedulerTest(int nIndex) +#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0])) + +CCLayer* nextSchedulerTest() { - CCLayer* pLayer = NULL; + sceneIdx++; + sceneIdx = sceneIdx % MAX_LAYER; - switch (nIndex) - { - case 0: - pLayer = new SchedulerDelayAndRepeat(); break; - case 1: - pLayer = new SchedulerTimeScale(); break; - case 2: - pLayer = new TwoSchedulers(); break; - case 3: - pLayer = new SchedulerAutoremove(); break; - case 4: - pLayer = new SchedulerPauseResume(); break; - case 5: - pLayer = new SchedulerPauseResumeAll(); break; - case 6: - pLayer = new SchedulerUnscheduleAll(); break; - case 7: - pLayer = new SchedulerUnscheduleAllHard(); break; - case 8: - pLayer = new SchedulerUnscheduleAllUserLevel(); break; - case 9: - pLayer = new SchedulerSchedulesAndRemove(); break; - case 10: - pLayer = new SchedulerUpdate(); break; - case 11: - pLayer = new SchedulerUpdateAndCustom(); break; - case 12: - pLayer = new SchedulerUpdateFromCustom(); break; - default: - break; - } + CCLayer* pLayer = (createFunctions[sceneIdx])(); + pLayer->init(); pLayer->autorelease(); return pLayer; } -CCLayer* nextSchedulerTest() -{ - - sceneIdx++; - sceneIdx = sceneIdx % MAX_TESTS; - - return createSchedulerTest(sceneIdx); -} - CCLayer* backSchedulerTest() { sceneIdx--; + int total = MAX_LAYER; if( sceneIdx < 0 ) - sceneIdx += MAX_TESTS; + sceneIdx += total; - return createSchedulerTest(sceneIdx); + CCLayer* pLayer = (createFunctions[sceneIdx])(); + pLayer->init(); + pLayer->autorelease(); + + return pLayer; } CCLayer* restartSchedulerTest() { - return createSchedulerTest(sceneIdx); + CCLayer* pLayer = (createFunctions[sceneIdx])(); + pLayer->init(); + pLayer->autorelease(); + + return pLayer; } //------------------------------------------------------------------ @@ -647,6 +654,11 @@ TestNode::~TestNode() m_pstring->release(); } +void TestNode::update(float dt) +{ + CCLog(m_pstring->getCString()); +} + //------------------------------------------------------------------ // // SchedulerUpdate diff --git a/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.h b/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.h index 74bf338997..ffeb413bd2 100644 --- a/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.h +++ b/samples/TestCpp/Classes/SchedulerTest/SchedulerTest.h @@ -192,6 +192,7 @@ public: ~TestNode(); void initWithString(CCString* pStr, int priority); + virtual void update(float dt); private: CCString* m_pstring; }; diff --git a/samples/TestCpp/Resources/development.icf b/samples/TestCpp/Resources/development.icf new file mode 100644 index 0000000000..c670b09718 --- /dev/null +++ b/samples/TestCpp/Resources/development.icf @@ -0,0 +1,107 @@ +# Settings ICF file automatically generated by S3E development environment + +AccelEnabled = Type=bool, Default="true", Value = "true" +AudioAAC = Type=bool, Default="false", Value = "false" +AudioAACPlus = Type=bool, Default="false", Value = "false" +AudioMIDI = Type=bool, Default="true", Value = "true" +AudioMP3 = Type=bool, Default="true", Value = "true" +AudioPCM = Type=bool, Default="true", Value = "true" +AudioQCP = Type=bool, Default="false", Value = "false" +AudioVolumeDefault = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256" +BacklightTimeout = Type=int, Min=0.000000, Max=120000.000000, Default="10000", Value = "10000" +CompassEnabled = Type=bool, Default="true", Value = "true" +ContactsFromAddrBook = Type=bool, Default="false", Value = "false" +DeviceAdvanceSoftkeyPosition = Type=string, Allowed="Bottom Left" "Bottom Right" "Top Right" "Top Left", Default="Bottom Left", Value = "Bottom Left" +DeviceArch = Type=string, Allowed="" "ARM4T" "ARM4" "ARM5T" "ARM5TE" "ARM5TEJ" "ARM6" "ARM6K" "ARM6T2" "ARM6Z" "X86" "PPC" "AMD64" "ARM7", Default="", Value = "" +DeviceBackSoftkeyPosition = Type=string, Allowed="Bottom Left" "Bottom Right" "Top Right" "Top Left", Default="Bottom Right", Value = "Bottom Right" +DeviceBatteryLevel = Type=int, Min=0.000000, Max=100.000000, Default="50", Value = "50" +DeviceClass = Type=string, Allowed="UNKNOWN" "SYMBIAN_GENERIC" "SYMBIAN_SERIES60" "SYMBIAN_SERIES60_EMULATOR" "SYMBIAN_UIQ" "SYMBIAN_UIQ_EMULATOR" "BREW_GENERIC" "BREW_QCIF_3D" "BREW_QCIF_25G" "BREW_SQCIF_256" "BREW_QVGA_3G" "WINDOWS_GENERIC" "WINMOBILE_GENERIC" "WINMOBILE_SP" "WINMOBILE_PPC" "LINUX_GENERIC" "LINUX_DESKTOP" "LINUX_EMBED" "WIPI_GENERIC" "NDS_GENERIC" "ARM_SEMIH_GENERIC" "NULCUES_GENERIC" "NGI_GENERIC", Default="WINDOWS_GENERIC", Value = "WINDOWS_GENERIC" +DeviceFPU = Type=string, Allowed="None" "VFP Present", Default="VFP Present", Value = "VFP Present" +DeviceFreeRAM = Type=int, Min=0.000000, Max=2097151.000000, Default="1048576", Value = "1048576" +DeviceIDInt = Type=int, Default="0", Value = "0" +DeviceIDString = Type=string, Default="", Value = "" +DeviceIMSI = Type=string, Default="SIMULATOR_IMSI", Value = "SIMULATOR_IMSI" +DeviceLSKIsBack = Type=bool, Default="false", Value = "false" +DeviceLanguage = Type=string, Allowed="UNKNOWN" "ENGLISH" "FRENCH" "GERMAN" "SPANISH" "ITALIAN" "PORTUGUESE" "DUTCH" "TURKISH" "CROATIAN" "CZECH" "DANISH" "FINNISH" "HUNGARIAN" "NORWEGIAN" "POLISH" "RUSSIAN" "SERBIAN" "SLOVAK" "SLOVENIAN" "SWEDISH" "UKRAINIAN" "GREEK" "JAPANESE" "SIMPL_CHINESE" "TRAD_CHINESE" "KOREAN" "ICELANDIC" "FLEMISH" "THAI" "AFRIKAANS" "ALBANIAN" "AMHARIC" "ARABIC" "ARMENIAN" "AZERBAIJANI" "TAGALOG" "BELARUSSIAN" "BENGALI" "BULGARIAN" "BURMESE" "CATALAN" "ESTONIAN" "FARSI" "GAELIC" "GEORGIAN" "GUJARATI" "HEBREW" "HINDI" "INDONESIAN" "IRISH" "KANNADA" "KAZAKH" "KHMER" "LAO" "LATVIAN" "LITHUANIAN" "MACEDONIAN" "MALAY" "MALAYALAM" "MARATHI" "MOLDOVIAN" "MONGOLIAN" "PUNJABI" "ROMANIAN" "SINHALESE" "SOMALI" "SWAHILI" "TAJIK" "TAMIL" "TELUGU" "TIBETAN" "TIGRINYA" "TURKMEN" "URDU" "UZBEK" "VIETNAMESE" "WELSH" "ZULU" "", Default="", Value = "" +DeviceMainsPower = Type=bool, Default="false", Value = "false" +DeviceName = Type=string, Default="My Computer", Value = "My Computer" +DeviceOS = Type=string, Allowed="NONE" "SYMBIAN" "BREW" "WINDOWS" "WINMOBILE" "LINUX" "WIPI" "NDS" "ARM_SEMIH" "NUCLEUS" "NGI" "WINCE" "SHARPEMP" "OSX" "IPHONE" "UIQ" "PS3" "X360" "BADA" "ANDROID" "WEBOS" "QNX", Default="NONE", Value = "NONE" +DeviceOSVersion = Type=string, Default="", Value = "" +DeviceOSVersionNumber = Type=int, Default="0", Value = "0" +DevicePhoneNumber = Type=string, Default="0044123456789", Value = "0044123456789" +DeviceTimezone = Type=string, Default="SYSTEM", Value = "SYSTEM" +DeviceTotalRAM = Type=int, Min=0.000000, Max=2097151.000000, Default="1048576", Value = "1048576" +DeviceUniqueID = Type=string, Default="SIMULATOR_ID", Value = "SIMULATOR_ID" +DeviceUniqueIDInt = Type=int, Default="01234567890", Value = "01234567890" +FileTotalStorageSize = Type=int, Min=0.000000, Max=2147483648.000000, Default="67108864", Value = "67108864" +FileUseSeparateRomRam = Type=bool, Default="true", Value = "true" +FileUseTotalStorageSize = Type=bool, Default="false", Value = "false" +GLAPI = Type=string, Allowed="None" "GLES 1.0 Common-Lite Profile from Imagination POWERVR(TM)" "GLES 1.1 Common-Lite Profile from Imagination POWERVR(TM)" "GLES 1.0 Common Profile from Imagination POWERVR(TM)" "GLES 1.1 Common Profile from Imagination POWERVR(TM)" "GLES 2.0 from Imagination POWERVR(TM)" "Obey [S3E] SysGlesVersion .icf setting" "GLES 1.1 Common Profile from Qualcomm Snapdragon(TM)" "GLES 2.0 from Qualcomm Snapdragon(TM)" "GLES 2.0 ANGLE", Default="Obey [S3E] SysGlesVersion .icf setting", Value = "Obey [S3E] SysGlesVersion .icf setting" +GLDontUseHiddenWindow = Type=bool, Default="false", Value = "false" +GLTerminateOnSuspend = Type=bool, Default="false", Value = "false" +GLUsePVRVFrame = Type=bool, Default="false", Value = "false" +KeyboardHasAlpha = Type=bool, Default="true", Value = "true" +KeyboardHasDirection = Type=bool, Default="true", Value = "true" +KeyboardHasKeypad = Type=bool, Default="true", Value = "true" +KeyboardNumpadRotation = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0" +LicenseExpiryDate = Type=int, Min=0.000000, Max=999999995904.000000, Default="0", Value = "0" +LicenseMinutesRemaining = Type=int, Min=0.000000, Max=10000000.000000, Default="0", Value = "0" +LicenseStatus = Type=string, Allowed="EXPIRED" "DEMO" "USECOUNT" "EXPIRYDATE" "EXPIRYMINSUSE" "PURCHASE" "SUBSCRIPTION" "UPGRADE" "NONCOMMERCIAL", Default="NONCOMMERCIAL", Value = "NONCOMMERCIAL" +LicenseUsesRemaining = Type=int, Min=0.000000, Max=10000000.000000, Default="0", Value = "0" +LocationAltitude = Type=float, Min=-2000.000000, Max=100000.000000, Default="60.0", Value = "60.0" +LocationAvailable = Type=bool, Default="true", Value = "true" +LocationHeading = Type=float, Min=0.000000, Max=359.000000, Default="0.0", Value = "0.0" +LocationHorizontalAccuracy = Type=float, Min=0.000000, Max=100000.000000, Default="20.0", Value = "20.0" +LocationLatitude = Type=float, Min=-90.000000, Max=90.000000, Default="51.511791", Value = "51.511791" +LocationLongitude = Type=float, Min=-180.000000, Max=180.000000, Default="-0.191084", Value = "-0.191084" +LocationSpeed = Type=float, Min=0.000000, Max=10000.000000, Default="0", Value = "0" +LocationVerticalAccuracy = Type=float, Min=0.000000, Max=100000.000000, Default="100.0", Value = "100.0" +MacOSSimulatorCustomSettings = Type=string, Default="", Value = "" +MacOSSimulatorDevices_ANDROID = Type=string, Allowed="Samsung Galaxy S:480x800:512" "HTC Sensation XL:480x800:768" "Samsung Galaxy Note:800x1280:1024" "Motorola Droid Razr:540x960:1024" "Kindle Fire:1024x600:512" "Samsung Galaxy Tab:1024x600:512", Default="Samsung Galaxy S:480x800:512", Value = "Samsung Galaxy S:480x800:512" +MacOSSimulatorDevices_IPHONE = Type=string, Allowed="iPhone 3GS:320x480:256" "iPhone 4:640x960:512" "iPad 2:768x1024:512", Default="iPhone 3GS:320x480:256", Value = "iPhone 3GS:320x480:256" +MacOSSimulatorPlatforms = Type=string, Allowed="IPHONE" "ANDROID", Default="IPHONE", Value = "IPHONE" +MacOSSimulatorUseCustomSettings = Type=bool, Default="true", Value = "true" +MemoryPoison = Type=bool, Default="true", Value = "true" +MemoryPoisonAlloc = Type=int, Min=0.000000, Max=255.000000, Default="170", Value = "170" +MemoryPoisonFree = Type=int, Min=0.000000, Max=255.000000, Default="221", Value = "221" +MemoryPoisonInit = Type=int, Min=0.000000, Max=255.000000, Default="204", Value = "204" +PointerAvailable = Type=bool, Default="true", Value = "true" +PointerMultiSimulationMode = Type=bool, Default="false", Value = "false" +PointerMultiTouchAvailable = Type=bool, Default="false", Value = "false" +PointerStylusType = Type=string, Allowed="INVALID" "STYLUS" "FINGER", Default="INVALID", Value = "INVALID" +PointerType = Type=string, Allowed="INVALID" "MOUSE" "STYLUS", Default="MOUSE", Value = "MOUSE" +SMSEnabled = Type=bool, Default="true", Value = "true" +SMSReceiveEnabled = Type=bool, Default="true", Value = "true" +SocketDNSDelay = Type=int, Min=0.000000, Max=30000.000000, Default="0", Value = "0" +SocketHTTPProxy = Type=string, Default="", Value = "" +SocketHostName = Type=string, Default="", Value = "" +SocketNetworkAvailable = Type=bool, Default="true", Value = "true" +SocketNetworkLoss = Type=bool, Default="false", Value = "false" +SocketNetworkType = Type=string, Allowed="NONE" "UNKNOWN" "LAN" "WLAN" "GPRS" "UMTS" "EVDO" "CDMA2000" "HSDPA" "WIMAX" "BLUETOOTH" "EDGE" "CDMA" "IDEN" "LTE" "EHRPD" "HSPAPLUS", Default="LAN", Value = "LAN" +SocketRecvLimit = Type=int, Min=0.000000, Max=1000000.000000, Default="0", Value = "0" +SocketSendLimit = Type=int, Min=0.000000, Max=1000000.000000, Default="0", Value = "0" +SoundEnabled = Type=bool, Default="true", Value = "true" +SoundRecordEnabled = Type=bool, Default="true", Value = "true" +SoundSampleRate = Type=int, Allowed="8192" "11025" "16000" "22050" "44100", Default="22050", Value = "22050" +SoundStereo = Type=bool, Default="true", Value = "true" +SoundVolumeDefault = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256" +SurfaceDisableWhenGLIsActive = Type=bool, Default="false", Value = "false" +SurfaceDoubleBuffer = Type=bool, Default="false", Value = "false" +SurfaceHeight = Type=int, Min=128.000000, Max=4096.000000, Default="480", Value = "320" +SurfacePitch = Type=int, Min=0.000000, Max=8192.000000, Default="0", Value = "0" +SurfacePixelType = Type=string, Allowed="RGB444" "RGB555" "RGB565" "RGB666" "RGB888" "BGR444" "BGR555" "BGR565" "BGR666" "BGR888", Default="RGB565", Value = "RGB565" +SurfacePredefinedResolution = Type=string, Allowed="176x200" "176x208" "240x320 (QVGA Portrait)" "240x400" "320x240 (QVGA Landscape)" "320x400" "320x480 (iPhone Portrait)" "400x240" "480x320 (iPhone Landscape)" "360x640 (qHD Portrait)" "640x360 (qHD Landscape)" "480x640 (VGA Portrait)" "480x800 (WVGA Portrait)" "640x480 (VGA Landscape)" "800x400" "800x480 (WVGA Landscape)" "640x960 (iPhone 4 Portrait)" "960x640 (iPhone 4 Landscape)" "1024x600 (Playbook Landscape)" "600x1024 (Playbook Portrait)" "768x1024 (iPad Portrait)" "1024x768 (iPad Landscape)" "2048x1536 (iPad Retina Landscape)" "1536x2048 (iPad Retina Portrait)", Default="320x480 (iPhone Portrait)", Value = "176x200" +SurfaceRotation = Type=string, Allowed="Rot0" "Rot90" "Rot180" "Rot270", Default="Rot0", Value = "Rot0" +SurfaceUnalign = Type=bool, Default="true", Value = "true" +SurfaceUseMultiBuffers = Type=bool, Default="true", Value = "true" +SurfaceWidth = Type=int, Min=128.000000, Max=4096.000000, Default="320", Value = "480" +SymbianSoundLatency = Type=int, Min=20.000000, Max=1400.000000, Default="120", Value = "120" +ThreadEnabled = Type=bool, Default="true", Value = "true" +TimerAccuracy = Type=int, Min=0.000000, Max=1000.000000, Default="0", Value = "0" +TimerHiRes = Type=bool, Default="false", Value = "false" +TimerLocaltimeOffsetHours = Type=string, Allowed="-12" "-11" "-10" "-9" "-8" "-7" "-6" "-5" "-4" "-3" "-2" "-1" "0" "+1" "+2" "+3" "+4" "+5" "+6" "+7" "+8" "+9" "+10" "+11" "+12" "+13" "SYSTEM", Default="SYSTEM", Value = "SYSTEM" +VibraEnabled = Type=bool, Default="true", Value = "true" +Video3GPP = Type=bool, Default="false", Value = "false" +VideoJPEG = Type=bool, Default="true", Value = "true" +VideoMPEG4 = Type=bool, Default="true", Value = "true" +VideoVolumeDefault = Type=int, Min=0.000000, Max=256.000000, Default="256", Value = "256" diff --git a/samples/TestCpp/proj.android/AndroidManifest.xml b/samples/TestCpp/proj.android/AndroidManifest.xml index 023998ea8b..11ae6c591d 100644 --- a/samples/TestCpp/proj.android/AndroidManifest.xml +++ b/samples/TestCpp/proj.android/AndroidManifest.xml @@ -7,7 +7,6 @@ @@ -66,6 +67,7 @@ + diff --git a/samples/TestCpp/proj.linux/Makefile b/samples/TestCpp/proj.linux/Makefile index 502bf4630d..4e09433cef 100644 --- a/samples/TestCpp/proj.linux/Makefile +++ b/samples/TestCpp/proj.linux/Makefile @@ -172,7 +172,7 @@ BIN_DIR = BIN_DIR_ROOT debug: SHAREDLIBS += -L../../../lib/linux/Debug -lcocos2d -lrt -lz -lcocosdenshion -Wl,-rpath,../../../../../lib/linux/Debug debug: CCFLAGS += -g3 -O0 debug: CXXFLAGS += -g3 -O0 -debug: DEFINES += -DDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION +debug: DEFINES += -DDEBUG -DCC_ENABLE_CHIPMUNK_INTEGRATION -DCOCOS2D_DEBUG=1 debug: BIN_DIR = $(BIN_DIR_ROOT)/debug debug: $(TARGET) diff --git a/samples/TestJavascript/Classes/AppDelegate.cpp b/samples/TestJavascript/Classes/AppDelegate.cpp index a1705a3220..8edaedb08f 100644 --- a/samples/TestJavascript/Classes/AppDelegate.cpp +++ b/samples/TestJavascript/Classes/AppDelegate.cpp @@ -40,7 +40,7 @@ bool AppDelegate::applicationDidFinishLaunching() CCScriptEngineProtocol *pEngine = ScriptingCore::getInstance(); CCScriptEngineManager::sharedManager()->setScriptEngine(pEngine); - ScriptingCore::getInstance()->runScript("tests/tests-boot-jsb.js"); + ScriptingCore::getInstance()->runScript("tests-boot-jsb.js"); return true; } diff --git a/samples/TestJavascript/cocos2d-js-tests b/samples/TestJavascript/cocos2d-js-tests index 9d41fd26d5..2e932705a1 160000 --- a/samples/TestJavascript/cocos2d-js-tests +++ b/samples/TestJavascript/cocos2d-js-tests @@ -1 +1 @@ -Subproject commit 9d41fd26d5302e53c5bdcf4d574cc974768c8da8 +Subproject commit 2e932705a10756255a226e5faa18891a8ec9d0d0 diff --git a/samples/TestJavascript/proj.android/AndroidManifest.xml b/samples/TestJavascript/proj.android/AndroidManifest.xml index 156094ab60..9468751cc3 100644 --- a/samples/TestJavascript/proj.android/AndroidManifest.xml +++ b/samples/TestJavascript/proj.android/AndroidManifest.xml @@ -7,7 +7,6 @@ +xcopy "$(ProjectDir)..\cocos2d-js-tests\tests" "$(OutDir)\TestJavascriptRes\" /e /Y Copy js and resource files. @@ -149,7 +149,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\lib\* if exist "$(OutDir)\TestJavascriptRes" rd /s /q "$(OutDir)\TestJavascriptRes" mkdir "$(OutDir)\TestJavascriptRes" xcopy "$(ProjectDir)..\..\..\scripting\javascript\bindings\js\*.js" "$(OutDir)\TestJavascriptRes\" /e /Y -xcopy "$(ProjectDir)..\cocos2d-js-tests\tests" "$(OutDir)\TestJavascriptRes\tests\" /e /Y +xcopy "$(ProjectDir)..\cocos2d-js-tests\tests" "$(OutDir)\TestJavascriptRes\" /e /Y Copy js and resource files. diff --git a/samples/TestLua/proj.android/AndroidManifest.xml b/samples/TestLua/proj.android/AndroidManifest.xml index 028f47272f..87b4cb8918 100644 --- a/samples/TestLua/proj.android/AndroidManifest.xml +++ b/samples/TestLua/proj.android/AndroidManifest.xml @@ -7,7 +7,7 @@ + android:icon="@drawable/icon"> Run(); +} diff --git a/samples/TestLua/proj.marmalade/src/Main.h b/samples/TestLua/proj.marmalade/src/Main.h new file mode 100644 index 0000000000..ebfa484e72 --- /dev/null +++ b/samples/TestLua/proj.marmalade/src/Main.h @@ -0,0 +1,4 @@ +#ifndef MAIN_H +#define MAIN_H + +#endif diff --git a/samples/WatermelonWithMe/proj.android/AndroidManifest.xml b/samples/WatermelonWithMe/proj.android/AndroidManifest.xml index c0b7bddac1..6a708d3036 100644 --- a/samples/WatermelonWithMe/proj.android/AndroidManifest.xml +++ b/samples/WatermelonWithMe/proj.android/AndroidManifest.xml @@ -7,8 +7,7 @@ + android:icon="@drawable/icon"> if not exist "$(OutDir)" mkdir "$(OutDir)" if exist "$(OutDir)\WatermelonWithMeRes" rd /s /q "$(OutDir)\WatermelonWithMeRes" mkdir "$(OutDir)\WatermelonWithMeRes" -xcopy "$(ProjectDir)..\..\TestJavascript\cocos2d-js-tests\games\WatermelonWithMe" "$(OutDir)\WatermelonWithMeRes" /e /Y -xcopy "$(ProjectDir)..\..\..\scripting\javascript\bindings\js\*.js" "$(OutDir)\WatermelonWithMeRes" /e /Y - +xcopy "$(ProjectDir)..\..\TestJavascript\cocos2d-js-tests\games\WatermelonWithMe" "$(OutDir)\WatermelonWithMeRes\" /e /Y +xcopy "$(ProjectDir)..\..\..\scripting\javascript\bindings\js\*.js" "$(OutDir)\WatermelonWithMeRes" /e /Y Copy js and resource files. @@ -149,12 +148,8 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\lib\* if not exist "$(OutDir)" mkdir "$(OutDir)" if exist "$(OutDir)\WatermelonWithMeRes" rd /s /q "$(OutDir)\WatermelonWithMeRes" mkdir "$(OutDir)\WatermelonWithMeRes" -copy "$(ProjectDir)..\Resources\*.*" "$(OutDir)\WatermelonWithMeRes\" /Y -copy "$(ProjectDir)..\Resources\CCB\*.*" "$(OutDir)\WatermelonWithMeRes\" /Y -copy "$(ProjectDir)..\Resources\single_files\*.*" "$(OutDir)\WatermelonWithMeRes\" /Y -xcopy "$(ProjectDir)..\bindings\*.js" "$(OutDir)\WatermelonWithMeRes" /e /Y -copy "$(ProjectDir)..\*.js" "$(OutDir)\WatermelonWithMeRes\" /Y - +xcopy "$(ProjectDir)..\..\TestJavascript\cocos2d-js-tests\games\WatermelonWithMe" "$(OutDir)\WatermelonWithMeRes\" /e /Y +xcopy "$(ProjectDir)..\..\..\scripting\javascript\bindings\js\*.js" "$(OutDir)\WatermelonWithMeRes" /e /Y Copy js and resource files. diff --git a/scripting/javascript/bindings/ScriptingCore.cpp b/scripting/javascript/bindings/ScriptingCore.cpp index 68621e4ae1..dd30b55ef5 100644 --- a/scripting/javascript/bindings/ScriptingCore.cpp +++ b/scripting/javascript/bindings/ScriptingCore.cpp @@ -393,7 +393,6 @@ void ScriptingCore::removeAllRoots(JSContext *cx) { } HASH_CLEAR(hh, _js_native_global_ht); HASH_CLEAR(hh, _native_js_global_ht); - HASH_CLEAR(hh, _js_global_type_ht); } void ScriptingCore::createGlobalContext() { @@ -413,7 +412,7 @@ void ScriptingCore::createGlobalContext() { JS_SetOptions(this->cx_, JS_GetOptions(this->cx_) & ~JSOPTION_METHODJIT_ALWAYS); JS_SetErrorReporter(this->cx_, ScriptingCore::reportError); #if defined(JS_GC_ZEAL) && defined(DEBUG) - JS_SetGCZeal(this->cx_, 2, JS_DEFAULT_ZEAL_FREQ); + //JS_SetGCZeal(this->cx_, 2, JS_DEFAULT_ZEAL_FREQ); #endif this->global_ = NewGlobalObject(cx_); for (std::vector::iterator it = registrationList.begin(); it != registrationList.end(); it++) { @@ -476,6 +475,15 @@ ScriptingCore::~ScriptingCore() free(_js_log_buf); _js_log_buf = NULL; } + + js_type_class_t* current, *tmp; + HASH_ITER(hh, _js_global_type_ht, current, tmp) + { + HASH_DEL(_js_global_type_ht, current); + free(current->jsclass); + free(current); + } + HASH_CLEAR(hh, _js_global_type_ht); } void ScriptingCore::reportError(JSContext *cx, const char *message, JSErrorReport *report) @@ -801,6 +809,11 @@ int ScriptingCore::executeAccelerometerEvent(CCLayer *pLayer, CCAcceleration *pA return 1; } +int ScriptingCore::executeLayerKeypadEvent(CCLayer* pLayer, int eventType) +{ + return 0; +} + int ScriptingCore::executeCustomTouchesEvent(int eventType, CCSet *pTouches, JSObject *obj) @@ -917,39 +930,39 @@ CCAcceleration jsval_to_ccacceleration(JSContext *cx, jsval v) { return ret; } -CCArray* jsvals_variadic_to_ccarray( JSContext *cx, jsval *vp, int argc) -{ - JSBool ok = JS_FALSE; - CCArray* pArray = CCArray::create(); - for( int i=0; i < argc; i++ ) - { - double num = 0.0; - // optimization: JS_ValueToNumber is expensive. And can convert an string like "12" to a number - if( JSVAL_IS_NUMBER(*vp)) { - ok = JS_ValueToNumber(cx, *vp, &num ); - if (!ok) { - break; - } - pArray->addObject(CCInteger::create((int)num)); - } +CCArray* jsvals_variadic_to_ccarray( JSContext *cx, jsval *vp, int argc) +{ + JSBool ok = JS_FALSE; + CCArray* pArray = CCArray::create(); + for( int i=0; i < argc; i++ ) + { + double num = 0.0; + // optimization: JS_ValueToNumber is expensive. And can convert an string like "12" to a number + if( JSVAL_IS_NUMBER(*vp)) { + ok = JS_ValueToNumber(cx, *vp, &num ); + if (!ok) { + break; + } + pArray->addObject(CCInteger::create((int)num)); + } else if (JSVAL_IS_STRING(*vp)) { JSStringWrapper str(JSVAL_TO_STRING(*vp), cx); pArray->addObject(CCString::create(str)); - } - else - { - js_proxy_t* p; - JSObject* obj = JSVAL_TO_OBJECT(*vp); - JS_GET_NATIVE_PROXY(p, obj); - if (p) { - pArray->addObject((CCObject*)p->ptr); - } - } - // next - vp++; - } - return pArray; + } + else + { + js_proxy_t* p; + JSObject* obj = JSVAL_TO_OBJECT(*vp); + JS_GET_NATIVE_PROXY(p, obj); + if (p) { + pArray->addObject((CCObject*)p->ptr); + } + } + // next + vp++; + } + return pArray; } CCRect jsval_to_ccrect(JSContext *cx, jsval v) { @@ -1490,26 +1503,26 @@ JSBool jsSocketClose(JSContext* cx, unsigned argc, jsval* vp) return JS_TRUE; } -JSBool jsb_set_reserved_slot(JSObject *obj, uint32_t idx, jsval value) -{ - JSClass *klass = JS_GetClass(obj); - unsigned int slots = JSCLASS_RESERVED_SLOTS(klass); - if( idx >= slots ) - return JS_FALSE; - - JS_SetReservedSlot(obj, idx, value); - - return JS_TRUE; +JSBool jsb_set_reserved_slot(JSObject *obj, uint32_t idx, jsval value) +{ + JSClass *klass = JS_GetClass(obj); + unsigned int slots = JSCLASS_RESERVED_SLOTS(klass); + if( idx >= slots ) + return JS_FALSE; + + JS_SetReservedSlot(obj, idx, value); + + return JS_TRUE; } -JSBool jsb_get_reserved_slot(JSObject *obj, uint32_t idx, jsval& ret) -{ - JSClass *klass = JS_GetClass(obj); - unsigned int slots = JSCLASS_RESERVED_SLOTS(klass); - if( idx >= slots ) - return JS_FALSE; - - ret = JS_GetReservedSlot(obj, idx); - - return JS_TRUE; +JSBool jsb_get_reserved_slot(JSObject *obj, uint32_t idx, jsval& ret) +{ + JSClass *klass = JS_GetClass(obj); + unsigned int slots = JSCLASS_RESERVED_SLOTS(klass); + if( idx >= slots ) + return JS_FALSE; + + ret = JS_GetReservedSlot(obj, idx); + + return JS_TRUE; } diff --git a/scripting/javascript/bindings/ScriptingCore.h b/scripting/javascript/bindings/ScriptingCore.h index ed801d38cf..d7304a623e 100644 --- a/scripting/javascript/bindings/ScriptingCore.h +++ b/scripting/javascript/bindings/ScriptingCore.h @@ -84,6 +84,7 @@ public: 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); + virtual int executeLayerKeypadEvent(CCLayer* pLayer, int eventType); bool executeFunctionWithObjectData(CCNode *self, const char *name, JSObject *obj); int executeFunctionWithOwner(jsval owner, const char *name, jsval data); diff --git a/scripting/javascript/bindings/cocos2d_specifics.cpp b/scripting/javascript/bindings/cocos2d_specifics.cpp index ea63f6477a..ac035a6ca2 100644 --- a/scripting/javascript/bindings/cocos2d_specifics.cpp +++ b/scripting/javascript/bindings/cocos2d_specifics.cpp @@ -645,6 +645,21 @@ void JSCallbackWrapper::setJSExtraData(jsval data) { extraData = data; } +const jsval& JSCallbackWrapper::getJSCallbackFunc() const +{ + return jsCallback; +} + +const jsval& JSCallbackWrapper::getJSCallbackThis() const +{ + return jsThisObj; +} + +const jsval& JSCallbackWrapper::getJSExtraData() const +{ + return extraData; +} + void JSCallFuncWrapper::setTargetForNativeNode(CCNode *pNode, JSCallFuncWrapper *target) { callfuncTarget_proxy_t *t; HASH_FIND_PTR(_callfuncTarget_native_ht, &pNode, t); @@ -804,7 +819,7 @@ CCArray * JSScheduleWrapper::getTargetForNativeNode(CCNode *pNode) void JSScheduleWrapper::removeAllTargetsForNatiaveNode(CCNode* pNode) { - CCLOG("removeAllTargetsForNatiaveNode before"); + CCLOGINFO("removeAllTargetsForNatiaveNode begin"); dump(); CCArray* removeNativeTargets = NULL; schedTarget_proxy_t *t = NULL; @@ -839,6 +854,7 @@ void JSScheduleWrapper::removeAllTargetsForNatiaveNode(CCNode* pNode) if (targets->count() == 0) { HASH_DEL(_schedFunc_target_ht, current); + targets->release(); free(current); } } @@ -847,19 +863,20 @@ void JSScheduleWrapper::removeAllTargetsForNatiaveNode(CCNode* pNode) removeNativeTargets->release(); free(t); dump(); - CCLOG("removeAllTargetsForNatiaveNode end"); + CCLOGINFO("removeAllTargetsForNatiaveNode end"); } void JSScheduleWrapper::dump() { - CCLOG("\n---------JSScheduleWrapper begin--------------\n"); +#if COCOS2D_DEBUG > 1 + CCLOGINFO("\n---------JSScheduleWrapper dump begin--------------\n"); schedTarget_proxy_t *current, *tmp; int nativeTargetsCount = 0; HASH_ITER(hh, _schedTarget_native_ht, current, tmp) { CCObject* pObj = NULL; CCARRAY_FOREACH(current->targets, pObj) { - CCLOG("native %s ( %p ), target[%d]=( %p )", typeid(*current->nativeObj).name(), current->nativeObj, nativeTargetsCount, pObj); + CCLOGINFO("native %s ( %p ), target[%d]=( %p )", typeid(*current->nativeObj).name(), current->nativeObj, nativeTargetsCount, pObj); nativeTargetsCount++; } } @@ -872,12 +889,13 @@ void JSScheduleWrapper::dump() CCObject* pObj = NULL; CCARRAY_FOREACH(current_func->targets, pObj) { - CCLOG("jsfunc ( %p ), target[%d]=( %p )", current_func->jsfuncObj, jsfuncTargetCount, pObj); + CCLOGINFO("jsfunc ( %p ), target[%d]=( %p )", current_func->jsfuncObj, jsfuncTargetCount, pObj); jsfuncTargetCount++; } } CCAssert(nativeTargetsCount == jsfuncTargetCount, ""); - CCLOG("\n---------JSScheduleWrapper end--------------\n"); + CCLOGINFO("\n---------JSScheduleWrapper dump end--------------\n"); +#endif } void JSScheduleWrapper::scheduleFunc(float dt) const @@ -948,18 +966,24 @@ JSBool js_cocos2dx_CCNode_unscheduleAllSelectors(JSContext *cx, uint32_t argc, j cocos2d::CCNode* cobj = (cocos2d::CCNode *)(proxy ? proxy->ptr : NULL); TEST_NATIVE_OBJECT(cx, cobj) - cobj->unscheduleAllSelectors(); + if (argc == 0) + { + cobj->unscheduleAllSelectors(); - CCArray *arr = JSScheduleWrapper::getTargetForNativeNode(cobj); - if(! arr) return JS_FALSE; - for(unsigned int i = 0; i < arr->count(); ++i) { - if(arr->objectAtIndex(i)) { - cobj->getScheduler()->unscheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), arr->objectAtIndex(i)); + CCArray *arr = JSScheduleWrapper::getTargetForNativeNode(cobj); + // If there aren't any targets, just return true. + // Otherwise, the for loop will break immediately. + // It will lead to logic errors. + // For details to reproduce it, please refer to SchedulerTest/SchedulerUpdate. + if(! arr) return JS_TRUE; + for(unsigned int i = 0; i < arr->count(); ++i) { + if(arr->objectAtIndex(i)) { + cobj->getScheduler()->unscheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), arr->objectAtIndex(i)); + } } - } - - return JS_TRUE; + return JS_TRUE; + } JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 0); return JS_FALSE; } @@ -983,8 +1007,14 @@ JSBool js_cocos2dx_CCScheduler_unscheduleAllSelectorsForTarget(JSContext *cx, ui JS_GET_NATIVE_PROXY(proxy, tmpObj); arg0 = (cocos2d::CCNode*)(proxy ? proxy->ptr : NULL); TEST_NATIVE_OBJECT(cx, arg0) + cobj->unscheduleAllForTarget(arg0); + CCArray *arr = JSScheduleWrapper::getTargetForNativeNode(arg0); - if(! arr) return JS_FALSE; + // If there aren't any targets, just return true. + // Otherwise, the for loop will break immediately. + // It will lead to logic errors. + // For details to reproduce it, please refer to SchedulerTest/SchedulerUpdate. + if(! arr) return JS_TRUE; for(unsigned int i = 0; i < arr->count(); ++i) { if(arr->objectAtIndex(i)) { arg0->getScheduler()->unscheduleAllForTarget(arr->objectAtIndex(i)); @@ -993,7 +1023,7 @@ JSBool js_cocos2dx_CCScheduler_unscheduleAllSelectorsForTarget(JSContext *cx, ui } while (0); - cobj->unscheduleAllForTarget(arg0); + return JS_TRUE; } JS_ReportError(cx, "wrong number of arguments: %d, was expecting %d", argc, 1); @@ -1003,7 +1033,6 @@ JSBool js_cocos2dx_CCScheduler_unscheduleAllSelectorsForTarget(JSContext *cx, ui JSBool js_CCNode_scheduleOnce(JSContext *cx, uint32_t argc, jsval *vp) { - if (argc >= 1) { jsval *argv = JS_ARGV(cx, vp); @@ -1014,8 +1043,7 @@ JSBool js_CCNode_scheduleOnce(JSContext *cx, uint32_t argc, jsval *vp) CCScheduler *sched = node->getScheduler(); - JSScheduleWrapper *tmpCobj = new JSScheduleWrapper(); - tmpCobj->autorelease(); + JSScheduleWrapper *tmpCobj = NULL; // // delay @@ -1026,12 +1054,31 @@ JSBool js_CCNode_scheduleOnce(JSContext *cx, uint32_t argc, jsval *vp) return JS_FALSE; } - tmpCobj->setJSCallbackThis(OBJECT_TO_JSVAL(obj)); - tmpCobj->setJSCallbackFunc(argv[0]); - tmpCobj->setTarget(node); - - JSScheduleWrapper::setTargetForSchedule(argv[0], tmpCobj); - JSScheduleWrapper::setTargetForNativeNode(node, tmpCobj); + bool bFound = false; + CCArray* pTargetArr = JSScheduleWrapper::getTargetForNativeNode(node); + CCObject* pObj = NULL; + CCARRAY_FOREACH(pTargetArr, pObj) + { + JSScheduleWrapper* pTarget = (JSScheduleWrapper*)pObj; + if (argv[0] == pTarget->getJSCallbackFunc()) + { + tmpCobj = pTarget; + bFound = true; + break; + } + } + + if (!bFound) + { + tmpCobj = new JSScheduleWrapper(); + tmpCobj->autorelease(); + tmpCobj->setJSCallbackThis(OBJECT_TO_JSVAL(obj)); + tmpCobj->setJSCallbackFunc(argv[0]); + tmpCobj->setTarget(node); + + JSScheduleWrapper::setTargetForSchedule(argv[0], tmpCobj); + JSScheduleWrapper::setTargetForNativeNode(node, tmpCobj); + } if(argc == 1) { sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCobj, 0, 0, 0.0f, !node->isRunning()); @@ -1057,12 +1104,11 @@ JSBool js_CCNode_schedule(JSContext *cx, uint32_t argc, jsval *vp) js_proxy_t *proxy; JS_GET_NATIVE_PROXY(proxy, obj); cocos2d::CCNode *node = (cocos2d::CCNode *)(proxy ? proxy->ptr : NULL); - CCScheduler *sched = node->getScheduler(); + js_proxy_t *p = js_get_or_create_proxy(cx, sched); - JSScheduleWrapper *tmpCobj = new JSScheduleWrapper(); - tmpCobj->autorelease(); + JSScheduleWrapper *tmpCobj = NULL; double interval = 0.0; if( argc >= 2 ) { @@ -1088,12 +1134,30 @@ JSBool js_CCNode_schedule(JSContext *cx, uint32_t argc, jsval *vp) return JS_FALSE; } - tmpCobj->setJSCallbackThis(OBJECT_TO_JSVAL(obj)); - tmpCobj->setJSCallbackFunc(argv[0]); - tmpCobj->setTarget(node); + bool bFound = false; + CCArray* pTargetArr = JSScheduleWrapper::getTargetForNativeNode(node); + CCObject* pObj = NULL; + CCARRAY_FOREACH(pTargetArr, pObj) + { + JSScheduleWrapper* pTarget = (JSScheduleWrapper*)pObj; + if (argv[0] == pTarget->getJSCallbackFunc()) + { + tmpCobj = pTarget; + bFound = true; + break; + } + } - JSScheduleWrapper::setTargetForSchedule(argv[0], tmpCobj); - JSScheduleWrapper::setTargetForNativeNode(node, tmpCobj); + if (!bFound) + { + tmpCobj = new JSScheduleWrapper(); + tmpCobj->autorelease(); + tmpCobj->setJSCallbackThis(OBJECT_TO_JSVAL(obj)); + tmpCobj->setJSCallbackFunc(argv[0]); + tmpCobj->setTarget(node); + JSScheduleWrapper::setTargetForSchedule(argv[0], tmpCobj); + JSScheduleWrapper::setTargetForNativeNode(node, tmpCobj); + } if(argc == 1) { sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCobj, 0, !node->isRunning()); @@ -1124,8 +1188,7 @@ JSBool js_CCScheduler_schedule(JSContext *cx, uint32_t argc, jsval *vp) JS_GET_NATIVE_PROXY(proxy, obj); cocos2d::CCScheduler *sched = (cocos2d::CCScheduler *)(proxy ? proxy->ptr : NULL); - JSScheduleWrapper *tmpCobj = new JSScheduleWrapper(); - tmpCobj->autorelease(); + JSScheduleWrapper *tmpCobj = NULL; cocos2d::CCNode* node; JSObject *tmpObj = JSVAL_TO_OBJECT(argv[0]); @@ -1164,13 +1227,32 @@ JSBool js_CCScheduler_schedule(JSContext *cx, uint32_t argc, jsval *vp) return JS_FALSE; } - tmpCobj->setJSCallbackThis(OBJECT_TO_JSVAL(proxy->obj)); - tmpCobj->setJSCallbackFunc(argv[1]); + bool bFound = false; + CCArray* pTargetArr = JSScheduleWrapper::getTargetForNativeNode(node); + CCObject* pObj = NULL; + CCARRAY_FOREACH(pTargetArr, pObj) + { + JSScheduleWrapper* pTarget = (JSScheduleWrapper*)pObj; + if (argv[1] == pTarget->getJSCallbackFunc()) + { + tmpCobj = pTarget; + bFound = true; + break; + } + } + + if (!bFound) + { + tmpCobj = new JSScheduleWrapper(); + tmpCobj->autorelease(); + tmpCobj->setJSCallbackThis(OBJECT_TO_JSVAL(proxy->obj)); + tmpCobj->setJSCallbackFunc(argv[1]); + + JSScheduleWrapper::setTargetForSchedule(argv[1], tmpCobj); + JSScheduleWrapper::setTargetForNativeNode(node, tmpCobj); + } - JSScheduleWrapper::setTargetForSchedule(argv[1], tmpCobj); - JSScheduleWrapper::setTargetForNativeNode(node, tmpCobj); - - sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCobj, interval, paused, repeat, delay); + sched->scheduleSelector(schedule_selector(JSScheduleWrapper::scheduleFunc), tmpCobj, interval, repeat, delay, paused); JS_SET_RVAL(cx, vp, JSVAL_VOID); } @@ -1192,7 +1274,7 @@ JSBool js_cocos2dx_CCScheduler_pauseTarget(JSContext *cx, uint32_t argc, jsval * arg0 = (cocos2d::CCNode*)(proxy ? proxy->ptr : NULL); TEST_NATIVE_OBJECT(cx, arg0) CCArray *arr = JSScheduleWrapper::getTargetForNativeNode(arg0); - if(! arr) return JS_FALSE; + if(! arr) return JS_TRUE; for(unsigned int i = 0; i < arr->count(); ++i) { if(arr->objectAtIndex(i)) { arg0->getScheduler()->pauseTarget(arr->objectAtIndex(i)); @@ -1221,7 +1303,7 @@ JSBool js_cocos2dx_CCScheduler_resumeTarget(JSContext *cx, uint32_t argc, jsval arg0 = (cocos2d::CCNode*)(proxy ? proxy->ptr : NULL); TEST_NATIVE_OBJECT(cx, arg0) CCArray *arr = JSScheduleWrapper::getTargetForNativeNode(arg0); - if(! arr) return JS_FALSE; + if(! arr) return JS_TRUE; for(unsigned int i = 0; i < arr->count(); ++i) { if(arr->objectAtIndex(i)) { arg0->getScheduler()->resumeTarget(arr->objectAtIndex(i)); diff --git a/scripting/javascript/bindings/cocos2d_specifics.hpp b/scripting/javascript/bindings/cocos2d_specifics.hpp index d7989f858a..4dd3e71f8a 100644 --- a/scripting/javascript/bindings/cocos2d_specifics.hpp +++ b/scripting/javascript/bindings/cocos2d_specifics.hpp @@ -91,6 +91,9 @@ public: void setJSCallbackThis(jsval thisObj); void setJSExtraData(jsval data); + const jsval& getJSCallbackFunc() const; + const jsval& getJSCallbackThis() const; + const jsval& getJSExtraData() const; protected: jsval jsCallback; jsval jsThisObj; diff --git a/scripting/javascript/bindings/generated b/scripting/javascript/bindings/generated index 44d3cca119..52944d6681 160000 --- a/scripting/javascript/bindings/generated +++ b/scripting/javascript/bindings/generated @@ -1 +1 @@ -Subproject commit 44d3cca11907abe4d314b99e8fc9ad79b188f4c9 +Subproject commit 52944d66814063a7033072cbd30ab19b6e0316ef diff --git a/scripting/javascript/bindings/js/jsb_constants_cocosbuilder.js b/scripting/javascript/bindings/js/jsb_constants_cocosbuilder.js index b66da4c73e..498fa7d807 100644 --- a/scripting/javascript/bindings/js/jsb_constants_cocosbuilder.js +++ b/scripting/javascript/bindings/js/jsb_constants_cocosbuilder.js @@ -3,6 +3,11 @@ // cc.BuilderReader = {}; +cc.BuilderReader._resourcePath = ""; + +cc.BuilderReader.setResourcePath = function (rootPath) { + cc.BuilderReader._resourcePath = rootPath; +}; var _ccbGlobalContext = this; @@ -10,6 +15,8 @@ cc.BuilderReader.load = function(file, owner, parentSize) { // Load the node graph using the correct function var reader = cc._Reader.create(); + reader.setCCBRootPath(cc.BuilderReader._resourcePath); + var node; if (owner && parentSize) diff --git a/scripting/javascript/bindings/js_bindings_ccbreader.cpp b/scripting/javascript/bindings/js_bindings_ccbreader.cpp index 2a2585ad91..d37d7ca46d 100644 --- a/scripting/javascript/bindings/js_bindings_ccbreader.cpp +++ b/scripting/javascript/bindings/js_bindings_ccbreader.cpp @@ -98,7 +98,6 @@ JSBool js_cocos2dx_CCBAnimationManager_animationCompleteCallback(JSContext *cx, return JS_FALSE; } - JSBool js_cocos2dx_CCBReader_readNodeGraphFromFile(JSContext *cx, uint32_t argc, jsval *vp) { jsval *argv = JS_ARGV(cx, vp); @@ -302,7 +301,6 @@ void register_CCBuilderReader(JSContext *cx, JSObject *obj) { JS_DefineFunction(cx, tmpObj, "create", js_CocosBuilder_create, 2, JSPROP_READONLY | JSPROP_PERMANENT); JS_DefineFunction(cx, tmpObj, "loadScene", js_cocos2dx_CCBReader_createSceneWithNodeGraphFromFile, 2, JSPROP_READONLY | JSPROP_PERMANENT); - JS_DefineFunction(cx, js_cocos2dx_CCBReader_prototype, "load", js_cocos2dx_CCBReader_readNodeGraphFromFile, 2, JSPROP_READONLY | JSPROP_PERMANENT); + JS_DefineFunction(cx, js_cocos2dx_CCBReader_prototype, "load", js_cocos2dx_CCBReader_readNodeGraphFromFile, 2, JSPROP_READONLY | JSPROP_PERMANENT); JS_DefineFunction(cx, js_cocos2dx_CCBAnimationManager_prototype, "setCompletedAnimationCallback", js_cocos2dx_CCBAnimationManager_animationCompleteCallback, 2, JSPROP_READONLY | JSPROP_PERMANENT); - } diff --git a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp b/scripting/lua/cocos2dx_support/CCLuaEngine.cpp index 1453ad51df..ee5ddafc93 100644 --- a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp +++ b/scripting/lua/cocos2dx_support/CCLuaEngine.cpp @@ -395,7 +395,7 @@ int CCLuaEngine::executeLayerTouchEvent(CCLayer* pLayer, int eventType, CCTouch int ret = 0; do { - CCTouchScriptHandlerEntry* pScriptHandlerEntry = pLayer->getScriptHandlerEntry(); + CCTouchScriptHandlerEntry* pScriptHandlerEntry = pLayer->getScriptTouchHandlerEntry(); CC_BREAK_IF(NULL == pScriptHandlerEntry); int nScriptHandler = pScriptHandlerEntry->getHandler(); CC_BREAK_IF(0 == nScriptHandler); @@ -415,7 +415,7 @@ int CCLuaEngine::executeLayerTouchesEvent(CCLayer* pLayer, int eventType, CCSet int ret = 0; do { - CCTouchScriptHandlerEntry* pScriptHandlerEntry = pLayer->getScriptHandlerEntry(); + CCTouchScriptHandlerEntry* pScriptHandlerEntry = pLayer->getScriptTouchHandlerEntry(); CC_BREAK_IF(NULL == pScriptHandlerEntry); int nScriptHandler = pScriptHandlerEntry->getHandler(); CC_BREAK_IF(0 == nScriptHandler); @@ -445,6 +445,45 @@ int CCLuaEngine::executeLayerTouchesEvent(CCLayer* pLayer, int eventType, CCSet return ret; } +int CCLuaEngine::executeLayerKeypadEvent(CCLayer* pLayer, int eventType) +{ + int ret = 0; + do + { + CCScriptHandlerEntry* pScriptHandlerEntry = pLayer->getScriptKeypadHandlerEntry(); + CC_BREAK_IF(NULL == pScriptHandlerEntry); + int nScriptHandler = pScriptHandlerEntry->getHandler(); + CC_BREAK_IF(0 == nScriptHandler); + + cleanStack(); + lua_newtable(m_state); + lua_pushinteger(m_state, eventType); + ret = executeFunctionByHandler(nScriptHandler, 1); + } while (0); + return ret; +} + +int CCLuaEngine::executeAccelerometerEvent(CCLayer* pLayer, CCAcceleration* pAccelerationValue) +{ + int ret = 0; + do + { + CCScriptHandlerEntry* pScriptHandlerEntry = pLayer->getScriptAccelerateHandlerEntry(); + CC_BREAK_IF(NULL == pScriptHandlerEntry); + int nScriptHandler = pScriptHandlerEntry->getHandler(); + CC_BREAK_IF(0 == nScriptHandler); + + cleanStack(); + lua_newtable(m_state); + lua_pushnumber(m_state, pAccelerationValue->x); + lua_pushnumber(m_state, pAccelerationValue->y); + lua_pushnumber(m_state, pAccelerationValue->z); + lua_pushnumber(m_state, pAccelerationValue->timestamp); + ret = executeFunctionByHandler(nScriptHandler, 4); + } while (0); + return ret; +} + int CCLuaEngine::executeFunctionByHandler(int nHandler, int numArgs) { if (pushFunction(nHandler)) /* stack: ... arg1 arg2 ... func */ diff --git a/scripting/lua/cocos2dx_support/CCLuaEngine.h b/scripting/lua/cocos2dx_support/CCLuaEngine.h index f2e93a9cde..f6afe62da4 100644 --- a/scripting/lua/cocos2dx_support/CCLuaEngine.h +++ b/scripting/lua/cocos2dx_support/CCLuaEngine.h @@ -195,8 +195,9 @@ public: virtual int executeSchedule(CCTimer* pTimer, 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); /** execute a accelerometer event */ - virtual int executeAccelerometerEvent(CCLayer* pLayer, CCAcceleration* pAccelerationValue){ return 0;}; + virtual int executeAccelerometerEvent(CCLayer* pLayer, CCAcceleration* pAccelerationValue); /** @brief Method used to get a pointer to the lua_State that the script module is attached to. @return A pointer to the lua_State that the script module is attached to. diff --git a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id index 34b07dcf1c..97b91736cd 100644 --- a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id +++ b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id @@ -1 +1 @@ -58e432f8cbf9f340398f9d6db2b61303b6a06034 \ No newline at end of file +82c746a075d2fda3f8af4ab4b8f3bfdfe4110252 \ No newline at end of file diff --git a/scripting/lua/proj.marmalade/lua.mkf b/scripting/lua/proj.marmalade/lua.mkf index 6dabd6eb63..42779425e0 100644 --- a/scripting/lua/proj.marmalade/lua.mkf +++ b/scripting/lua/proj.marmalade/lua.mkf @@ -2,15 +2,24 @@ includepaths { ../lua/ ../tolua/ + ../cocos2dx_support/ } files { + [lua] ("../lua") "*.h" "*.c" - + + [tolua] ("../tolua") "*.h" "*.c" + + [cocos2dxSupport] + ("../cocos2dx_support") + "*.h" + "*.c" + "*.cpp" } diff --git a/scripting/lua/tolua/tolua_map.c b/scripting/lua/tolua/tolua_map.c index 8bab1546c7..59b2636f64 100644 --- a/scripting/lua/tolua/tolua_map.c +++ b/scripting/lua/tolua/tolua_map.c @@ -240,6 +240,13 @@ static int tolua_bnd_cast (lua_State* L) return 1; } +/* Test userdata is null +*/ +static int tolua_bnd_isnulluserdata (lua_State* L) { + void **ud = (void**)lua_touserdata(L, -1); + return ud == NULL || *ud == NULL; +} + /* Inheritance */ static int tolua_bnd_inherit (lua_State* L) { @@ -353,6 +360,7 @@ TOLUA_API void tolua_open (lua_State* L) tolua_function(L,"takeownership",tolua_bnd_takeownership); tolua_function(L,"releaseownership",tolua_bnd_releaseownership); tolua_function(L,"cast",tolua_bnd_cast); + tolua_function(L,"isnull",tolua_bnd_isnulluserdata); tolua_function(L,"inherit", tolua_bnd_inherit); #ifdef LUA_VERSION_NUM /* lua 5.1 */ tolua_function(L, "setpeer", tolua_bnd_setpeer); diff --git a/template/msvc/CCAppWiz.win32/Scripts/1033/default.js b/template/msvc/CCAppWiz.win32/Scripts/1033/default.js index 7de7505a22..556955d102 100644 --- a/template/msvc/CCAppWiz.win32/Scripts/1033/default.js +++ b/template/msvc/CCAppWiz.win32/Scripts/1033/default.js @@ -287,7 +287,7 @@ function AddConfigurations(proj, strProjectName) { } // Additional Library Directories - var strAddDepends = 'libcocos2d.lib libExtensions.lib opengl32.lib glew32.lib'; + var strAddDepends = 'libcocos2d.lib opengl32.lib glew32.lib'; if (wizard.FindSymbol('CC_USE_BOX2D')) { strAddDepends += ' libBox2d.lib'; } diff --git a/template/msvc/InstallWizardForVC2010Express.js b/template/msvc/InstallWizardForVC2010Express.js index 46e4ae18da..65ea45a269 100644 --- a/template/msvc/InstallWizardForVC2010Express.js +++ b/template/msvc/InstallWizardForVC2010Express.js @@ -33,7 +33,7 @@ function main() { // Decode command line arguments var bDebug = false; var bQuiet = false; - var bElevated = false; + var bElevated = true; var Args = WScript.Arguments; for (var i = 0; i < Args.length; i++) { if (Args(i) == "/debug") diff --git a/template/msvc/InstallWizardForVS2010.js b/template/msvc/InstallWizardForVS2010.js index 477b0970c3..b029484c3d 100644 --- a/template/msvc/InstallWizardForVS2010.js +++ b/template/msvc/InstallWizardForVS2010.js @@ -33,7 +33,7 @@ function main() { // Decode command line arguments var bDebug = false; var bQuiet = false; - var bElevated = false; + var bElevated = true; var Args = WScript.Arguments; for (var i = 0; i < Args.length; i++) { if (Args(i) == "/debug") diff --git a/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp index f9dd07bc43..4005bc3bbf 100644 --- a/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx.xctemplate/Classes/AppDelegate.cpp @@ -46,17 +46,15 @@ bool AppDelegate::applicationDidFinishLaunching() // This function will be called when the app is inactive. When comes a phone call,it's be invoked too void AppDelegate::applicationDidEnterBackground() { - CCDirector::sharedDirector()->pause(); - - // if you use SimpleAudioEngine, it must be paused - // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); + CCDirector::sharedDirector()->stopAnimation(); + SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->pauseAllEffects(); } // this function will be called when the app is active again void AppDelegate::applicationWillEnterForeground() { - CCDirector::sharedDirector()->resume(); - - // if you use SimpleAudioEngine, it must resume here - // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); + CCDirector::sharedDirector()->startAnimation(); + SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->resumeAllEffects(); } diff --git a/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp index 142b992f45..4005bc3bbf 100644 --- a/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx_box2d.xctemplate/Classes/AppDelegate.cpp @@ -47,16 +47,14 @@ bool AppDelegate::applicationDidFinishLaunching() void AppDelegate::applicationDidEnterBackground() { CCDirector::sharedDirector()->stopAnimation(); - - // if you use SimpleAudioEngine, it must be paused - // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->pauseAllEffects(); } // this function will be called when the app is active again void AppDelegate::applicationWillEnterForeground() { CCDirector::sharedDirector()->startAnimation(); - - // if you use SimpleAudioEngine, it must resume here - // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->resumeAllEffects(); } diff --git a/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp index 9b7ad94815..4005bc3bbf 100644 --- a/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx_chipmunk.xctemplate/Classes/AppDelegate.cpp @@ -47,16 +47,14 @@ bool AppDelegate::applicationDidFinishLaunching() void AppDelegate::applicationDidEnterBackground() { CCDirector::sharedDirector()->stopAnimation(); - - // if you use SimpleAudioEngine, it must be pause - // SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->pauseAllEffects(); } // this function will be called when the app is active again void AppDelegate::applicationWillEnterForeground() { CCDirector::sharedDirector()->startAnimation(); - - // if you use SimpleAudioEngine, it must resume here - // SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->resumeAllEffects(); } diff --git a/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp b/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp index ba615ffad3..d7c908afd5 100644 --- a/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp +++ b/template/xcode4/cocos2dx_lua.xctemplate/Classes/AppDelegate.cpp @@ -56,6 +56,7 @@ void AppDelegate::applicationDidEnterBackground() { CCDirector::sharedDirector()->stopAnimation(); SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->pauseAllEffects(); } // this function will be called when the app is active again @@ -63,4 +64,5 @@ void AppDelegate::applicationWillEnterForeground() { CCDirector::sharedDirector()->startAnimation(); SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); + SimpleAudioEngine::sharedEngine()->resumeAllEffects(); } diff --git a/tools/cxx-generator b/tools/cxx-generator index e4761d02b3..ab8a6c0823 160000 --- a/tools/cxx-generator +++ b/tools/cxx-generator @@ -1 +1 @@ -Subproject commit e4761d02b363515a293adb637fd8ab4a99db9722 +Subproject commit ab8a6c0823d396f4d1e2cfb5de2314da653c657f diff --git a/tools/tolua++/CCApplication.pkg b/tools/tolua++/CCApplication.pkg index 669cea1698..7be440f1b5 100644 --- a/tools/tolua++/CCApplication.pkg +++ b/tools/tolua++/CCApplication.pkg @@ -7,7 +7,10 @@ typedef enum LanguageType kLanguageItalian, kLanguageGerman, kLanguageSpanish, - kLanguageRussian + kLanguageRussian, + kLanguageKorean, + kLanguageJapanese, + kLanguageHungarian } ccLanguageType; enum TargetPlatform @@ -23,6 +26,7 @@ enum TargetPlatform class CCApplication { + ~CCApplication(); static CCApplication* sharedApplication(); ccLanguageType getCurrentLanguage(); TargetPlatform getTargetPlatform(); diff --git a/tools/tolua++/CCCommon.pkg b/tools/tolua++/CCCommon.pkg index 1226c80592..5f01e967be 100644 --- a/tools/tolua++/CCCommon.pkg +++ b/tools/tolua++/CCCommon.pkg @@ -1,14 +1,3 @@ -typedef enum LanguageType -{ - kLanguageEnglish = 0, - kLanguageChinese, - kLanguageFrench, - kLanguageItalian, - kLanguageGerman, - kLanguageSpanish, - kLanguageRussian -} ccLanguageType; - void CCLuaLog(const char * pszFormat); void CCMessageBox(const char * pszMsg, const char * pszTitle); diff --git a/tools/tolua++/CCDirector.pkg b/tools/tolua++/CCDirector.pkg index 85a61cb6df..84cce1fb53 100644 --- a/tools/tolua++/CCDirector.pkg +++ b/tools/tolua++/CCDirector.pkg @@ -13,7 +13,6 @@ class CCDirector : public CCObject double getAnimationInterval(void); bool isDisplayStats(void); - void setDisplayStats(bool bDisplayFPS); bool isPaused(void); unsigned int getTotalFrames(void); @@ -37,12 +36,13 @@ class CCDirector : public CCObject void end @ endToLua (); float getContentScaleFactor(void); + void setContentScaleFactor(float scaleFactor); CCScheduler* getScheduler(); CCActionManager* getActionManager(); CCTouchDispatcher* getTouchDispatcher(); - CCKeypadDispatcher* getKeypadDispatcher(); - CCAccelerometer* getAccelerometer(); + // CCKeypadDispatcher* getKeypadDispatcher(); + // CCAccelerometer* getAccelerometer(); void setDepthTest(bool var); void setProjection(ccDirectorProjection kProjection); diff --git a/tools/tolua++/CCKeypadDispatcher.pkg b/tools/tolua++/CCKeypadDispatcher.pkg new file mode 100644 index 0000000000..868e390bec --- /dev/null +++ b/tools/tolua++/CCKeypadDispatcher.pkg @@ -0,0 +1,6 @@ + +typedef enum { + // the back key clicked msg + kTypeBackClicked = 1, + kTypeMenuClicked, +} ccKeypadMSGType; diff --git a/tools/tolua++/CCLabelBMFont.pkg b/tools/tolua++/CCLabelBMFont.pkg index 7c7aca953b..08d31a8c14 100644 --- a/tools/tolua++/CCLabelBMFont.pkg +++ b/tools/tolua++/CCLabelBMFont.pkg @@ -31,8 +31,6 @@ class CCLabelBMFont : public CCNode bool isOpacityModifyRGB(); void setOpacityModifyRGB(bool isOpacityModifyRGB); - tolua_property__CCOpacity GLubyte opacity; - static void purgeCachedData(); static CCLabelBMFont * create(const char *str, const char *fntFile, float width = kCCLabelAutomaticWidth, CCTextAlignment alignment = kCCTextAlignmentLeft, CCPoint imageOffset = CCPointMake(0, 0)); static CCLabelBMFont * create(); diff --git a/tools/tolua++/CCLayer.pkg b/tools/tolua++/CCLayer.pkg index 67036125fa..d9f5becb69 100644 --- a/tools/tolua++/CCLayer.pkg +++ b/tools/tolua++/CCLayer.pkg @@ -10,12 +10,18 @@ class CCLayer : public CCNode void setKeypadEnabled(bool bValue); bool isKeypadEnabled(); - void registerScriptTouchHandler(LUA_FUNCTION funcID, + void registerScriptTouchHandler(LUA_FUNCTION nHandler, bool bIsMultiTouches = false, int nPriority = 0, bool bSwallowsTouches = false); void unregisterScriptTouchHandler(); + void registerScriptKeypadHandler(LUA_FUNCTION nHandler); + void unregisterScriptKeypadHandler(void); + + void registerScriptAccelerateHandler(LUA_FUNCTION nHandler); + void unregisterScriptAccelerateHandler(void); + static CCLayer *create(void); }; diff --git a/tools/tolua++/CCSprite.pkg b/tools/tolua++/CCSprite.pkg index 8076c4619c..294dad79e3 100644 --- a/tools/tolua++/CCSprite.pkg +++ b/tools/tolua++/CCSprite.pkg @@ -68,8 +68,6 @@ class CCSprite : public CCNode void setOpacity(GLubyte opacity); GLubyte getOpacity(void); - tolua_property__CCOpacity GLubyte opacity; - void setColor(ccColor3B color3); ccColor3B getColor(void); void setOpacityModifyRGB(bool bValue); diff --git a/tools/tolua++/CCTouchDispatcher.pkg b/tools/tolua++/CCTouchDispatcher.pkg new file mode 100644 index 0000000000..8ef8227d07 --- /dev/null +++ b/tools/tolua++/CCTouchDispatcher.pkg @@ -0,0 +1,6 @@ + +class CCTouchDispatcher : public CCObject +{ + bool isDispatchEvents(void); + void setDispatchEvents(bool bDispatchEvents); +}; diff --git a/tools/tolua++/Cocos2d.pkg b/tools/tolua++/Cocos2d.pkg index b7f3442638..f507c15007 100644 --- a/tools/tolua++/Cocos2d.pkg +++ b/tools/tolua++/Cocos2d.pkg @@ -16,9 +16,11 @@ $pfile "CCFileUtils.pkg" $pfile "CCDrawingPrimitives.pkg" $pfile "CCAffineTransform.pkg" $pfile "CCApplication.pkg" +$pfile "CCTouchDispatcher.pkg" $pfile "CCDirector.pkg" $pfile "CCUserDefault.pkg" $pfile "CCNotificationCenter.pkg" +$pfile "CCKeypadDispatcher.pkg" $pfile "CCNode.pkg" $pfile "CCTexture2D.pkg" diff --git a/tools/tolua++/basic.lua b/tools/tolua++/basic.lua index d7eec9a4e9..e6ea8a63f9 100644 --- a/tools/tolua++/basic.lua +++ b/tools/tolua++/basic.lua @@ -201,14 +201,3 @@ _to_functions["LUA_FUNCTION"] = "toluafix_ref_function" _is_functions["LUA_FUNCTION"] = "toluafix_isfunction" _to_functions["LUA_TABLE"] = "toluafix_totable" _is_functions["LUA_TABLE"] = "toluafix_istable" - - -function get_property_methods_hook(ptype, name) - if ptype == "IsVisible" then - return "isVisible", "setVisible" - end - if string.sub(ptype, 1, 2) == "CC" then - ptype = string.sub(ptype, 3) - end - return "get"..ptype, "set"..ptype -end diff --git a/tools/xcode4_template_generator/template_generator.py b/tools/xcode4_template_generator/template_generator.py index 3b78fc1487..8f1e99b2f1 100644 --- a/tools/xcode4_template_generator/template_generator.py +++ b/tools/xcode4_template_generator/template_generator.py @@ -185,7 +185,7 @@ if __name__ == "__main__": if opt in ("-d","--directory"): directory = arg if opt in ("-g","--group"): - group = arg + group = int(arg) if opt in ("-i","--identifier"): identifier = arg if opt in ("-p","--prefix"):