From ac865de287b2e740acd9f6a8724301146df73ccf Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 25 Jan 2019 22:02:16 +0200 Subject: SL-1945 Day Cycle Editor Copy Track --- indra/newview/lltexturectrl.cpp | 58 ++--------------------------------------- 1 file changed, 2 insertions(+), 56 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index a5a2eec246..5ca77ad3c3 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -70,9 +70,6 @@ #include "lllocalbitmaps.h" #include "llerror.h" -static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; -static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; -static const F32 CONTEXT_FADE_TIME = 0.08f; static const S32 LOCAL_TRACKING_ID_COLUMN = 1; @@ -410,59 +407,8 @@ BOOL LLFloaterTexturePicker::postBuild() // virtual void LLFloaterTexturePicker::draw() { - if (mOwner) - { - // draw cone of context pointing back to texture swatch - LLRect owner_rect; - mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this); - LLRect local_rect = getLocalRect(); - if (gFocusMgr.childHasKeyboardFocus(this) && mOwner->isInVisibleChain() && mContextConeOpacity > 0.001f) - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::QUADS); - { - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); - } - gGL.end(); - } - } - - if (gFocusMgr.childHasMouseCapture(getDragHandle())) - { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); - } - else - { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); - } + static LLCachedControl max_opacity(gSavedSettings, "PickerContextOpacity", 0.4f); + drawConeToOwner(mContextConeOpacity, max_opacity, mOwner); updateImageStats(); -- cgit v1.2.3 From 42fa05bd4cd8d587af4c216faca5e8c010812c8b Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Wed, 8 May 2019 12:49:02 -0700 Subject: Remove unref'd vars for Clang. --- indra/newview/lltexturectrl.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 39a7e81184..c21b16e4f8 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -70,8 +70,6 @@ #include "lllocalbitmaps.h" #include "llerror.h" -static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; -static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; static const F32 CONTEXT_FADE_TIME = 0.08f; static const S32 LOCAL_TRACKING_ID_COLUMN = 1; -- cgit v1.2.3 From 0d674ea43f5f5ce640ce5a52ae39c425872787ca Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 13 May 2019 20:32:17 +0200 Subject: Fix merge error --- indra/newview/lltexturectrl.cpp | 57 ++--------------------------------------- 1 file changed, 2 insertions(+), 55 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index c21b16e4f8..25c481cdf5 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -70,8 +70,6 @@ #include "lllocalbitmaps.h" #include "llerror.h" -static const F32 CONTEXT_FADE_TIME = 0.08f; - static const S32 LOCAL_TRACKING_ID_COLUMN = 1; //static const char CURRENT_IMAGE_NAME[] = "Current Texture"; @@ -408,59 +406,8 @@ BOOL LLFloaterTexturePicker::postBuild() // virtual void LLFloaterTexturePicker::draw() { - if (mOwner) - { - // draw cone of context pointing back to texture swatch - LLRect owner_rect; - mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this); - LLRect local_rect = getLocalRect(); - if (gFocusMgr.childHasKeyboardFocus(this) && mOwner->isInVisibleChain() && mContextConeOpacity > 0.001f) - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::QUADS); - { - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); - } - gGL.end(); - } - } - - if (gFocusMgr.childHasMouseCapture(getDragHandle())) - { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); - } - else - { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); - } + static LLCachedControl max_opacity(gSavedSettings, "PickerContextOpacity", 0.4f); + drawConeToOwner(mContextConeOpacity, max_opacity, mOwner); updateImageStats(); -- cgit v1.2.3 From 3dff18eb6981dec4231437b5fd67a4f7e6b4d9a2 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 26 Aug 2019 14:20:04 -0700 Subject: Fix merged code use of obsoleted vars and other merge errors. --- indra/newview/lltexturectrl.cpp | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 801d0f0893..3830e11893 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -73,6 +73,10 @@ #include "llavatarappearancedefines.h" +static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; +static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; +static const F32 CONTEXT_FADE_TIME = 0.08f; + static const S32 LOCAL_TRACKING_ID_COLUMN = 1; //static const char CURRENT_IMAGE_NAME[] = "Current Texture"; @@ -391,6 +395,9 @@ BOOL LLFloaterTexturePicker::postBuild() // don't put keyboard focus on selected item, because the selection callback // will assume that this was user input + + + if(!mImageAssetID.isNull()) { mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); @@ -437,9 +444,6 @@ void LLFloaterTexturePicker::draw() { if (mOwner) { - static LLCachedControl max_opacity(gSavedSettings, "PickerContextOpacity", 0.4f); - drawConeToOwner(mContextConeOpacity, max_opacity, mOwner); - // draw cone of context pointing back to texture swatch LLRect owner_rect; mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this); @@ -742,6 +746,7 @@ void LLFloaterTexturePicker::onBtnSelect(void* userdata) local_id = LLLocalBitmapMgr::getWorldID(temp_id); } } + if (self->mOnFloaterCommitCallback) { self->mOnFloaterCommitCallback(LLTextureCtrl::TEXTURE_SELECT, local_id); @@ -805,14 +810,14 @@ void LLFloaterTexturePicker::onSelectionChange(const std::dequemModeSelector->getSelectedIndex() == 0); - - self->getChild("Default")->setVisible(mode); - self->getChild("Blank")->setVisible(mode); - self->getChild("None")->setVisible(mode); - self->getChild("Pipette")->setVisible(mode); - self->getChild("inventory search editor")->setVisible(mode); - self->getChild("inventory panel")->setVisible(mode); + int mode = self->mModeSelector->getSelectedIndex(); + + self->getChild("Default")->setVisible(mode == 0); + self->getChild("Blank")->setVisible(mode == 0); + self->getChild("None")->setVisible(mode == 0); + self->getChild("Pipette")->setVisible(mode == 0); + self->getChild("inventory search editor")->setVisible(mode == 0); + self->getChild("inventory panel")->setVisible(mode == 0); /*self->getChild("show_folders_check")->setVisible(mode); no idea under which conditions the above is even shown, needs testing. */ -- cgit v1.2.3 From 1cf1459cbc261c3512ebd6f07ce7b1d0f078f627 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 26 Aug 2019 14:34:15 -0700 Subject: Make texture ctrl visibility set respect BOOL vs bool and use better naming. --- indra/newview/lltexturectrl.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 3830e11893..395e83a036 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -810,27 +810,27 @@ void LLFloaterTexturePicker::onSelectionChange(const std::dequemModeSelector->getSelectedIndex(); + int index = self->mModeSelector->getSelectedIndex(); - self->getChild("Default")->setVisible(mode == 0); - self->getChild("Blank")->setVisible(mode == 0); - self->getChild("None")->setVisible(mode == 0); - self->getChild("Pipette")->setVisible(mode == 0); - self->getChild("inventory search editor")->setVisible(mode == 0); - self->getChild("inventory panel")->setVisible(mode == 0); + self->getChild("Default")->setVisible(index == 0 ? TRUE : FALSE); + self->getChild("Blank")->setVisible(index == 0 ? TRUE : FALSE); + self->getChild("None")->setVisible(index == 0 ? TRUE : FALSE); + self->getChild("Pipette")->setVisible(index == 0 ? TRUE : FALSE); + self->getChild("inventory search editor")->setVisible(index == 0 ? TRUE : FALSE); + self->getChild("inventory panel")->setVisible(index == 0 ? TRUE : FALSE); /*self->getChild("show_folders_check")->setVisible(mode); no idea under which conditions the above is even shown, needs testing. */ - self->getChild("l_add_btn")->setVisible(mode == 1); - self->getChild("l_rem_btn")->setVisible(mode == 1); - self->getChild("l_upl_btn")->setVisible(mode == 1); - self->getChild("l_name_list")->setVisible(mode == 1); + self->getChild("l_add_btn")->setVisible(index == 1 ? TRUE : FALSE); + self->getChild("l_rem_btn")->setVisible(index == 1 ? TRUE : FALSE); + self->getChild("l_upl_btn")->setVisible(index == 1 ? TRUE : FALSE); + self->getChild("l_name_list")->setVisible(index == 1 ? TRUE : FALSE); - self->getChild("l_bake_use_texture_combo_box")->setVisible(mode == 2); - self->getChild("hide_base_mesh_region")->setVisible(false);// mode == 2); + self->getChild("l_bake_use_texture_combo_box")->setVisible(index == 2 ? TRUE : FALSE); + self->getChild("hide_base_mesh_region")->setVisible(FALSE);// index == 2 ? TRUE : FALSE); - if (mode == 2) + if (index == 2) { self->stopUsingPipette(); -- cgit v1.2.3 From 2cd01c8e92e2ecf4402a3a075ec8bdc6a8f20470 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 27 Aug 2019 08:59:48 -0700 Subject: Move decl of statics inside func to appease Clang, maybe. --- indra/newview/lltexturectrl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 395e83a036..e0ae8aaacb 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -73,10 +73,6 @@ #include "llavatarappearancedefines.h" -static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; -static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; -static const F32 CONTEXT_FADE_TIME = 0.08f; - static const S32 LOCAL_TRACKING_ID_COLUMN = 1; //static const char CURRENT_IMAGE_NAME[] = "Current Texture"; @@ -442,6 +438,10 @@ BOOL LLFloaterTexturePicker::postBuild() // virtual void LLFloaterTexturePicker::draw() { + static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; + static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; + static const F32 CONTEXT_FADE_TIME = 0.08f; + if (mOwner) { // draw cone of context pointing back to texture swatch -- cgit v1.2.3 From b660db7324387e2fcc55312e2c4f05897ca2c0eb Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 27 Aug 2019 19:21:05 +0200 Subject: Merge fix --- indra/newview/lltexturectrl.cpp | 59 ++--------------------------------------- 1 file changed, 2 insertions(+), 57 deletions(-) (limited to 'indra/newview/lltexturectrl.cpp') diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index e0ae8aaacb..ab7d1b26ed 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -438,63 +438,8 @@ BOOL LLFloaterTexturePicker::postBuild() // virtual void LLFloaterTexturePicker::draw() { - static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f; - static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f; - static const F32 CONTEXT_FADE_TIME = 0.08f; - - if (mOwner) - { - // draw cone of context pointing back to texture swatch - LLRect owner_rect; - mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this); - LLRect local_rect = getLocalRect(); - if (gFocusMgr.childHasKeyboardFocus(this) && mOwner->isInVisibleChain() && mContextConeOpacity > 0.001f) - { - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - LLGLEnable(GL_CULL_FACE); - gGL.begin(LLRender::QUADS); - { - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mTop); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mTop); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - - - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); - gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); - gGL.vertex2i(local_rect.mRight, local_rect.mBottom); - gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); - gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); - gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); - } - gGL.end(); - } - } - - if (gFocusMgr.childHasMouseCapture(getDragHandle())) - { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); - } - else - { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); - } + static LLCachedControl max_opacity(gSavedSettings, "PickerContextOpacity", 0.4f); + drawConeToOwner(mContextConeOpacity, max_opacity, mOwner); updateImageStats(); -- cgit v1.2.3