| 284 | |
| 285 | |
| 286 | void appInit() |
| 287 | { |
| 288 | if (!Initialized) { |
| 289 | Initialized = true; |
| 290 | |
| 291 | //// ----- Core initialization ----- |
| 292 | //BE1::Engine::InitParms initParms; |
| 293 | |
| 294 | //BE1::Str appDir = BE1::PlatformFile::ExecutablePath(); |
| 295 | //initParms.baseDir = appDir; |
| 296 | |
| 297 | //BE1::Str dataDir = appDir + "/Data"; |
| 298 | //initParms.searchPath = dataDir; |
| 299 | |
| 300 | //BE1::Engine::Init(&initParms); |
| 301 | |
| 302 | BE1::Engine::InitParms initParms; |
| 303 | initParms.baseDir = ""; |
| 304 | initParms.searchPath = "Data"; |
| 305 | BE1::Engine::Init(&initParms); |
| 306 | //// ------------------------------- |
| 307 | |
| 308 | //BE1::resourceGuidMapper.Read("Data/guidmap"); |
| 309 | BE1::resourceGuidMapper.Read("Data/guidmap"); |
| 310 | |
| 311 | //// mainWindow(UIWindow) - rootViewController.view(UIView) - eaglView(EAGLView) |
| 312 | //CGRect screenBounds = [[UIScreen mainScreen] bounds]; |
| 313 | //mainWindow = [[UIWindow alloc] initWithFrame:screenBounds]; |
| 314 | //mainWindow.backgroundColor = [UIColor blackColor]; |
| 315 | |
| 316 | //rootViewController = [[RootViewController alloc] init]; |
| 317 | //mainWindow.rootViewController = rootViewController; |
| 318 | |
| 319 | //[mainWindow makeKeyAndVisible]; |
| 320 | |
| 321 | //BE1::gameClient.Init((__bridge BE1::Renderer::WindowHandle)mainWindow, true); |
| 322 | BE1::gameClient.Init(0 /*&mEgl*/, true); |
| 323 | |
| 324 | //float retinaScale = [[UIScreen mainScreen] scale]; |
| 325 | //BE1::Vec2 screenScaleFactor(0.75f, 0.75f); |
| 326 | //int renderWidth = screenBounds.size.width * retinaScale * screenScaleFactor.x; |
| 327 | //int renderHeight = screenBounds.size.height * retinaScale* screenScaleFactor.y; |
| 328 | |
| 329 | //app.mainRenderContext = BE1::renderSystem.AllocRenderContext(true); |
| 330 | app.mainRenderContext = BE1::renderSystem.AllocRenderContext(true); |
| 331 | //app.mainRenderContext->Init((__bridge BE1::Renderer::WindowHandle)[rootViewController view], |
| 332 | // renderWidth, renderHeight, DisplayContext, NULL); |
| 333 | { |
| 334 | int w = mEgl.getWidth(); |
| 335 | int h = mEgl.getHeight(); |
| 336 | app.mainRenderContext->Init(&mEgl, w, h, DisplayContext, 0); |
| 337 | } |
| 338 | |
| 339 | //app.Init(); |
| 340 | app.Init(); |
| 341 | |
| 342 | #if USE_ADMOB |
| 343 | RewardBasedVideoAd::RegisterLuaModule(&app.gameWorld->GetLuaVM().State()); |
no test coverage detected