Automated merge.

--HG--
branch : avatar-pipeline
master
Loren Shih 2009-11-24 22:07:17 -05:00
commit 2369fa96c2
9 changed files with 138 additions and 33 deletions

View File

@ -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;

View File

@ -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))

View File

@ -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;
}

View File

@ -78,6 +78,7 @@ public:
//////////////////////////////////////////////////////////////////////////////////
// Accordion //
LLInventoryPanel* getActivePanel();
bool isAccordionPanel(LLInventoryPanel *panel);
protected:
void initAccordionPanels();

View File

@ -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();
}
// composite color layers
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
{
LLTexLayerInterface* layer = *iter;
if (layer->getRenderPass() == LLTexLayer::RP_COLOR)
for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++)
{
gGL.flush();
success &= layer->render(x, y, width, height);
gGL.flush();
LLTexLayerInterface* layer = *iter;
if (layer->isInvisibleAlphaMask())
{
mIsVisible = FALSE;
}
}
}
renderAlphaMaskTextures(x, y, width, height, false);
stop_glerror();
if (mIsVisible)
{
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();
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();
}
// 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;
}
//-----------------------------------------------------------------------------

View File

@ -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;

View File

@ -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);

View File

@ -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.

View File

@ -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);