summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerpartsim.cpp
diff options
context:
space:
mode:
authorsimon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com>2013-01-22 13:51:19 -0800
committersimon@Simon-PC.lindenlab.com <simon@Simon-PC.lindenlab.com>2013-01-22 13:51:19 -0800
commitc72a0b7bbcbeca0f586d902b3bd73f101c144edd (patch)
tree21214559c39ad57c93782fa28dd832dbdeb74861 /indra/newview/llviewerpartsim.cpp
parentac6a19d456089e40d6d849a7b8aea1bc6b136c12 (diff)
MAINT-2158 - Particle grievance. Particles are not added at less than 4 fps.
Reviewed by Kelly
Diffstat (limited to 'indra/newview/llviewerpartsim.cpp')
-rw-r--r--indra/newview/llviewerpartsim.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp
index 6bd9f66b9c..61cdfd7818 100644
--- a/indra/newview/llviewerpartsim.cpp
+++ b/indra/newview/llviewerpartsim.cpp
@@ -488,9 +488,13 @@ void LLViewerPartSim::destroyClass()
//static
BOOL LLViewerPartSim::shouldAddPart()
{
- if (sParticleCount > PART_THROTTLE_THRESHOLD*sMaxParticleCount)
+ if (sParticleCount >= MAX_PART_COUNT)
{
+ return FALSE;
+ }
+ if (sParticleCount > PART_THROTTLE_THRESHOLD*sMaxParticleCount)
+ {
F32 frac = (F32)sParticleCount/(F32)sMaxParticleCount;
frac -= PART_THROTTLE_THRESHOLD;
frac *= PART_THROTTLE_RESCALE;
@@ -500,7 +504,10 @@ BOOL LLViewerPartSim::shouldAddPart()
return FALSE;
}
}
- if (sParticleCount >= MAX_PART_COUNT)
+
+ // Check frame rate, and don't add more if the viewer is really slow
+ const F32 MIN_FRAME_RATE_FOR_NEW_PARTICLES = 4.f;
+ if (gFPSClamped < MIN_FRAME_RATE_FOR_NEW_PARTICLES)
{
return FALSE;
}