diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp index c541fbdcc2..2822c7aa7a 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_extension_manual.cpp @@ -186,7 +186,7 @@ static int tolua_cocos2d_ScrollView_unregisterScriptHandler(lua_State* tolua_S) return 0; } - CCLOG("'unregisterScriptHandler' function of ScrollView has wrong number of arguments: %d, was expecting %d\n", argc, 0); + CCLOG("'unregisterScriptHandler' function of ScrollView has wrong number of arguments: %d, was expecting %d\n", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 @@ -313,7 +313,7 @@ static int tolua_cocos2d_control_unregisterControlEventHandler(lua_State* tolua_ return 0; } - CCLOG("'unregisterControlEventHandler' function of Control has wrong number of arguments: %d, was expecting %d\n", argc, 0); + CCLOG("'unregisterControlEventHandler' function of Control has wrong number of arguments: %d, was expecting %d\n", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 @@ -1190,7 +1190,7 @@ static int lua_cocos2dx_TableView_create(lua_State* L) #if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(L,3,"Node",0,&tolua_err)) goto tolua_lerror; #endif - Node* node = static_cast(tolua_tousertype(L, 2, nullptr)); + Node* node = static_cast(tolua_tousertype(L, 3, nullptr)); ret = TableView::create(dataSource, size, node); } diff --git a/cocos/scripting/lua/script/Deprecated.lua b/cocos/scripting/lua/script/Deprecated.lua index 0b2bc4662f..055d417532 100644 --- a/cocos/scripting/lua/script/Deprecated.lua +++ b/cocos/scripting/lua/script/Deprecated.lua @@ -16,6 +16,19 @@ rawset(CCDirector,"sharedDirector",CCDirectorDeprecated.sharedDirector) --functions of CCTextureCache will be deprecated begin +local TextureCacheDeprecated = {} +function TextureCacheDeprecated.getInstance(self) + deprecatedTip("cc.TextureCache:getInstance","cc.Director:getInstance():getTextureCache") + return cc.Director:getInstance():getTextureCache() +end +rawset(cc.TextureCache,"getInstance",TextureCacheDeprecated.getInstance) + +function TextureCacheDeprecated.destroyInstance(self) + deprecatedTip("cc.TextureCache:destroyInstance","cc.Director:getInstance():destroyTextureCache") + return cc.Director:getInstance():destroyTextureCache() +end +rawset(cc.TextureCache,"destroyInstance",TextureCacheDeprecated.destroyInstance) + local CCTextureCacheDeprecated = { } function CCTextureCacheDeprecated.sharedTextureCache() deprecatedTip("CCTextureCache:sharedTextureCache","CCTextureCache:getInstance")