------------------------------------------------------------------------ Search positions of all entities with class "PrecacheCamera" and pass it to the 3dengine
| 1537 | //------------------------------------------------------------------------ |
| 1538 | // Search positions of all entities with class "PrecacheCamera" and pass it to the 3dengine |
| 1539 | void 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 | //------------------------------------------------------------------------ |
| 1583 | void CLevelSystem::PrepareNextLevel(const char* levelName) |
nothing calls this directly
no test coverage detected