diff options
| author | Graham Linden <graham@lindenlab.com> | 2013-08-19 12:10:40 -0700 |
|---|---|---|
| committer | Graham Linden <graham@lindenlab.com> | 2013-08-19 12:10:40 -0700 |
| commit | 3f186aab7737d611e1b8a62e66a79828e3b5ef5b (patch) | |
| tree | a42a19d1ff584a2d074ef9c07f166d0ad47dc7a2 /indra/newview/llviewerpartsim.cpp | |
| parent | 80256fdbf5fe444c177be793b12d0da58ce2b608 (diff) | |
| parent | 171089207b528ab80a954292c127ba77254ee927 (diff) | |
Merge in viewer-release
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 6bd9f66b9c..61cdfd7818 100755 --- 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; } |
