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

Method PrecacheLevelRenderData

Code/CryEngine/CryAction/LevelSystem.cpp:1539–1580  ·  view source on GitHub ↗

------------------------------------------------------------------------ Search positions of all entities with class "PrecacheCamera" and pass it to the 3dengine

Source from the content-addressed store, hash-verified

1537//------------------------------------------------------------------------
1538// Search positions of all entities with class "PrecacheCamera" and pass it to the 3dengine
1539void CLevelSystem::PrecacheLevelRenderData()
1540{
1541 if (gEnv->IsDedicated())
1542 return;
1543
1544 // gEnv->pSystem->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_LEVEL_PRECACHE_START, NULL, NULL);
1545#ifndef CONSOLE_CONST_CVAR_MODE
1546 ICVar* pPrecacheVar = gEnv->pConsole->GetCVar("e_PrecacheLevel");
1547 CRY_ASSERT(pPrecacheVar);
1548
1549 if (pPrecacheVar && pPrecacheVar->GetIVal() > 0)
1550 {
1551
1552 if (gEnv->pGame)
1553 if (I3DEngine* p3DEngine = gEnv->p3DEngine)
1554 {
1555 std::vector<Vec3> arrCamOutdoorPositions;
1556
1557 IEntitySystem* pEntitySystem = gEnv->pEntitySystem;
1558 IEntityItPtr pEntityIter = pEntitySystem->GetEntityIterator();
1559
1560 IEntityClass* pPrecacheCameraClass = pEntitySystem->GetClassRegistry()->FindClass("PrecacheCamera");
1561 IEntity* pEntity = NULL;
1562 while (pEntity = pEntityIter->Next())
1563 {
1564 if (pEntity->GetClass() == pPrecacheCameraClass)
1565 {
1566 arrCamOutdoorPositions.push_back(pEntity->GetWorldPos());
1567 }
1568 }
1569 Vec3* pPoints = 0;
1570 if (arrCamOutdoorPositions.size() > 0)
1571 {
1572 pPoints = &arrCamOutdoorPositions[0];
1573 }
1574
1575 p3DEngine->PrecacheLevel(true, pPoints, arrCamOutdoorPositions.size());
1576 }
1577 }
1578#endif
1579 // gEnv->pSystem->GetISystemEventDispatcher()->OnSystemEvent(ESYSTEM_EVENT_LEVEL_PRECACHE_END, NULL, NULL);
1580}
1581
1582//------------------------------------------------------------------------
1583void CLevelSystem::PrepareNextLevel(const char* levelName)

Callers

nothing calls this directly

Calls 12

IsDedicatedMethod · 0.80
GetEntityIteratorMethod · 0.80
FindClassMethod · 0.80
GetClassRegistryMethod · 0.80
GetCVarMethod · 0.45
GetIValMethod · 0.45
NextMethod · 0.45
GetClassMethod · 0.45
push_backMethod · 0.45
GetWorldPosMethod · 0.45
sizeMethod · 0.45
PrecacheLevelMethod · 0.45

Tested by

no test coverage detected