summaryrefslogtreecommitdiffstats
path: root/src/peds/Population.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-08-07 10:18:46 +0200
committerGitHub <noreply@github.com>2020-08-07 10:18:46 +0200
commitf14b1fba09fa992a67abe10ca12897fd9db386be (patch)
tree10651feff629e4d2b9e31727d35ed7b00bb02a06 /src/peds/Population.cpp
parentMerge pull request #676 from aap/master (diff)
parentSqueeze performance option, minor fixes (diff)
downloadre3-f14b1fba09fa992a67abe10ca12897fd9db386be.tar
re3-f14b1fba09fa992a67abe10ca12897fd9db386be.tar.gz
re3-f14b1fba09fa992a67abe10ca12897fd9db386be.tar.bz2
re3-f14b1fba09fa992a67abe10ca12897fd9db386be.tar.lz
re3-f14b1fba09fa992a67abe10ca12897fd9db386be.tar.xz
re3-f14b1fba09fa992a67abe10ca12897fd9db386be.tar.zst
re3-f14b1fba09fa992a67abe10ca12897fd9db386be.zip
Diffstat (limited to 'src/peds/Population.cpp')
-rw-r--r--src/peds/Population.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp
index 1357907d..0756df38 100644
--- a/src/peds/Population.cpp
+++ b/src/peds/Population.cpp
@@ -1104,7 +1104,11 @@ CPopulation::ManagePopulation(void)
}
int pedPoolSize = CPools::GetPedPool()->GetSize();
+#ifndef SQUEEZE_PERFORMANCE
for (int poolIndex = pedPoolSize-1; poolIndex >= 0; poolIndex--) {
+#else
+ for (int poolIndex = (pedPoolSize * (frameMod32 + 1) / 32) - 1; poolIndex >= pedPoolSize * frameMod32 / 32; poolIndex--) {
+#endif
CPed *ped = CPools::GetPedPool()->GetSlot(poolIndex);
if (ped && !ped->IsPlayer() && ped->CanBeDeleted() && !ped->bInVehicle) {
@@ -1117,6 +1121,13 @@ CPopulation::ManagePopulation(void)
}
float dist = (ped->GetPosition() - playerPos).Magnitude2D();
+#ifdef SQUEEZE_PERFORMANCE
+ if (dist > 50.f)
+ ped->bUsesCollision = false;
+ else
+ ped->bUsesCollision = true;
+#endif
+
bool pedIsFarAway = false;
if (PedCreationDistMultiplier() * (PED_REMOVE_DIST_SPECIAL * TheCamera.GenerationDistMultiplier) < dist
|| (!ped->bCullExtraFarAway && PedCreationDistMultiplier() * PED_REMOVE_DIST * TheCamera.GenerationDistMultiplier < dist)