summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-11-24 22:07:17 -0500
committerLoren Shih <seraph@lindenlab.com>2009-11-24 22:07:17 -0500
commit2369fa96c24bafbd032c85b58767502cfd37ebaf (patch)
tree65926883dc0b5f81207e76d7d4f2ad64d56ebf40 /indra
parent9b9c3f03ac581d312ad61f433877979fba0614bb (diff)
parent788dbcce6661923c6963a454fb094239cc669723 (diff)
Automated merge.
--HG-- branch : avatar-pipeline
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llagentwearables.cpp2
-rw-r--r--indra/newview/llinventorybridge.cpp22
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp20
-rw-r--r--indra/newview/llpaneloutfitsinventory.h1
-rw-r--r--indra/newview/lltexlayer.cpp102
-rw-r--r--indra/newview/lltexlayer.h6
-rw-r--r--indra/newview/llvoavatar.cpp2
-rw-r--r--indra/newview/llvoavatarself.cpp7
-rw-r--r--indra/newview/llvoavatarself.h1
9 files changed, 134 insertions, 29 deletions
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<LLWearable*>::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;
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 50dbe8af96..9421cf5716 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;
@@ -2351,6 +2352,19 @@ void LLFolderBridge::staticFolderOptionsMenu()
sSelf->folderOptionsMenu();
}
+bool isInOutfitsSidePanel(LLPanel *panel)
+{
+ LLInventoryPanel *my_panel = dynamic_cast<LLInventoryPanel*>(panel);
+ LLPanelOutfitsInventory *outfit_panel =
+ dynamic_cast<LLPanelOutfitsInventory*>(LLSideTray::getInstance()->getPanel("panel_outfits_inventory"));
+ 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()
{
std::vector<std::string> disabled_items;
@@ -2364,11 +2378,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))
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 2550962d76..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<LLFolderViewItem*> &items, BOOL user_action)
{
updateListCommands();
updateParent();
+ if (getRootFolder()->needsAutoRename())
+ {
+ getRootFolder()->startRenamingSelectedItem();
+ getRootFolder()->setNeedsAutoRename(FALSE);
+ }
}
void LLPanelOutfitsInventory::onSelectorButtonClicked()
@@ -398,3 +401,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();
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<LLTexLayerSetBuffer> 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..9882dcd6af 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3868,7 +3868,7 @@ U32 LLVOAvatar::renderRigid()
return 0;
}
- if (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);
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);