diff --git a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id
index 3b81da810d..ee7de1f55a 100644
--- a/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id
+++ b/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id
@@ -1 +1 @@
-62276b5bbca4f4c7b09fa6f3eab9d01aaa7a8372
\ No newline at end of file
+f7781fbb67fc947c54f987d419593d211f6a4020
\ No newline at end of file
diff --git a/samples/Lua/HelloLua/Resources/hello.lua b/samples/Lua/HelloLua/Resources/hello.lua
index 99befa8f0d..6fde4f0f63 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);
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">
-
+
$(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" "$(ProjectDir)..\..\HelloLua\Resources" /e /Y
+
diff --git a/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id b/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id
index a25441c987..a7de9f9e04 100644
--- a/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id
+++ b/samples/samples.xcodeproj/project.pbxproj.REMOVED.git-id
@@ -1 +1 @@
-4a829fc84c7a38d95e536c8a26b4822bff188701
\ No newline at end of file
+32e637c6b271e1eea27e207c13116f43c310c0d4
\ No newline at end of file
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 3a9fae18b8..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)
{
@@ -54,6 +54,7 @@ bool LuaEngine::init(void)
_stack = LuaStack::create();
_stack->retain();
extendLuaObject();
+ executeScriptFile("Deprecated.lua");
return true;
}
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 00135a60b3..31541bd2fb 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
+7314b8a835d96e154da442ff16a7325c94edd276
\ No newline at end of file
diff --git a/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp b/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp
index aeb7aca9c8..ae3e4a71f4 100644
--- a/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp
+++ b/scripting/lua/cocos2dx_support/LuaScriptHandlerMgr.cpp
@@ -320,7 +320,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/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
new file mode 100644
index 0000000000..7097950c8b
--- /dev/null
+++ b/scripting/lua/script/Deprecated.lua
@@ -0,0 +1,458 @@
+
+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","registerControlEventHandler")
+ self:registerControlEventHandler(func,controlEvent)
+end
+rawset(CCControl,"addHandleOfControlEvent",addHandleOfControlEvent)
+
+local function ccpLineIntersect(a,b,c,d,s,t)
+ 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","CCPoint:__call")
+ return CCPoint:__call(x,y)
+end
+rawset(_G,"CCPointMake",CCPointMake)
+
+local function ccp(x,y)
+ deprecatedTip("ccp","CCPoint:__call")
+ return CCPoint:__call(x,y)
+end
+rawset(_G,"ccp",ccp)
+
+local function CCSizeMake(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","CCRect:__call")
+ return CCRect:__call(x,y,width,height)
+end
+rawset(_G,"CCRectMake",CCRectMake)
+
+local function ccpNeg(pt)
+ 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","CCPoint.__add")
+ return CCPoint.__add(pt1,pt2)
+end
+rawset(_G,"ccpAdd",ccpAdd)
+
+local function ccpSub(pt1,pt2)
+ deprecatedTip("ccpSub","CCPoint.__sub")
+ return CCPoint.__sub(pt1,pt2)
+end
+rawset(_G,"ccpSub",ccpSub)
+
+local function ccpMult(pt,factor)
+ deprecatedTip("ccpMult","CCPoint.__mul")
+ return CCPoint.__mul(pt,factor)
+end
+rawset(_G,"ccpMult",ccpMult)
+
+local function ccpMidpoint(pt1,pt2)
+ deprecatedTip("ccpMidpoint","CCPoint:getMidpoint")
+ return pt1:getMidpoint(pt2)
+end
+rawset(_G,"ccpMidpoint",ccpMidpoint)
+
+local function ccpDot(pt1,pt2)
+ deprecatedTip("ccpDot","CCPoint:dot")
+ return pt1:dot(pt2)
+end
+rawset(_G,"ccpDot",ccpDot)
+
+local function ccpCross(pt1,pt2)
+ deprecatedTip("ccpCross","CCPoint:cross")
+ return pt1:cross(pt2)
+end
+rawset(_G,"ccpCross",ccpCross)
+
+local function ccpPerp(pt)
+ deprecatedTip("ccpPerp","CCPoint:getPerp")
+ return pt:getPerp()
+end
+rawset(_G,"ccpPerp",ccpPerp)
+
+local function ccpRPerp(pt)
+ deprecatedTip("ccpRPerp","CCPoint:getRPerp")
+ return pt:getRPerp()
+end
+rawset(_G,"ccpRPerp",ccpRPerp)
+
+--no test
+local function ccpProject(pt1,pt2)
+ deprecatedTip("ccpProject","CCPoint:project")
+ return pt1:project(pt2)
+end
+rawset(_G,"ccpProject",ccpProject)
+
+local function ccpRotate(pt1,pt2)
+ deprecatedTip("ccpRotate","CCPoint:rotate")
+ return pt1:rotate(pt2)
+end
+rawset(_G,"ccpRotate",ccpRotate)
+
+local function ccpUnrotate(pt1,pt2)
+ deprecatedTip("ccpUnrotate","CCPoint:unrotate")
+ return pt1:unrotate(pt2)
+end
+rawset(_G,"ccpUnrotate",ccpUnrotate)
+
+local function ccpLengthSQ(pt)
+ deprecatedTip("ccpLengthSQ","CCPoint:getLengthSq")
+ return pt:getLengthSq(pt)
+end
+rawset(_G,"ccpLengthSQ",ccpLengthSQ)
+
+local function ccpDistanceSQ(pt1,pt2)
+ deprecatedTip("ccpDistanceSQ","CCPoint:__sub(pt1,pt2):getLengthSq")
+ return (CCPoint.__sub(pt1,pt2)):getLengthSq()
+end
+rawset(_G,"ccpDistanceSQ",ccpDistanceSQ)
+
+local function ccpLength(pt)
+ deprecatedTip("ccpLength","CCPoint:getLength")
+ return pt:getLength()
+end
+rawset(_G,"ccpLength",ccpLength)
+
+local function ccpDistance(pt1,pt2)
+ deprecatedTip("ccpDistance","CCPoint:getDistance")
+ return pt1:getDistance(pt2)
+end
+rawset(_G,"ccpDistance",ccpDistance)
+
+local function ccpNormalize(pt)
+ deprecatedTip("ccpNormalize","CCPoint:getDistance")
+ return pt:getDistance()
+end
+rawset(_G,"ccpNormalize",ccpNormalize)
+
+local function ccpForAngle(angle)
+ deprecatedTip("ccpForAngle","CCPoint:forAngle")
+ return CCPoint:forAngle(angle)
+end
+rawset(_G,"ccpForAngle",ccpForAngle)
+
+local function ccpToAngle(pt)
+ deprecatedTip("ccpToAngle","CCPoint:getAngle")
+ return pt:getAngle()
+end
+rawset(_G,"ccpToAngle",ccpToAngle)
+
+local function ccpClamp(pt1,pt2,pt3)
+ deprecatedTip("ccpClamp","CCPoint:getClampPoint")
+ return pt1:getClampPoint(pt2, pt3)
+end
+rawset(_G,"ccpClamp",ccpClamp)
+
+
+local function ccpFromSize(sz)
+ deprecatedTip("ccpFromSize","CCPoint:__call")
+ return CCPoint:__call(sz)
+end
+rawset(_G,"ccpFromSize",ccpFromSize)
+
+local function ccpLerp(pt1,pt2,alpha)
+ deprecatedTip("ccpLerp","CCPoint:lerp")
+ return pt1:lerp(pt2,alpha)
+end
+rawset(_G,"ccpLerp",ccpLerp)
+
+local function ccpFuzzyEqual(pt1,pt2,variance)
+ deprecatedTip("ccpFuzzyEqual","CCPoint:fuzzyEquals")
+ return pt1:fuzzyEquals(pt2,variance)
+end
+rawset(_G,"ccpFuzzyEqual",ccpFuzzyEqual)
+
+local function ccpCompMult(pt1,pt2)
+ 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","CCPoint:getAngle")
+ return pt1:getAngle(pt2)
+end
+rawset(_G,"ccpAngleSigned",ccpAngleSigned)
+
+local function ccpAngle(pt1,pt2)
+ deprecatedTip("ccpAngle","CCPoint:getAngle")
+ return pt1:getAngle(pt2)
+end
+rawset(_G,"ccpAngle",ccpAngle)
+
+local function ccpRotateByAngle(pt1,pt2,angle)
+ deprecatedTip("ccpRotateByAngle","CCPoint:rotateByAngle")
+ return pt1:rotateByAngle(pt2, angle)
+end
+rawset(_G,"ccpRotateByAngle",ccpRotateByAngle)
+
+local function ccpSegmentIntersect(pt1,pt2,pt3,pt4)
+ 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","CCPoint:getIntersectPoint")
+ return CCPoint:getIntersectPoint(pt1,pt2,pt3,pt4)
+end
+rawset(_G,"ccpIntersectPoint",ccpIntersectPoint)
+
+
+local function sharedOpenGLView()
+ deprecatedTip("CCEGLView:sharedOpenGLView","CCEGLView:getInstance")
+ return CCEGLView:getInstance()
+end
+rawset(CCEGLView,"sharedOpenGLView",sharedOpenGLView)
+
+local function sharedFileUtils()
+ deprecatedTip("CCFileUtils:sharedFileUtils","CCFileUtils:getInstance")
+ return CCFileUtils:getInstance()
+end
+rawset(CCFileUtils,"sharedFileUtils",sharedFileUtils)
+
+local function purgeFileUtils()
+ deprecatedTip("CCFileUtils:purgeFileUtils","CCFileUtils:destroyInstance")
+ return CCFileUtils:destroyInstance()
+end
+rawset(CCFileUtils,"purgeFileUtils",purgeFileUtils)
+
+local function sharedApplication()
+ deprecatedTip("CCApplication:sharedApplication","CCApplication:getInstance")
+ return CCApplication:getInstance()
+end
+rawset(CCApplication,"sharedApplication",sharedApplication)
+
+local function sharedDirector()
+ deprecatedTip("CCDirector:sharedDirector","CCDirector:getInstance")
+ return CCDirector:getInstance()
+end
+rawset(CCDirector,"sharedDirector",sharedDirector)
+
+local function sharedUserDefault()
+ deprecatedTip("CCUserDefault:sharedUserDefault","CCUserDefault:getInstance")
+ return CCUserDefault:getInstance()
+end
+rawset(CCUserDefault,"sharedUserDefault",sharedUserDefault)
+
+local function purgeSharedUserDefault()
+ deprecatedTip("CCUserDefault:purgeSharedUserDefault","CCUserDefault:destroyInstance")
+ return CCUserDefault:destroyInstance()
+end
+rawset(CCUserDefault,"purgeSharedUserDefault",purgeSharedUserDefault)
+
+
+local function sharedNotificationCenter()
+ deprecatedTip("CCNotificationCenter:sharedNotificationCenter","CCNotificationCenter:getInstance")
+ return CCNotificationCenter:getInstance()
+end
+rawset(CCNotificationCenter,"sharedNotificationCenter",sharedNotificationCenter)
+
+local function purgeNotificationCenter()
+ deprecatedTip("CCNotificationCenter:purgeNotificationCenter","CCNotificationCenter:destroyInstance")
+ return CCNotificationCenter:destroyInstance()
+end
+rawset(CCNotificationCenter,"purgeNotificationCenter",purgeNotificationCenter)
+
+local function sharedTextureCache()
+ deprecatedTip("CCTextureCache:sharedTextureCache","CCTextureCache:getInstance")
+ return CCTextureCache:getInstance()
+end
+rawset(CCTextureCache,"sharedTextureCache",sharedTextureCache)
+
+local function purgeSharedTextureCache()
+ deprecatedTip("CCTextureCache:purgeSharedTextureCache","CCTextureCache:destroyInstance")
+ return CCTextureCache:destroyInstance()
+end
+rawset(CCTextureCache,"purgeSharedTextureCache",purgeSharedTextureCache)
+
+local function sharedSpriteFrameCache()
+ deprecatedTip("CCSpriteFrameCache:sharedSpriteFrameCache","CCSpriteFrameCache:getInstance")
+ return CCSpriteFrameCache:getInstance()
+end
+rawset(CCSpriteFrameCache,"sharedSpriteFrameCache",sharedSpriteFrameCache)
+
+local function purgeSharedSpriteFrameCache()
+ deprecatedTip("CCSpriteFrameCache:purgeSharedSpriteFrameCache","CCSpriteFrameCache:destroyInstance")
+ return CCSpriteFrameCache:destroyInstance()
+end
+rawset(CCSpriteFrameCache,"purgeSharedSpriteFrameCache",purgeSharedSpriteFrameCache)
+
+local function vertex(self,pt)
+ deprecatedTip("vertex","CCGrid3DAction:getVertex")
+ return self:getVertex(pt)
+end
+rawset(CCGrid3DAction,"vertex",vertex)
+
+local function originalVertex(self,pt)
+ deprecatedTip("originalVertex","CCGrid3DAction:getOriginalVertex")
+ return self:getOriginalVertex(pt)
+end
+rawset(CCGrid3DAction,"originalVertex",originalVertex)
+
+local function tile(self,pt)
+ deprecatedTip("tile","CCTiledGrid3DAction:getTile")
+ return self:getTile(pt)
+end
+rawset(CCTiledGrid3DAction,"tile",tile)
+
+local function originalTile(self,pt)
+ deprecatedTip("originalTile","CCTiledGrid3DAction:getOriginalTile")
+ return self:getOriginalTile(pt)
+end
+rawset(CCTiledGrid3DAction,"originalTile",originalTile)
+
+local function sharedAnimationCache()
+ deprecatedTip("CCAnimationCache:sharedAnimationCache","CCAnimationCache:getInstance")
+ return CCAnimationCache:getInstance()
+end
+rawset(CCAnimationCache,"sharedAnimationCache",sharedAnimationCache)
+
+local function 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)
+
+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++/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++/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++/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++/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 71e9628c74..53c3a9df33 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);
@@ -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++/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++/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 ded2e70323..207042b654 100644
--- a/tools/tolua++/CCSpriteFrameCache.pkg
+++ b/tools/tolua++/CCSpriteFrameCache.pkg
@@ -14,11 +14,7 @@ class CCSpriteFrameCache : public CCObject
//void removeSpriteFramesFromDictionary(CCDictionary *dictionary);
void removeSpriteFramesFromTexture(CCTexture2D* texture);
- CCSpriteFrame* spriteFrameByName(const char *pszName);
-
- // XXX deprecated
- static CCSpriteFrameCache* sharedSpriteFrameCache(void);
- static void purgeSharedSpriteFrameCache(void);
+ 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 81530a082f..61f2693313 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 IOS7 sdk
+//#define GL_STENCIL_INDEX 0x1901
#define GL_STENCIL_INDEX8 0x8D48
#define GL_RENDERBUFFER_WIDTH 0x8D42
@@ -504,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++/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++/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++/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();
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);