diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2013-08-19 16:12:07 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2013-08-19 16:12:07 -0600 |
commit | 1616b73ef30bcb3e99be68fb7ccc05f0be78ddf6 (patch) | |
tree | e22c94948ed8d8c7f35422fc064172ea3662b264 /indra/newview/llviewerpartsim.cpp | |
parent | ea45b8acd25785bd2789c2c1928e223c9a8e2fbd (diff) | |
parent | d8c02bf06250015b8cb0bcc9c0d8445cfb6acf1c (diff) |
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/newview/llviewerpartsim.cpp')
-rwxr-xr-x | indra/newview/llviewerpartsim.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index 978c307c60..09b6b8eb4b 100755 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -502,9 +502,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; @@ -514,7 +518,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; } |