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/llviewerobject.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/llviewerobject.cpp')
-rw-r--r-- | indra/newview/llviewerobject.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index e491e11960..3c79045cc5 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2767,22 +2767,23 @@ void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent) // I don't think there's a better way to do this without calculating distance per-poly F32 range = sqrt(dx*dx + dy*dy + dz*dz) - min_scale/2; + LLViewerCamera* camera = LLViewerCamera::getInstance(); if (range < 0.001f || isHUDAttachment()) // range == zero { mAppAngle = 180.f; - mPixelArea = (F32)LLViewerCamera::getInstance()->getScreenPixelArea(); + mPixelArea = (F32)camera->getScreenPixelArea(); } else { mAppAngle = (F32) atan2( max_scale, range) * RAD_TO_DEG; - F32 pixels_per_meter = LLViewerCamera::getInstance()->getPixelMeterRatio() / range; + F32 pixels_per_meter = camera->getPixelMeterRatio() / range; mPixelArea = (pixels_per_meter * max_scale) * (pixels_per_meter * mid_scale); - if (mPixelArea > LLViewerCamera::getInstance()->getScreenPixelArea()) + if (mPixelArea > camera->getScreenPixelArea()) { mAppAngle = 180.f; - mPixelArea = (F32)LLViewerCamera::getInstance()->getScreenPixelArea(); + mPixelArea = (F32)camera->getScreenPixelArea(); } } } |