From e1cd91de4e9f3847f185d8b2ffc5ba3a545340fb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 24 Nov 2009 12:49:36 -0500 Subject: For EXT-2571: Right click context menu for Outfits --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index db079de593..628db46281 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -62,6 +62,7 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llwearablelist.h" +#include "llpaneloutfitsinventory.h" using namespace LLOldEvents; @@ -2340,6 +2341,15 @@ void LLFolderBridge::staticFolderOptionsMenu() sSelf->folderOptionsMenu(); } +bool isInOutfitsSidePanel(LLPanel *panel) +{ + LLInventoryPanel *my_panel = dynamic_cast(panel); + LLPanelOutfitsInventory *outfit_panel = + dynamic_cast(LLSideTray::getInstance()->getPanel("panel_outfits_inventory")); + LLInventoryPanel *outfit_inv_panel = outfit_panel ? outfit_panel->getActivePanel(): NULL; + return (my_panel && (my_panel == outfit_inv_panel)); +} + void LLFolderBridge::folderOptionsMenu() { std::vector disabled_items; @@ -2353,11 +2363,17 @@ void LLFolderBridge::folderOptionsMenu() // BAP change once we're no longer treating regular categories as ensembles. const bool is_ensemble = category && (type == LLFolderType::FT_NONE || LLFolderType::lookupIsEnsembleType(type)); + const bool is_sidepanel = isInOutfitsSidePanel(mInventoryPanel.get()); // calling card related functionality for folders. + if (is_sidepanel) + { + mItems.clear(); + } + // Only enable calling-card related options for non-default folders. - if (!is_default_folder) + if (!is_sidepanel && !is_default_folder) { LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); if (mCallingCards || checkFolderForContentsOfType(model, is_callingcard)) -- cgit v1.2.3 From fc6cfc27bec61ac1f66c1304cc7b54f19157584e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 24 Nov 2009 14:37:48 -0500 Subject: Fix for EXT-2571 to accommodate accordion panels --HG-- branch : avatar-pipeline --- indra/newview/llinventorybridge.cpp | 8 ++++++-- indra/newview/llpaneloutfitsinventory.cpp | 11 +++++++++++ indra/newview/llpaneloutfitsinventory.h | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 628db46281..3e847f11ce 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2346,8 +2346,12 @@ bool isInOutfitsSidePanel(LLPanel *panel) LLInventoryPanel *my_panel = dynamic_cast(panel); LLPanelOutfitsInventory *outfit_panel = dynamic_cast(LLSideTray::getInstance()->getPanel("panel_outfits_inventory")); - LLInventoryPanel *outfit_inv_panel = outfit_panel ? outfit_panel->getActivePanel(): NULL; - return (my_panel && (my_panel == outfit_inv_panel)); + if (!outfit_panel) + return false; + return outfit_panel->isAccordionPanel(my_panel); + + //LLInventoryPanel *outfit_inv_panel = outfit_panel ? outfit_panel->getActivePanel(): NULL; + //return (my_panel && (my_panel == outfit_inv_panel)); } void LLFolderBridge::folderOptionsMenu() diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index 2550962d76..e66a4440e9 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -398,3 +398,14 @@ LLInventoryPanel* LLPanelOutfitsInventory::getActivePanel() return mActivePanel; } +bool LLPanelOutfitsInventory::isAccordionPanel(LLInventoryPanel *panel) +{ + for(accordionpanels_vec_t::iterator it = mAccordionPanels.begin(); + it != mAccordionPanels.end(); + ++it) + { + if (*it == panel) + return true; + } + return false; +} diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 902a5caab8..7769a7d172 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -78,6 +78,7 @@ public: ////////////////////////////////////////////////////////////////////////////////// // Accordion // LLInventoryPanel* getActivePanel(); + bool isAccordionPanel(LLInventoryPanel *panel); protected: void initAccordionPanels(); -- cgit v1.2.3 From 4821134aa7be2471aad461aa6a730a68a4c92560 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 24 Nov 2009 15:34:31 -0500 Subject: EXT-2671 avatar rebaking on every login We were querying agent wearables (baked texture) cache before setting mWearablesLoaded. First thing the function does is checks mWearablesLoaded. Moving the call down to later in the function allows us to request & use cached baked textures again. Code reviewed by Seraph --HG-- branch : avatar-pipeline --- indra/newview/llagentwearables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 574b449d23..475f34dc2b 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1547,7 +1547,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it gInventory.notifyObservers(); - queryWearableCache(); std::vector::iterator wearable_iter; @@ -1570,6 +1569,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it // Start rendering & update the server mWearablesLoaded = TRUE; checkWearablesLoaded(); + queryWearableCache(); updateServer(); lldebugs << "setWearableOutfit() end" << llendl; -- cgit v1.2.3 From b6c93cf5406cf1a6e898c072f3c900bf2d902953 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 24 Nov 2009 17:11:26 -0500 Subject: For EXT-2584: Select and rename new folder when creating new outfit; currently works for new outfit created in side panel, but not in appearance editor --HG-- branch : avatar-pipeline --- indra/newview/llpaneloutfitsinventory.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index e66a4440e9..5af26c1ad9 100644 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -144,17 +144,20 @@ void LLPanelOutfitsInventory::onNew() { const std::string& outfit_name = LLViewerFolderType::lookupNewCategoryName(LLFolderType::FT_OUTFIT); LLUUID outfit_folder = gAgentWearables.makeNewOutfitLinks(outfit_name); - /* + getRootFolder()->setSelectionByID(outfit_folder, TRUE); getRootFolder()->setNeedsAutoRename(TRUE); - getRootFolder()->startRenamingSelectedItem(); - */ } void LLPanelOutfitsInventory::onSelectionChange(const std::deque &items, BOOL user_action) { updateListCommands(); updateParent(); + if (getRootFolder()->needsAutoRename()) + { + getRootFolder()->startRenamingSelectedItem(); + getRootFolder()->setNeedsAutoRename(FALSE); + } } void LLPanelOutfitsInventory::onSelectorButtonClicked() -- cgit v1.2.3 From 52a21a301b3fef1401ee333a77f1d53310737717 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 24 Nov 2009 18:25:20 -0500 Subject: EXT-2818 not using IMG_INVISIBLE in baked textures this patch allows IMG_INVISIBLE in an alpha mask to set the baked texture to also be IMG_INVISIBLE for the appropriate baked texture. Will be post-reviewed with other alpha mask fixes. --HG-- branch : avatar-pipeline --- indra/newview/lltexlayer.cpp | 102 ++++++++++++++++++++++++++++++--------- indra/newview/lltexlayer.h | 6 +++ indra/newview/llvoavatar.cpp | 6 +-- indra/newview/llvoavatarself.cpp | 7 +++ indra/newview/llvoavatarself.h | 1 + 5 files changed, 96 insertions(+), 26 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 25e0ca46e4..a90f3ee181 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -223,7 +223,16 @@ BOOL LLTexLayerSetBuffer::render() } else { - readBackAndUpload(); + if (mTexLayerSet->isVisible()) + { + readBackAndUpload(); + } + else + { + mUploadPending = FALSE; + mNeedsUpload = FALSE; + mTexLayerSet->getAvatar()->setNewBakedTexture(mTexLayerSet->getBakedTexIndex(),IMG_INVISIBLE); + } } } @@ -551,6 +560,7 @@ LLTexLayerSet::LLTexLayerSet(LLVOAvatarSelf* const avatar) : mComposite( NULL ), mAvatar( avatar ), mUpdatesEnabled( FALSE ), + mIsVisible( TRUE ), mInfo( NULL ) { } @@ -665,38 +675,54 @@ BOOL LLTexLayerSet::isLocalTextureDataFinal() const BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height ) { BOOL success = TRUE; + mIsVisible = TRUE; - LLGLSUIDefault gls_ui; - LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE); - gGL.setColorMask(true, true); - - // clear buffer area to ensure we don't pick up UI elements + if (mMaskLayerList.size() > 0) { - gGL.flush(); - LLGLDisable no_alpha(GL_ALPHA_TEST); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4f( 0.f, 0.f, 0.f, 1.f ); - - gl_rect_2d_simple( width, height ); - - gGL.flush(); + for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++) + { + LLTexLayerInterface* layer = *iter; + if (layer->isInvisibleAlphaMask()) + { + mIsVisible = FALSE; + } + } } - // composite color layers - for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + if (mIsVisible) { - LLTexLayerInterface* layer = *iter; - if (layer->getRenderPass() == LLTexLayer::RP_COLOR) + LLGLSUIDefault gls_ui; + LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE); + gGL.setColorMask(true, true); + + // clear buffer area to ensure we don't pick up UI elements { gGL.flush(); - success &= layer->render(x, y, width, height); + LLGLDisable no_alpha(GL_ALPHA_TEST); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.color4f( 0.f, 0.f, 0.f, 1.f ); + + gl_rect_2d_simple( width, height ); + gGL.flush(); } - } - renderAlphaMaskTextures(x, y, width, height, false); - - stop_glerror(); + // composite color layers + for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + { + LLTexLayerInterface* layer = *iter; + if (layer->getRenderPass() == LLTexLayer::RP_COLOR) + { + gGL.flush(); + success &= layer->render(x, y, width, height); + gGL.flush(); + } + } + + renderAlphaMaskTextures(x, y, width, height, false); + + stop_glerror(); + } return success; } @@ -1709,6 +1735,19 @@ void LLTexLayer::addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 } } +/*virtual*/ BOOL LLTexLayer::isInvisibleAlphaMask() +{ + if (mLocalTextureObject) + { + if (mLocalTextureObject->getID() == IMG_INVISIBLE) + { + return TRUE; + } + } + + return FALSE; +} + // private helper function LLUUID LLTexLayer::getUUID() { @@ -1898,6 +1937,23 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) } } +/*virtual*/ BOOL LLTexLayerTemplate::isInvisibleAlphaMask() +{ + U32 num_wearables = updateWearableCache(); + for (U32 i = 0; i < num_wearables; i++) + { + LLTexLayer *layer = getLayer(i); + if (layer) + { + if (layer->isInvisibleAlphaMask()) + { + return TRUE; + } + } + } + + return FALSE; +} //----------------------------------------------------------------------------- diff --git a/indra/newview/lltexlayer.h b/indra/newview/lltexlayer.h index cd8f27a96b..5be58f64a9 100644 --- a/indra/newview/lltexlayer.h +++ b/indra/newview/lltexlayer.h @@ -99,6 +99,7 @@ public: virtual void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height) = 0; BOOL hasAlphaParams() const { return !mParamAlphaList.empty(); } BOOL isVisibilityMask() const; + virtual BOOL isInvisibleAlphaMask() = 0; LLTexLayerSet* getLayerSet() {return mTexLayerSet;} @@ -141,6 +142,8 @@ public: /*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height); /*virtual*/ void setHasMorph(BOOL newval); /*virtual*/ void deleteCaches(); + /*virtual*/ BOOL isInvisibleAlphaMask(); + private: U32 updateWearableCache(); LLTexLayer* getLayer(U32 i); @@ -173,6 +176,7 @@ public: /*virtual*/ void gatherAlphaMasks(U8 *data, S32 originX, S32 originY, S32 width, S32 height); BOOL renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color); void addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 height); + /*virtual*/ BOOL isInvisibleAlphaMask(); void setLTO(LLLocalTextureObject *lto) { mLocalTextureObject = lto; } LLLocalTextureObject* getLTO() { return mLocalTextureObject; } @@ -272,6 +276,7 @@ public: BOOL hasComposite() const { return (mComposite.notNull()); } LLVOAvatarDefines::EBakedTextureIndex getBakedTexIndex() { return mBakedTexIndex; } void setBakedTexIndex( LLVOAvatarDefines::EBakedTextureIndex index) { mBakedTexIndex = index; } + BOOL isVisible() const { return mIsVisible; } public: static BOOL sHasCaches; @@ -284,6 +289,7 @@ private: LLPointer mComposite; LLVOAvatarSelf* const mAvatar; // Backlink only; don't make this an LLPointer. BOOL mUpdatesEnabled; + BOOL mIsVisible; LLVOAvatarDefines::EBakedTextureIndex mBakedTexIndex; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9e75d7853d..3bf8038a66 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3832,7 +3832,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) } // Can't test for baked hair being defined, since that won't always be the case (not all viewers send baked hair) // TODO: 1.25 will be able to switch this logic back to calling isTextureVisible(); - if (getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE || LLDrawPoolAlpha::sShowDebugAlpha) + if ((getImage(TEX_HAIR_ALPHA, 0)->getID() != IMG_INVISIBLE && getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE) || LLDrawPoolAlpha::sShowDebugAlpha) { num_indices += mMeshLOD[MESH_ID_HAIR]->render(mAdjustedPixelArea, first_pass, mIsDummy); first_pass = FALSE; @@ -3868,7 +3868,7 @@ U32 LLVOAvatar::renderRigid() return 0; } - if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) + if ((isTextureVisible(TEX_EYES_ALPHA) && isTextureVisible(TEX_EYES_BAKED)) || mIsDummy) { num_indices += mMeshLOD[MESH_ID_EYEBALL_LEFT]->render(mAdjustedPixelArea, TRUE, mIsDummy); num_indices += mMeshLOD[MESH_ID_EYEBALL_RIGHT]->render(mAdjustedPixelArea, TRUE, mIsDummy); @@ -3898,7 +3898,7 @@ U32 LLVOAvatar::renderFootShadows() // Don't render foot shadows if your lower body is completely invisible. // (non-humanoid avatars rule!) - if (!isTextureVisible(TEX_LOWER_BAKED)) + if (!isTextureVisible(TEX_LOWER_BAKED) || ! isTextureVisible(TEX_LOWER_ALPHA)) { return 0; } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 843cba7860..f3e787ae7e 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1839,6 +1839,13 @@ ETextureIndex LLVOAvatarSelf::getBakedTE( const LLTexLayerSet* layerset ) const } +void LLVOAvatarSelf::setNewBakedTexture(LLVOAvatarDefines::EBakedTextureIndex i, const LLUUID &uuid) +{ + ETextureIndex index = LLVOAvatarDictionary::bakedToLocalTextureIndex(i); + setNewBakedTexture(index, uuid); +} + + //----------------------------------------------------------------------------- // setNewBakedTexture() // A new baked texture has been successfully uploaded and we can start using it now. diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index a1cad82eff..e376e5e9ef 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -209,6 +209,7 @@ private: //-------------------------------------------------------------------- public: LLVOAvatarDefines::ETextureIndex getBakedTE(const LLTexLayerSet* layerset ) const; + void setNewBakedTexture(LLVOAvatarDefines::EBakedTextureIndex i, const LLUUID &uuid); void setNewBakedTexture(LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid); void setCachedBakedTexture(LLVOAvatarDefines::ETextureIndex i, const LLUUID& uuid); void forceBakeAllTextures(bool slam_for_debug = false); -- cgit v1.2.3 From 6da470f189ed9f92a7e04529496e95e92d34abcb Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 24 Nov 2009 19:47:56 -0500 Subject: EXT-2818 no way to get IMG_INVISIBLE as a baked texture reverting unnecessary changes based on code review of previous checkin. Code for both patches reviewed by Seraph. --HG-- branch : avatar-pipeline --- indra/newview/llvoavatar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3bf8038a66..9882dcd6af 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3832,7 +3832,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) } // Can't test for baked hair being defined, since that won't always be the case (not all viewers send baked hair) // TODO: 1.25 will be able to switch this logic back to calling isTextureVisible(); - if ((getImage(TEX_HAIR_ALPHA, 0)->getID() != IMG_INVISIBLE && getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE) || LLDrawPoolAlpha::sShowDebugAlpha) + if (getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE || LLDrawPoolAlpha::sShowDebugAlpha) { num_indices += mMeshLOD[MESH_ID_HAIR]->render(mAdjustedPixelArea, first_pass, mIsDummy); first_pass = FALSE; @@ -3868,7 +3868,7 @@ U32 LLVOAvatar::renderRigid() return 0; } - if ((isTextureVisible(TEX_EYES_ALPHA) && isTextureVisible(TEX_EYES_BAKED)) || mIsDummy) + if (isTextureVisible(TEX_EYES_BAKED) || mIsDummy) { num_indices += mMeshLOD[MESH_ID_EYEBALL_LEFT]->render(mAdjustedPixelArea, TRUE, mIsDummy); num_indices += mMeshLOD[MESH_ID_EYEBALL_RIGHT]->render(mAdjustedPixelArea, TRUE, mIsDummy); @@ -3898,7 +3898,7 @@ U32 LLVOAvatar::renderFootShadows() // Don't render foot shadows if your lower body is completely invisible. // (non-humanoid avatars rule!) - if (!isTextureVisible(TEX_LOWER_BAKED) || ! isTextureVisible(TEX_LOWER_ALPHA)) + if (!isTextureVisible(TEX_LOWER_BAKED)) { return 0; } -- cgit v1.2.3