summaryrefslogtreecommitdiff
path: root/indra/newview/llhudtext.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-10-10 15:25:11 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-10-10 15:25:11 +0100
commit393c819477b268aa0a05ec0a006e1dba27d6e6c6 (patch)
tree2516b6f114fd739e2aa59670d77d217264f00de5 /indra/newview/llhudtext.cpp
parent48c2b2496d3ed6aeeebb0bc8950725f8ef7e305f (diff)
VWR-21967 There's lots of ::renderForSelect() code that we don't need any more.
VWR-22088 Remove underlying ::renderForSelect() code (render-pipeline)
Diffstat (limited to 'indra/newview/llhudtext.cpp')
-rw-r--r--indra/newview/llhudtext.cpp78
1 files changed, 19 insertions, 59 deletions
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index 96638018c4..8e44678924 100644
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -222,44 +222,21 @@ void LLHUDText::render()
if (!mOnHUDAttachment && sDisplayText)
{
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
- renderText(FALSE);
+ renderText();
}
}
-void LLHUDText::renderForSelect()
-{
- if (!mOnHUDAttachment)
- {
- LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
- renderText(TRUE);
- }
-}
-
-void LLHUDText::renderText(BOOL for_select)
+void LLHUDText::renderText()
{
if (!mVisible || mHidden)
{
return;
}
- // don't pick text that isn't bound to a viewerobject or isn't in a bubble
- if (for_select &&
- (!mSourceObject || mSourceObject->mDrawable.isNull() || !mUseBubble))
- {
- return;
- }
-
- if (for_select)
- {
- gGL.getTexUnit(0)->disable();
- }
- else
- {
- gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
- }
+ gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
- LLGLState gls_blend(GL_BLEND, for_select ? FALSE : TRUE);
- LLGLState gls_alpha(GL_ALPHA_TEST, for_select ? FALSE : TRUE);
+ LLGLState gls_blend(GL_BLEND, TRUE);
+ LLGLState gls_alpha(GL_ALPHA_TEST, TRUE);
LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f);
F32 alpha_factor = 1.f;
@@ -364,35 +341,22 @@ void LLHUDText::renderText(BOOL for_select)
- (height_vec);
LLUI::translate(bg_pos.mV[VX], bg_pos.mV[VY], bg_pos.mV[VZ]);
- if (for_select)
- {
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- S32 name = mSourceObject->mGLName;
- LLColor4U coloru((U8)(name >> 16), (U8)(name >> 8), (U8)name);
- gGL.color4ubv(coloru.mV);
- gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec);
- LLUI::popMatrix();
- return;
- }
- else
+ gGL.getTexUnit(0)->bind(imagep->getImage());
+
+ gGL.color4fv(bg_color.mV);
+ gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec);
+
+ if ( mLabelSegments.size())
{
- gGL.getTexUnit(0)->bind(imagep->getImage());
-
- gGL.color4fv(bg_color.mV);
- gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec);
-
- if ( mLabelSegments.size())
+ LLUI::pushMatrix();
{
- LLUI::pushMatrix();
- {
- gGL.color4f(text_color.mV[VX], text_color.mV[VY], text_color.mV[VZ], gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
- LLVector3 label_height = (mFontp->getLineHeight() * mLabelSegments.size() + (VERTICAL_PADDING / 3.f)) * y_pixel_vec;
- LLVector3 label_offset = height_vec - label_height;
- LLUI::translate(label_offset.mV[VX], label_offset.mV[VY], label_offset.mV[VZ]);
- gl_segmented_rect_3d_tex_top(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, label_height);
- }
- LLUI::popMatrix();
+ gGL.color4f(text_color.mV[VX], text_color.mV[VY], text_color.mV[VZ], gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
+ LLVector3 label_height = (mFontp->getLineHeight() * mLabelSegments.size() + (VERTICAL_PADDING / 3.f)) * y_pixel_vec;
+ LLVector3 label_offset = height_vec - label_height;
+ LLUI::translate(label_offset.mV[VX], label_offset.mV[VY], label_offset.mV[VZ]);
+ gl_segmented_rect_3d_tex_top(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, label_height);
}
+ LLUI::popMatrix();
}
BOOL outside_width = llabs(mPositionOffset.mV[VX]) > mWidth * 0.5f;
@@ -550,10 +514,6 @@ void LLHUDText::renderText(BOOL for_select)
}
/// Reset the default color to white. The renderer expects this to be the default.
gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f);
- if (for_select)
- {
- gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
- }
}
void LLHUDText::setStringUTF8(const std::string &wtext)
@@ -1051,7 +1011,7 @@ void LLHUDText::renderAllHUD()
for (text_it = sVisibleHUDTextObjects.begin(); text_it != sVisibleHUDTextObjects.end(); ++text_it)
{
- (*text_it)->renderText(FALSE);
+ (*text_it)->renderText();
}
}