| 51 | } |
| 52 | |
| 53 | bool AppDelegate::applicationDidFinishLaunching() |
| 54 | { |
| 55 | // set default FPS |
| 56 | Director::getInstance()->setAnimationInterval(1.0 / 60.0f); |
| 57 | |
| 58 | // register lua module |
| 59 | auto engine = LuaEngine::getInstance(); |
| 60 | ScriptEngineManager::getInstance()->setScriptEngine(engine); |
| 61 | lua_State* L = engine->getLuaStack()->getLuaState(); |
| 62 | lua_module_register(L); |
| 63 | |
| 64 | LuaStack* stack = engine->getLuaStack(); |
| 65 | |
| 66 | // register custom function |
| 67 | // LuaStack* stack = engine->getLuaStack(); |
| 68 | // register_custom_function(stack->getLuaState()); |
| 69 | |
| 70 | stack->addSearchPath("src"); |
| 71 | FileUtils::getInstance()->addSearchPath("res"); |
| 72 | if (engine->executeString("require 'main'")) |
| 73 | { |
| 74 | return false; |
| 75 | } |
| 76 | |
| 77 | return true; |
| 78 | } |
| 79 | |
| 80 | // This function will be called when the app is inactive. Note, when receiving a phone call it is invoked. |
| 81 | void AppDelegate::applicationDidEnterBackground() |
nothing calls this directly
no test coverage detected