From 7d3b3cc474822db144b623980d08b7addc2f77ff Mon Sep 17 00:00:00 2001
From: James Cook <james@lindenlab.com>
Date: Mon, 30 Nov 2009 14:41:52 -0800
Subject: Linker optimization - use "extern template" for commonly regenerated
 templates Also replaced many duplicate calls to LLViewerCamera::getInstance()
 with local pointer. Reviewed with Ambroff

---
 indra/newview/llviewerobject.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'indra/newview/llviewerobject.cpp')

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();
 		}
 	}
 }
-- 
cgit v1.2.3