diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llhudnametag.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llhudnametag.h | 4 | ||||
-rw-r--r-- | indra/newview/llhudtext.cpp | 3 |
3 files changed, 8 insertions, 10 deletions
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 81d862a827..fa89d3986d 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -105,6 +105,9 @@ LLHUDNameTag::LLHUDNameTag(const U8 type) { LLPointer<LLHUDNameTag> ptr(this); sTextObjects.insert(ptr); + + mRoundedRectImgp = LLUI::getUIImage("Rounded_Rect"); + mRoundedRectTopImgp = LLUI::getUIImage("Rounded_Rect_Top"); } LLHUDNameTag::~LLHUDNameTag() @@ -274,9 +277,6 @@ void LLHUDNameTag::renderText(BOOL for_select) mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f)); - // *TODO: cache this image - LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Rect"); - // *TODO: make this a per-text setting LLColor4 bg_color = LLUIColorTable::instance().getColor("NameTagBackground"); bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); @@ -306,17 +306,16 @@ void LLHUDNameTag::renderText(BOOL for_select) LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); LLRect screen_rect; screen_rect.setCenterAndSize(0, static_cast<S32>(lltrunc(-mHeight / 2 + mOffsetY)), static_cast<S32>(lltrunc(mWidth)), static_cast<S32>(lltrunc(mHeight))); - imagep->draw3D(render_position, x_pixel_vec, y_pixel_vec, screen_rect, bg_color); + mRoundedRectImgp->draw3D(render_position, x_pixel_vec, y_pixel_vec, screen_rect, bg_color); if (mLabelSegments.size()) { - LLUIImagePtr rect_top_image = LLUI::getUIImage("Rounded_Rect_Top"); LLRect label_top_rect = screen_rect; const S32 label_height = ll_round((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f))); label_top_rect.mBottom = label_top_rect.mTop - label_height; LLColor4 label_top_color = text_color; label_top_color.mV[VALPHA] = gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor; - rect_top_image->draw3D(render_position, x_pixel_vec, y_pixel_vec, label_top_rect, label_top_color); + mRoundedRectTopImgp->draw3D(render_position, x_pixel_vec, y_pixel_vec, label_top_rect, label_top_color); } F32 y_offset = (F32)mOffsetY; diff --git a/indra/newview/llhudnametag.h b/indra/newview/llhudnametag.h index 38a4f18415..f7d7c2a51a 100644 --- a/indra/newview/llhudnametag.h +++ b/indra/newview/llhudnametag.h @@ -40,8 +40,8 @@ #include <set> #include <vector> -class LLDrawable; class LLHUDNameTag; +class LLUIImage; struct llhudnametag_further_away { @@ -171,6 +171,8 @@ private: EVertAlignment mVertAlignment; S32 mLOD; BOOL mHidden; + LLPointer<LLUIImage> mRoundedRectImgp; + LLPointer<LLUIImage> mRoundedRectTopImgp; static BOOL sDisplayText ; static std::set<LLPointer<LLHUDNameTag> > sTextObjects; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 82824861a9..98ce632254 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -138,9 +138,6 @@ void LLHUDText::renderText() mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f)); - // *TODO: cache this image - LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square"); - // *TODO: make this a per-text setting LLColor4 bg_color = LLUIColorTable::instance().getColor("ObjectBubbleColor"); bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor); |