diff options
author | Dave Parks <davep@lindenlab.com> | 2023-02-14 10:10:25 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-02-14 10:10:25 -0600 |
commit | 914ae0448fea64147d9a8b601e34ceac85e0dd01 (patch) | |
tree | d2333c82a6b9bbd40084cd191c0455deedb053db | |
parent | 68c4ff7dce2bd519431238f6209238aba46dc0ba (diff) | |
parent | a549140fd072c0bf03047fa1809d4ea4b89b5a12 (diff) |
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
-rw-r--r-- | indra/llcommon/lluuid.cpp | 12 | ||||
-rw-r--r-- | indra/newview/llpanelface.cpp | 35 | ||||
-rw-r--r-- | indra/newview/llpanelface.h | 4 |
3 files changed, 20 insertions, 31 deletions
diff --git a/indra/llcommon/lluuid.cpp b/indra/llcommon/lluuid.cpp index 47c6bc71c8..fc04dca08d 100644 --- a/indra/llcommon/lluuid.cpp +++ b/indra/llcommon/lluuid.cpp @@ -44,6 +44,7 @@ #include "lltimer.h" #include "llthread.h" #include "llmutex.h" +#include "llmd5.h" #include "hbxxh.h" const LLUUID LLUUID::null; @@ -400,11 +401,16 @@ LLUUID LLUUID::operator^(const LLUUID& rhs) const return id; } +// WARNING: this algorithm SHALL NOT be changed. It is also used by the server +// and plays a role in some assets validation (e.g. clothing items). Changing +// it would cause invalid assets. void LLUUID::combine(const LLUUID& other, LLUUID& result) const { - HBXXH128 hash((const void*)mData, 16, false); // false = do not finalize - hash.update((const void*)other.mData, 16); - hash.digest(result); + LLMD5 md5_uuid; + md5_uuid.update((unsigned char*)mData, 16); + md5_uuid.update((unsigned char*)other.mData, 16); + md5_uuid.finalize(); + md5_uuid.raw_digest(result.mData); } LLUUID LLUUID::combine(const LLUUID &other) const diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index cb09ec9fbf..ce086f2520 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1829,6 +1829,7 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, const U32 pbr_type = findChild<LLRadioGroup>("radio_pbr_type")->getSelectedIndex(); const LLGLTFMaterial::TextureInfo texture_info = texture_info_from_pbrtype(pbr_type); const bool show_texture_info = texture_info != LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT; + const bool new_state = show_texture_info && has_pbr_capabilities && has_pbr_material; LLUICtrl* gltfCtrlTextureScaleU = getChild<LLUICtrl>("gltfTextureScaleU"); LLUICtrl* gltfCtrlTextureScaleV = getChild<LLUICtrl>("gltfTextureScaleV"); @@ -1836,13 +1837,15 @@ void LLPanelFace::updateUIGLTF(LLViewerObject* objectp, bool& has_pbr_material, LLUICtrl* gltfCtrlTextureOffsetU = getChild<LLUICtrl>("gltfTextureOffsetU"); LLUICtrl* gltfCtrlTextureOffsetV = getChild<LLUICtrl>("gltfTextureOffsetV"); - gltfCtrlTextureScaleU->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material); - gltfCtrlTextureScaleV->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material); - gltfCtrlTextureRotation->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material); - gltfCtrlTextureOffsetU->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material); - gltfCtrlTextureOffsetV->setEnabled(show_texture_info && has_pbr_capabilities && has_pbr_material); + gltfCtrlTextureScaleU->setEnabled(new_state); + gltfCtrlTextureScaleV->setEnabled(new_state); + gltfCtrlTextureRotation->setEnabled(new_state); + gltfCtrlTextureOffsetU->setEnabled(new_state); + gltfCtrlTextureOffsetV->setEnabled(new_state); - // Control values are set in setMaterialOverridesFromSelection + // Control values will be set once per frame in + // setMaterialOverridesFromSelection + sMaterialOverrideSelection.setDirty(); } } @@ -2821,7 +2824,6 @@ void LLPanelFace::onCommitPbrType(LLUICtrl* ctrl, void* userdata) // and generally reflecting old state when switching tabs or objects // self->updateUI(); - self->setMaterialOverridesFromSelection(); } // static @@ -4768,17 +4770,7 @@ void LLPanelFace::Selection::connect() bool LLPanelFace::Selection::update() { - const bool selection_changed = compareSelection(); - if (selection_changed) - { - clearObjectUpdatePending(); - } - else if (isObjectUpdatePending()) - { - return false; - } - - const bool changed = mChanged; + const bool changed = mChanged || compareSelection(); mChanged = false; return changed; } @@ -4794,16 +4786,9 @@ void LLPanelFace::Selection::onSelectedObjectUpdated(const LLUUID& object_id, S3 if (object_id == mSelectedObjectID && side == mSelectedSide) { mChanged = true; - clearObjectUpdatePending(); } } -void LLPanelFace::Selection::clearObjectUpdatePending() -{ - mPendingObjectID = LLUUID::null; - mPendingSide = -1; -} - bool LLPanelFace::Selection::compareSelection() { if (!mNeedsSelectionCheck) diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 707d693672..106259b84a 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -484,15 +484,13 @@ private: // updated. Necessary to prevent controls updating when the mouse is // held down. void setObjectUpdatePending(const LLUUID &object_id, S32 side); + void setDirty() { mChanged = true; }; // Callbacks void onSelectionChanged() { mNeedsSelectionCheck = true; } void onSelectedObjectUpdated(const LLUUID &object_id, S32 side); protected: - void clearObjectUpdatePending(); - bool isObjectUpdatePending() { return mPendingSide != -1; } - bool compareSelection(); bool mChanged = false; |