diff options
author | Neal Orman <nyx@lindenlab.com> | 2009-10-22 22:25:38 +0000 |
---|---|---|
committer | Neal Orman <nyx@lindenlab.com> | 2009-10-22 22:25:38 +0000 |
commit | 4e6fd496eef05d3ab59f3f35878be601b18350f0 (patch) | |
tree | bf8103912bf4359c140a5fc60ba1dedc70d05b7d | |
parent | e5484e56b3c13e65bd31d7bf21c1cd3a2d9333f2 (diff) |
EXT-1822 changing textures in appearance not immediate
Texture changes in appearance editor were not taking effect immediately. Changed texture setting code to refresh local bake of textures.
Code reviewed by Vir
-rw-r--r-- | indra/newview/llagentwearables.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llagentwearables.h | 4 | ||||
-rw-r--r-- | indra/newview/llpaneleditwearable.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.h | 2 | ||||
-rw-r--r-- | indra/newview/llwearable.cpp | 1 |
5 files changed, 22 insertions, 7 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index c1866c36a2..af2f3613b8 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -668,9 +668,17 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl return MAX_WEARABLES_PER_TYPE; } -void LLAgentWearables::popWearable(const EWearableType type, LLWearable *wearable) +void LLAgentWearables::popWearable(LLWearable *wearable) { - U32 index = getWearableIndex(type, wearable); + if (wearable == NULL) + { + // nothing to do here. move along. + return; + } + + U32 index = getWearableIndex(wearable); + EWearableType type = wearable->getType(); + if (index < MAX_WEARABLES_PER_TYPE && index < getWearableCount(type)) { popWearable(type, index); @@ -685,8 +693,14 @@ void LLAgentWearables::popWearable(const EWearableType type, U32 index) } } -U32 LLAgentWearables::getWearableIndex(const EWearableType type, LLWearable *wearable) +U32 LLAgentWearables::getWearableIndex(LLWearable *wearable) { + if (wearable == NULL) + { + return MAX_WEARABLES_PER_TYPE; + } + + const EWearableType type = wearable->getType(); wearableentry_map_t::const_iterator wearable_iter = mWearableDatas.find(type); if (wearable_iter == mWearableDatas.end()) { diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 6b456abfa7..03743a2373 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -106,7 +106,7 @@ private: // Low-level data structure setter - public access is via setWearableItem, etc. void setWearable(const EWearableType type, U32 index, LLWearable *wearable); U32 pushWearable(const EWearableType type, LLWearable *wearable); - void popWearable(const EWearableType type, LLWearable *wearable); + void popWearable(LLWearable *wearable); void popWearable(const EWearableType type, U32 index); public: @@ -114,7 +114,7 @@ public: void setWearableOutfit(const LLInventoryItem::item_array_t& items, const LLDynamicArray< LLWearable* >& wearables, BOOL remove); void setWearableName(const LLUUID& item_id, const std::string& new_name); void addLocalTextureObject(const EWearableType wearable_type, const LLVOAvatarDefines::ETextureIndex texture_type, U32 wearable_index); - U32 getWearableIndex(const EWearableType type, LLWearable *wearable); + U32 getWearableIndex(LLWearable *wearable); protected: void setWearableFinal(LLInventoryItem* new_item, LLWearable* new_wearable, bool do_append = false); static bool onSetWearableDialog(const LLSD& notification, const LLSD& response, LLWearable* wearable); diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index e2057bbbd7..e7acc68b93 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -369,7 +369,7 @@ void LLPanelEditWearable::saveChanges() return; } - U32 index = gAgentWearables.getWearableIndex(mWearablePtr->getType(), mWearablePtr); + U32 index = gAgentWearables.getWearableIndex(mWearablePtr); if (mWearablePtr->getName().compare(mTextEditor->getText()) != 0) { diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index aaa261cea7..978dca9389 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -187,8 +187,8 @@ public: void setLocalTextureTE(U8 te, LLViewerTexture* image, BOOL set_by_user, U32 index); const LLUUID& grabLocalTexture(LLVOAvatarDefines::ETextureIndex type, U32 index) const; BOOL canGrabLocalTexture(LLVOAvatarDefines::ETextureIndex type, U32 index) const; -protected: /*virtual*/ void setLocalTexture(LLVOAvatarDefines::ETextureIndex type, LLViewerTexture* tex, BOOL baked_version_exits, U32 index); +protected: /*virtual*/ void setBakedReady(LLVOAvatarDefines::ETextureIndex type, BOOL baked_version_exists, U32 index); void localTextureLoaded(BOOL succcess, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata); void getLocalTextureByteCount(S32* gl_byte_count) const; diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 631f128ffa..3bbf4c2c47 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -537,6 +537,7 @@ BOOL LLWearable::isDirty() const const LLUUID& saved_image_id = saved_iter->second->getID(); if (saved_image_id != current_image_id) { + // saved vs current images are different, wearable is dirty return TRUE; } } |