From 74e497bb2b26f124c80cb3a9728f6b038b9e9706 Mon Sep 17 00:00:00 2001 From: dualface Date: Mon, 4 Feb 2013 11:28:09 +0800 Subject: [PATCH] restore CCLuaEngine missed methods --- scripting/lua/cocos2dx_support/CCLuaEngine.cpp | 10 ++++++++++ scripting/lua/cocos2dx_support/CCLuaEngine.h | 13 ++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp b/scripting/lua/cocos2dx_support/CCLuaEngine.cpp index f101dfa324..6bd47f595e 100644 --- a/scripting/lua/cocos2dx_support/CCLuaEngine.cpp +++ b/scripting/lua/cocos2dx_support/CCLuaEngine.cpp @@ -54,6 +54,16 @@ bool CCLuaEngine::init(void) return true; } +void CCLuaEngine::addSearchPath(const char* path) +{ + m_stack->addSearchPath(path); +} + +void CCLuaEngine::addLuaLoader(lua_CFunction func) +{ + m_stack->addLuaLoader(func); +} + void CCLuaEngine::removeScriptObjectByCCObject(CCObject* pObj) { m_stack->removeScriptObjectByCCObject(pObj); diff --git a/scripting/lua/cocos2dx_support/CCLuaEngine.h b/scripting/lua/cocos2dx_support/CCLuaEngine.h index 049e4a4677..9c96b27f95 100644 --- a/scripting/lua/cocos2dx_support/CCLuaEngine.h +++ b/scripting/lua/cocos2dx_support/CCLuaEngine.h @@ -54,7 +54,18 @@ public: CCLuaStack *getLuaStack(void) { return m_stack; } - + + /** + @brief Add a path to find lua files in + @param path to be added to the Lua path + */ + virtual void addSearchPath(const char* path); + + /** + @brief Add lua loader, now it is used on android + */ + virtual void addLuaLoader(lua_CFunction func); + /** @brief Remove CCObject from lua state @param object to remove