Beispiel #1
0
void CCore::OnGameLoad()
{
	// Is the game already loaded?
	if(IsGameLoaded())
		return;

	CLogFile::Print(__FUNCTION__);

	// Initialize game instance & respawn local player
	GetGame()->Initialise();

	// Mark the game as loaded
	SetGameLoaded(true);

	// Startup the network module
	m_pNetworkManager->Startup();
	
	// Prepare the client in game elements
	g_pCore->GetGame()->PrepareWorld();

	// Finalize the client in game elements
	g_pCore->GetGame()->OnClientReadyToGamePlay();

	// Set the loading screen not visible
	m_pLoadingScreen->SetVisible(false);

	// Set the main menu visible
	m_pMainMenu->SetVisible(true);

	// Set the initialize time
	m_uiGameInitializeTime = timeGetTime(); 
}
Beispiel #2
0
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("");
}