diff options
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 75 |
1 files changed, 22 insertions, 53 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 1e9945b514..6871c0b06f 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -38,6 +38,7 @@ #include "pipeline.h" #include "llagent.h" // Get state values from here +#include "llattachmentsmgr.h" #include "llagentcamera.h" #include "llagentwearables.h" #include "llhudeffecttrail.h" @@ -434,7 +435,7 @@ BOOL LLVOAvatarSelf::buildMenus() ++iter) { LLViewerJointAttachment* attachment = iter->second; - if (attachment->getGroup() == i) + if (attachment && attachment->getGroup() == i) { LLMenuItemCallGL::Params item_params; @@ -473,7 +474,7 @@ BOOL LLVOAvatarSelf::buildMenus() ++iter) { LLViewerJointAttachment* attachment = iter->second; - if (attachment->getGroup() == i) + if (attachment && attachment->getGroup() == i) { LLMenuItemCallGL::Params item_params; std::string sub_piemenu_name = attachment->getName(); @@ -506,7 +507,7 @@ BOOL LLVOAvatarSelf::buildMenus() ++iter) { LLViewerJointAttachment* attachment = iter->second; - if (attachment->getGroup() == 8) + if (attachment && attachment->getGroup() == 8) { LLMenuItemCallGL::Params item_params; std::string sub_piemenu_name = attachment->getName(); @@ -608,7 +609,7 @@ BOOL LLVOAvatarSelf::buildMenus() ++iter) { LLViewerJointAttachment* attachment = iter->second; - if(attachment->getGroup() == group) + if(attachment && attachment->getGroup() == group) { // use multimap to provide a partial order off of the pie slice key S32 pie_index = attachment->getPieSlice(); @@ -1118,44 +1119,6 @@ BOOL LLVOAvatarSelf::isWearingAttachment(const LLUUID& inv_item_id) const } //----------------------------------------------------------------------------- -BOOL LLVOAvatarSelf::attachmentWasRequested(const LLUUID& inv_item_id) const -{ - const F32 REQUEST_EXPIRATION_SECONDS = 5.0; // any request older than this is ignored/removed. - std::map<LLUUID,LLTimer>::iterator it = mAttachmentRequests.find(inv_item_id); - if (it != mAttachmentRequests.end()) - { - const LLTimer& request_time = it->second; - F32 request_time_elapsed = request_time.getElapsedTimeF32(); - if (request_time_elapsed > REQUEST_EXPIRATION_SECONDS) - { - mAttachmentRequests.erase(it); - return FALSE; - } - else - { - return TRUE; - } - } - else - { - return FALSE; - } -} - -//----------------------------------------------------------------------------- -void LLVOAvatarSelf::addAttachmentRequest(const LLUUID& inv_item_id) -{ - LLTimer current_time; - mAttachmentRequests[inv_item_id] = current_time; -} - -//----------------------------------------------------------------------------- -void LLVOAvatarSelf::removeAttachmentRequest(const LLUUID& inv_item_id) -{ - mAttachmentRequests.erase(inv_item_id); -} - -//----------------------------------------------------------------------------- // getWornAttachment() //----------------------------------------------------------------------------- LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id) @@ -1221,8 +1184,6 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view { const LLUUID& attachment_id = viewer_object->getAttachmentItemID(); LLAppearanceMgr::instance().registerAttachment(attachment_id); - // Clear any pending requests once the attachment arrives. - removeAttachmentRequest(attachment_id); updateLODRiggedAttachments(); } @@ -1570,8 +1531,16 @@ BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex t return LLVOAvatar::isTextureVisible(type); } - U32 index = gAgentWearables.getWearableIndex(wearable); - return isTextureVisible(type,index); + U32 index; + if (gAgentWearables.getWearableIndex(wearable,index)) + { + return isTextureVisible(type,index); + } + else + { + LL_WARNS() << "Wearable not found" << LL_ENDL; + return FALSE; + } } bool LLVOAvatarSelf::areTexturesCurrent() const @@ -1916,7 +1885,7 @@ void LLVOAvatarSelf::dumpTotalLocalTextureByteCount() LL_INFOS() << "Total Avatar LocTex GL:" << (gl_bytes/1024) << "KB" << LL_ENDL; } -BOOL LLVOAvatarSelf::getIsCloud() const +bool LLVOAvatarSelf::getIsCloud() const { // Let people know why they're clouded without spamming them into oblivion. bool do_warn = false; @@ -1944,7 +1913,7 @@ BOOL LLVOAvatarSelf::getIsCloud() const << (skin_count ? "" : "SKIN ") << LL_ENDL; } - return TRUE; + return true; } if (!isTextureDefined(TEX_HAIR, 0)) @@ -1953,7 +1922,7 @@ BOOL LLVOAvatarSelf::getIsCloud() const { LL_INFOS() << "Self is clouded because of no hair texture" << LL_ENDL; } - return TRUE; + return true; } if (!mPreviousFullyLoaded) @@ -1965,7 +1934,7 @@ BOOL LLVOAvatarSelf::getIsCloud() const { LL_INFOS() << "Self is clouded because lower textures not baked" << LL_ENDL; } - return TRUE; + return true; } if (!isLocalTextureDataAvailable(getLayerSet(BAKED_UPPER)) && @@ -1975,7 +1944,7 @@ BOOL LLVOAvatarSelf::getIsCloud() const { LL_INFOS() << "Self is clouded because upper textures not baked" << LL_ENDL; } - return TRUE; + return true; } for (U32 i = 0; i < mBakedTextureDatas.size(); i++) @@ -1996,13 +1965,13 @@ BOOL LLVOAvatarSelf::getIsCloud() const LL_INFOS() << "Self is clouded because texture at index " << i << " (texture index is " << texture_data.mTextureIndex << ") is not loaded" << LL_ENDL; } - return TRUE; + return true; } } LL_DEBUGS() << "Avatar de-clouded" << LL_ENDL; } - return FALSE; + return false; } /*static*/ |