diff options
-rw-r--r-- | indra/newview/lloutfitgallery.cpp | 28 | ||||
-rw-r--r-- | indra/newview/lloutfitgallery.h | 2 | ||||
-rw-r--r-- | indra/newview/llpanelface.cpp | 9 | ||||
-rw-r--r-- | indra/newview/lltexturecache.cpp | 19 |
4 files changed, 42 insertions, 16 deletions
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index cca65f2ce1..c38d3ab140 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -72,6 +72,7 @@ LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p) mItemsAddedCount(0), mOutfitLinkPending(NULL), mOutfitRenamePending(NULL), + mSnapshotFolderID(NULL), mRowPanelHeight(p.row_panel_height), mVerticalGap(p.vertical_gap), mHorizontalGap(p.horizontal_gap), @@ -1011,8 +1012,8 @@ void LLOutfitGallery::onTextureSelectionChanged(LLInventoryItem* itemp) void LLOutfitGallery::loadPhotos() { //Iterate over inventory - LLUUID textures = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE); - LLViewerInventoryCategory* textures_category = gInventory.getCategory(textures); + mSnapshotFolderID = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE); + LLViewerInventoryCategory* textures_category = gInventory.getCategory(mSnapshotFolderID); if (!textures_category) return; if (mTexturesObserver == NULL) @@ -1022,12 +1023,26 @@ void LLOutfitGallery::loadPhotos() } // Start observing changes in "Textures" category. - mTexturesObserver->addCategory(textures, - boost::bind(&LLOutfitGallery::refreshTextures, this, textures)); - + mTexturesObserver->addCategory(mSnapshotFolderID, + boost::bind(&LLOutfitGallery::refreshTextures, this, mSnapshotFolderID)); + textures_category->fetch(); } +void LLOutfitGallery::updateSnapshotFolderObserver() +{ + if(mSnapshotFolderID != gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE)) + { + if (gInventory.containsObserver(mTexturesObserver)) + { + gInventory.removeObserver(mTexturesObserver); + } + delete mTexturesObserver; + mTexturesObserver = NULL; + loadPhotos(); + } +} + void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) { LLViewerInventoryCategory* category = gInventory.getCategory(category_id); @@ -1200,7 +1215,7 @@ void LLOutfitGallery::uploadPhoto(LLUUID outfit_id) LLViewerInventoryCategory *outfit_cat = gInventory.getCategory(outfit_id); if (!outfit_cat) return; - + updateSnapshotFolderObserver(); checkRemovePhoto(outfit_id); std::string upload_pending_name = outfit_id.asString(); std::string upload_pending_desc = ""; @@ -1372,6 +1387,7 @@ void LLOutfitGallery::onBeforeOutfitSnapshotSave() if (!selected_outfit_id.isNull()) { checkRemovePhoto(selected_outfit_id); + updateSnapshotFolderObserver(); } } diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index b1ca850508..383924a7d6 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -130,6 +130,7 @@ protected: private: void loadPhotos(); void uploadPhoto(LLUUID outfit_id); + void updateSnapshotFolderObserver(); LLUUID getPhotoAssetId(const LLUUID& outfit_id); LLUUID getDefaultPhoto(); void linkPhotoToOutfit(LLUUID outfit_id, LLUUID photo_id); @@ -168,6 +169,7 @@ private: LLPanel* mLastRowPanel; LLUUID mOutfitLinkPending; LLUUID mOutfitRenamePending; + LLUUID mSnapshotFolderID; LLTextBox* mMessageTextBox; bool mGalleryCreated; int mRowCount; diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index a16259886d..f95a83f427 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1623,6 +1623,15 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh } } } + else + { + if (shiny_texture_ID.isNull() && comboShiny && comboShiny->itemExists(USE_TEXTURE)) + { + comboShiny->remove(SHINY_TEXTURE); + comboShiny->selectFirstItem(); + } + } + LLComboBox* combo_matmedia = getChild<LLComboBox>("combobox matmedia"); LLRadioGroup* radio_mat_type = getChild<LLRadioGroup>("radio_material_type"); diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index f0c28041d1..87a2c0ae60 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -550,9 +550,11 @@ bool LLTextureCacheRemoteWorker::doWrite() { if ((mOffset != 0) // We currently do not support write offsets || (mDataSize <= 0) // Things will go badly wrong if mDataSize is nul or negative... - || (mImageSize < mDataSize)) + || (mImageSize < mDataSize) + || (mRawDiscardLevel < 0) + || (mRawImage->isBufferInvalid())) // decode failed or malfunctioned, don't write { - LL_WARNS() << "INIT state check failed" << LL_ENDL; + LL_WARNS() << "INIT state check failed for image: " << mID << " Size: " << mImageSize << " DataSize: " << mDataSize << " Discard:" << mRawDiscardLevel << LL_ENDL; mDataSize = -1; // failed done = true; } @@ -577,15 +579,12 @@ bool LLTextureCacheRemoteWorker::doWrite() idx = mCache->setHeaderCacheEntry(mID, entry, mImageSize, mDataSize); // create the new entry. if(idx >= 0) { - // (almost always) write to the fast cache. - if (mRawImage->getDataSize()) + // write to the fast cache. + if(!mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)) { - if(!mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)) - { - LL_WARNS() << "writeToFastCache failed" << LL_ENDL; - mDataSize = -1; // failed - done = true; - } + LL_WARNS() << "writeToFastCache failed" << LL_ENDL; + mDataSize = -1; // failed + done = true; } } } |