From 78cd3e561e2cb2158ec7cdf467368ec9059aff9d Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Thu, 18 Jul 2013 23:27:07 +0800 Subject: [PATCH 1/6] issue #2404:Move deprecated functions to Deprecated.lua --- .../project.pbxproj.REMOVED.git-id | 2 +- samples/Lua/HelloLua/Resources/hello.lua | 12 +- .../HelloLua/proj.android/AndroidManifest.xml | 2 +- .../project.pbxproj.REMOVED.git-id | 2 +- .../lua/cocos2dx_support/CCLuaEngine.cpp | 1 + .../LuaCocos2d.cpp.REMOVED.git-id | 2 +- .../cocos2dx_support/LuaScriptHandlerMgr.cpp | 2 +- scripting/lua/script/Deprecated.lua | 342 ++++++++++++++++++ tools/tolua++/CCActionGrid.pkg | 8 +- tools/tolua++/CCAnimationCache.pkg | 5 - tools/tolua++/CCApplication.pkg | 2 - tools/tolua++/CCDirector.pkg | 2 - tools/tolua++/CCEGLViewProtocol.pkg | 2 - tools/tolua++/CCFileUtils.pkg | 5 - tools/tolua++/CCGeometry.pkg | 30 +- tools/tolua++/CCNotificationCenter.pkg | 4 - tools/tolua++/CCPointExtension.pkg | 31 -- tools/tolua++/CCSpriteFrameCache.pkg | 4 - tools/tolua++/CCTextureCache.pkg | 3 - tools/tolua++/CCUserDefault.pkg | 3 - 20 files changed, 383 insertions(+), 81 deletions(-) create mode 100644 scripting/lua/script/Deprecated.lua diff --git a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index 7e2a12a92c..932f33731b 100644 --- a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -1ab0fd6fdad74af8ce054c089d8571a05a7a04d8 \ No newline at end of file +ca5e8099d358d62ed915a2d316a4a4545b61471d \ No newline at end of file diff --git a/samples/Lua/HelloLua/Resources/hello.lua b/samples/Lua/HelloLua/Resources/hello.lua index 99befa8f0d..2c17d1f311 100644 --- a/samples/Lua/HelloLua/Resources/hello.lua +++ b/samples/Lua/HelloLua/Resources/hello.lua @@ -31,9 +31,9 @@ local function main() -- create dog animate local textureDog = CCTextureCache:getInstance():addImage("dog.png") - local rect = Rect(0, 0, frameWidth, frameHeight) + local rect = CCRectMake(0, 0, frameWidth, frameHeight) local frame0 = CCSpriteFrame:createWithTexture(textureDog, rect) - rect = Rect(frameWidth, 0, frameWidth, frameHeight) + rect = CCRectMake(frameWidth, 0, frameWidth, frameHeight) local frame1 = CCSpriteFrame:createWithTexture(textureDog, rect) local spriteDog = CCSprite:createWithSpriteFrame(frame0) @@ -86,7 +86,7 @@ local function main() end -- add crop - local frameCrop = CCSpriteFrame:create("crop.png", Rect(0, 0, 105, 95)) + local frameCrop = CCSpriteFrame:create("crop.png", CCRectMake(0, 0, 105, 95)) for i = 0, 3 do for j = 0, 1 do local spriteCrop = CCSprite:createWithSpriteFrame(frameCrop); @@ -136,7 +136,7 @@ local function main() end end - layerFarm:registerScriptTouchHandler(onTouch) + --layerFarm:registerScriptTouchHandler(onTouch) layerFarm:setTouchEnabled(true) return layerFarm @@ -165,7 +165,7 @@ local function main() -- add a popup menu local menuPopupItem = CCMenuItemImage:create("menu2.png", "menu2.png") menuPopupItem:setPosition(0, 0) - menuPopupItem:registerScriptTapHandler(menuCallbackClosePopup) +-- menuPopupItem:registerScriptTapHandler(menuCallbackClosePopup) menuPopup = CCMenu:createWithItem(menuPopupItem) menuPopup:setPosition(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2) menuPopup:setVisible(false) @@ -174,7 +174,7 @@ local function main() -- add the left-bottom "tools" menu to invoke menuPopup local menuToolsItem = CCMenuItemImage:create("menu1.png", "menu1.png") menuToolsItem:setPosition(0, 0) - menuToolsItem:registerScriptTapHandler(menuCallbackOpenPopup) +-- menuToolsItem:registerScriptTapHandler(menuCallbackOpenPopup) menuTools = CCMenu:createWithItem(menuToolsItem) local itemWidth = menuToolsItem:getContentSize().width local itemHeight = menuToolsItem:getContentSize().height diff --git a/samples/Lua/HelloLua/proj.android/AndroidManifest.xml b/samples/Lua/HelloLua/proj.android/AndroidManifest.xml index 091157ff36..578c23647b 100644 --- a/samples/Lua/HelloLua/proj.android/AndroidManifest.xml +++ b/samples/Lua/HelloLua/proj.android/AndroidManifest.xml @@ -4,7 +4,7 @@ android:versionCode="1" android:versionName="1.0"> - + retain(); + executeScriptFile("Deprecated.lua"); return true; } diff --git a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id index 00135a60b3..e7a67e70c5 100644 --- a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id +++ b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id @@ -1 +1 @@ -ecb6191757f5eb70142d6767d49edf46074a2db4 \ No newline at end of file +6cd03232ead4eb4ed276ac13b14762099984683d \ No newline at end of file diff --git a/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp b/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp index 44fae6f12a..c1a0ae7a16 100644 --- a/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp +++ b/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp @@ -317,7 +317,7 @@ int tolua_Cocos2d_registerScriptTouchHandler00(lua_State* tolua_S) LUA_FUNCTION handler = ( toluafix_ref_function(tolua_S,2,0)); bool isMultiTouches = ((bool) tolua_toboolean(tolua_S,3,false)); int priority = ((int) tolua_tonumber(tolua_S,4,0)); - bool swallowsTouches = ((bool) tolua_toboolean(tolua_S,5,false)); + //the fifth arg(swallowsTouches) is not set in Layer,default true, ccTouchesMode touchesMode = kTouchesAllAtOnce; if (!isMultiTouches) touchesMode = kTouchesOneByOne; diff --git a/scripting/lua/script/Deprecated.lua b/scripting/lua/script/Deprecated.lua new file mode 100644 index 0000000000..08885353c5 --- /dev/null +++ b/scripting/lua/script/Deprecated.lua @@ -0,0 +1,342 @@ + +local function deprecatedTip(funcName) + local tip = string.format("%s is deprecated function",funcName) + print(tip) +end +local function addHandleOfControlEvent(self,func,controlEvent) + deprecatedTip("addHandleOfControlEvent") + self:registerControlEventHandler(func,controlEvent) +end +rawset(CCControl,"addHandleOfControlEvent",addHandleOfControlEvent) + +local function ccpLineIntersect(a,b,c,d,s,t) + deprecatedTip("ccpLineIntersect") + return CCPoint:isLineIntersect(a,b,c,d,s,t) +end +rawset(_G,"ccpLineIntersect",ccpLineIntersect) + + +local function CCPointMake(x,y) + deprecatedTip("CCPointMake") + return CCPoint:new_local(x,y) +end +rawset(_G,"CCPointMake",CCPointMake) + +local function ccp(x,y) + deprecatedTip("ccp") + return CCPoint:new_local(x,y) +end +rawset(_G,"ccp",ccp) + +local function CCSizeMake(width,height) + deprecatedTip("CCSizeMake") + return CCSize:new_local(width,height) +end +rawset(_G,"CCSizeMake",CCSizeMake) + +local function CCRectMake(x,y,width,height) + deprecatedTip("CCRectMake") + return CCRect:new_local(x,y,width,height) +end +rawset(_G,"CCRectMake",CCRectMake) + +local function ccpNeg(pt) + deprecatedTip("ccpNeg") + return CCPoint.__sub(CCPoint:new_local(0,0),pt) +end +rawset(_G,"ccpNeg",ccpNeg) + +local function ccpAdd(pt1,pt2) + deprecatedTip("ccpAdd") + return CCPoint.__add(pt1,pt2) +end +rawset(_G,"ccpAdd",ccpAdd) + +local function ccpSub(pt1,pt2) + deprecatedTip("ccpSub") + return CCPoint.__sub(pt1,pt2) +end +rawset(_G,"ccpSub",ccpSub) + +local function ccpMult(pt,factor) + deprecatedTip("ccpMult") + return CCPoint.__mul(pt,factor) +end +rawset(_G,"ccpMult",ccpMult) + +local function ccpMidpoint(pt1,pt2) + deprecatedTip("ccpMidpoint") + return pt1:getMidpoint(pt2) +end +rawset(_G,"ccpMidpoint",ccpMidpoint) + +local function ccpDot(pt1,pt2) + deprecatedTip("ccpDot") + return pt1:dot(pt2) +end +rawset(_G,"ccpDot",ccpDot) + +local function ccpCross(pt1,pt2) + deprecatedTip("ccpCross") + return pt1:cross(pt2) +end +rawset(_G,"ccpCross",ccpCross) + +local function ccpPerp(pt) + deprecatedTip("ccpPerp") + return pt:getPerp() +end +rawset(_G,"ccpPerp",ccpPerp) + +local function ccpRPerp(pt) + deprecatedTip("ccpRPerp") + return pt:getRPerp() +end +rawset(_G,"ccpRPerp",ccpRPerp) + +--no test +local function ccpProject(pt1,pt2) + deprecatedTip("ccpProject") + return pt1:project(pt2) +end +rawset(_G,"ccpProject",ccpProject) + +local function ccpRotate(pt1,pt2) + deprecatedTip("ccpRotate") + return pt1:rotate(pt2) +end +rawset(_G,"ccpRotate",ccpRotate) + +local function ccpUnrotate(pt1,pt2) + deprecatedTip("ccpUnrotate") + return pt1:unrotate(pt2) +end +rawset(_G,"ccpUnrotate",ccpUnrotate) + +local function ccpLengthSQ(pt) + deprecatedTip("ccpLengthSQ") + return pt:getLengthSq(pt) +end +rawset(_G,"ccpLengthSQ",ccpLengthSQ) + +local function ccpDistanceSQ(pt1,pt2) + deprecatedTip("ccpDistanceSQ") + return (CCPoint.__sub(pt1,pt2)):getLengthSq() +end +rawset(_G,"ccpDistanceSQ",ccpDistanceSQ) + +local function ccpLength(pt) + deprecatedTip("ccpLength") + return pt:getLength() +end +rawset(_G,"ccpLength",ccpLength) + +local function ccpDistance(pt1,pt2) + deprecatedTip("ccpDistance") + return pt1:getDistance(pt2) +end +rawset(_G,"ccpDistance",ccpDistance) + +local function ccpNormalize(pt) + deprecatedTip("ccpNormalize") + return pt:getDistance() +end +rawset(_G,"ccpNormalize",ccpNormalize) + +local function ccpForAngle(angle) + deprecatedTip("ccpForAngle") + return CCPoint:forAngle(angle) +end +rawset(_G,"ccpForAngle",ccpForAngle) + +local function ccpToAngle(pt) + deprecatedTip("ccpToAngle") + return pt:getAngle() +end +rawset(_G,"ccpToAngle",ccpToAngle) + +local function ccpClamp(pt1,pt2,pt3) + deprecatedTip("ccpClamp") + return pt1:getClampPoint(pt2, pt3) +end +rawset(_G,"ccpClamp",ccpClamp) + + +local function ccpFromSize(sz) + deprecatedTip("ccpFromSize") + return CCPoint:new_local(sz) +end +rawset(_G,"ccpFromSize",ccpFromSize) + +local function ccpLerp(pt1,pt2,alpha) + deprecatedTip("ccpLerp") + return pt1:lerp(pt2,alpha) +end +rawset(_G,"ccpLerp",ccpLerp) + +local function ccpFuzzyEqual(pt1,pt2,variance) + deprecatedTip("ccpFuzzyEqual") + return pt1:fuzzyEquals(pt2,variance) +end +rawset(_G,"ccpFuzzyEqual",ccpFuzzyEqual) + +local function ccpCompMult(pt1,pt2) + deprecatedTip("ccpCompMult") + return CCPoint:new_local(pt1.x * pt2.x , pt1.y * pt2.y) +end +rawset(_G,"ccpCompMult",ccpCompMult) + +local function ccpAngleSigned(pt1,pt2) + deprecatedTip("ccpAngleSigned") + return pt1:getAngle(pt2) +end +rawset(_G,"ccpAngleSigned",ccpAngleSigned) + +local function ccpAngle(pt1,pt2) + deprecatedTip("ccpAngle") + return pt1:getAngle(pt2) +end +rawset(_G,"ccpAngle",ccpAngle) + +local function ccpRotateByAngle(pt1,pt2,angle) + deprecatedTip("ccpRotateByAngle") + return pt1:rotateByAngle(pt2, angle) +end +rawset(_G,"ccpRotateByAngle",ccpRotateByAngle) + +local function ccpSegmentIntersect(pt1,pt2,pt3,pt4) + deprecatedTip("ccpSegmentIntersect") + return CCPoint:isSegmentIntersect(pt1,pt2,pt3,pt4) +end +rawset(_G,"ccpSegmentIntersect",ccpSegmentIntersect) + +local function ccpIntersectPoint(pt1,pt2,pt3,pt4) + deprecatedTip("ccpIntersectPoint") + return CCPoint:getIntersectPoint(pt1,pt2,pt3,pt4) +end +rawset(_G,"ccpIntersectPoint",ccpIntersectPoint) + + +local function sharedOpenGLView() + deprecatedTip("sharedOpenGLView") + return CCEGLView:getInstance() +end +rawset(CCEGLView,"sharedOpenGLView",sharedOpenGLView) + +local function sharedFileUtils() + deprecatedTip("sharedFileUtils") + return CCFileUtils:getInstance() +end +rawset(CCFileUtils,"sharedFileUtils",sharedFileUtils) + +local function purgeFileUtils() + deprecatedTip("purgeFileUtils") + return CCFileUtils:destroyInstance() +end +rawset(CCFileUtils,"purgeFileUtils",purgeFileUtils) + +local function sharedApplication() + deprecatedTip("sharedApplication") + return CCApplication:getInstance() +end +rawset(CCApplication,"sharedApplication",sharedApplication) + +local function sharedDirector() + deprecatedTip("sharedDirector") + return CCDirector:getInstance() +end +rawset(CCDirector,"sharedDirector",sharedDirector) + +local function sharedUserDefault() + deprecatedTip("sharedUserDefault") + return CCUserDefault:getInstance() +end +rawset(CCUserDefault,"sharedUserDefault",sharedUserDefault) + +local function purgeSharedUserDefault() + deprecatedTip("purgeSharedUserDefault") + return CCUserDefault:destroyInstance() +end +rawset(CCUserDefault,"purgeSharedUserDefault",purgeSharedUserDefault) + + +local function sharedNotificationCenter() + deprecatedTip("sharedNotificationCenter") + return CCNotificationCenter:getInstance() +end +rawset(CCNotificationCenter,"sharedNotificationCenter",sharedNotificationCenter) + +local function purgeNotificationCenter() + deprecatedTip("purgeNotificationCenter") + return CCNotificationCenter:destroyInstance() +end +rawset(CCNotificationCenter,"purgeNotificationCenter",purgeNotificationCenter) + +local function sharedTextureCache() + deprecatedTip("sharedTextureCache") + return CCTextureCache:getInstance() +end +rawset(CCTextureCache,"sharedTextureCache",sharedTextureCache) + +local function purgeSharedTextureCache() + deprecatedTip("purgeSharedTextureCache") + return CCTextureCache:destroyInstance() +end +rawset(CCTextureCache,"purgeSharedTextureCache",purgeSharedTextureCache) + +local function sharedSpriteFrameCache() + deprecatedTip("sharedSpriteFrameCache") + return CCSpriteFrameCache:getInstance() +end +rawset(CCSpriteFrameCache,"sharedSpriteFrameCache",sharedSpriteFrameCache) + +local function purgeSharedSpriteFrameCache() + deprecatedTip("purgeSharedSpriteFrameCache") + return CCSpriteFrameCache:destroyInstance() +end +rawset(CCSpriteFrameCache,"purgeSharedSpriteFrameCache",purgeSharedSpriteFrameCache) + +local function vertex(self,pt) + deprecatedTip("vertex") + return self:getVertex(pt) +end +rawset(CCGrid3DAction,"vertex",vertex) + +local function originalVertex(self,pt) + deprecatedTip("originalVertex") + return self:getOriginalVertex(pt) +end +rawset(CCGrid3DAction,"originalVertex",originalVertex) + +local function tile(self,pt) + deprecatedTip("tile") + return self:getTile(pt) +end +rawset(CCTiledGrid3DAction,"tile",tile) + +local function originalTile(self,pt) + deprecatedTip("originalTile") + return self:getOriginalTile(pt) +end +rawset(CCTiledGrid3DAction,"originalTile",originalTile) + +local function sharedAnimationCache() + deprecatedTip("sharedAnimationCache") + return CCAnimationCache:getInstance() +end +rawset(CCAnimationCache,"sharedAnimationCache",sharedAnimationCache) + +local function purgeSharedAnimationCache() + deprecatedTip("purgeSharedAnimationCache") + return CCAnimationCache:destroyInstance() +end +rawset(CCAnimationCache,"purgeSharedAnimationCache",purgeSharedAnimationCache) + + + + + + + + + diff --git a/tools/tolua++/CCActionGrid.pkg b/tools/tolua++/CCActionGrid.pkg index a2ba5621ce..bcd89597b5 100644 --- a/tools/tolua++/CCActionGrid.pkg +++ b/tools/tolua++/CCActionGrid.pkg @@ -19,17 +19,17 @@ class CCAccelDeccelAmplitude : public CCActionInterval class CCGrid3DAction : public CCGridAction { virtual CCGridBase* getGrid(void); - Vertex3F vertex(const CCPoint& pos); - Vertex3F originalVertex(const CCPoint& pos); void setVertex(const CCPoint& pos, const Vertex3F& vertex); + Vertex3F getVertex(const CCPoint& position); + Vertex3F getOriginalVertex(const CCPoint& position); }; class CCTiledGrid3DAction : public CCGridAction { - Quad3 tile(CCPoint pos); - Quad3 originalTile(CCPoint pos); void setTile(CCPoint pos, Quad3 coords); CCGridBase* getGrid(void); + Quad3 getTile(const CCPoint& position); + Quad3 getOriginalTile(const CCPoint& position); //static CCTiledGrid3DAction* create(float duration, const CCSize& gridSize); }; diff --git a/tools/tolua++/CCAnimationCache.pkg b/tools/tolua++/CCAnimationCache.pkg index 8f5163b556..c4da10ccd9 100644 --- a/tools/tolua++/CCAnimationCache.pkg +++ b/tools/tolua++/CCAnimationCache.pkg @@ -5,11 +5,6 @@ class CCAnimationCache : public CCObject void removeAnimationByName(const char* name); CCAnimation* animationByName(const char* name); - // XXX deprecated, use getInstance instead - static CCAnimationCache* sharedAnimationCache(void); - // XXX deprecated, use destroyInstance instead - static void purgeSharedAnimationCache(void); - static CCAnimationCache* getInstance(); static void destroyInstance(); diff --git a/tools/tolua++/CCApplication.pkg b/tools/tolua++/CCApplication.pkg index 6276b6b513..8bf80c8895 100644 --- a/tools/tolua++/CCApplication.pkg +++ b/tools/tolua++/CCApplication.pkg @@ -28,8 +28,6 @@ enum TargetPlatform class CCApplication { ~CCApplication(); - // XXX: deprecated - static CCApplication* sharedApplication(); static CCApplication* getInstance(); ccLanguageType getCurrentLanguage(); diff --git a/tools/tolua++/CCDirector.pkg b/tools/tolua++/CCDirector.pkg index 1a202e1e72..e63fda7c94 100644 --- a/tools/tolua++/CCDirector.pkg +++ b/tools/tolua++/CCDirector.pkg @@ -57,7 +57,5 @@ class CCDirector : public CCObject CCSize getVisibleSize(); CCPoint getVisibleOrigin(); - /** @deprecated Use getInstance() instead */ - static CCDirector* sharedDirector(void); static CCDirector* getInstance(); }; diff --git a/tools/tolua++/CCEGLViewProtocol.pkg b/tools/tolua++/CCEGLViewProtocol.pkg index d47e721e66..ff01580f8b 100644 --- a/tools/tolua++/CCEGLViewProtocol.pkg +++ b/tools/tolua++/CCEGLViewProtocol.pkg @@ -86,8 +86,6 @@ class CCEGLViewProtocol class CCEGLView : public CCEGLViewProtocol { - /** @deprecated Use getInstance() instead */ - static CCEGLView* sharedOpenGLView(void); static CCEGLView* getInstance(); }; diff --git a/tools/tolua++/CCFileUtils.pkg b/tools/tolua++/CCFileUtils.pkg index 4b3a52d051..558bbc3394 100644 --- a/tools/tolua++/CCFileUtils.pkg +++ b/tools/tolua++/CCFileUtils.pkg @@ -1,11 +1,6 @@ class CCFileUtils { - /** @deprecated Use getInstance() instead */ - static CCFileUtils* sharedFileUtils(); - /** @deprecated Use destroyInstance() instead */ - static void purgeFileUtils(); - static CCFileUtils* getInstance(); static void destroyInstance(); diff --git a/tools/tolua++/CCGeometry.pkg b/tools/tolua++/CCGeometry.pkg index 870e71dae5..917f83079a 100644 --- a/tools/tolua++/CCGeometry.pkg +++ b/tools/tolua++/CCGeometry.pkg @@ -5,8 +5,33 @@ class CCPoint float y; CCPoint(); CCPoint(float x, float y); + CCPoint(const CCSize& size); + CCPoint operator-(const CCPoint& right) const; + CCPoint operator+(const CCPoint& right) const; + CCPoint operator*(float a) const; + CCPoint getMidpoint(const CCPoint& other) const; + float dot(const CCPoint& other) const; + float cross(const CCPoint& other) const; + CCPoint getPerp() const; + CCPoint getRPerp() const; + CCPoint project(const CCPoint& other) const; + CCPoint rotate(const CCPoint& other) const; + CCPoint unrotate(const CCPoint& other) const; + float getLengthSq() const; + float getLength() const; + float getDistance(const CCPoint& other) const; + CCPoint normalize() const; + float getAngle() const; + CCPoint getClampPoint(const CCPoint& min_inclusive, const CCPoint& max_inclusive) const; + CCPoint lerp(const CCPoint& other, float alpha) const; + bool fuzzyEquals(const CCPoint& target, float variance) const; + CCPoint rotateByAngle(const CCPoint& pivot, float angle) const; bool equals(const CCPoint & target) const ; + static bool isLineIntersect(const CCPoint& A, const CCPoint& B,const CCPoint& C, const CCPoint& D,float* S, float* T); + static bool isSegmentIntersect(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D); + static CCPoint getIntersectPoint(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D); + static CCPoint forAngle(const float a); }; class CCSize @@ -36,8 +61,3 @@ class CCRect bool containsPoint(const CCPoint & point) const; bool intersectsRect(const CCRect & rect) const; }; - -CCPoint CCPointMake(float x, float y); -CCPoint CCPointMake @ ccp (float x, float y); -CCSize CCSizeMake(float width, float height); -CCRect CCRectMake(float x, float y, float width,float height); diff --git a/tools/tolua++/CCNotificationCenter.pkg b/tools/tolua++/CCNotificationCenter.pkg index f80e6eb432..d6598d1076 100644 --- a/tools/tolua++/CCNotificationCenter.pkg +++ b/tools/tolua++/CCNotificationCenter.pkg @@ -5,10 +5,6 @@ class CCNotificationCenter : public CCObject ~CCNotificationCenter(); - // XXX deprecated - static CCNotificationCenter *sharedNotificationCenter(void); - static void purgeNotificationCenter(void); - static CCNotificationCenter* getInstance(); static void destroyInstance(); diff --git a/tools/tolua++/CCPointExtension.pkg b/tools/tolua++/CCPointExtension.pkg index 6e4e60070a..1af9739089 100644 --- a/tools/tolua++/CCPointExtension.pkg +++ b/tools/tolua++/CCPointExtension.pkg @@ -1,32 +1 @@ - -static CCPoint ccpNeg(const CCPoint& v); -static CCPoint ccpAdd(const CCPoint& v1, const CCPoint& v2); -static CCPoint ccpSub(const CCPoint& v1, const CCPoint& v2); -static CCPoint ccpMult(const CCPoint& v, const float s); -static CCPoint ccpMidpoint(const CCPoint& v1, const CCPoint& v2); -static float ccpDot(const CCPoint& v1, const CCPoint& v2); -static float ccpCross(const CCPoint& v1, const CCPoint& v2); -static CCPoint ccpPerp(const CCPoint& v); -static CCPoint ccpRPerp(const CCPoint& v); -static CCPoint ccpProject(const CCPoint& v1, const CCPoint& v2); -static CCPoint ccpRotate(const CCPoint& v1, const CCPoint& v2); -static CCPoint ccpUnrotate(const CCPoint& v1, const CCPoint& v2); -static float ccpLengthSQ(const CCPoint& v); -static float ccpDistanceSQ(const CCPoint p1, const CCPoint p2); -float ccpLength(const CCPoint& v); -float ccpDistance(const CCPoint& v1, const CCPoint& v2); -CCPoint ccpNormalize(const CCPoint& v); -CCPoint ccpForAngle(const float a); -float ccpToAngle(const CCPoint& v); float clampf(float value, float min_inclusive, float max_inclusive); -CCPoint ccpClamp(const CCPoint& p, const CCPoint& from, const CCPoint& to); -CCPoint ccpFromSize(const CCSize& s); -CCPoint ccpLerp(const CCPoint& a, const CCPoint& b, float alpha); -bool ccpFuzzyEqual(const CCPoint& a, const CCPoint& b, float variance); -CCPoint ccpCompMult(const CCPoint& a, const CCPoint& b); -float ccpAngleSigned(const CCPoint& a, const CCPoint& b); -float ccpAngle(const CCPoint& a, const CCPoint& b); -CCPoint ccpRotateByAngle(const CCPoint& v, const CCPoint& pivot, float angle); -bool ccpLineIntersect(const CCPoint& p1, const CCPoint& p2, const CCPoint& p3, const CCPoint& p4, float *s, float *t); -bool ccpSegmentIntersect(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D); -CCPoint ccpIntersectPoint(const CCPoint& A, const CCPoint& B, const CCPoint& C, const CCPoint& D); diff --git a/tools/tolua++/CCSpriteFrameCache.pkg b/tools/tolua++/CCSpriteFrameCache.pkg index ded2e70323..fd2bc3d45e 100644 --- a/tools/tolua++/CCSpriteFrameCache.pkg +++ b/tools/tolua++/CCSpriteFrameCache.pkg @@ -16,10 +16,6 @@ class CCSpriteFrameCache : public CCObject CCSpriteFrame* spriteFrameByName(const char *pszName); - // XXX deprecated - static CCSpriteFrameCache* sharedSpriteFrameCache(void); - static void purgeSharedSpriteFrameCache(void); - static CCSpriteFrameCache* getInstance(); static void destroyInstance(); }; diff --git a/tools/tolua++/CCTextureCache.pkg b/tools/tolua++/CCTextureCache.pkg index 955d7d72c2..9a00040ac9 100644 --- a/tools/tolua++/CCTextureCache.pkg +++ b/tools/tolua++/CCTextureCache.pkg @@ -13,10 +13,7 @@ class CCTextureCache : public CCObject void removeTextureForKey(const char *textureKeyName); void dumpCachedTextureInfo(); - // XXX: deprecated - static CCTextureCache * sharedTextureCache(); static void reloadAllTextures(); - static void purgeSharedTextureCache(); static CCTextureCache * getInstance(); static void destroyInstance(); diff --git a/tools/tolua++/CCUserDefault.pkg b/tools/tolua++/CCUserDefault.pkg index 81876105cc..57d9cdb9be 100644 --- a/tools/tolua++/CCUserDefault.pkg +++ b/tools/tolua++/CCUserDefault.pkg @@ -17,9 +17,6 @@ class CCUserDefault void flush(); - static CCUserDefault* sharedUserDefault(); - static void purgeSharedUserDefault(); - static CCUserDefault* getInstance(); static void destroyInstance(); From 3b97353e14067277e75e4613f549854a85437e5f Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 19 Jul 2013 14:57:02 +0800 Subject: [PATCH 2/6] issue #2404:Modify Deprecated.lua and set platform config --- samples/Lua/HelloLua/Resources/hello.lua | 6 +- .../Lua/HelloLua/proj.android/build_native.sh | 3 + .../Lua/HelloLua/proj.win32/HelloLua.vcxproj | 5 +- .../LuaCocos2d.cpp.REMOVED.git-id | 2 +- scripting/lua/script/Deprecated.lua | 132 +++++++++--------- tools/tolua++/CCNode.pkg | 2 +- tools/tolua++/CCTexture2D.pkg | 3 +- 7 files changed, 83 insertions(+), 70 deletions(-) diff --git a/samples/Lua/HelloLua/Resources/hello.lua b/samples/Lua/HelloLua/Resources/hello.lua index 2c17d1f311..6fde4f0f63 100644 --- a/samples/Lua/HelloLua/Resources/hello.lua +++ b/samples/Lua/HelloLua/Resources/hello.lua @@ -136,7 +136,7 @@ local function main() end end - --layerFarm:registerScriptTouchHandler(onTouch) + layerFarm:registerScriptTouchHandler(onTouch) layerFarm:setTouchEnabled(true) return layerFarm @@ -165,7 +165,7 @@ local function main() -- add a popup menu local menuPopupItem = CCMenuItemImage:create("menu2.png", "menu2.png") menuPopupItem:setPosition(0, 0) --- menuPopupItem:registerScriptTapHandler(menuCallbackClosePopup) + menuPopupItem:registerScriptTapHandler(menuCallbackClosePopup) menuPopup = CCMenu:createWithItem(menuPopupItem) menuPopup:setPosition(origin.x + visibleSize.width / 2, origin.y + visibleSize.height / 2) menuPopup:setVisible(false) @@ -174,7 +174,7 @@ local function main() -- add the left-bottom "tools" menu to invoke menuPopup local menuToolsItem = CCMenuItemImage:create("menu1.png", "menu1.png") menuToolsItem:setPosition(0, 0) --- menuToolsItem:registerScriptTapHandler(menuCallbackOpenPopup) + menuToolsItem:registerScriptTapHandler(menuCallbackOpenPopup) menuTools = CCMenu:createWithItem(menuToolsItem) local itemWidth = menuToolsItem:getContentSize().width local itemHeight = menuToolsItem:getContentSize().height diff --git a/samples/Lua/HelloLua/proj.android/build_native.sh b/samples/Lua/HelloLua/proj.android/build_native.sh index 70e662a0d8..40e12f7329 100755 --- a/samples/Lua/HelloLua/proj.android/build_native.sh +++ b/samples/Lua/HelloLua/proj.android/build_native.sh @@ -79,6 +79,9 @@ if [ -f "$file" ]; then fi done +#copy Deprecated.lua +cp "$APP_ROOT"/../../../scripting/lua/script/Deprecated.lua "$APP_ANDROID_ROOT"/assets + if [[ "$buildexternalsfromsource" ]]; then echo "Building external dependencies from source" "$NDK_ROOT"/ndk-build -C "$APP_ANDROID_ROOT" $* \ diff --git a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj index 3dd971f498..5e14770890 100644 --- a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj +++ b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj @@ -95,12 +95,15 @@ $(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.1A\include;$(IntDir);%(AdditionalIncludeDirectories) - libcocos2d.lib;libCocosDenshion.lib;liblua.lib;lua51.lib;libExtensions.lib;%(AdditionalDependencies) + libcocos2d.lib;libCocosDenshion.lib;liblua.lib;lua51.lib;libExtensions.lib;websockets.lib;%(AdditionalDependencies) $(OutDir);%(AdditionalLibraryDirectories) true Windows MachineX86 + + xcopy "$(ProjectDir)..\..\..\..\scripting\lua\script\Deprecated.lua" "$(ProjectDir)..\..\HelloLua\Resources" /e /Y + diff --git a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id index e7a67e70c5..6c626ffa1f 100644 --- a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id +++ b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id @@ -1 +1 @@ -6cd03232ead4eb4ed276ac13b14762099984683d \ No newline at end of file +8049a6272800a59fa3ecf062ee7426248ec69d3a \ No newline at end of file diff --git a/scripting/lua/script/Deprecated.lua b/scripting/lua/script/Deprecated.lua index 08885353c5..2167840933 100644 --- a/scripting/lua/script/Deprecated.lua +++ b/scripting/lua/script/Deprecated.lua @@ -1,337 +1,343 @@ -local function deprecatedTip(funcName) - local tip = string.format("%s is deprecated function",funcName) - print(tip) +local function deprecatedTip(old_name,new_name) + print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") end local function addHandleOfControlEvent(self,func,controlEvent) - deprecatedTip("addHandleOfControlEvent") + deprecatedTip("addHandleOfControlEvent","registerControlEventHandler") self:registerControlEventHandler(func,controlEvent) end rawset(CCControl,"addHandleOfControlEvent",addHandleOfControlEvent) local function ccpLineIntersect(a,b,c,d,s,t) - deprecatedTip("ccpLineIntersect") + deprecatedTip("ccpLineIntersect","CCPoint:isLineIntersect") return CCPoint:isLineIntersect(a,b,c,d,s,t) end rawset(_G,"ccpLineIntersect",ccpLineIntersect) local function CCPointMake(x,y) - deprecatedTip("CCPointMake") - return CCPoint:new_local(x,y) + deprecatedTip("CCPointMake","CCPoint:__call") + return CCPoint:__call(x,y) end rawset(_G,"CCPointMake",CCPointMake) local function ccp(x,y) - deprecatedTip("ccp") - return CCPoint:new_local(x,y) + deprecatedTip("ccp","CCPoint:__call") + return CCPoint:__call(x,y) end rawset(_G,"ccp",ccp) local function CCSizeMake(width,height) - deprecatedTip("CCSizeMake") - return CCSize:new_local(width,height) + deprecatedTip("CCSizeMake","CCSize:__call") + return CCSize:__call(width,height) end rawset(_G,"CCSizeMake",CCSizeMake) local function CCRectMake(x,y,width,height) - deprecatedTip("CCRectMake") - return CCRect:new_local(x,y,width,height) + deprecatedTip("CCRectMake","CCRect:__call") + return CCRect:__call(x,y,width,height) end rawset(_G,"CCRectMake",CCRectMake) local function ccpNeg(pt) - deprecatedTip("ccpNeg") + deprecatedTip("ccpNeg","CCPoint.__sub") return CCPoint.__sub(CCPoint:new_local(0,0),pt) end rawset(_G,"ccpNeg",ccpNeg) local function ccpAdd(pt1,pt2) - deprecatedTip("ccpAdd") + deprecatedTip("ccpAdd","CCPoint.__add") return CCPoint.__add(pt1,pt2) end rawset(_G,"ccpAdd",ccpAdd) local function ccpSub(pt1,pt2) - deprecatedTip("ccpSub") + deprecatedTip("ccpSub","CCPoint.__sub") return CCPoint.__sub(pt1,pt2) end rawset(_G,"ccpSub",ccpSub) local function ccpMult(pt,factor) - deprecatedTip("ccpMult") + deprecatedTip("ccpMult","CCPoint.__mul") return CCPoint.__mul(pt,factor) end rawset(_G,"ccpMult",ccpMult) local function ccpMidpoint(pt1,pt2) - deprecatedTip("ccpMidpoint") + deprecatedTip("ccpMidpoint","CCPoint:getMidpoint") return pt1:getMidpoint(pt2) end rawset(_G,"ccpMidpoint",ccpMidpoint) local function ccpDot(pt1,pt2) - deprecatedTip("ccpDot") + deprecatedTip("ccpDot","CCPoint:dot") return pt1:dot(pt2) end rawset(_G,"ccpDot",ccpDot) local function ccpCross(pt1,pt2) - deprecatedTip("ccpCross") + deprecatedTip("ccpCross","CCPoint:cross") return pt1:cross(pt2) end rawset(_G,"ccpCross",ccpCross) local function ccpPerp(pt) - deprecatedTip("ccpPerp") + deprecatedTip("ccpPerp","CCPoint:getPerp") return pt:getPerp() end rawset(_G,"ccpPerp",ccpPerp) local function ccpRPerp(pt) - deprecatedTip("ccpRPerp") + deprecatedTip("ccpRPerp","CCPoint:getRPerp") return pt:getRPerp() end rawset(_G,"ccpRPerp",ccpRPerp) --no test local function ccpProject(pt1,pt2) - deprecatedTip("ccpProject") + deprecatedTip("ccpProject","CCPoint:project") return pt1:project(pt2) end rawset(_G,"ccpProject",ccpProject) local function ccpRotate(pt1,pt2) - deprecatedTip("ccpRotate") + deprecatedTip("ccpRotate","CCPoint:rotate") return pt1:rotate(pt2) end rawset(_G,"ccpRotate",ccpRotate) local function ccpUnrotate(pt1,pt2) - deprecatedTip("ccpUnrotate") + deprecatedTip("ccpUnrotate","CCPoint:unrotate") return pt1:unrotate(pt2) end rawset(_G,"ccpUnrotate",ccpUnrotate) local function ccpLengthSQ(pt) - deprecatedTip("ccpLengthSQ") + deprecatedTip("ccpLengthSQ","CCPoint:getLengthSq") return pt:getLengthSq(pt) end rawset(_G,"ccpLengthSQ",ccpLengthSQ) local function ccpDistanceSQ(pt1,pt2) - deprecatedTip("ccpDistanceSQ") + deprecatedTip("ccpDistanceSQ","CCPoint:__sub(pt1,pt2):getLengthSq") return (CCPoint.__sub(pt1,pt2)):getLengthSq() end rawset(_G,"ccpDistanceSQ",ccpDistanceSQ) local function ccpLength(pt) - deprecatedTip("ccpLength") + deprecatedTip("ccpLength","CCPoint:getLength") return pt:getLength() end rawset(_G,"ccpLength",ccpLength) local function ccpDistance(pt1,pt2) - deprecatedTip("ccpDistance") + deprecatedTip("ccpDistance","CCPoint:getDistance") return pt1:getDistance(pt2) end rawset(_G,"ccpDistance",ccpDistance) local function ccpNormalize(pt) - deprecatedTip("ccpNormalize") + deprecatedTip("ccpNormalize","CCPoint:getDistance") return pt:getDistance() end rawset(_G,"ccpNormalize",ccpNormalize) local function ccpForAngle(angle) - deprecatedTip("ccpForAngle") + deprecatedTip("ccpForAngle","CCPoint:forAngle") return CCPoint:forAngle(angle) end rawset(_G,"ccpForAngle",ccpForAngle) local function ccpToAngle(pt) - deprecatedTip("ccpToAngle") + deprecatedTip("ccpToAngle","CCPoint:getAngle") return pt:getAngle() end rawset(_G,"ccpToAngle",ccpToAngle) local function ccpClamp(pt1,pt2,pt3) - deprecatedTip("ccpClamp") + deprecatedTip("ccpClamp","CCPoint:getClampPoint") return pt1:getClampPoint(pt2, pt3) end rawset(_G,"ccpClamp",ccpClamp) local function ccpFromSize(sz) - deprecatedTip("ccpFromSize") - return CCPoint:new_local(sz) + deprecatedTip("ccpFromSize","CCPoint:__call") + return CCPoint:__call(sz) end rawset(_G,"ccpFromSize",ccpFromSize) local function ccpLerp(pt1,pt2,alpha) - deprecatedTip("ccpLerp") + deprecatedTip("ccpLerp","CCPoint:lerp") return pt1:lerp(pt2,alpha) end rawset(_G,"ccpLerp",ccpLerp) local function ccpFuzzyEqual(pt1,pt2,variance) - deprecatedTip("ccpFuzzyEqual") + deprecatedTip("ccpFuzzyEqual","CCPoint:fuzzyEquals") return pt1:fuzzyEquals(pt2,variance) end rawset(_G,"ccpFuzzyEqual",ccpFuzzyEqual) local function ccpCompMult(pt1,pt2) - deprecatedTip("ccpCompMult") - return CCPoint:new_local(pt1.x * pt2.x , pt1.y * pt2.y) + deprecatedTip("ccpCompMult","CCPoint:__call") + return CCPoint:__call(pt1.x * pt2.x , pt1.y * pt2.y) end rawset(_G,"ccpCompMult",ccpCompMult) local function ccpAngleSigned(pt1,pt2) - deprecatedTip("ccpAngleSigned") + deprecatedTip("ccpAngleSigned","CCPoint:getAngle") return pt1:getAngle(pt2) end rawset(_G,"ccpAngleSigned",ccpAngleSigned) local function ccpAngle(pt1,pt2) - deprecatedTip("ccpAngle") + deprecatedTip("ccpAngle","CCPoint:getAngle") return pt1:getAngle(pt2) end rawset(_G,"ccpAngle",ccpAngle) local function ccpRotateByAngle(pt1,pt2,angle) - deprecatedTip("ccpRotateByAngle") + deprecatedTip("ccpRotateByAngle","CCPoint:rotateByAngle") return pt1:rotateByAngle(pt2, angle) end rawset(_G,"ccpRotateByAngle",ccpRotateByAngle) local function ccpSegmentIntersect(pt1,pt2,pt3,pt4) - deprecatedTip("ccpSegmentIntersect") + deprecatedTip("ccpSegmentIntersect","CCPoint:isSegmentIntersect") return CCPoint:isSegmentIntersect(pt1,pt2,pt3,pt4) end rawset(_G,"ccpSegmentIntersect",ccpSegmentIntersect) local function ccpIntersectPoint(pt1,pt2,pt3,pt4) - deprecatedTip("ccpIntersectPoint") + deprecatedTip("ccpIntersectPoint","CCPoint:getIntersectPoint") return CCPoint:getIntersectPoint(pt1,pt2,pt3,pt4) end rawset(_G,"ccpIntersectPoint",ccpIntersectPoint) local function sharedOpenGLView() - deprecatedTip("sharedOpenGLView") + deprecatedTip("CCEGLView:sharedOpenGLView","CCEGLView:getInstance") return CCEGLView:getInstance() end rawset(CCEGLView,"sharedOpenGLView",sharedOpenGLView) local function sharedFileUtils() - deprecatedTip("sharedFileUtils") + deprecatedTip("CCFileUtils:sharedFileUtils","CCFileUtils:getInstance") return CCFileUtils:getInstance() end rawset(CCFileUtils,"sharedFileUtils",sharedFileUtils) local function purgeFileUtils() - deprecatedTip("purgeFileUtils") + deprecatedTip("CCFileUtils:purgeFileUtils","CCFileUtils:destroyInstance") return CCFileUtils:destroyInstance() end rawset(CCFileUtils,"purgeFileUtils",purgeFileUtils) local function sharedApplication() - deprecatedTip("sharedApplication") + deprecatedTip("CCApplication:sharedApplication","CCApplication:getInstance") return CCApplication:getInstance() end rawset(CCApplication,"sharedApplication",sharedApplication) local function sharedDirector() - deprecatedTip("sharedDirector") + deprecatedTip("CCDirector:sharedDirector","CCDirector:getInstance") return CCDirector:getInstance() end rawset(CCDirector,"sharedDirector",sharedDirector) local function sharedUserDefault() - deprecatedTip("sharedUserDefault") + deprecatedTip("CCUserDefault:sharedUserDefault","CCUserDefault:getInstance") return CCUserDefault:getInstance() end rawset(CCUserDefault,"sharedUserDefault",sharedUserDefault) local function purgeSharedUserDefault() - deprecatedTip("purgeSharedUserDefault") + deprecatedTip("CCUserDefault:purgeSharedUserDefault","CCUserDefault:destroyInstance") return CCUserDefault:destroyInstance() end rawset(CCUserDefault,"purgeSharedUserDefault",purgeSharedUserDefault) local function sharedNotificationCenter() - deprecatedTip("sharedNotificationCenter") + deprecatedTip("CCNotificationCenter:sharedNotificationCenter","CCNotificationCenter:getInstance") return CCNotificationCenter:getInstance() end rawset(CCNotificationCenter,"sharedNotificationCenter",sharedNotificationCenter) local function purgeNotificationCenter() - deprecatedTip("purgeNotificationCenter") + deprecatedTip("CCNotificationCenter:purgeNotificationCenter","CCNotificationCenter:destroyInstance") return CCNotificationCenter:destroyInstance() end rawset(CCNotificationCenter,"purgeNotificationCenter",purgeNotificationCenter) local function sharedTextureCache() - deprecatedTip("sharedTextureCache") + deprecatedTip("CCTextureCache:sharedTextureCache","CCTextureCache:getInstance") return CCTextureCache:getInstance() end rawset(CCTextureCache,"sharedTextureCache",sharedTextureCache) local function purgeSharedTextureCache() - deprecatedTip("purgeSharedTextureCache") + deprecatedTip("CCTextureCache:purgeSharedTextureCache","CCTextureCache:destroyInstance") return CCTextureCache:destroyInstance() end rawset(CCTextureCache,"purgeSharedTextureCache",purgeSharedTextureCache) local function sharedSpriteFrameCache() - deprecatedTip("sharedSpriteFrameCache") + deprecatedTip("CCSpriteFrameCache:sharedSpriteFrameCache","CCSpriteFrameCache:getInstance") return CCSpriteFrameCache:getInstance() end rawset(CCSpriteFrameCache,"sharedSpriteFrameCache",sharedSpriteFrameCache) local function purgeSharedSpriteFrameCache() - deprecatedTip("purgeSharedSpriteFrameCache") + deprecatedTip("CCSpriteFrameCache:purgeSharedSpriteFrameCache","CCSpriteFrameCache:destroyInstance") return CCSpriteFrameCache:destroyInstance() end rawset(CCSpriteFrameCache,"purgeSharedSpriteFrameCache",purgeSharedSpriteFrameCache) local function vertex(self,pt) - deprecatedTip("vertex") + deprecatedTip("vertex","CCGrid3DAction:getVertex") return self:getVertex(pt) end rawset(CCGrid3DAction,"vertex",vertex) local function originalVertex(self,pt) - deprecatedTip("originalVertex") + deprecatedTip("originalVertex","CCGrid3DAction:getOriginalVertex") return self:getOriginalVertex(pt) end rawset(CCGrid3DAction,"originalVertex",originalVertex) local function tile(self,pt) - deprecatedTip("tile") + deprecatedTip("tile","CCTiledGrid3DAction:getTile") return self:getTile(pt) end rawset(CCTiledGrid3DAction,"tile",tile) local function originalTile(self,pt) - deprecatedTip("originalTile") + deprecatedTip("originalTile","CCTiledGrid3DAction:getOriginalTile") return self:getOriginalTile(pt) end rawset(CCTiledGrid3DAction,"originalTile",originalTile) local function sharedAnimationCache() - deprecatedTip("sharedAnimationCache") + deprecatedTip("CCAnimationCache:sharedAnimationCache","CCAnimationCache:getInstance") return CCAnimationCache:getInstance() end rawset(CCAnimationCache,"sharedAnimationCache",sharedAnimationCache) local function purgeSharedAnimationCache() - deprecatedTip("purgeSharedAnimationCache") + deprecatedTip("CCAnimationCache:purgeSharedAnimationCache","CCAnimationCache:destroyInstance") return CCAnimationCache:destroyInstance() end rawset(CCAnimationCache,"purgeSharedAnimationCache",purgeSharedAnimationCache) +local function boundingBox(self) + deprecatedTip("CCNode:boundingBox","CCNode:getBoundingBox") + return self:getBoundingBox() +end +rawset(CCNode,"boundingBox",boundingBox) + + diff --git a/tools/tolua++/CCNode.pkg b/tools/tolua++/CCNode.pkg index 71e9628c74..cec1bd1cd2 100644 --- a/tools/tolua++/CCNode.pkg +++ b/tools/tolua++/CCNode.pkg @@ -86,7 +86,7 @@ class CCNode : public CCObject void visit(void); void transform(void); void transformAncestors(void); - CCRect boundingBox(void); + CCRect getBoundingBox(void) const; CCAction* runAction(CCAction* action); void stopAllActions(void); diff --git a/tools/tolua++/CCTexture2D.pkg b/tools/tolua++/CCTexture2D.pkg index 81530a082f..5334207b36 100644 --- a/tools/tolua++/CCTexture2D.pkg +++ b/tools/tolua++/CCTexture2D.pkg @@ -389,7 +389,8 @@ //comment nextline since it wasn't defined in glew.h of windows // #define GL_RGB565 0x8D62 #define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_STENCIL_INDEX 0x1901 +//comment nextline since it wasn't defined in gl.h of mac5.0 +//#define GL_STENCIL_INDEX 0x1901 #define GL_STENCIL_INDEX8 0x8D48 #define GL_RENDERBUFFER_WIDTH 0x8D42 From 18fa6f2fbd69091aea8210646eff61eae87661e0 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 19 Jul 2013 15:29:36 +0800 Subject: [PATCH 3/6] issue #2404:Modify a comment --- tools/tolua++/CCTexture2D.pkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tolua++/CCTexture2D.pkg b/tools/tolua++/CCTexture2D.pkg index 5334207b36..c3eaec930f 100644 --- a/tools/tolua++/CCTexture2D.pkg +++ b/tools/tolua++/CCTexture2D.pkg @@ -389,7 +389,7 @@ //comment nextline since it wasn't defined in glew.h of windows // #define GL_RGB565 0x8D62 #define GL_DEPTH_COMPONENT16 0x81A5 -//comment nextline since it wasn't defined in gl.h of mac5.0 +//comment nextline since it wasn't defined in gl.h of Xcode5.0's sdk //#define GL_STENCIL_INDEX 0x1901 #define GL_STENCIL_INDEX8 0x8D48 From 4eb6d7aea43fc87771887ac180086f170c81c031 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Fri, 19 Jul 2013 15:38:17 +0800 Subject: [PATCH 4/6] issue #2404:Modify a comment --- tools/tolua++/CCTexture2D.pkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tolua++/CCTexture2D.pkg b/tools/tolua++/CCTexture2D.pkg index c3eaec930f..a2d5254c82 100644 --- a/tools/tolua++/CCTexture2D.pkg +++ b/tools/tolua++/CCTexture2D.pkg @@ -389,7 +389,7 @@ //comment nextline since it wasn't defined in glew.h of windows // #define GL_RGB565 0x8D62 #define GL_DEPTH_COMPONENT16 0x81A5 -//comment nextline since it wasn't defined in gl.h of Xcode5.0's sdk +//comment nextline since it wasn't defined in gl.h of IOS7 sdk //#define GL_STENCIL_INDEX 0x1901 #define GL_STENCIL_INDEX8 0x8D48 From 1f5f6e8fa23ed5e67f92911ff02c981642b5af96 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 22 Jul 2013 09:36:00 +0800 Subject: [PATCH 5/6] issue #2404:Modify configs --- samples/Lua/HelloLua/proj.android/build_native.sh | 13 +++++++++++-- samples/Lua/HelloLua/proj.emscripten/Makefile | 1 + samples/Lua/HelloLua/proj.linux/Makefile | 1 + samples/Lua/HelloLua/proj.marmalade/HelloLua.mkb | 2 +- samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/samples/Lua/HelloLua/proj.android/build_native.sh b/samples/Lua/HelloLua/proj.android/build_native.sh index 40e12f7329..ffbe9e564f 100755 --- a/samples/Lua/HelloLua/proj.android/build_native.sh +++ b/samples/Lua/HelloLua/proj.android/build_native.sh @@ -79,8 +79,17 @@ if [ -f "$file" ]; then fi done -#copy Deprecated.lua -cp "$APP_ROOT"/../../../scripting/lua/script/Deprecated.lua "$APP_ANDROID_ROOT"/assets +#copy comment script +for file in "$APP_ROOT"/../../../scripting/lua/script/* +do +if [ -d "$file" ]; then + cp -rf "$file" "$APP_ANDROID_ROOT"/assets +fi + +if [ -f "$file" ]; then + cp "$file" "$APP_ANDROID_ROOT"/assets +fi +done if [[ "$buildexternalsfromsource" ]]; then echo "Building external dependencies from source" diff --git a/samples/Lua/HelloLua/proj.emscripten/Makefile b/samples/Lua/HelloLua/proj.emscripten/Makefile index 35dbca8492..3cb02a4db5 100644 --- a/samples/Lua/HelloLua/proj.emscripten/Makefile +++ b/samples/Lua/HelloLua/proj.emscripten/Makefile @@ -16,6 +16,7 @@ include $(COCOS_ROOT)/cocos2dx/proj.emscripten/cocos2dx.mk $(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) @mkdir -p $(@D) + cp -r ../../../../scripting/lua/script/ ../../../../samples/Lua/HelloLua/Resources $(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS) $(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) diff --git a/samples/Lua/HelloLua/proj.linux/Makefile b/samples/Lua/HelloLua/proj.linux/Makefile index e1b282e63e..f0b63ea010 100644 --- a/samples/Lua/HelloLua/proj.linux/Makefile +++ b/samples/Lua/HelloLua/proj.linux/Makefile @@ -16,6 +16,7 @@ include $(COCOS_ROOT)/cocos2dx/proj.linux/cocos2dx.mk $(TARGET): $(OBJECTS) $(STATICLIBS) $(COCOS_LIBS) $(CORE_MAKEFILE_LIST) @mkdir -p $(@D) + cp -n ../../../../scripting/lua/script/* ../../../../samples/Lua/HelloLua/Resources $(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -o $@ $(SHAREDLIBS) $(STATICLIBS) $(LIBS) $(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST) diff --git a/samples/Lua/HelloLua/proj.marmalade/HelloLua.mkb b/samples/Lua/HelloLua/proj.marmalade/HelloLua.mkb index bebf68dd2d..a8f786b8d1 100644 --- a/samples/Lua/HelloLua/proj.marmalade/HelloLua.mkb +++ b/samples/Lua/HelloLua/proj.marmalade/HelloLua.mkb @@ -55,4 +55,4 @@ files AppDelegate.cpp } - +postbuild "cccopy.py -s ../../../../scripting/lua/script/ -d ../../../../samples/Lua/HelloLua/Resources/" diff --git a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj index 5e14770890..d00b43f5d4 100644 --- a/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj +++ b/samples/Lua/HelloLua/proj.win32/HelloLua.vcxproj @@ -102,7 +102,7 @@ MachineX86 - xcopy "$(ProjectDir)..\..\..\..\scripting\lua\script\Deprecated.lua" "$(ProjectDir)..\..\HelloLua\Resources" /e /Y + xcopy "$(ProjectDir)..\..\..\..\scripting\lua\script" "$(ProjectDir)..\..\HelloLua\Resources" /e /Y From 510a5912fdd9bcc4aa8a3fe4615762c4e5981373 Mon Sep 17 00:00:00 2001 From: samuele3hu Date: Mon, 22 Jul 2013 13:42:58 +0800 Subject: [PATCH 6/6] issue #2404:Add many functions to Deprecated.lua --- .../lua/cocos2dx_support/CCLuaBridge.cpp | 2 +- .../lua/cocos2dx_support/CCLuaEngine.cpp | 2 +- scripting/lua/cocos2dx_support/CCLuaEngine.h | 3 +- .../LuaCocos2d.cpp.REMOVED.git-id | 2 +- .../lua/cocos2dx_support/Lua_web_socket.cpp | 2 +- scripting/lua/script/Deprecated.lua | 116 +++++++++++++++++- tools/tolua++/CCActionManager.pkg | 2 +- tools/tolua++/CCMenuItem.pkg | 10 +- tools/tolua++/CCNode.pkg | 2 +- tools/tolua++/CCScheduler.pkg | 2 +- tools/tolua++/CCSpriteFrameCache.pkg | 2 +- tools/tolua++/CCTMXLayer.pkg | 8 +- tools/tolua++/CCTexture2D.pkg | 8 +- tools/tolua++/CCTileMapAtlas.pkg | 2 +- tools/tolua++/SimpleAudioEngine.pkg | 2 +- 15 files changed, 138 insertions(+), 27 deletions(-) diff --git a/scripting/lua/cocos2dx_support/CCLuaBridge.cpp b/scripting/lua/cocos2dx_support/CCLuaBridge.cpp index e3179bb723..c915636448 100644 --- a/scripting/lua/cocos2dx_support/CCLuaBridge.cpp +++ b/scripting/lua/cocos2dx_support/CCLuaBridge.cpp @@ -31,7 +31,7 @@ int LuaBridge::s_newFunctionId = 0; LuaStack *LuaBridge::getStack(void) { - return LuaEngine::defaultEngine()->getLuaStack(); + return LuaEngine::getInstance()->getLuaStack(); } int LuaBridge::pushLuaFunctionById(int functionId) diff --git a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp b/scripting/lua/cocos2dx_support/CCLuaEngine.cpp index 5163985dc7..1fb32449a8 100644 --- a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp +++ b/scripting/lua/cocos2dx_support/CCLuaEngine.cpp @@ -33,7 +33,7 @@ NS_CC_BEGIN LuaEngine* LuaEngine::_defaultEngine = NULL; -LuaEngine* LuaEngine::defaultEngine(void) +LuaEngine* LuaEngine::getInstance(void) { if (!_defaultEngine) { diff --git a/scripting/lua/cocos2dx_support/CCLuaEngine.h b/scripting/lua/cocos2dx_support/CCLuaEngine.h index beacf42d49..58ae5d498a 100644 --- a/scripting/lua/cocos2dx_support/CCLuaEngine.h +++ b/scripting/lua/cocos2dx_support/CCLuaEngine.h @@ -44,7 +44,8 @@ NS_CC_BEGIN class LuaEngine : public ScriptEngineProtocol { public: - static LuaEngine* defaultEngine(void); + static LuaEngine* getInstance(void); + CC_DEPRECATED_ATTRIBUTE static LuaEngine* defaultEngine(void) { return LuaEngine::getInstance(); } virtual ~LuaEngine(void); virtual ccScriptType getScriptType() { diff --git a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id index 6c626ffa1f..31541bd2fb 100644 --- a/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id +++ b/scripting/lua/cocos2dx_support/LuaCocos2d.cpp.REMOVED.git-id @@ -1 +1 @@ -8049a6272800a59fa3ecf062ee7426248ec69d3a \ No newline at end of file +7314b8a835d96e154da442ff16a7325c94edd276 \ No newline at end of file diff --git a/scripting/lua/cocos2dx_support/Lua_web_socket.cpp b/scripting/lua/cocos2dx_support/Lua_web_socket.cpp index 06ff048c60..449616c5f7 100644 --- a/scripting/lua/cocos2dx_support/Lua_web_socket.cpp +++ b/scripting/lua/cocos2dx_support/Lua_web_socket.cpp @@ -32,7 +32,7 @@ static int SendBinaryMessageToLua(int nHandler,const unsigned char* pTable,int n return 0; } - LuaStack *pStack = LuaEngine::defaultEngine()->getLuaStack(); + LuaStack *pStack = LuaEngine::getInstance()->getLuaStack(); if (NULL == pStack) { return 0; } diff --git a/scripting/lua/script/Deprecated.lua b/scripting/lua/script/Deprecated.lua index 2167840933..7097950c8b 100644 --- a/scripting/lua/script/Deprecated.lua +++ b/scripting/lua/script/Deprecated.lua @@ -337,9 +337,119 @@ local function boundingBox(self) end rawset(CCNode,"boundingBox",boundingBox) - - - +local function numberOfRunningActions(self) + deprecatedTip("CCNode:numberOfRunningActions","CCNode:getNumberOfRunningActions") + return self:getNumberOfRunningActions() +end +rawset(CCNode,"numberOfRunningActions",numberOfRunningActions) + +local function stringForFormat(self) + deprecatedTip("Texture2D:stringForFormat","Texture2D:getStringForFormat") + return self:getStringForFormat() +end +rawset(CCTexture2D,"stringForFormat",stringForFormat) + +local function bitsPerPixelForFormat(self) + deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat") + return self:getBitsPerPixelForFormat() +end +rawset(CCTexture2D,"bitsPerPixelForFormat",bitsPerPixelForFormat) + +local function bitsPerPixelForFormat(self,pixelFormat) + deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat") + return self:getBitsPerPixelForFormat(pixelFormat) +end +rawset(CCTexture2D,"bitsPerPixelForFormat",bitsPerPixelForFormat) + +local function defaultAlphaPixelFormat(self) + deprecatedTip("Texture2D:defaultAlphaPixelFormat","Texture2D:getDefaultAlphaPixelFormat") + return self:getDefaultAlphaPixelFormat() +end +rawset(CCTexture2D,"defaultAlphaPixelFormat",defaultAlphaPixelFormat) + +local function spriteFrameByName(self,szName) + deprecatedTip("CCSpriteFrameCache:spriteFrameByName","CCSpriteFrameCache:getSpriteFrameByName") + return self:getSpriteFrameByName(szName) +end +rawset(CCSpriteFrameCache,"spriteFrameByName",spriteFrameByName) + +local function timerWithScriptHandler(handler,seconds) + deprecatedTip("CCTimer:timerWithScriptHandler","CCTimer:createWithScriptHandler") + return CCTimer:createWithScriptHandler(handler,seconds) +end +rawset(CCTimer,"timerWithScriptHandler",timerWithScriptHandler) + +local function numberOfRunningActionsInTarget(self,target) + deprecatedTip("CCActionManager:numberOfRunningActionsInTarget","CCActionManager:getNumberOfRunningActionsInTarget") + return self:getNumberOfRunningActionsInTarget(target) +end +rawset(CCTimer,"numberOfRunningActionsInTarget",numberOfRunningActionsInTarget) + +local function fontSize() + deprecatedTip("CCMenuItemFont:fontSize","CCMenuItemFont:getFontSize") + return CCMenuItemFont:getFontSize() +end +rawset(CCMenuItemFont,"fontSize",fontSize) + +local function fontName() + deprecatedTip("CCMenuItemFont:fontName","CCMenuItemFont:getFontName") + return CCMenuItemFont:getFontName() +end +rawset(CCMenuItemFont,"fontName",fontName) + +local function fontSizeObj(self) + deprecatedTip("CCMenuItemFont:fontSizeObj","CCMenuItemFont:getFontSizeObj") + return self:getFontSizeObj() +end +rawset(CCMenuItemFont,"fontSizeObj",fontSizeObj) + +local function fontNameObj(self) + deprecatedTip("CCMenuItemFont:fontNameObj","CCMenuItemFont:getFontNameObj") + return self:getFontNameObj() +end +rawset(CCMenuItemFont,"fontNameObj",fontNameObj) + +local function selectedItem(self) + deprecatedTip("CCMenuItemToggle:selectedItem","CCMenuItemToggle:getSelectedItem") + return self:getSelectedItem() +end +rawset(CCMenuItemToggle,"selectedItem",selectedItem) + +local function tileAt(self,pos) + deprecatedTip("CCTileMapAtlas:tileAt","CCTileMapAtlas:getTileAt") + return self:getTileAt(pos) +end +rawset(CCTileMapAtlas,"tileAt",tileAt) + +local function tileAt(self,tileCoordinate) + deprecatedTip("CCTMXLayer:tileAt","CCTMXLayer:getTileAt") + return self:getTileAt(tileCoordinate) +end +rawset(CCTMXLayer,"tileAt",tileAt) + +local function tileGIDAt(self,tileCoordinate) + deprecatedTip("CCTMXLayer:tileGIDAt","CCTMXLayer:getTileGIDAt") + return self:getTileGIDAt(tileCoordinate) +end +rawset(CCTMXLayer,"tileGIDAt",tileGIDAt) + +local function positionAt(self,tileCoordinate) + deprecatedTip("CCTMXLayer:positionAt","CCTMXLayer:getPositionAt") + return self:getPositionAt(tileCoordinate) +end +rawset(CCTMXLayer,"positionAt",positionAt) + +local function propertyNamed(self,propertyName) + deprecatedTip("CCTMXLayer:propertyNamed","CCTMXLayer:getPropertyNamed") + return self:getPropertyNamed(propertyName) +end +rawset(CCTMXLayer,"propertyNamed",propertyNamed) + +local function sharedEngine() + deprecatedTip("SimpleAudioEngine:sharedEngine","SimpleAudioEngine:getInstance") + return SimpleAudioEngine:getInstance() +end +rawset(SimpleAudioEngine,"sharedEngine",sharedEngine) diff --git a/tools/tolua++/CCActionManager.pkg b/tools/tolua++/CCActionManager.pkg index 114ad720af..8eb3890da9 100644 --- a/tools/tolua++/CCActionManager.pkg +++ b/tools/tolua++/CCActionManager.pkg @@ -13,7 +13,7 @@ class CCActionManager : public CCObject CCAction* getActionByTag(unsigned int tag, CCObject *pTarget); - unsigned int numberOfRunningActionsInTarget(CCObject *pTarget); + unsigned int getNumberOfRunningActionsInTarget(CCObject *pTarget); void pauseTarget(CCObject *pTarget); diff --git a/tools/tolua++/CCMenuItem.pkg b/tools/tolua++/CCMenuItem.pkg index 577cc379dc..7f0dd8414a 100644 --- a/tools/tolua++/CCMenuItem.pkg +++ b/tools/tolua++/CCMenuItem.pkg @@ -46,13 +46,13 @@ class CCMenuItemAtlasFont : public CCMenuItemLabel class CCMenuItemFont : public CCMenuItemLabel { static void setFontSize(int s); - static unsigned int fontSize(); + static unsigned int getFontSize(); static void setFontName(const char* name); - static const char* fontName(); + static const char* getFontName(); void setFontSizeObj(unsigned int s); - unsigned int fontSizeObj(); + unsigned int getFontSizeObj(); void setFontNameObj(const char* name); - const char* fontNameObj(); + const char* getFontNameObj() const; static CCMenuItemFont * create(const char* value); }; @@ -116,7 +116,7 @@ class CCMenuItemToggle : public CCMenuItem CCArray* getSubItems(); void addSubItem(CCMenuItem *item); - CCMenuItem* selectedItem(); + CCMenuItem* getSelectedItem(); void activate(); void selected(); diff --git a/tools/tolua++/CCNode.pkg b/tools/tolua++/CCNode.pkg index cec1bd1cd2..53c3a9df33 100644 --- a/tools/tolua++/CCNode.pkg +++ b/tools/tolua++/CCNode.pkg @@ -97,7 +97,7 @@ class CCNode : public CCObject const char * description(void) const; CCNode* getChildByTag(int tag); - unsigned int numberOfRunningActions(void); + unsigned int getNumberOfRunningActions(void) const; CCAffineTransform nodeToParentTransform(void); CCAffineTransform parentToNodeTransform(void); diff --git a/tools/tolua++/CCScheduler.pkg b/tools/tolua++/CCScheduler.pkg index f749f35422..1bb53bb84f 100644 --- a/tools/tolua++/CCScheduler.pkg +++ b/tools/tolua++/CCScheduler.pkg @@ -5,7 +5,7 @@ class CCTimer : public CCObject void setInterval(float fInterval); void update(float dt); - static CCTimer* timerWithScriptHandler(LUA_FUNCTION funcID, float fSeconds); + static CCTimer* createWithScriptHandler(LUA_FUNCTION funcID, float fSeconds); }; class CCScheduler : public CCObject diff --git a/tools/tolua++/CCSpriteFrameCache.pkg b/tools/tolua++/CCSpriteFrameCache.pkg index fd2bc3d45e..207042b654 100644 --- a/tools/tolua++/CCSpriteFrameCache.pkg +++ b/tools/tolua++/CCSpriteFrameCache.pkg @@ -14,7 +14,7 @@ class CCSpriteFrameCache : public CCObject //void removeSpriteFramesFromDictionary(CCDictionary *dictionary); void removeSpriteFramesFromTexture(CCTexture2D* texture); - CCSpriteFrame* spriteFrameByName(const char *pszName); + CCSpriteFrame* getSpriteFrameByName(const char *pszName); static CCSpriteFrameCache* getInstance(); static void destroyInstance(); diff --git a/tools/tolua++/CCTMXLayer.pkg b/tools/tolua++/CCTMXLayer.pkg index b76dbec9d8..b72ea3be5c 100644 --- a/tools/tolua++/CCTMXLayer.pkg +++ b/tools/tolua++/CCTMXLayer.pkg @@ -21,13 +21,13 @@ class CCTMXLayer : public CCSpriteBatchNode void releaseMap(); - CCSprite* tileAt(CCPoint tileCoordinate); - unsigned int tileGIDAt(const CCPoint& tileCoordinate); + CCSprite* getTileAt(const CCPoint& tileCoordinate); + unsigned int getTileGIDAt(const CCPoint& tileCoordinate); void setTileGID(unsigned int gid, const CCPoint& tileCoordinate); void setTileGID(unsigned int gid, const CCPoint& tileCoordinate, ccTMXTileFlags flags); void removeTileAt(CCPoint tileCoordinate); - CCPoint positionAt(CCPoint tileCoordinate); - CCString *propertyNamed(const char *propertyName); + CCPoint getPositionAt(CCPoint tileCoordinate); + CCString *getPropertyNamed(const char *propertyName) const; void setupTiles(); void setLayerName(const char *layerName); diff --git a/tools/tolua++/CCTexture2D.pkg b/tools/tolua++/CCTexture2D.pkg index a2d5254c82..61f2693313 100644 --- a/tools/tolua++/CCTexture2D.pkg +++ b/tools/tolua++/CCTexture2D.pkg @@ -505,10 +505,10 @@ class CCTexture2D : public CCObject void setAliasTexParameters(); void generateMipmap(); - const char* stringForFormat() const; - unsigned int bitsPerPixelForFormat() const; - unsigned int bitsPerPixelForFormat(CCTexture2DPixelFormat format) const; + const char* getStringForFormat() const; + unsigned int getBitsPerPixelForFormat() const; + unsigned int getBitsPerPixelForFormat(CCTexture2DPixelFormat format) const; static void setDefaultAlphaPixelFormat(CCTexture2DPixelFormat format); - static CCTexture2DPixelFormat defaultAlphaPixelFormat(); + static CCTexture2DPixelFormat getDefaultAlphaPixelFormat(); }; diff --git a/tools/tolua++/CCTileMapAtlas.pkg b/tools/tolua++/CCTileMapAtlas.pkg index 1d614cfae0..2e913f2aa4 100644 --- a/tools/tolua++/CCTileMapAtlas.pkg +++ b/tools/tolua++/CCTileMapAtlas.pkg @@ -10,7 +10,7 @@ class CCTileMapAtlas : public CCAtlasNode void setTile(Color3B tile, CCPoint position); void releaseMap(); - Color3B tileAt(const CCPoint & pos); + Color3B getTileAt(const CCPoint & pos) const; static CCTileMapAtlas * create(const char *tile, const char *mapFile, int tileWidth, int tileHeight); }; diff --git a/tools/tolua++/SimpleAudioEngine.pkg b/tools/tolua++/SimpleAudioEngine.pkg index b850ebc944..b49e83ab5c 100644 --- a/tools/tolua++/SimpleAudioEngine.pkg +++ b/tools/tolua++/SimpleAudioEngine.pkg @@ -1,6 +1,6 @@ class SimpleAudioEngine { - static SimpleAudioEngine* sharedEngine(); + static SimpleAudioEngine* getInstance(); void preloadBackgroundMusic(const char* pszFilePath); void playBackgroundMusic(const char* pszFilePath, bool bLoop = false); void stopBackgroundMusic(bool bReleaseData = false);