diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp index 2de5f7be69..1c4e923106 100644 --- a/indra/newview/lltoolgun.cpp +++ b/indra/newview/lltoolgun.cpp @@ -50,6 +50,8 @@ LLToolGun::LLToolGun( LLToolComposite* composite ) : LLTool( std::string("gun"), composite ), mIsSelected(FALSE) { + // Performance tweak + mCrosshairp = LLUI::getUIImage("crosshairs.tga"); } void LLToolGun::handleSelect() @@ -146,9 +148,14 @@ void LLToolGun::draw() static LLCachedControl showCrosshairs(gSavedSettings, "ShowCrosshairs"); if (showCrosshairs) { - LLUIImagePtr crosshair = LLUI::getUIImage("crosshairs.tga"); - crosshair->draw( - ( gViewerWindow->getWorldViewRectScaled().getWidth() - crosshair->getWidth() ) / 2, - ( gViewerWindow->getWorldViewRectScaled().getHeight() - crosshair->getHeight() ) / 2); + // Performance tweak + //LLUIImagePtr crosshair = LLUI::getUIImage("crosshairs.tga"); + //crosshair->draw( + // ( gViewerWindow->getWorldViewRectScaled().getWidth() - crosshair->getWidth() ) / 2, + // ( gViewerWindow->getWorldViewRectScaled().getHeight() - crosshair->getHeight() ) / 2); + mCrosshairp->draw( + ( gViewerWindow->getWorldViewRectScaled().getWidth() - mCrosshairp->getWidth() ) / 2, + ( gViewerWindow->getWorldViewRectScaled().getHeight() - mCrosshairp->getHeight() ) / 2); + // Performance tweak } } diff --git a/indra/newview/lltoolgun.h b/indra/newview/lltoolgun.h index 8ae926b741..9608dd7817 100644 --- a/indra/newview/lltoolgun.h +++ b/indra/newview/lltoolgun.h @@ -48,6 +48,9 @@ public: virtual BOOL clipMouseWhenDown() { return FALSE; } private: BOOL mIsSelected; + + // Performance tweak + LLUIImagePtr mCrosshairp; }; #endif