diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 0188fba6f4..aa242241d6 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -574,17 +574,21 @@ void AOEngine::checkSitCancel() if (foreignAnimations(seat)) { - LLUUID animation = mCurrentSet->getStateByRemapID(ANIM_AGENT_SIT)->mCurrentAnimationID; - if (animation.notNull()) + AOSet::AOState* aoState = mCurrentSet->getStateByRemapID(ANIM_AGENT_SIT); + if (aoState) { - LL_DEBUGS("AOEngine") << "Stopping sit animation due to foreign animations running" << LL_ENDL; - gAgent.sendAnimationRequest(animation, ANIM_REQUEST_STOP); - // remove cycle point cover-up - gAgent.sendAnimationRequest(ANIM_AGENT_SIT_GENERIC, ANIM_REQUEST_STOP); - gAgentAvatarp->LLCharacter::stopMotion(animation); - mSitCancelTimer.stop(); - // stop cycle tiemr - mCurrentSet->stopTimer(); + LLUUID animation = aoState->mCurrentAnimationID; + if (animation.notNull()) + { + LL_DEBUGS("AOEngine") << "Stopping sit animation due to foreign animations running" << LL_ENDL; + gAgent.sendAnimationRequest(animation, ANIM_REQUEST_STOP); + // remove cycle point cover-up + gAgent.sendAnimationRequest(ANIM_AGENT_SIT_GENERIC, ANIM_REQUEST_STOP); + gAgentAvatarp->LLCharacter::stopMotion(animation); + mSitCancelTimer.stop(); + // stop cycle tiemr + mCurrentSet->stopTimer(); + } } } } @@ -931,6 +935,11 @@ BOOL AOEngine::removeSet(AOSet* set) BOOL AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 index) { + if (index < 0) + { + return FALSE; + } + S32 numOfAnimations = state->mAnimations.size(); if (numOfAnimations == 0) { @@ -1717,9 +1726,16 @@ void AOEngine::onNotecardLoadComplete(LLVFS* vfs, const LLUUID& assetUUID, LLAss S32 notecardSize = vfs->getSize(assetUUID, type); char* buffer = new char[notecardSize]; - vfs->getData(assetUUID, type, (U8*) buffer, 0, notecardSize); - AOEngine::instance().parseNotecard(buffer); + S32 ret = vfs->getData(assetUUID, type, reinterpret_cast(buffer), 0, notecardSize); + if (ret > 0) + { + AOEngine::instance().parseNotecard(buffer); + } + else + { + delete[] buffer; + } } void AOEngine::parseNotecard(const char* buffer) @@ -1739,7 +1755,7 @@ void AOEngine::parseNotecard(const char* buffer) } std::string text(buffer); - delete buffer; + delete[] buffer; std::vector lines; LLStringUtil::getTokens(text, lines, "\n"); diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index eb9d103524..171dd13466 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -1083,17 +1083,22 @@ void LLInventoryFilter::setFilterWorn(BOOL worn) // // FIRE-19340: search inventory by transferable permission -void LLInventoryFilter::setFilterTransferable(BOOL transferable) -{ - setModified(); - if (transferable) - { - mFilterOps.mFilterTypes |= FILTERTYPE_TRANSFERABLE; - } - else - { - mFilterOps.mFilterTypes &= ~FILTERTYPE_TRANSFERABLE; - } +void LLInventoryFilter::setFilterTransferable(BOOL transferable) +{ + BOOL current = (mFilterOps.mFilterTypes & FILTERTYPE_TRANSFERABLE) != 0; + + if (current != transferable) + { + setModified(); + if (transferable) + { + mFilterOps.mFilterTypes |= FILTERTYPE_TRANSFERABLE; + } + else + { + mFilterOps.mFilterTypes &= ~FILTERTYPE_TRANSFERABLE; + } + } } // diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index bb57cb8f8c..5a1b8f8238 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -9193,7 +9193,8 @@ void LLVOAvatar::calculateUpdateRenderComplexity() static const U32 COMPLEXITY_BODY_PART_COST = 200; // Diagnostic list of all textures on our avatar - static std::set all_textures; + // Disable useless diagnostics + //static std::set all_textures; if (mVisualComplexityStale) { @@ -9289,41 +9290,43 @@ void LLVOAvatar::calculateUpdateRenderComplexity() // Diagnostic output to identify all avatar-related textures. // Does not affect rendering cost calculation. // Could be wrapped in a debug option if output becomes problematic. - if (isSelf()) - { - // print any attachment textures we didn't already know about. - for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it) - { - LLUUID image_id = it->first; - if( ! (image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) - && (all_textures.find(image_id) == all_textures.end())) - { - // attachment texture not previously seen. - LL_INFOS() << "attachment_texture: " << image_id.asString() << LL_ENDL; - all_textures.insert(image_id); - } - } + // Disable useless diagnostics + //if (isSelf()) + //{ + // // print any attachment textures we didn't already know about. + // for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it) + // { + // LLUUID image_id = it->first; + // if( ! (image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) + // && (all_textures.find(image_id) == all_textures.end())) + // { + // // attachment texture not previously seen. + // LL_INFOS() << "attachment_texture: " << image_id.asString() << LL_ENDL; + // all_textures.insert(image_id); + // } + // } - // print any avatar textures we didn't already know about - for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); - iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); - ++iter) - { - const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; - // TODO: MULTI-WEARABLE: handle multiple textures for self - const LLViewerTexture* te_image = getImage(iter->first,0); - if (!te_image) - continue; - LLUUID image_id = te_image->getID(); - if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) - continue; - if (all_textures.find(image_id) == all_textures.end()) - { - LL_INFOS() << "local_texture: " << texture_dict->mName << ": " << image_id << LL_ENDL; - all_textures.insert(image_id); - } - } - } + // // print any avatar textures we didn't already know about + // for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); + // iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); + // ++iter) + // { + // const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; + // // TODO: MULTI-WEARABLE: handle multiple textures for self + // const LLViewerTexture* te_image = getImage(iter->first,0); + // if (!te_image) + // continue; + // LLUUID image_id = te_image->getID(); + // if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) + // continue; + // if (all_textures.find(image_id) == all_textures.end()) + // { + // LL_INFOS() << "local_texture: " << texture_dict->mName << ": " << image_id << LL_ENDL; + // all_textures.insert(image_id); + // } + // } + //} + // if ( cost != mVisualComplexity ) {