MCPcopy Create free account
hub / github.com/MergHQ/CRYENGINE / OnLoadingComplete

Method OnLoadingComplete

Code/CryEngine/CryAction/LevelSystem.cpp:1706–1772  ·  view source on GitHub ↗

------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1704
1705//------------------------------------------------------------------------
1706void CLevelSystem::OnLoadingComplete(ILevelInfo* pLevelInfo)
1707{
1708 PrecacheLevelRenderData();
1709
1710 if (m_bRecordingFileOpens)
1711 {
1712 // Stop recoding file opens.
1713 gEnv->pCryPak->RecordFileOpen(ICryPak::RFOM_Disabled);
1714 // Save recorded list.
1715 SaveOpenedFilesList();
1716 }
1717
1718 CTimeValue t = gEnv->pTimer->GetAsyncTime();
1719 m_fLastLevelLoadTime = (t - m_levelLoadStartTime).GetSeconds();
1720
1721 if (!gEnv->IsEditor())
1722 {
1723 CryLog("-----------------------------------------------------");
1724 CryLog("*LOADING: Level %s loading time: %.2f seconds", m_lastLevelName.c_str(), m_fLastLevelLoadTime);
1725 CryLog("-----------------------------------------------------");
1726 }
1727
1728 LogLoadingTime();
1729
1730 m_nLoadedLevelsCount++;
1731
1732 // Hide console after loading.
1733 gEnv->pConsole->ShowConsole(false);
1734
1735 // gEnv->pCryPak->GetFileReadSequencer()->EndSection();
1736
1737 if (!gEnv->bServer)
1738 return;
1739
1740 if (gEnv->pCharacterManager)
1741 {
1742 SAnimMemoryTracker amt;
1743 gEnv->pCharacterManager->SetAnimMemoryTracker(amt);
1744 }
1745 /*
1746 if( IStatsTracker* tr = CCryAction::GetCryAction()->GetIGameStatistics()->GetSessionTracker() )
1747 {
1748 string mapName = "no_map_assigned";
1749 if( pLevelInfo )
1750 if (ILevelInfo * pInfo = pLevelInfo->GetLevelInfo())
1751 {
1752 mapName = pInfo->GetName();
1753 PathUtil::RemoveExtension(mapName);
1754 mapName = PathUtil::GetFileName(mapName);
1755 mapName.MakeLower();
1756 }
1757 tr->StateValue(eSP_Map, mapName.c_str());
1758 }
1759 */
1760
1761 // LoadLevel is not called in the editor, hence OnLoadingComplete is not invoked on the ILevelSystemListeners
1762 if (gEnv->IsEditor())
1763 {

Callers 1

LoadLevelMethod · 0.45

Calls 11

CryLogFunction · 0.85
GetSecondsMethod · 0.80
SetAnimMemoryTrackerMethod · 0.80
SendEventToAllMethod · 0.80
RecordFileOpenMethod · 0.45
GetAsyncTimeMethod · 0.45
IsEditorMethod · 0.45
c_strMethod · 0.45
ShowConsoleMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected