diff options
author | Sergeanur <s.anureev@yandex.ua> | 2019-10-21 15:09:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-21 15:09:44 +0200 |
commit | 4844b3a3f8037b379654bb8109050d0adbc94ae7 (patch) | |
tree | 4366aac26c53bebd0f98bc121b5f04b5cd750fe3 /src/core/Streaming.cpp | |
parent | Merge pull request #248 from Nmzik/master (diff) | |
parent | Some CPool and CPools funcs, restoring original logic of pool lookup loops (diff) | |
download | re3-4844b3a3f8037b379654bb8109050d0adbc94ae7.tar re3-4844b3a3f8037b379654bb8109050d0adbc94ae7.tar.gz re3-4844b3a3f8037b379654bb8109050d0adbc94ae7.tar.bz2 re3-4844b3a3f8037b379654bb8109050d0adbc94ae7.tar.lz re3-4844b3a3f8037b379654bb8109050d0adbc94ae7.tar.xz re3-4844b3a3f8037b379654bb8109050d0adbc94ae7.tar.zst re3-4844b3a3f8037b379654bb8109050d0adbc94ae7.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/Streaming.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp index d9dc8628..69e14869 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -226,7 +226,7 @@ CStreaming::Init(void) CModelInfo::GetModelInfo("IslandLODsubIND", &islandLODsubInd); CModelInfo::GetModelInfo("IslandLODsubCOM", &islandLODsubCom); - for(i = 0; i < CPools::GetBuildingPool()->GetSize(); i++){ + for(i = CPools::GetBuildingPool()->GetSize()-1; i >= 0; i--){ CBuilding *building = CPools::GetBuildingPool()->GetSlot(i); if(building == nil) continue; @@ -682,8 +682,8 @@ CStreaming::RequestBigBuildings(eLevelName level) int i, n; CBuilding *b; - n = CPools::GetBuildingPool()->GetSize(); - for(i = 0; i < n; i++){ + n = CPools::GetBuildingPool()->GetSize()-1; + for(i = n; i >= 0; i--){ b = CPools::GetBuildingPool()->GetSlot(i); if(b && b->bIsBIGBuilding && b->m_level == level) RequestModel(b->GetModelIndex(), STREAMFLAGS_DONT_REMOVE|STREAMFLAGS_PRIORITY); @@ -837,8 +837,8 @@ CStreaming::RemoveBuildings(eLevelName level) CEntity *e; CBaseModelInfo *mi; - n = CPools::GetBuildingPool()->GetSize(); - for(i = 0; i < n; i++){ + n = CPools::GetBuildingPool()->GetSize()-1; + for(i = n; i >= 0; i--){ e = CPools::GetBuildingPool()->GetSlot(i); if(e && e->m_level == level){ mi = CModelInfo::GetModelInfo(e->GetModelIndex()); @@ -850,8 +850,8 @@ CStreaming::RemoveBuildings(eLevelName level) } } - n = CPools::GetTreadablePool()->GetSize(); - for(i = 0; i < n; i++){ + n = CPools::GetTreadablePool()->GetSize()-1; + for(i = n; i >= 0; i--){ e = CPools::GetTreadablePool()->GetSlot(i); if(e && e->m_level == level){ mi = CModelInfo::GetModelInfo(e->GetModelIndex()); @@ -863,8 +863,8 @@ CStreaming::RemoveBuildings(eLevelName level) } } - n = CPools::GetObjectPool()->GetSize(); - for(i = 0; i < n; i++){ + n = CPools::GetObjectPool()->GetSize()-1; + for(i = n; i >= 0; i--){ e = CPools::GetObjectPool()->GetSlot(i); if(e && e->m_level == level){ mi = CModelInfo::GetModelInfo(e->GetModelIndex()); @@ -876,8 +876,8 @@ CStreaming::RemoveBuildings(eLevelName level) } } - n = CPools::GetDummyPool()->GetSize(); - for(i = 0; i < n; i++){ + n = CPools::GetDummyPool()->GetSize()-1; + for(i = n; i >= 0; i--){ e = CPools::GetDummyPool()->GetSlot(i); if(e && e->m_level == level){ mi = CModelInfo::GetModelInfo(e->GetModelIndex()); @@ -951,8 +951,8 @@ CStreaming::RemoveBigBuildings(eLevelName level) CEntity *e; CBaseModelInfo *mi; - n = CPools::GetBuildingPool()->GetSize(); - for(i = 0; i < n; i++){ + n = CPools::GetBuildingPool()->GetSize()-1; + for(i = n; i >= 0; i--){ e = CPools::GetBuildingPool()->GetSlot(i); if(e && e->bIsBIGBuilding && e->m_level == level){ mi = CModelInfo::GetModelInfo(e->GetModelIndex()); @@ -1172,8 +1172,8 @@ CStreaming::HaveAllBigBuildingsLoaded(eLevelName level) return; } - n = CPools::GetBuildingPool()->GetSize(); - for(i = 0; i < n; i++){ + n = CPools::GetBuildingPool()->GetSize()-1; + for(i = n; i >= 0; i--){ e = CPools::GetBuildingPool()->GetSlot(i); if(e && e->bIsBIGBuilding && e->m_level == level && ms_aInfoForModel[e->GetModelIndex()].m_loadState != STREAMSTATE_LOADED) |