diff options
author | James Cook <james@lindenlab.com> | 2009-11-30 14:41:52 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-11-30 14:41:52 -0800 |
commit | 7d3b3cc474822db144b623980d08b7addc2f77ff (patch) | |
tree | 7d972191820ff94840a6f48d7f30b17fb6f3316a /indra/newview/llviewerpartsim.cpp | |
parent | 447d1c6498870e82834c3b404fa507aee331f45b (diff) |
Linker optimization - use "extern template" for commonly regenerated templates
Also replaced many duplicate calls to LLViewerCamera::getInstance() with local pointer.
Reviewed with Ambroff
Diffstat (limited to 'indra/newview/llviewerpartsim.cpp')
-rw-r--r-- | indra/newview/llviewerpartsim.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index cfb8340462..841a7ccc5e 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -71,9 +71,9 @@ const F32 LLViewerPartSim::PART_ADAPT_RATE_MULT_RECIP = 1.0f/PART_ADAPT_RATE_MUL U32 LLViewerPart::sNextPartID = 1; -F32 calc_desired_size(LLVector3 pos, LLVector2 scale) +F32 calc_desired_size(LLViewerCamera* camera, LLVector3 pos, LLVector2 scale) { - F32 desired_size = (pos-LLViewerCamera::getInstance()->getOrigin()).magVec(); + F32 desired_size = (pos - camera->getOrigin()).magVec(); desired_size /= 4; return llclamp(desired_size, scale.magVec()*0.5f, PART_SIM_BOX_SIDE*2); } @@ -273,6 +273,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) LLViewerPartSim::checkParticleCount(mParticles.size()); + LLViewerCamera* camera = LLViewerCamera::getInstance(); LLViewerRegion *regionp = getRegion(); S32 end = (S32) mParticles.size(); for (S32 i = 0 ; i < (S32)mParticles.size();) @@ -394,7 +395,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt) } else { - F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale); + F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale); if (!posInGroup(part->mPosAgent, desired_size)) { // Transfer particles between groups @@ -557,7 +558,8 @@ LLViewerPartGroup *LLViewerPartSim::put(LLViewerPart* part) } else { - F32 desired_size = calc_desired_size(part->mPosAgent, part->mScale); + LLViewerCamera* camera = LLViewerCamera::getInstance(); + F32 desired_size = calc_desired_size(camera, part->mPosAgent, part->mScale); S32 count = (S32) mViewerPartGroups.size(); for (S32 i = 0; i < count; i++) |