From 351ac4a5d72d1c82121f5b71f3a06d3affa4398b Mon Sep 17 00:00:00 2001 From: James Chen Date: Sun, 26 Jan 2014 17:05:35 +0800 Subject: [PATCH] [LUA] Adds missing cc prefix for lua classes. --- .../bindings/lua_cocos2dx_physics_manual.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp b/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp index f5e8f0b59f..884ba8d75d 100644 --- a/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp +++ b/cocos/scripting/lua/bindings/lua_cocos2dx_physics_manual.cpp @@ -1146,7 +1146,7 @@ static int tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler(lua_ EventListenerPhysicsContact* self = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S, 1, "EventListenerPhysicsContact", 0, &tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "cc.EventListenerPhysicsContact", 0, &tolua_err)) goto tolua_lerror; #endif self = static_cast(tolua_tousertype(tolua_S,1,0)); @@ -1177,8 +1177,8 @@ static int tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler(lua_ self->onContactBegin = [handler](EventCustom* event, const PhysicsContact& contact) -> bool{ LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); - stack->pushObject(event, "EventCustom"); - stack->pushObject(const_cast(&contact), "PhysicsContact"); + stack->pushObject(event, "cc.EventCustom"); + stack->pushObject(const_cast(&contact), "cc.PhysicsContact"); bool ret = stack->executeFunctionByHandler(handler, 2); stack->clean(); @@ -1192,9 +1192,9 @@ static int tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler(lua_ self->onContactPreSolve = [handler](EventCustom* event, const PhysicsContact& contact, const PhysicsContactPreSolve& solve) -> bool{ LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); - stack->pushObject(event, "EventCustom"); - stack->pushObject(const_cast(&contact), "PhysicsContact"); - tolua_pushusertype(stack->getLuaState(), const_cast(&solve), "PhysicsContactPreSolve"); + stack->pushObject(event, "cc.EventCustom"); + stack->pushObject(const_cast(&contact), "cc.PhysicsContact"); + tolua_pushusertype(stack->getLuaState(), const_cast(&solve), "cc.PhysicsContactPreSolve"); bool ret = stack->executeFunctionByHandler(handler, 3); stack->clean(); @@ -1208,9 +1208,9 @@ static int tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler(lua_ self->onContactPostSolve = [handler](EventCustom* event, const PhysicsContact& contact, const PhysicsContactPostSolve& solve){ LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); - stack->pushObject(event, "EventCustom"); - stack->pushObject(const_cast(&contact), "PhysicsContact"); - tolua_pushusertype(stack->getLuaState(), const_cast(&solve), "PhysicsContactPostSolve"); + stack->pushObject(event, "cc.EventCustom"); + stack->pushObject(const_cast(&contact), "cc.PhysicsContact"); + tolua_pushusertype(stack->getLuaState(), const_cast(&solve), "cc.PhysicsContactPostSolve"); stack->executeFunctionByHandler(handler, 3); stack->clean(); }; @@ -1222,8 +1222,8 @@ static int tolua_cocos2dx_EventListenerPhysicsContact_registerScriptHandler(lua_ self->onContactSeperate = [handler](EventCustom* event, const PhysicsContact& contact){ LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); - stack->pushObject(event, "EventCustom"); - stack->pushObject(const_cast(&contact), "PhysicsContact"); + stack->pushObject(event, "cc.EventCustom"); + stack->pushObject(const_cast(&contact), "cc.PhysicsContact"); stack->executeFunctionByHandler(handler, 2); stack->clean(); }; @@ -1363,7 +1363,7 @@ int register_all_cocos2dx_physics_manual(lua_State* tolua_S) } lua_pop(tolua_S, 1); - lua_pushstring(tolua_S, "EventListenerPhysicsContact"); + lua_pushstring(tolua_S, "cc.EventListenerPhysicsContact"); lua_rawget(tolua_S, LUA_REGISTRYINDEX); if (lua_istable(tolua_S,-1)) {