From 82c9b0fbbca6f61e57464a6126ae36a59b13d6ed Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 13 Apr 2012 23:07:48 -0700 Subject: fixed build all param values now support named values uniformly --- indra/llui/lluiimage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llui/lluiimage.cpp') diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index 1d9ce29ba9..6ae42c8852 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -155,7 +155,7 @@ void LLUIImage::onImageLoaded() namespace LLInitParam { - void ParamValue >::updateValueFromBlock() + void ParamValue::updateValueFromBlock() { // The keyword "none" is specifically requesting a null image // do not default to current value. Used to overwrite template images. @@ -172,7 +172,7 @@ namespace LLInitParam } } - void ParamValue >::updateBlockFromValue(bool make_block_authoritative) + void ParamValue::updateBlockFromValue(bool make_block_authoritative) { if (getValue() == NULL) { -- cgit v1.2.3 From 37186d452fcb94b13e34d01aa801e7db17ee353e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 17 Apr 2012 14:13:31 -0700 Subject: CHUI-86 WIP Investigate voice-dot with name tag integration added draw3D to LLUIImage to encapsulate display of image in projective 3D space --- indra/llui/lluiimage.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'indra/llui/lluiimage.cpp') diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index 6ae42c8852..a4886dabb0 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -112,6 +112,50 @@ void LLUIImage::drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& drawSolid(border_rect, color); } +void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, const LLVector3& y_axis, + const LLRect& rect, const LLColor4& color) +{ + F32 border_scale = 1.f; + F32 border_height = (1.f - mScaleRegion.getHeight()) * getHeight(); + F32 border_width = (1.f - mScaleRegion.getWidth()) * getWidth(); + if (rect.getHeight() < border_height || rect.getWidth() < border_width) + { + if(border_height - rect.getHeight() > border_width - rect.getWidth()) + { + border_scale = (F32)rect.getHeight() / border_height; + } + else + { + border_scale = (F32)rect.getWidth() / border_width; + } + } + + LLUI::pushMatrix(); + { + LLVector3 rect_origin = origin_agent + (rect.mLeft * x_axis) + (rect.mBottom * y_axis); + LLUI::translate(rect_origin.mV[VX], + rect_origin.mV[VY], + rect_origin.mV[VZ]); + gGL.getTexUnit(0)->bind(getImage()); + gGL.color4fv(color.mV); + + LLRectf center_uv_rect(mClipRegion.mLeft + mScaleRegion.mLeft * mClipRegion.getWidth(), + mClipRegion.mBottom + mScaleRegion.mTop * mClipRegion.getHeight(), + mClipRegion.mLeft + mScaleRegion.mRight * mClipRegion.getWidth(), + mClipRegion.mBottom + mScaleRegion.mBottom * mClipRegion.getHeight()); + gl_segmented_rect_3d_tex(mClipRegion, + center_uv_rect, + LLRectf(border_width * border_scale * 0.5f, + 1.f - (border_height * border_scale * 0.5f), + 1.f - (border_width * border_scale * 0.5f), + border_height * border_scale * 0.5f), + rect.getWidth() * x_axis, + rect.getHeight() * y_axis); + + } LLUI::popMatrix(); +} + + S32 LLUIImage::getWidth() const { // return clipped dimensions of actual image area -- cgit v1.2.3 From 42b5dfda161a1e6b92990cd5206bca5ff5b95ab6 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 17 Apr 2012 17:13:48 -0700 Subject: CHUI-86 WIP Investigate voice-dot with name tag integration fixed bad parameters in draw3d...name tags should display properly now --- indra/llui/lluiimage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui/lluiimage.cpp') diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index a4886dabb0..9ed98f941f 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -145,10 +145,10 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c mClipRegion.mBottom + mScaleRegion.mBottom * mClipRegion.getHeight()); gl_segmented_rect_3d_tex(mClipRegion, center_uv_rect, - LLRectf(border_width * border_scale * 0.5f, - 1.f - (border_height * border_scale * 0.5f), - 1.f - (border_width * border_scale * 0.5f), - border_height * border_scale * 0.5f), + LLRectf(border_width * border_scale * 0.5f / (F32)rect.getWidth(), + (rect.getHeight() - (border_height * border_scale * 0.5f)) / (F32)rect.getHeight(), + (rect.getWidth() - (border_width * border_scale * 0.5f)) / (F32)rect.getWidth(), + (border_height * border_scale * 0.5f) / (F32)rect.getHeight()), rect.getWidth() * x_axis, rect.getHeight() * y_axis); -- cgit v1.2.3