| 44 | } |
| 45 | |
| 46 | bool AppDelegate::applicationDidFinishLaunching() |
| 47 | { |
| 48 | ax::setLogFmtFlag(ax::LogFmtFlag::Colored); |
| 49 | |
| 50 | // register lua engine |
| 51 | LuaEngine* pEngine = LuaEngine::getInstance(); |
| 52 | ScriptEngineManager::getInstance()->setScriptEngine(pEngine); |
| 53 | |
| 54 | LuaStack* stack = pEngine->getLuaStack(); |
| 55 | lua_State* L = stack->getLuaState(); |
| 56 | |
| 57 | lua_module_register(L); |
| 58 | |
| 59 | lua_getglobal(L, "_G"); |
| 60 | if (lua_istable(L, -1)) // stack:...,_G, |
| 61 | { |
| 62 | #if (AX_TARGET_PLATFORM == AX_PLATFORM_WIN32 || AX_TARGET_PLATFORM == AX_PLATFORM_ANDROID || \ |
| 63 | AX_TARGET_PLATFORM == AX_PLATFORM_IOS || AX_TARGET_PLATFORM == AX_PLATFORM_MAC) |
| 64 | register_assetsmanager_test_sample(L); |
| 65 | #endif |
| 66 | register_test_binding(L); |
| 67 | } |
| 68 | lua_pop(L, 1); |
| 69 | |
| 70 | FileUtils::getInstance()->addSearchPath("src"); |
| 71 | FileUtils::getInstance()->addSearchPath("res"); |
| 72 | pEngine->executeScriptFile("controller.lua"); |
| 73 | |
| 74 | return true; |
| 75 | } |
| 76 | |
| 77 | // This function will be called when the app is inactive. Note, when receiving a phone call it is invoked. |
| 78 | void AppDelegate::applicationDidEnterBackground() |
nothing calls this directly
no test coverage detected