From c1a226686fd07baae29937e4ba9bc96a12cf7c8f Mon Sep 17 00:00:00 2001 From: samuele3 Date: Wed, 4 Dec 2013 15:15:55 +0800 Subject: [PATCH] issue #3309:Modify some deprecated cpp files and lua files --- .../lua/bindings/lua_cocos2dx_deprecated.cpp | 2259 +++++++++++++++++ ...lua_cocos2dx_deprecated.cpp.REMOVED.git-id | 1 - cocos/scripting/lua/script/CCBReaderLoad.lua | 7 + cocos/scripting/lua/script/Deprecated.lua | 40 +- .../scripting/lua/script/DeprecatedClass.lua | 26 + cocos/scripting/lua/script/DeprecatedEnum.lua | 5 + tools/tolua/cocos2dx.ini | 12 +- 7 files changed, 2326 insertions(+), 24 deletions(-) create mode 100644 cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp delete mode 100644 cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp.REMOVED.git-id diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp new file mode 100644 index 0000000000..780ad41a31 --- /dev/null +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp @@ -0,0 +1,2259 @@ +#include "lua_cocos2dx_deprecated.h" + +#ifdef __cplusplus +extern "C" { +#endif +#include "tolua_fix.h" +#ifdef __cplusplus +} +#endif + +#include "cocos2d.h" +#include "LuaBasicConversions.h" +#include "LuaScriptHandlerMgr.h" +#include "CCLuaValue.h" +#include "cocos-ext.h" + +USING_NS_CC; +USING_NS_CC_EXT; + +#define deprecatedClassTip(className) CCLOG("%s will be not binded in lua,please use the lua's table instead",className) +#define deprecatedFunctionTip(oldFun,newFun) CCLOG("%s was deprecated please use %s instead ",oldFun, newFun) +static int tolua_Cocos2d_CCPoint_new00(lua_State* tolua_S) +{ + deprecatedClassTip("CCPoint"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCPoint",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Point tolua_ret; + point_to_luaval(tolua_S, tolua_ret); + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCPoint_new00_local(lua_State* tolua_S) +{ + deprecatedClassTip("CCPoint"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCPoint",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Point tolua_ret; + point_to_luaval(tolua_S, tolua_ret); + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCPoint_new01(lua_State* tolua_S) +{ + deprecatedClassTip("CCPoint"); + + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCPoint",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else + { + float x = ((float) tolua_tonumber(tolua_S,2,0)); + float y = ((float) tolua_tonumber(tolua_S,3,0)); + Point tolua_ret(x,y); + point_to_luaval(tolua_S, tolua_ret); + } + return 1; +tolua_lerror: + return tolua_Cocos2d_CCPoint_new00(tolua_S); +} + + +static int tolua_Cocos2d_CCPoint_new01_local(lua_State* tolua_S) +{ + deprecatedClassTip("CCPoint"); + + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCPoint",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else + { + float x = ((float) tolua_tonumber(tolua_S,2,0)); + float y = ((float) tolua_tonumber(tolua_S,3,0)); + Point tolua_ret(x,y); + point_to_luaval(tolua_S, tolua_ret); + } + return 1; +tolua_lerror: + return tolua_Cocos2d_CCPoint_new00_local(tolua_S); +} + +static int tolua_collect_CCPoint (lua_State* tolua_S) +{ + Point* self = (Point*) tolua_tousertype(tolua_S,1,0); + Mtolua_delete(self); + return 0; +} + +static int register_cocos2dx_deprecated_Point(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"CCPoint"); +#ifdef __cplusplus + tolua_cclass(tolua_S,"CCPoint","CCPoint","",tolua_collect_CCPoint); +#else + tolua_cclass(tolua_S,"CCPoint","CCPoint","",NULL); +#endif + tolua_beginmodule(tolua_S,"CCPoint"); + tolua_function(tolua_S,"new",tolua_Cocos2d_CCPoint_new00); + tolua_function(tolua_S,"new_local",tolua_Cocos2d_CCPoint_new00_local); + tolua_function(tolua_S,".call",tolua_Cocos2d_CCPoint_new00_local); + tolua_function(tolua_S,"new",tolua_Cocos2d_CCPoint_new01); + tolua_function(tolua_S,"new_local",tolua_Cocos2d_CCPoint_new01_local); + tolua_function(tolua_S,".call",tolua_Cocos2d_CCPoint_new01_local); + tolua_endmodule(tolua_S); + + return 1; +} + +static int tolua_Cocos2d_CCRect_new00(lua_State* tolua_S) +{ + deprecatedClassTip("CCRect"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCRect",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Rect tolua_ret; + rect_to_luaval(tolua_S, tolua_ret); + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCRect_new00_local(lua_State* tolua_S) +{ + deprecatedClassTip("CCRect"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCRect",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Rect tolua_ret; + rect_to_luaval(tolua_S, tolua_ret); + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err); + return 0; +#endif +} + +static int tolua_Cocos2d_CCRect_new01(lua_State* tolua_S) +{ + deprecatedClassTip("CCRect"); + + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCRect",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnumber(tolua_S,5,0,&tolua_err) || + !tolua_isnoobj(tolua_S,6,&tolua_err) + ) + goto tolua_lerror; + else + { + float x = ((float) tolua_tonumber(tolua_S,2,0)); + float y = ((float) tolua_tonumber(tolua_S,3,0)); + float width = ((float) tolua_tonumber(tolua_S,4,0)); + float height = ((float) tolua_tonumber(tolua_S,5,0)); + Rect tolua_ret(x, y, width, height); + rect_to_luaval(tolua_S, tolua_ret); + } + return 1; +tolua_lerror: + return tolua_Cocos2d_CCRect_new00(tolua_S); +} + + +static int tolua_Cocos2d_CCRect_new01_local(lua_State* tolua_S) +{ + deprecatedClassTip("CCRect"); + + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCRect",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnumber(tolua_S,4,0,&tolua_err) || + !tolua_isnumber(tolua_S,5,0,&tolua_err) || + !tolua_isnoobj(tolua_S,6,&tolua_err) + ) + goto tolua_lerror; + else + { + float x = ((float) tolua_tonumber(tolua_S,2,0)); + float y = ((float) tolua_tonumber(tolua_S,3,0)); + float width = ((float) tolua_tonumber(tolua_S,4,0)); + float height = ((float) tolua_tonumber(tolua_S,5,0)); + Rect tolua_ret(x, y, width, height); + rect_to_luaval(tolua_S, tolua_ret); + } + return 1; +tolua_lerror: + return tolua_Cocos2d_CCRect_new00_local(tolua_S); +} + +static int register_cocos2dx_deprecated_Rect(lua_State* tolua_S) +{ + + tolua_usertype(tolua_S,"CCRect"); + tolua_cclass(tolua_S,"CCRect","CCRect","",NULL); + tolua_beginmodule(tolua_S,"CCRect"); + tolua_function(tolua_S,"new",tolua_Cocos2d_CCRect_new00); + tolua_function(tolua_S,"new_local",tolua_Cocos2d_CCRect_new00_local); + tolua_function(tolua_S,".call",tolua_Cocos2d_CCRect_new00_local); + tolua_function(tolua_S,"new",tolua_Cocos2d_CCRect_new01); + tolua_function(tolua_S,"new_local",tolua_Cocos2d_CCRect_new01_local); + tolua_function(tolua_S,".call",tolua_Cocos2d_CCRect_new01_local); + tolua_endmodule(tolua_S); + + return 1; +} + +static int tolua_Cocos2d_CCSize_new00(lua_State* tolua_S) +{ + deprecatedClassTip("CCSize"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCSize",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Size tolua_ret; + size_to_luaval(tolua_S, tolua_ret); + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCSize_new00_local(lua_State* tolua_S) +{ + deprecatedClassTip("CCSize"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCSize",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Size tolua_ret; + size_to_luaval(tolua_S, tolua_ret); + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCSize_new01(lua_State* tolua_S) +{ + deprecatedClassTip("CCSize"); + + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCSize",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else + { + float width = ((float) tolua_tonumber(tolua_S,2,0)); + float height = ((float) tolua_tonumber(tolua_S,3,0)); + Size tolua_ret(width, height); + size_to_luaval(tolua_S, tolua_ret); + } + return 1; +tolua_lerror: + return tolua_Cocos2d_CCSize_new00(tolua_S); +} + + + +static int tolua_Cocos2d_CCSize_new01_local(lua_State* tolua_S) +{ + + deprecatedClassTip("CCSize"); + + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCSize",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else + { + float width = ((float) tolua_tonumber(tolua_S,2,0)); + float height = ((float) tolua_tonumber(tolua_S,3,0)); + Size tolua_ret(width, height); + size_to_luaval(tolua_S, tolua_ret); + } + return 1; +tolua_lerror: + return tolua_Cocos2d_CCSize_new00_local(tolua_S); +} + + +static int register_cocos2dx_deprecated_Size(lua_State* tolua_S) +{ + + tolua_usertype(tolua_S,"CCSize"); + tolua_cclass(tolua_S,"CCSize","CCSize","",NULL); + tolua_beginmodule(tolua_S,"CCSize"); + tolua_function(tolua_S,"new",tolua_Cocos2d_CCSize_new00); + tolua_function(tolua_S,"new_local",tolua_Cocos2d_CCSize_new00_local); + tolua_function(tolua_S,".call",tolua_Cocos2d_CCSize_new00_local); + tolua_function(tolua_S,"new",tolua_Cocos2d_CCSize_new01); + tolua_function(tolua_S,"new_local",tolua_Cocos2d_CCSize_new01_local); + tolua_function(tolua_S,".call",tolua_Cocos2d_CCSize_new01_local); + tolua_endmodule(tolua_S); + + return 1; +} + + +static int tolua_Cocos2d_CCArray_create00(lua_State* tolua_S) +{ + + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + { + Array* tolua_ret = (Array*) Array::create(); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCArray"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'create'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_createWithObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"Object",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Object* pObject = ((Object*) tolua_tousertype(tolua_S,2,0)); + { + Array* tolua_ret = (Array*) Array::createWithObject(pObject); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCArray"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'createWithObject'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_createWithArray00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* otherArray = ((Array*) tolua_tousertype(tolua_S,2,0)); + { + Array* tolua_ret = (Array*) Array::createWithArray(otherArray); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCArray"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'createWithArray'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_createWithCapacity00(lua_State* tolua_S) +{ + + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + unsigned int capacity = ((unsigned int) tolua_tonumber(tolua_S,2,0)); + { + Array* tolua_ret = (Array*) Array::createWithCapacity(capacity); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCArray"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'createWithCapacity'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_createWithContentsOfFile00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isstring(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const char* pFileName = ((const char*) tolua_tostring(tolua_S,2,0)); + { + Array* tolua_ret = (Array*) Array::createWithContentsOfFile(pFileName); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCArray"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'createWithContentsOfFile'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_count00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'count'", NULL); +#endif + { + unsigned int tolua_ret = (unsigned int) self->count(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'count'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_capacity00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'capacity'", NULL); +#endif + { + unsigned int tolua_ret = (unsigned int) self->capacity(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'capacity'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_indexOfObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"Object",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + Object* object = ((Object*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'indexOfObject'", NULL); +#endif + { + unsigned int tolua_ret = (unsigned int) self->getIndexOfObject(object); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'indexOfObject'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_objectAtIndex00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + unsigned int index = ((unsigned int) tolua_tonumber(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'objectAtIndex'", NULL); +#endif + { + Object* tolua_ret = (Object*) self->getObjectAtIndex(index); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"Object"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'objectAtIndex'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_lastObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'lastObject'", NULL); +#endif + { + Object* tolua_ret = (Object*) self->getLastObject(); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"Object"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lastObject'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_randomObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'randomObject'", NULL); +#endif + { + Object* tolua_ret = (Object*) self->getRandomObject(); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"Object"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'randomObject'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_isEqualToArray00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + Array* pOtherArray = ((Array*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'isEqualToArray'", NULL); +#endif + { + bool tolua_ret = (bool) self->isEqualToArray(pOtherArray); + tolua_pushboolean(tolua_S,(bool)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'isEqualToArray'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_containsObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"Object",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + Object* object = ((Object*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'containsObject'", NULL); +#endif + { + bool tolua_ret = (bool) self->containsObject(object); + tolua_pushboolean(tolua_S,(bool)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'containsObject'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_addObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"Object",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + Object* object = ((Object*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'addObject'", NULL); +#endif + { + self->addObject(object); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'addObject'.",&tolua_err); + return 0; +#endif +} + +static int tolua_Cocos2d_CCArray_addObjectsFromArray00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + Array* otherArray = ((Array*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'addObjectsFromArray'", NULL); +#endif + { + self->addObjectsFromArray(otherArray); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'addObjectsFromArray'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_insertObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"Object",0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + Object* object = ((Object*) tolua_tousertype(tolua_S,2,0)); + unsigned int index = ((unsigned int) tolua_tonumber(tolua_S,3,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'insertObject'", NULL); +#endif + { + self->insertObject(object,index); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'insertObject'.",&tolua_err); + return 0; +#endif +} + +static int tolua_Cocos2d_CCArray_removeLastObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isboolean(tolua_S,2,1,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + bool bReleaseObj = ((bool) tolua_toboolean(tolua_S,2,true)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'removeLastObject'", NULL); +#endif + { + self->removeLastObject(bReleaseObj); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'removeLastObject'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_removeObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"Object",0,&tolua_err) || + !tolua_isboolean(tolua_S,3,1,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + Object* object = ((Object*) tolua_tousertype(tolua_S,2,0)); + bool bReleaseObj = ((bool) tolua_toboolean(tolua_S,3,true)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'removeObject'", NULL); +#endif + { + self->removeObject(object,bReleaseObj); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'removeObject'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_removeObjectAtIndex00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isboolean(tolua_S,3,1,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + unsigned int index = ((unsigned int) tolua_tonumber(tolua_S,2,0)); + bool bReleaseObj = ((bool) tolua_toboolean(tolua_S,3,true)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'removeObjectAtIndex'", NULL); +#endif + { + self->removeObjectAtIndex(index,bReleaseObj); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'removeObjectAtIndex'.",&tolua_err); + return 0; +#endif +} + +static int tolua_Cocos2d_CCArray_removeObjectsInArray00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + Array* otherArray = ((Array*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'removeObjectsInArray'", NULL); +#endif + { + self->removeObjectsInArray(otherArray); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'removeObjectsInArray'.",&tolua_err); + return 0; +#endif +} + +static int tolua_Cocos2d_CCArray_removeAllObjects00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'removeAllObjects'", NULL); +#endif + { + self->removeAllObjects(); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'removeAllObjects'.",&tolua_err); + return 0; +#endif +} + +static int tolua_Cocos2d_CCArray_fastRemoveObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"Object",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + Object* object = ((Object*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'fastRemoveObject'", NULL); +#endif + { + self->fastRemoveObject(object); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'fastRemoveObject'.",&tolua_err); + return 0; +#endif +} + +static int tolua_Cocos2d_CCArray_fastRemoveObjectAtIndex00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + unsigned int index = ((unsigned int) tolua_tonumber(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'fastRemoveObjectAtIndex'", NULL); +#endif + { + self->fastRemoveObjectAtIndex(index); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'fastRemoveObjectAtIndex'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_exchangeObject00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"Object",0,&tolua_err) || + !tolua_isusertype(tolua_S,3,"Object",0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + Object* object1 = ((Object*) tolua_tousertype(tolua_S,2,0)); + Object* object2 = ((Object*) tolua_tousertype(tolua_S,3,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'exchangeObject'", NULL); +#endif + { + self->exchangeObject(object1,object2); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'exchangeObject'.",&tolua_err); + return 0; +#endif +} + +static int tolua_Cocos2d_CCArray_exchangeObjectAtIndex00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + unsigned int index1 = ((unsigned int) tolua_tonumber(tolua_S,2,0)); + unsigned int index2 = ((unsigned int) tolua_tonumber(tolua_S,3,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'exchangeObjectAtIndex'", NULL); +#endif + { + self->exchangeObjectAtIndex(index1,index2); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'exchangeObjectAtIndex'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_reverseObjects00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'reverseObjects'", NULL); +#endif + { + self->reverseObjects(); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'reverseObjects'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_reduceMemoryFootprint00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'reduceMemoryFootprint'", NULL); +#endif + { + self->reduceMemoryFootprint(); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'reduceMemoryFootprint'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCArray_replaceObjectAtIndex00(lua_State* tolua_S) +{ + deprecatedClassTip("CCArray"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCArray",0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isusertype(tolua_S,3,"Object",0,&tolua_err) || + !tolua_isboolean(tolua_S,4,1,&tolua_err) || + !tolua_isnoobj(tolua_S,5,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* self = (Array*) tolua_tousertype(tolua_S,1,0); + unsigned int uIndex = ((unsigned int) tolua_tonumber(tolua_S,2,0)); + Object* pObject = ((Object*) tolua_tousertype(tolua_S,3,0)); + bool bReleaseObject = ((bool) tolua_toboolean(tolua_S,4,true)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'replaceObjectAtIndex'", NULL); +#endif + { + self->replaceObjectAtIndex(uIndex,pObject,bReleaseObject); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'replaceObjectAtIndex'.",&tolua_err); + return 0; +#endif +} + +static int register_cocos2dx_deprecated_Array(lua_State* tolua_S) +{ + tolua_usertype(tolua_S, "CCArray"); + + tolua_cclass(tolua_S,"CCArray","CCArray","CCObject",NULL); + tolua_beginmodule(tolua_S,"CCArray"); + tolua_function(tolua_S,"create",tolua_Cocos2d_CCArray_create00); + tolua_function(tolua_S,"createWithObject",tolua_Cocos2d_CCArray_createWithObject00); + tolua_function(tolua_S,"createWithArray",tolua_Cocos2d_CCArray_createWithArray00); + tolua_function(tolua_S,"createWithCapacity",tolua_Cocos2d_CCArray_createWithCapacity00); + tolua_function(tolua_S,"createWithContentsOfFile",tolua_Cocos2d_CCArray_createWithContentsOfFile00); + tolua_function(tolua_S,"count",tolua_Cocos2d_CCArray_count00); + tolua_function(tolua_S,"capacity",tolua_Cocos2d_CCArray_capacity00); + tolua_function(tolua_S,"indexOfObject",tolua_Cocos2d_CCArray_indexOfObject00); + tolua_function(tolua_S,"objectAtIndex",tolua_Cocos2d_CCArray_objectAtIndex00); + tolua_function(tolua_S,"lastObject",tolua_Cocos2d_CCArray_lastObject00); + tolua_function(tolua_S,"randomObject",tolua_Cocos2d_CCArray_randomObject00); + tolua_function(tolua_S,"isEqualToArray",tolua_Cocos2d_CCArray_isEqualToArray00); + tolua_function(tolua_S,"containsObject",tolua_Cocos2d_CCArray_containsObject00); + tolua_function(tolua_S,"addObject",tolua_Cocos2d_CCArray_addObject00); + tolua_function(tolua_S,"addObjectsFromArray",tolua_Cocos2d_CCArray_addObjectsFromArray00); + tolua_function(tolua_S,"insertObject",tolua_Cocos2d_CCArray_insertObject00); + tolua_function(tolua_S,"removeLastObject",tolua_Cocos2d_CCArray_removeLastObject00); + tolua_function(tolua_S,"removeObject",tolua_Cocos2d_CCArray_removeObject00); + tolua_function(tolua_S,"removeObjectAtIndex",tolua_Cocos2d_CCArray_removeObjectAtIndex00); + tolua_function(tolua_S,"removeObjectsInArray",tolua_Cocos2d_CCArray_removeObjectsInArray00); + tolua_function(tolua_S,"removeAllObjects",tolua_Cocos2d_CCArray_removeAllObjects00); + tolua_function(tolua_S,"fastRemoveObject",tolua_Cocos2d_CCArray_fastRemoveObject00); + tolua_function(tolua_S,"fastRemoveObjectAtIndex",tolua_Cocos2d_CCArray_fastRemoveObjectAtIndex00); + tolua_function(tolua_S,"exchangeObject",tolua_Cocos2d_CCArray_exchangeObject00); + tolua_function(tolua_S,"exchangeObjectAtIndex",tolua_Cocos2d_CCArray_exchangeObjectAtIndex00); + tolua_function(tolua_S,"reverseObjects",tolua_Cocos2d_CCArray_reverseObjects00); + tolua_function(tolua_S,"reduceMemoryFootprint",tolua_Cocos2d_CCArray_reduceMemoryFootprint00); + tolua_function(tolua_S,"replaceObjectAtIndex",tolua_Cocos2d_CCArray_replaceObjectAtIndex00); + tolua_endmodule(tolua_S); + + return 1; +} + +static int tolua_cocos2d_kmGLPushMatrix00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isnoobj(tolua_S,1,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + kmGLPushMatrix(); + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'kmGLPushMatrix'.",&tolua_err); + return 0; +#endif +} + +static int tolua_cocos2d_kmGLTranslatef00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isnumber(tolua_S,1,0,&tolua_err) || + !tolua_isnumber(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + float x = ((float) tolua_tonumber(tolua_S,1,0)); + float y = ((float) tolua_tonumber(tolua_S,2,0)); + float z = ((float) tolua_tonumber(tolua_S,3,0)); + { + kmGLTranslatef(x,y,z); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'kmGLTranslatef'.",&tolua_err); + return 0; +#endif +} + +static int tolua_cocos2d_kmGLPopMatrix00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isnoobj(tolua_S,1,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + { + kmGLPopMatrix(); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'kmGLPopMatrix'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCString_intValue00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"const CCString",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const String* self = (const String*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'intValue'", NULL); +#endif + { + int tolua_ret = (int) self->intValue(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'intValue'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCString_uintValue00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"const CCString",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const String* self = (const String*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'uintValue'", NULL); +#endif + { + unsigned int tolua_ret = (unsigned int) self->uintValue(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'uintValue'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCString_floatValue00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"const CCString",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const String* self = (const String*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'floatValue'", NULL); +#endif + { + float tolua_ret = (float) self->floatValue(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'floatValue'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCString_doubleValue00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"const CCString",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const String* self = (const String*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'doubleValue'", NULL); +#endif + { + double tolua_ret = (double) self->doubleValue(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'doubleValue'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCString_boolValue00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"const CCString",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const String* self = (const String*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'boolValue'", NULL); +#endif + { + bool tolua_ret = (bool) self->boolValue(); + tolua_pushboolean(tolua_S,(bool)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'boolValue'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCString_getCString00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"const CCString",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const String* self = (const String*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getCString'", NULL); +#endif + { + const char* tolua_ret = (const char*) self->getCString(); + tolua_pushstring(tolua_S,(const char*)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'getCString'.",&tolua_err); + return 0; +#endif +} + + + +static int tolua_Cocos2d_CCString_length00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"const CCString",0,&tolua_err) || + !tolua_isnoobj(tolua_S,2,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const String* self = (const String*) tolua_tousertype(tolua_S,1,0); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'length'", NULL); +#endif + { + unsigned int tolua_ret = (unsigned int) self->length(); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'length'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCString_compare00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"const CCString",0,&tolua_err) || + !tolua_isstring(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const String* self = (const String*) tolua_tousertype(tolua_S,1,0); + const char* str = ((const char*) tolua_tostring(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'compare'", NULL); +#endif + { + int tolua_ret = (int) self->compare(str); + tolua_pushnumber(tolua_S,(lua_Number)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'compare'.",&tolua_err); + return 0; +#endif +} + + + +static int tolua_Cocos2d_CCString_isEqual00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"CCString",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"const CCObject",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + String* self = (String*) tolua_tousertype(tolua_S,1,0); + const Object* pObject = ((const Object*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'isEqual'", NULL); +#endif + { + bool tolua_ret = (bool) self->isEqual(pObject); + tolua_pushboolean(tolua_S,(bool)tolua_ret); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'isEqual'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCString_create00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCString",0,&tolua_err) || + !tolua_isstring(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const char* pStr = ((const char*) tolua_tostring(tolua_S,2,0)); + { + String* tolua_ret = (String*) String::create(pStr); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCString"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'create'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCString_createWithData00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCString",0,&tolua_err) || + !tolua_isstring(tolua_S,2,0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + unsigned char* pData = ((unsigned char*) tolua_tostring(tolua_S,2,0)); + unsigned long nLen = ((unsigned long) tolua_tonumber(tolua_S,3,0)); + { + String* tolua_ret = (String*) String::createWithData(pData,nLen); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCString"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'createWithData'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_Cocos2d_CCString_createWithContentsOfFile00(lua_State* tolua_S) +{ + deprecatedClassTip("CCString"); + +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"CCString",0,&tolua_err) || + !tolua_isstring(tolua_S,2,0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + const char* pszFileName = ((const char*) tolua_tostring(tolua_S,2,0)); + { + String* tolua_ret = (String*) String::createWithContentsOfFile(pszFileName); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"CCString"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'createWithContentsOfFile'.",&tolua_err); + return 0; +#endif +} + +static int register_cocos2dx_deprecated_String(lua_State* tolua_S) +{ + tolua_usertype(tolua_S, "CCString"); + tolua_cclass(tolua_S,"CCString","CCString","Object",NULL); + tolua_beginmodule(tolua_S,"CCString"); + tolua_function(tolua_S,"intValue",tolua_Cocos2d_CCString_intValue00); + tolua_function(tolua_S,"uintValue",tolua_Cocos2d_CCString_uintValue00); + tolua_function(tolua_S,"floatValue",tolua_Cocos2d_CCString_floatValue00); + tolua_function(tolua_S,"doubleValue",tolua_Cocos2d_CCString_doubleValue00); + tolua_function(tolua_S,"boolValue",tolua_Cocos2d_CCString_boolValue00); + tolua_function(tolua_S,"getCString",tolua_Cocos2d_CCString_getCString00); + tolua_function(tolua_S,"length",tolua_Cocos2d_CCString_length00); + tolua_function(tolua_S,"compare",tolua_Cocos2d_CCString_compare00); + tolua_function(tolua_S,"isEqual",tolua_Cocos2d_CCString_isEqual00); + tolua_function(tolua_S,"create",tolua_Cocos2d_CCString_create00); + tolua_function(tolua_S,"createWithData",tolua_Cocos2d_CCString_createWithData00); + tolua_function(tolua_S,"createWithContentsOfFile",tolua_Cocos2d_CCString_createWithContentsOfFile00); + tolua_endmodule(tolua_S); + return 1; +} + + +int register_all_cocos2dx_deprecated(lua_State* tolua_S) +{ + tolua_open(tolua_S); + + tolua_module(tolua_S,NULL,0); + tolua_beginmodule(tolua_S,NULL); + register_cocos2dx_deprecated_Point(tolua_S); + register_cocos2dx_deprecated_Rect(tolua_S); + register_cocos2dx_deprecated_Size(tolua_S); + register_cocos2dx_deprecated_Array(tolua_S); + register_cocos2dx_deprecated_String(tolua_S); + tolua_function(tolua_S,"kmGLPushMatrix",tolua_cocos2d_kmGLPushMatrix00); + tolua_function(tolua_S,"kmGLTranslatef",tolua_cocos2d_kmGLTranslatef00); + tolua_function(tolua_S,"kmGLPopMatrix",tolua_cocos2d_kmGLPopMatrix00); + tolua_endmodule(tolua_S); + + return 0; +} + +extern int lua_cocos2dx_Animation_createWithSpriteFrames(lua_State* tolua_S); + +static int tolua_cocos2d_Animation_createWithSpriteFrames_deprecated00(lua_State* tolua_S) +{ + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"Animation",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnumber(tolua_S,3,0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else + { + Array* arrayOfSpriteFrameNames = ((Array*) tolua_tousertype(tolua_S,2,0)); + float delay = ((float) tolua_tonumber(tolua_S,3,0)); + { + cocos2d::Animation* tolua_ret = (cocos2d::Animation*) cocos2d::Animation::createWithSpriteFrames(arrayOfSpriteFrameNames,delay); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"Animation"); + } + } + return 1; +tolua_lerror: + return lua_cocos2dx_Animation_createWithSpriteFrames(tolua_S); +} + +static int tolua_cocos2d_Animation_createWithSpriteFrames_deprecated01(lua_State* tolua_S) +{ + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"Animation",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else + { + Array* arrayOfSpriteFrameNames = ((Array*) tolua_tousertype(tolua_S,2,0)); + { + cocos2d::Animation* tolua_ret = (cocos2d::Animation*) cocos2d::Animation::createWithSpriteFrames(arrayOfSpriteFrameNames); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"Animation"); + } + } + return 1; +tolua_lerror: + return tolua_cocos2d_Animation_createWithSpriteFrames_deprecated00(tolua_S); +} + +static void extendAnimationDeprecated(lua_State* tolua_S) +{ + lua_pushstring(tolua_S,"Animation"); + lua_rawget(tolua_S,LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + lua_pushstring(tolua_S,"createWithSpriteFrames"); + lua_pushcfunction(tolua_S,tolua_cocos2d_Animation_createWithSpriteFrames_deprecated00); + lua_rawset(tolua_S,-3); + lua_pushstring(tolua_S,"createWithSpriteFrames"); + lua_pushcfunction(tolua_S,tolua_cocos2d_Animation_createWithSpriteFrames_deprecated01); + lua_rawset(tolua_S,-3); + } +} + +static int tolua_cocos2d_Sequence_createWithTwoActions(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"Sequence",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"FiniteTimeAction",0,&tolua_err) || + !tolua_isusertype(tolua_S,3,"FiniteTimeAction",0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + FiniteTimeAction* pActionOne = ((FiniteTimeAction*) tolua_tousertype(tolua_S,2,0)); + FiniteTimeAction* pActionTwo = ((FiniteTimeAction*) tolua_tousertype(tolua_S,3,0)); + { + Sequence* tolua_ret = (Sequence*) Sequence::createWithTwoActions(pActionOne,pActionTwo); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"Sequence"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'createWithTwoActions'.",&tolua_err); + return 0; +#endif +} + +extern int tolua_cocos2d_Sequence_create(lua_State* tolua_S); +static int tolua_Cocos2d_Sequence_create_deprecated00(lua_State* tolua_S) +{ + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"Sequence",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else + { + Array* actions = ((Array*) tolua_tousertype(tolua_S,2,0)); + { + Sequence* tolua_ret = (Sequence*) Sequence::create(actions); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"Sequence"); + } + } + return 1; +tolua_lerror: + return tolua_cocos2d_Sequence_create(tolua_S); +} + +static int extendSequenceDeprecated(lua_State* tolua_S) +{ + lua_pushstring(tolua_S,"Sequence"); + lua_rawget(tolua_S,LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + tolua_function(tolua_S, "createWithTwoActions",tolua_cocos2d_Sequence_createWithTwoActions); + tolua_function(tolua_S, "create", tolua_Cocos2d_Sequence_create_deprecated00); + } + + return 1; +} + +#ifdef __cplusplus +extern "C" { +#endif +extern int tolua_bnd_cast(lua_State* tolua_S); +#ifdef __cplusplus +} +#endif + +static int tolua_bnd_cast_deprecated00(lua_State* tolua_S) +{ + void* v = nullptr; + std::string strValue = ""; + strValue = tolua_tostring(tolua_S,2,NULL); + int pos = strValue.find("CC"); + if (pos == 0 && + std::string::npos == strValue.find("CCBAnimationManager") && + std::string::npos == strValue.find("CCString") && + std::string::npos == strValue.find("CCPoint") && + std::string::npos == strValue.find("CCRect") && + std::string::npos == strValue.find("CCSize") && + std::string::npos == strValue.find("CCArray")) + { + strValue = strValue.substr(2); + if (lua_islightuserdata(tolua_S, 1)) { + v = tolua_touserdata(tolua_S, 1, NULL); + } else { + v = tolua_tousertype(tolua_S, 1, 0); + }; + if (v && !strValue.empty()) + tolua_pushusertype(tolua_S,v,strValue.c_str()); + else + lua_pushnil(tolua_S); + return 1; + } + else + { + return tolua_bnd_cast(tolua_S); + } +} + +static int extendToluaDeprecated(lua_State* tolua_S) +{ + lua_getglobal(tolua_S, "_G"); + if (lua_istable(tolua_S,-1))//stack:...,_G, + { + lua_pushstring(tolua_S,"tolua");//stack:_G,keyValue + lua_gettable(tolua_S, -2);//stack:_G,toluaModule + if (lua_istable(tolua_S,-1)) + { + tolua_function(tolua_S, "cast", tolua_bnd_cast_deprecated00); + } + lua_pop(tolua_S, 1);//statck:_G + } + lua_pop(tolua_S, 1);//statck:... + + return 1; +} + +static int tolua_cocos2d_Spawn_createWithTwoActions_deprcated00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"Spawn",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"FiniteTimeAction",0,&tolua_err) || + !tolua_isusertype(tolua_S,3,"FiniteTimeAction",0,&tolua_err) || + !tolua_isnoobj(tolua_S,4,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + FiniteTimeAction* pAction1 = ((FiniteTimeAction*) tolua_tousertype(tolua_S,2,0)); + FiniteTimeAction* pAction2 = ((FiniteTimeAction*) tolua_tousertype(tolua_S,3,0)); + { + Spawn* tolua_ret = (Spawn*) Spawn::createWithTwoActions(pAction1,pAction2); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"Spawn"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'createWithTwoActions'.",&tolua_err); + return 0; +#endif +} + +static int extendSpawnDeprecated(lua_State* tolua_S) +{ + lua_pushstring(tolua_S,"Spawn"); + lua_rawget(tolua_S,LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + tolua_function(tolua_S, "createWithTwoActions", tolua_cocos2d_Spawn_createWithTwoActions_deprcated00); + } + + return 1; +} + + +static int tolua_cocos2d_Menu_createWithArray00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"Menu",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* pArrayOfItems = ((Array*) tolua_tousertype(tolua_S,2,0)); + { + Menu* tolua_ret = (Menu*) Menu::createWithArray(pArrayOfItems); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"Menu"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'createWithArray'.",&tolua_err); + return 0; +#endif +} + +static int tolua_cocos2d_Menu_alignItemsInColumnsWithArray00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"Menu",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Menu* self = (Menu*) tolua_tousertype(tolua_S,1,0); + Array* rows = ((Array*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'alignItemsInColumnsWithArray'", NULL); +#endif + { + self->alignItemsInColumnsWithArray(rows); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'alignItemsInColumnsWithArray'.",&tolua_err); + return 0; +#endif +} + + +static int tolua_cocos2d_Menu_alignItemsInRowsWithArray00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertype(tolua_S,1,"Menu",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Menu* self = (Menu*) tolua_tousertype(tolua_S,1,0); + Array* columns = ((Array*) tolua_tousertype(tolua_S,2,0)); +#ifndef TOLUA_RELEASE + if (!self) tolua_error(tolua_S,"invalid 'self' in function 'alignItemsInRowsWithArray'", NULL); +#endif + { + self->alignItemsInRowsWithArray(columns); + } + } + return 0; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'alignItemsInRowsWithArray'.",&tolua_err); + return 0; +#endif +} + +static int extendMenuDeprecated(lua_State* tolua_S) +{ + lua_pushstring(tolua_S,"Menu"); + lua_rawget(tolua_S,LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + tolua_function(tolua_S, "createWithArray", tolua_cocos2d_Menu_createWithArray00); + tolua_function(tolua_S, "alignItemsInColumnsWithArray", tolua_cocos2d_Menu_alignItemsInColumnsWithArray00); + tolua_function(tolua_S, "alignItemsInRowsWithArray", tolua_cocos2d_Menu_alignItemsInRowsWithArray00); + } + + return 1; +} + +static int tolua_cocos2d_LayerMultiplex_createWithArray00(lua_State* tolua_S) +{ +#ifndef TOLUA_RELEASE + tolua_Error tolua_err; + if ( + !tolua_isusertable(tolua_S,1,"LayerMultiplex",0,&tolua_err) || + !tolua_isusertype(tolua_S,2,"CCArray",0,&tolua_err) || + !tolua_isnoobj(tolua_S,3,&tolua_err) + ) + goto tolua_lerror; + else +#endif + { + Array* arrayOfLayers = ((Array*) tolua_tousertype(tolua_S,2,0)); + { + LayerMultiplex* tolua_ret = (LayerMultiplex*) LayerMultiplex::createWithArray(arrayOfLayers); + int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1; + int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL; + toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"LayerMultiplex"); + } + } + return 1; +#ifndef TOLUA_RELEASE +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'createWithArray'.",&tolua_err); + return 0; +#endif +} + +static int extendLayerMultiplexDeprecated(lua_State* tolua_S) +{ + lua_pushstring(tolua_S,"LayerMultiplex"); + lua_rawget(tolua_S,LUA_REGISTRYINDEX); + if (lua_istable(tolua_S,-1)) + { + tolua_function(tolua_S, "createWithArray", tolua_cocos2d_LayerMultiplex_createWithArray00); + } + return 1; +} + + +int register_all_cocos2dx_manual_deprecated(lua_State* tolua_S) +{ + if (NULL == tolua_S) + return 0; + + extendAnimationDeprecated(tolua_S); + extendSequenceDeprecated(tolua_S); + extendToluaDeprecated(tolua_S); + extendMenuDeprecated(tolua_S); + extendLayerMultiplexDeprecated(tolua_S); + return 0; +} diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp.REMOVED.git-id b/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp.REMOVED.git-id deleted file mode 100644 index 1307b885c9..0000000000 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_deprecated.cpp.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -e70a68a07977b12b3f233641ac8d558e48c5517c \ No newline at end of file diff --git a/cocos/scripting/lua/script/CCBReaderLoad.lua b/cocos/scripting/lua/script/CCBReaderLoad.lua index 6acfe432fa..733a432317 100644 --- a/cocos/scripting/lua/script/CCBReaderLoad.lua +++ b/cocos/scripting/lua/script/CCBReaderLoad.lua @@ -112,3 +112,10 @@ function CCBReaderLoad(strFilePath,proxy,owner) return node end + + +local function CCBuilderReaderLoad(strFilePath,proxy,owner) + print("\n********** \n".."CCBuilderReaderLoad(strFilePath,proxy,owner)".." was deprecated please use ".. "CCBReaderLoad(strFilePath,proxy,owner)" .. " instead.\n**********") + return CCBReaderLoad(strFilePath,proxy,owner) +end +rawset(_G,"CCBuilderReaderLoad",CCBuilderReaderLoad) \ No newline at end of file diff --git a/cocos/scripting/lua/script/Deprecated.lua b/cocos/scripting/lua/script/Deprecated.lua index 935a07514f..83d7b07989 100644 --- a/cocos/scripting/lua/script/Deprecated.lua +++ b/cocos/scripting/lua/script/Deprecated.lua @@ -725,24 +725,6 @@ local function tex2(u,v) end rawset(_G,"tex2",tex2) -local function CCPoint( x, y) - deprecatedTip("CCPoint(x,y)","cc.p(x,y)") - return cc.p(x,y) -end -rawset(_G,"CCPoint",CCPoint) - -local function CCSize( width, height) - deprecatedTip("CCSize(width,height)","cc.size(width,height)") - return cc.size(width,height) -end -rawset(_G,"CCSize",CCSize) - -local function CCRect( x,y, width, height) - deprecatedTip("CCRect(x,y,width,height)","cc.rect(x,y,width,height)") - return cc.rect(x,y,width,height) -end -rawset(_G,"CCRect",CCRect) - --functions of CCControl will be deprecated end local CCControlDeprecated = { } function CCControlDeprecated.addHandleOfControlEvent(self,func,controlEvent) @@ -1160,4 +1142,26 @@ end rawset(ActionManager,"purgeActionManager",ActionManagerDeprecated.purgeActionManager) --functions of ActionManager will be deprecated end +--functions of CCEGLView will be deprecated begin +local CCEGLViewDeprecated = { } +function CCEGLViewDeprecated.sharedOpenGLView() + deprecatedTip("CCEGLView:sharedOpenGLView","cc.EGLView:getInstance") + return cc.EGLView:getInstance() +end +rawset(CCEGLView,"sharedOpenGLView",CCEGLViewDeprecated.sharedOpenGLView) +--functions of CCEGLView will be deprecated end + +--Enums of CCTableView will be deprecated begin +rawset(CCTableView, "kTableViewScroll",cc.SCROLLVIEW_SCRIPT_SCROLL) +rawset(CCTableView,"kTableViewZoom",cc.SCROLLVIEW_SCRIPT_ZOOM) +rawset(CCTableView,"kTableCellTouched",cc.TABLECELL_TOUCHED) +rawset(CCTableView,"kTableCellSizeForIndex",cc.TABLECELL_SIZE_FOR_INDEX) +rawset(CCTableView,"kTableCellSizeAtIndex",cc.TABLECELL_SIZE_AT_INDEX) +rawset(CCTableView,"kNumberOfCellsInTableView",cc.NUMBER_OF_CELLS_IN_TABLEVIEW) +--Enums of CCTableView will be deprecated end + +--Enums of CCScrollView will be deprecated begin +rawset(CCScrollView, "kScrollViewScroll",cc.SCROLLVIEW_SCRIPT_SCROLL) +rawset(CCScrollView,"kScrollViewZoom",cc.SCROLLVIEW_SCRIPT_ZOOM) +--Enums of CCScrollView will be deprecated end diff --git a/cocos/scripting/lua/script/DeprecatedClass.lua b/cocos/scripting/lua/script/DeprecatedClass.lua index 15e94b5189..82ffa3446b 100644 --- a/cocos/scripting/lua/script/DeprecatedClass.lua +++ b/cocos/scripting/lua/script/DeprecatedClass.lua @@ -2110,3 +2110,29 @@ function DeprecatedClass.ActionObject() end _G["ActionObject"] = DeprecatedClass.ActionObject() --ActionObject class will be Deprecated,end + +--CCEGLViewProtocol class will be Deprecated,begin +function DeprecatedClass.CCEGLViewProtocol() + deprecatedTip("CCEGLViewProtocol","cc.EGLViewProtocol") + return cc.EGLViewProtocol +end +_G["CCEGLViewProtocol"] = DeprecatedClass.CCEGLViewProtocol() +--CCEGLViewProtocol class will be Deprecated,end + +--CCEGLView class will be Deprecated,begin +function DeprecatedClass.CCEGLView() + deprecatedTip("CCEGLView","cc.EGLView") + return cc.EGLView +end +_G["CCEGLView"] = DeprecatedClass.CCEGLView() +--CCEGLView class will be Deprecated,end + +--CCBProxy class will be Deprecated,begin +function DeprecatedClass.CCBProxy() + deprecatedTip("CCBProxy","cc.CCBProxy") + return cc.CCBProxy +end +_G["CCBProxy"] = DeprecatedClass.CCBProxy() +--CCBProxy class will be Deprecated,end + + diff --git a/cocos/scripting/lua/script/DeprecatedEnum.lua b/cocos/scripting/lua/script/DeprecatedEnum.lua index 03c7619f83..d3bc6738dc 100644 --- a/cocos/scripting/lua/script/DeprecatedEnum.lua +++ b/cocos/scripting/lua/script/DeprecatedEnum.lua @@ -1,5 +1,6 @@ require "Cocos2dConstants.lua" require "OpenglConstants.lua" +require "StudioConstants.lua" --Enums will be deprecated,begin _G.kCCTextAlignmentLeft = cc.TEXT_ALIGNMENT_LEFT _G.kCCTextAlignmentRight = cc.TEXT_ALIGNMENT_RIGHT @@ -479,3 +480,7 @@ _G.LAYOUT_PARAMETER_NONE = ccs.UILayoutParameterType.none _G.LAYOUT_PARAMETER_LINEAR = ccs.UILayoutParameterType.linear _G.LAYOUT_PARAMETER_RELATIVE = ccs.UILayoutParameterType.relative +_G.kCCScrollViewDirectionHorizontal = cc.SCROLLVIEW_DIRECTION_HORIZONTAL +_G.kCCScrollViewDirectionVertical = cc.SCROLLVIEW_DIRECTION_VERTICAL +_G.kCCTableViewFillTopDown = cc.TABLEVIEW_FILL_TOPDOWN +_G.kCCTableViewFillBottomUp = cc.TABLEVIEW_FILL_BOTTOMUP diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index 5cdd7c2781..36a6a98ed9 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos/2d/cocos2d.h %(cocosdir)s/cocos/audio/include/Simpl # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". -classes = Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Data SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Object$ UserDefault Image +classes = Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* RemoveSelf Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Data SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak ^Object$ UserDefault EGLViewProtocol EGLView Image # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -50,7 +50,8 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS MenuItem.*::[create setCallback initWithCallback], Label::[getLettersInfo], Copying::[*], - .*Protocol::[*], + LabelProtocol::[*], + LabelTextFormatProtocol::[*], .*Delegate::[*], PoolManager::[*], Texture2D::[initWithPVRTCData addPVRTCImage releaseData setTexParameters initWithData keepData], @@ -68,7 +69,6 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS ScriptEngineManager::[*], KeypadHandler::[*], Invocation::[*], - EGLView::[*], SchedulerScriptHandlerEntry::[*], Size::[*], Point::[*], @@ -105,7 +105,9 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS ccFontDefinition::[*], Object::[autorelease isEqual acceptVisitor update], UserDefault::[getInstance (s|g)etDataForKey], - Label::[getLettersInfo] + Label::[getLettersInfo], + EGLViewProtocol::[setTouchDelegate], + EGLView::[end swapBuffers] rename_functions = SpriteFrameCache::[addSpriteFramesWithFile=addSpriteFrames getSpriteFrameByName=getSpriteFrame], ProgressTimer::[setReverseProgress=setReverseDirection], @@ -136,7 +138,7 @@ base_classes_to_skip = Clonable # classes that create no constructor # Set is special and we will use a hand-written constructor -abstract_classes = Action FiniteTimeAction ActionInterval ActionEase EaseRateAction EaseElastic EaseBounce ActionInstant GridAction Grid3DAction TiledGrid3DAction Director SpriteFrameCache TransitionEaseScene Set SimpleAudioEngine FileUtils Application ClippingNode Label +abstract_classes = Action FiniteTimeAction ActionInterval ActionEase EaseRateAction EaseElastic EaseBounce ActionInstant GridAction Grid3DAction TiledGrid3DAction Director SpriteFrameCache TransitionEaseScene Set SimpleAudioEngine FileUtils Application ClippingNode Label EGLViewProtocol EGLView # Determining whether to use script object(js object) to control the lifecycle of native(cpp) object or the other way around. Supported values are 'yes' or 'no'. script_control_cpp = no