void game::LoadGameState::Update(math::Real elapsedTime) { START_PROFILING_GAME(true, ""); DELOCUST_LOG_GAME("LOAD game state updating"); const auto gameManager = engine::GameManager::GetGameManager(); m_loadingProgress = gameManager->GetLoadingProgress(); // m_loadingProgress += 0.00022f; if (m_loadingProgress > REAL_ONE) { m_loadingProgress = REAL_ONE; } if (gameManager->IsGameLoaded()) { NOTICE_LOG_GAME("The game is loaded"); m_loadingThread->join(); gameManager->SetTransition(new engine::game_state_transitioning::GameStateTransition(gameManager->GetPlayGameState(), engine::game_state_transitioning::SWITCH, engine::game_state_modality::EXCLUSIVE)); } STOP_PROFILING_GAME(""); }
void VAppBase::OnLoadSceneStatus(int iStatus, float fPercentage) { VisionApp_cl::OnLoadSceneStatus(iStatus, fPercentage); if (!m_pAppImpl->GetSceneLoader().IsAborted()) { switch (iStatus) { case VIS_API_LOADSCENESTATUS_START: Vision::Video.SuspendRendering(); break; case VIS_API_LOADMODELSTATUS_START: case VIS_API_LOADMODELSTATUS_FINISHED: case VIS_API_LOADMODELSTATUS_PROGRESS: { if (m_eAppState != VAppHelper::AS_SCENE_LOADING) return; } } // Skip rendering when in background if (m_eAppState == VAppHelper::AS_SUSPENDED) return; if (!GetLoadingProgress().WantsAbort()) { // ResumeRendering ensures that we have control over the rendering device Vision::Video.ResumeRendering(); VisRenderContext_cl::GetMainRenderContext()->Activate(); Vision::RenderScreenMasks(); Vision::Video.UpdateScreen(); } Vision::Video.SuspendRendering(); } }
void IVisApp_cl::TriggerLoadSceneStatus(int iStatus, float fPercentage, const char* pszStatus) { OnLoadSceneStatus(iStatus, fPercentage, pszStatus); VisProgressDataObject_cl data(&Vision::Callbacks.OnProgress,iStatus,GetLoadingProgress()); Vision::Callbacks.OnProgress.TriggerCallbacks(&data); }