Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alchemy-archive/alchemy
  • Liru/alchemy
  • TesticularSlingshot/alchemy
3 results
Show changes
Showing
with 241 additions and 222 deletions
......@@ -204,6 +204,7 @@ public:
/*virtual*/ void handleMenuSelect(LLWindow *window, S32 menu_item) override;
/*virtual*/ BOOL handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S32 height) override;
/*virtual*/ void handleScrollWheel(LLWindow *window, S32 clicks) override;
/*virtual*/ void handleScrollHWheel(LLWindow *window, S32 clicks) override;
/*virtual*/ BOOL handleDoubleClick(LLWindow *window, LLCoordGL pos, MASK mask) override;
/*virtual*/ void handleWindowBlock(LLWindow *window) override;
/*virtual*/ void handleWindowUnblock(LLWindow *window) override;
......@@ -321,6 +322,7 @@ public:
BOOL handleKey(KEY key, MASK mask);
BOOL handleKeyUp(KEY key, MASK mask);
void handleScrollWheel (S32 clicks);
void handleScrollHWheel (S32 clicks);
// add and remove views from "popup" layer
void addPopup(LLView* popup);
......
......@@ -45,6 +45,7 @@
#include "alavatarcolormgr.h"
#include "llagent.h" // Get state values from here
#include "llagentbenefits.h"
#include "llagentcamera.h"
#include "llagentwearables.h"
#include "llanimationstates.h"
......@@ -94,6 +95,7 @@
#include "llviewertexlayer.h"
#include "llviewertexturelist.h"
#include "llviewermenu.h"
#include "llviewernetwork.h"
#include "llviewerobjectlist.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
......@@ -320,7 +322,7 @@ public:
// must return true to indicate success and be available for activation
LLMotionInitStatus onInitialize(LLCharacter *character) override
{
if( !mTorsoState->setJoint( character->getJoint("mTorso") ))
if (!character || !mTorsoState->setJoint(character->getJoint("mTorso")))
{
return STATUS_FAILURE;
}
......@@ -379,8 +381,7 @@ public:
// Constructor
LLBreatheMotionRot(const LLUUID &id) :
LLMotion(id),
mBreatheRate(1.f),
mCharacter(nullptr)
mBreatheRate(1.f)
{
mName = "breathe_rot";
mChestState = new LLJointState;
......@@ -427,10 +428,9 @@ public:
// must return true to indicate success and be available for activation
LLMotionInitStatus onInitialize(LLCharacter *character) override
{
mCharacter = character;
BOOL success = true;
if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) )
if (!character || !mChestState->setJoint(character->getJoint("mChest")))
{
success = false;
}
......@@ -479,7 +479,6 @@ private:
//-------------------------------------------------------------------------
LLPointer<LLJointState> mChestState;
F32 mBreatheRate;
LLCharacter* mCharacter;
};
//-----------------------------------------------------------------------------
......@@ -491,7 +490,7 @@ class LLPelvisFixMotion final :
public:
// Constructor
LLPelvisFixMotion(const LLUUID &id)
: LLMotion(id), mCharacter(nullptr)
: LLMotion(id)
{
mName = "pelvis_fix";
......@@ -539,7 +538,8 @@ public:
// must return true to indicate success and be available for activation
LLMotionInitStatus onInitialize(LLCharacter *character) override
{
mCharacter = character;
if (!character)
return STATUS_FAILURE;
if (!mPelvisState->setJoint( character->getJoint("mPelvis")))
{
......@@ -575,7 +575,6 @@ private:
// joint states to be animated
//-------------------------------------------------------------------------
LLPointer<LLJointState> mPelvisState;
LLCharacter* mCharacter;
};
/**
......@@ -781,6 +780,26 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mVisuallyMuteSetting = LLVOAvatar::VisualMuteSettings(LLRenderMuteList::getInstance()->getSavedVisualMuteSetting(getID()));
}
S32 LLVOAvatar::getNumBakes() const
{
// BAKED_LEFT_ARM is equal to the pre-BOM BAKED_NUM_INDICES
if(getRegion())
{
// LL_INFOS("BOMOS")
// << getFullname()
// << "Using avatar region settings [" << getRegion()->getName() << "]"
// << " bakesOnMesh = " << static_cast<const char *>(getRegion()->bakesOnMeshEnabled()?"True":"False")
// << LL_ENDL;
return getRegion()->getRegionMaxBakes();
}
// LL_INFOS("BOMOS")
// << " Using fallback settings"
// << " bakesOnMesh = " << static_cast<const char *>(LLGridManager::instance().isInSecondLife()?"True":"False")
// << LL_ENDL;
// fallback, in SL assume BOM, elsewhere assume not.
return LLGridManager::instance().isInSecondlife() ? BAKED_NUM_INDICES : BAKED_LEFT_ARM;
}
std::string LLVOAvatar::avString() const
{
if (isControlAvatar())
......@@ -867,7 +886,7 @@ BOOL LLVOAvatar::isFullyBaked()
if (mIsDummy) return TRUE;
if (getNumTEs() == 0) return FALSE;
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
for (U32 i = 0; i < getNumBakes(); i++)
{
if (!isTextureDefined(mBakedTextureDatas[i].mTextureIndex)
&& ((i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT))
......@@ -1348,7 +1367,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
{
LL_RECORD_BLOCK_TIME(FTM_AVATAR_EXTENT_UPDATE);
static LLCachedControl<S32> box_detail(gSavedSettings, "AvatarBoundingBoxComplexity");
static const LLCachedControl<S32> box_detail(gSavedSettings, "AvatarBoundingBoxComplexity");
// FIXME the update_min_max function used below assumes there is a
// known starting point, but in general there isn't. Ideally the
......@@ -2055,8 +2074,10 @@ void LLVOAvatar::resetSkeleton(bool reset_animations)
LL_ERRS() << "Error resetting skeleton" << LL_ENDL;
}
// Reset attachment points (buildSkeleton only does bones and CVs)
bool ignore_hud_joints = true;
// Reset attachment points
// BuildSkeleton only does bones and CVs but we still need to reinit huds
// since huds can be animated.
bool ignore_hud_joints = !isSelf();
initAttachmentPoints(ignore_hud_joints);
// Fix up collision volumes
......@@ -3197,7 +3218,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
debugAvatarRezTime("AvatarRezLeftAppearanceNotification","left appearance mode");
}
}
static LLCachedControl<bool> use_color_mgr(gSavedSettings, "AlchemyNametagColorMgr", false);
static LLCachedControl<bool> use_color_mgr(gSavedSettings, "AlchemyNametagColorMgr", true);
const LLColor4& name_tag_color = use_color_mgr ? isSelf() ? LLColor4::white : ALAvatarColorMgr::instance().getColor(getID()) : getNameTagColor(is_friend);
// Rebuild name tag if state change detected
......@@ -3341,9 +3362,11 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
std::deque<LLChat>::iterator chat_iter = mChats.begin();
mNameText->clearString();
LLColor4 new_chat = LLUIColorTable::instance().getColor( isSelf() ? "UserChatColor" : "AgentChatColor" );
LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f);
LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f);
static const LLUIColor user_chat_color = LLUIColorTable::instance().getColor("UserChatColor");
static const LLUIColor agent_chat_color = LLUIColorTable::instance().getColor("AgentChatColor");
const LLColor4 new_chat = isSelf() ? user_chat_color : agent_chat_color;
const LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f);
const LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f);
if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES)
{
++chat_iter;
......@@ -3625,7 +3648,7 @@ bool LLVOAvatar::isInMuteList()
// [RLVa:KB] - Checked: RLVa-2.2 (@setcam_avdist)
bool LLVOAvatar::isRlvSilhouette()
{
if (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_AVDIST))
if (!RlvHandler::instance().hasBehaviour(RLV_BHVR_SETCAM_AVDIST))
return false;
static RlvCachedBehaviourModifier<float> s_nSetCamAvDist(RLV_MODIFIER_SETCAM_AVDIST);
......@@ -5341,7 +5364,7 @@ void LLVOAvatar::releaseOldTextures()
}
}
}
mTextureIDs = new_texture_ids;
mTextureIDs = std::move(new_texture_ids);
}
void LLVOAvatar::updateTextures()
......@@ -5604,7 +5627,7 @@ void LLVOAvatar::resolveHeightAgent(const LLVector3 &in_pos_agent, LLVector3 &ou
}
void LLVOAvatar::resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm)
void LLVOAvatar::resolveRayCollisionAgent(const LLVector3d& start_pt, const LLVector3d& end_pt, LLVector3d &out_pos, LLVector3 &out_norm)
{
LLViewerObject *obj;
LLWorld::getInstance()->resolveStepHeightGlobal(this, start_pt, end_pt, out_pos, out_norm, &obj);
......@@ -6342,7 +6365,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL
LLViewerObject *root_object = (LLViewerObject*)vobj->getRoot();
LL_DEBUGS("AnimatedObjects") << "trying to add attachment overrides for root object " << root_object->getID() << " prim is " << vobj << LL_ENDL;
if (vobj->isRiggedMesh() &&
if (vobj->isMesh() &&
((vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded()) || !gMeshRepo.meshRezEnabled()))
{
LL_DEBUGS("AnimatedObjects") << "failed to add attachment overrides for root object " << root_object->getID() << " mesh asset not loaded" << LL_ENDL;
......@@ -6350,7 +6373,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL
}
const LLMeshSkinInfo* pSkinData = nullptr;
if ( vobj && vobj->isMesh() && (pSkinData = vobj->getSkinInfo()) )
if ( vobj && vobj->isMesh() && (pSkinData = vobj->getSkinInfo()))
{
const size_t bindCnt = pSkinData->mAlternateBindMatrix.size();
const size_t jointCnt = pSkinData->mJointNames.size();
......@@ -6744,7 +6767,7 @@ void LLVOAvatar::initAttachmentPoints(bool ignore_hud_joints)
LLAvatarXmlInfo::LLAvatarAttachmentInfo *info = *iter;
if (info->mIsHUDAttachment && (!isSelf() || ignore_hud_joints))
{
//don't process hud joint for other avatars, or when doing a skeleton reset.
//don't process hud joint for other avatars.
continue;
}
......@@ -7226,20 +7249,7 @@ U32 LLVOAvatar::getNumAttachments() const
//-----------------------------------------------------------------------------
S32 LLVOAvatar::getMaxAttachments() const
{
const S32 MAX_AGENT_ATTACHMENTS = 38;
S32 max_attach = MAX_AGENT_ATTACHMENTS;
if (gAgent.getRegion())
{
LLSD features;
gAgent.getRegion()->getSimulatorFeatures(features);
if (features.has("MaxAgentAttachments"))
{
max_attach = features["MaxAgentAttachments"].asInteger();
}
}
return max_attach;
return LLAgentBenefitsMgr::current().getAttachmentLimit();
}
//-----------------------------------------------------------------------------
......@@ -7271,24 +7281,7 @@ U32 LLVOAvatar::getNumAnimatedObjectAttachments() const
//-----------------------------------------------------------------------------
S32 LLVOAvatar::getMaxAnimatedObjectAttachments() const
{
S32 max_attach = 0;
if (gSavedSettings.getBOOL("AnimatedObjectsIgnoreLimits"))
{
max_attach = getMaxAttachments();
}
else
{
if (gAgent.getRegion())
{
LLSD features;
gAgent.getRegion()->getSimulatorFeatures(features);
if (features.has("AnimatedObjects"))
{
max_attach = features["AnimatedObjects"]["MaxAgentAnimatedObjectAttachments"].asInteger();
}
}
}
return max_attach;
return LLAgentBenefitsMgr::current().getAnimatedObjectLimit();
}
//-----------------------------------------------------------------------------
......@@ -7339,7 +7332,7 @@ void LLVOAvatar::lazyAttach()
}
}
mPendingAttachment = still_pending;
mPendingAttachment = std::move(still_pending);
}
void LLVOAvatar::resetHUDAttachments()
......@@ -7458,7 +7451,7 @@ void LLVOAvatar::sitDown(BOOL bSitting)
// [RLVa:KB] - Checked: 2010-08-29 (RLVa-1.2.1c) | Modified: RLVa-1.2.1c
if (rlv_handler_t::isEnabled())
{
gRlvHandler.onSitOrStand(bSitting);
RlvHandler::instance().onSitOrStand(bSitting);
}
// [/RLVa:KB]
}
......@@ -7761,7 +7754,8 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL
else if (global_color == mTexEyeColor)
{
// LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL;
invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet, upload_bake); }
invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet, upload_bake);
}
updateMeshTextures();
}
......@@ -8013,13 +8007,22 @@ void LLVOAvatar::updateRuthTimer(bool loading)
BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
{
// we wait a little bit before giving the all clear,
// to let textures settle down
const F32 PAUSE = 1.f;
// We wait a little bit before giving the 'all clear', to let things to
// settle down (models to snap into place, textures to get first packets)
const F32 LOADED_DELAY = 1.f;
const F32 FIRST_USE_DELAY = 3.f;
if (loading)
mFullyLoadedTimer.reset();
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE);
if (mFirstFullyVisible)
{
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > FIRST_USE_DELAY);
}
else
{
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > LOADED_DELAY);
}
if (!mPreviousFullyLoaded && !loading && mFullyLoaded)
{
......@@ -8126,36 +8129,15 @@ void LLVOAvatar::updateMeshVisibility()
LLViewerJointAttachment* attachment = attachment_point.second;
if (attachment)
{
for (const auto& objectp : attachment->mAttachedObjects)
for (LLViewerObject *objectp : attachment->mAttachedObjects)
{
if (objectp)
{
for (int face_index = 0; face_index < objectp->getNumTEs(); face_index++)
{
LLTextureEntry* tex_entry = objectp->getTE(face_index);
bake_flag[BAKED_HEAD] |= (tex_entry->getID() == IMG_USE_BAKED_HEAD);
bake_flag[BAKED_EYES] |= (tex_entry->getID() == IMG_USE_BAKED_EYES);
bake_flag[BAKED_HAIR] |= (tex_entry->getID() == IMG_USE_BAKED_HAIR);
bake_flag[BAKED_LOWER] |= (tex_entry->getID() == IMG_USE_BAKED_LOWER);
bake_flag[BAKED_UPPER] |= (tex_entry->getID() == IMG_USE_BAKED_UPPER);
bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT);
bake_flag[BAKED_LEFT_ARM] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTARM);
bake_flag[BAKED_LEFT_LEG] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTLEG);
bake_flag[BAKED_AUX1] |= (tex_entry->getID() == IMG_USE_BAKED_AUX1);
bake_flag[BAKED_AUX2] |= (tex_entry->getID() == IMG_USE_BAKED_AUX2);
bake_flag[BAKED_AUX3] |= (tex_entry->getID() == IMG_USE_BAKED_AUX3);
}
}
LLViewerObject::const_child_list_t& child_list = objectp->getChildren();
for (const auto& iter1 : child_list)
{
LLViewerObject* objectchild = iter1;
if (objectchild)
{
for (int face_index = 0; face_index < objectchild->getNumTEs(); face_index++)
if (tex_entry)
{
LLTextureEntry* tex_entry = objectchild->getTE(face_index);
bake_flag[BAKED_HEAD] |= (tex_entry->getID() == IMG_USE_BAKED_HEAD);
bake_flag[BAKED_EYES] |= (tex_entry->getID() == IMG_USE_BAKED_EYES);
bake_flag[BAKED_HAIR] |= (tex_entry->getID() == IMG_USE_BAKED_HAIR);
......@@ -8170,6 +8152,32 @@ void LLVOAvatar::updateMeshVisibility()
}
}
}
LLViewerObject::const_child_list_t& child_list = objectp->getChildren();
for (LLViewerObject* objectchild : child_list)
{
if (objectchild)
{
for (int face_index = 0; face_index < objectchild->getNumTEs(); face_index++)
{
LLTextureEntry* tex_entry = objectchild->getTE(face_index);
if (tex_entry)
{
bake_flag[BAKED_HEAD] |= (tex_entry->getID() == IMG_USE_BAKED_HEAD);
bake_flag[BAKED_EYES] |= (tex_entry->getID() == IMG_USE_BAKED_EYES);
bake_flag[BAKED_HAIR] |= (tex_entry->getID() == IMG_USE_BAKED_HAIR);
bake_flag[BAKED_LOWER] |= (tex_entry->getID() == IMG_USE_BAKED_LOWER);
bake_flag[BAKED_UPPER] |= (tex_entry->getID() == IMG_USE_BAKED_UPPER);
bake_flag[BAKED_SKIRT] |= (tex_entry->getID() == IMG_USE_BAKED_SKIRT);
bake_flag[BAKED_LEFT_ARM] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTARM);
bake_flag[BAKED_LEFT_LEG] |= (tex_entry->getID() == IMG_USE_BAKED_LEFTLEG);
bake_flag[BAKED_AUX1] |= (tex_entry->getID() == IMG_USE_BAKED_AUX1);
bake_flag[BAKED_AUX2] |= (tex_entry->getID() == IMG_USE_BAKED_AUX2);
bake_flag[BAKED_AUX3] |= (tex_entry->getID() == IMG_USE_BAKED_AUX3);
}
}
}
}
}
}
}
......@@ -8253,7 +8261,7 @@ void LLVOAvatar::updateMeshTextures()
mBakedTextureDebugText += fmt::format(FMT_STRING("{:06d}\n"),update_counter++);
mBakedTextureDebugText += "indx layerset linvld ltda ilb ulkg ltid\n";
for (U32 i=0; i < mBakedTextureDatas.size(); i++)
for (U32 i=0; i < getNumBakes(); i++)
{
is_layer_baked[i] = isTextureDefined(mBakedTextureDatas[i].mTextureIndex);
LLViewerTexLayerSet* layerset = nullptr;
......@@ -8302,7 +8310,7 @@ void LLVOAvatar::updateMeshTextures()
last_id_string.c_str());
}
for (U32 i=0; i < mBakedTextureDatas.size(); i++)
for (U32 i=0; i < getNumBakes(); i++)
{
debugColorizeSubMeshes(i, LLColor4::white);
......@@ -8568,7 +8576,7 @@ void LLVOAvatar::releaseComponentTextures()
}
}
for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
for (U8 baked_index = 0; baked_index < getNumBakes(); baked_index++)
{
const LLAvatarAppearanceDictionary::BakedEntry * bakedDicEntry = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index);
// skip if this is a skirt and av is not wearing one, or if we don't have a baked texture UUID
......@@ -9228,7 +9236,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte
LLViewerTexture* LLVOAvatar::getBakedTexture(const U8 te)
{
if (te < 0 || te >= BAKED_NUM_INDICES)
if (te < 0 || te >= getNumBakes())
{
return NULL;
}
......@@ -10457,7 +10465,7 @@ void LLVOAvatar::accountRenderComplexityForObject(
hud_object_complexity.objectId = attached_object->getAttachmentItemID();
std::string joint_name;
gAgentAvatarp->getAttachedPointName(attached_object->getAttachmentItemID(), joint_name);
hud_object_complexity.jointName = joint_name;
hud_object_complexity.jointName = std::move(joint_name);
// get cost and individual textures
hud_object_complexity.objectsCost += volume->getRenderCost(textures);
hud_object_complexity.objectsCount++;
......@@ -10525,7 +10533,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity()
hud_complexity_list_t hud_complexity_list;
const auto& avatar_dictionary = LLAvatarAppearanceDictionary::instance();
for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++)
for (U8 baked_index = 0; baked_index < getNumBakes(); baked_index++)
{
const LLAvatarAppearanceDictionary::BakedEntry *baked_dict
= avatar_dictionary.getBakedTexture((EBakedTextureIndex)baked_index);
......
......@@ -350,6 +350,7 @@ public:
BOOL hasGray() const;
S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = textured, 3 = textured and fully downloaded.
void updateRezzedStatusTimers();
S32 getNumBakes() const;
S32 mLastRezzedStatus;
......@@ -915,7 +916,7 @@ public:
void resolveHeightGlobal(const LLVector3d &inPos, LLVector3d &outPos, LLVector3 &outNorm);
bool distanceToGround( const LLVector3d &startPoint, LLVector3d &collisionPoint, F32 distToIntersectionAlongRay );
void resolveHeightAgent(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm);
void resolveRayCollisionAgent(const LLVector3d start_pt, const LLVector3d end_pt, LLVector3d &out_pos, LLVector3 &out_norm);
void resolveRayCollisionAgent(const LLVector3d& start_pt, const LLVector3d& end_pt, LLVector3d &out_pos, LLVector3 &out_norm);
void slamPosition(); // Slam position to transmitted position (for teleport);
protected:
......
......@@ -265,6 +265,10 @@ void LLVOAvatarSelf::setHoverIfRegionEnabled()
setHoverOffset(LLVector3(0.0, 0.0, llclamp(hover_z,MIN_HOVER_Z,MAX_HOVER_Z)));
LL_INFOS("Avatar") << avString() << " set hover height from debug setting " << hover_z << LL_ENDL;
}
else if (!isUsingServerBakes())
{
computeBodySize();
}
else
{
setHoverOffset(LLVector3(0.0, 0.0, 0.0));
......@@ -912,10 +916,31 @@ void LLVOAvatarSelf::removeMissingBakedTextures()
}
}
void LLVOAvatarSelf::checkBOMRebakeRequired()
{
if(!getRegion())
{
auto newBOMStatus = getRegion()->bakesOnMeshEnabled();
static const LLCachedControl<bool> using_bom(gSavedSettings, "CurrentlyUsingBakesOnMesh", true);
if(!using_bom != newBOMStatus)
{
// force a rebake when the last grid we were on (including previous login) had different BOM support
// This replicates forceAppearanceUpdate rather than pulling in the whole of llavatarself.
if(!LLGridManager::instance().isInSecondlife())
{
doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures, gAgentAvatarp.get(), true), 5.0);
}
// update the setting even if we are in SL so that switch SL to OS and back
gSavedSettings.setBOOL("CurrentlyUsingBakesOnMesh", newBOMStatus);
}
}
}
void LLVOAvatarSelf::onSimulatorFeaturesReceived(const LLUUID& region_id)
{
LL_INFOS("Avatar") << "simulator features received, setting hover based on region props" << LL_ENDL;
setHoverIfRegionEnabled();
checkBOMRebakeRequired(); // BOM we may have stale cache, rebake may be needed
}
//virtual
......@@ -942,6 +967,7 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp)
if (regionp->simulatorFeaturesReceived())
{
setHoverIfRegionEnabled();
checkBOMRebakeRequired();// <FS:Beq/> BOM we may have stale cache, rebake may be needed
}
else
{
......@@ -1163,8 +1189,8 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode)
if (rlv_handler_t::isEnabled())
{
fRlvCanShowAttachment =
(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWSELF)) &&
( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWSELFHEAD)) || (RLV_ATTACHGROUP_HEAD != rlvAttachGroupFromIndex(attachment->getGroup())) );
(!RlvHandler::instance().hasBehaviour(RLV_BHVR_SHOWSELF)) &&
( (!RlvHandler::instance().hasBehaviour(RLV_BHVR_SHOWSELFHEAD)) || (RLV_ATTACHGROUP_HEAD != rlvAttachGroupFromIndex(attachment->getGroup())) );
}
// [/RLVa:KB]
......@@ -1346,10 +1372,10 @@ const LLViewerJointAttachment *LLVOAvatarSelf::attachObject(LLViewerObject *view
if (rlv_handler_t::isEnabled())
{
RlvAttachmentLockWatchdog::instance().onAttach(viewer_object, attachment);
gRlvHandler.onAttach(viewer_object, attachment);
RlvHandler::instance().onAttach(viewer_object, attachment);
if ( (attachment->getIsHUDAttachment()) && (!gRlvAttachmentLocks.hasLockedHUD()) )
gRlvAttachmentLocks.updateLockedHUD();
if ( (attachment->getIsHUDAttachment()) && (!RlvAttachmentLocks::instance().hasLockedHUD()) )
RlvAttachmentLocks::instance().updateLockedHUD();
}
// [/RLVa:KB]
}
......@@ -1372,7 +1398,7 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
if (pAttachPt->isObjectAttached(viewer_object))
{
RlvAttachmentLockWatchdog::instance().onDetach(viewer_object, pAttachPt);
gRlvHandler.onDetach(viewer_object, pAttachPt);
RlvHandler::instance().onDetach(viewer_object, pAttachPt);
}
if (mAttachmentSignal)
{
......@@ -1390,9 +1416,8 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
LLFollowCamMgr::getInstance()->setCameraActive(viewer_object->getID(), FALSE);
LLViewerObject::const_child_list_t& child_list = viewer_object->getChildren();
for (const auto& iter : child_list)
for (LLViewerObject* child_objectp : child_list)
{
LLViewerObject* child_objectp = iter;
// the simulator should automatically handle
// permissions revocation
......@@ -1413,8 +1438,8 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
}
// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a
if ( (rlv_handler_t::isEnabled()) && (viewer_object->isHUDAttachment()) && (gRlvAttachmentLocks.hasLockedHUD()) )
gRlvAttachmentLocks.updateLockedHUD();
if ( (rlv_handler_t::isEnabled()) && (viewer_object->isHUDAttachment()) && (RlvAttachmentLocks::instance().hasLockedHUD()) )
RlvAttachmentLocks::instance().updateLockedHUD();
// [/RLVa:KB]
return TRUE;
......@@ -1428,7 +1453,7 @@ BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id)
LLInventoryItem* item = gInventory.getItem(item_id);
// if (item)
// [RLVa:KB] - Checked: 2010-09-04 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
if ( (item) && ((!rlv_handler_t::isEnabled()) || (gRlvAttachmentLocks.canDetach(item))) )
if ( (item) && ((!rlv_handler_t::isEnabled()) || (RlvAttachmentLocks::instance().canDetach(item))) )
// [/RLVa:KB]
{
gMessageSystem->newMessageFast(_PREHASH_DetachAttachmentIntoInv);
......@@ -1767,7 +1792,7 @@ bool LLVOAvatarSelf::areTexturesCurrent() const
// virtual
bool LLVOAvatarSelf::hasPendingBakedUploads() const
{
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
for (U32 i = 0; i < getNumBakes(); i++)
{
LLViewerTexLayerSet* layerset = getTexLayerSet(i);
if (layerset && layerset->getViewerComposite() && layerset->getViewerComposite()->uploadPending())
......@@ -2516,7 +2541,7 @@ LLSD summarize_by_buckets(std::vector<LLSD> in_records,
for (auto& record : in_records)
{
LLSD key;
for (auto& field : by_fields)
for (const auto& field : by_fields)
{
key[field] = record[field];
}
......@@ -2535,7 +2560,7 @@ LLSD summarize_by_buckets(std::vector<LLSD> in_records,
void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics()
{
std::string caps_url;
std::string caps_url;
if (getRegion())
{
// runway - change here to activate.
......@@ -2544,44 +2569,33 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics()
if (!caps_url.empty())
{
LLCoros::instance().launch("LLVOAvatarSelf::appearanceChangeMetricsCoro",
boost::bind(&LLVOAvatarSelf::appearanceChangeMetricsCoro, this, caps_url));
LLCoros::instance().launch("LLVOAvatarSelf::appearanceChangeMetricsCoro",
boost::bind(&LLVOAvatarSelf::appearanceChangeMetricsCoro, this, caps_url));
mTimeSinceLastRezMessage.reset();
}
}
//class CheckAgentAppearanceServiceResponder final : public LLHTTPClient::Responder
//{
//public:
// CheckAgentAppearanceServiceResponder() {}
//
// virtual ~CheckAgentAppearanceServiceResponder() {}
//
// /* virtual */ void httpSuccess()
// {
// LL_DEBUGS("Avatar") << "OK" << LL_ENDL;
// }
//
// // Error
// /*virtual*/ void httpFailure()
// {
// if (isAgentAvatarValid())
// {
// LL_DEBUGS("Avatar") << "failed, will rebake "
// << dumpResponse() << LL_ENDL;
// forceAppearanceUpdate();
// }
// }
//
// static void forceAppearanceUpdate()
// {
// // Trying to rebake immediately after crossing region boundary
// // seems to be failure prone; adding a delay factor. Yes, this
// // fix is ad-hoc and not guaranteed to work in all cases.
// doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures,
// gAgentAvatarp.get(), true), 5.0);
// }
//};
void CheckAgentAppearanceService_httpSuccess( LLSD const &aData )
{
LL_DEBUGS("Avatar") << "OK" << LL_ENDL;
}
void forceAppearanceUpdate()
{
// Trying to rebake immediately after crossing region boundary
// seems to be failure prone; adding a delay factor. Yes, this
// fix is ad-hoc and not guaranteed to work in all cases.
doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures, gAgentAvatarp.get(), true), 5.0);
}
void CheckAgentAppearanceService_httpFailure( LLSD const &aData )
{
if (isAgentAvatarValid())
{
LL_DEBUGS("Avatar") << "failed, will rebake " << aData << LL_ENDL;
forceAppearanceUpdate();
}
}
void LLVOAvatarSelf::checkForUnsupportedServerBakeAppearance()
{
......@@ -2595,12 +2609,13 @@ void LLVOAvatarSelf::checkForUnsupportedServerBakeAppearance()
// if baked image service is unknown, need to refresh.
if (LLAppearanceMgr::instance().getAppearanceServiceURL().empty())
{
//CheckAgentAppearanceServiceResponder::forceAppearanceUpdate();
forceAppearanceUpdate();
}
// query baked image service to check status.
//std::string image_url = gAgentAvatarp->getImageURL(TEX_HEAD_BAKED,
// getTE(TEX_HEAD_BAKED)->getID());
//LLHTTPClient::head(image_url, new CheckAgentAppearanceServiceResponder);
std::string image_url = gAgentAvatarp->getImageURL(TEX_HEAD_BAKED,
getTE(TEX_HEAD_BAKED)->getID());
LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpGet( image_url, CheckAgentAppearanceService_httpSuccess, CheckAgentAppearanceService_httpFailure );
}
const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const
......@@ -2669,10 +2684,9 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const
if (!items.empty())
{
// search for full permissions version
for (auto& item : items)
for (LLViewerInventoryItem* itemp : items)
{
LLViewerInventoryItem* itemp = item;
if (itemp->getIsFullPerm())
if (itemp->getIsFullPerm())
{
can_grab = TRUE;
break;
......@@ -3056,16 +3070,13 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index)
case TEX_HEAD_BAKED:
case TEX_HEAD_BODYPAINT:
return mHeadLayerSet; */
if (baked_index >= 0 && baked_index < BAKED_NUM_INDICES)
if (baked_index >= 0 && baked_index < getNumBakes())
{
return getTexLayerSet(baked_index);
}
return NULL;
}
// static
void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch)
{
......@@ -3142,7 +3153,15 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const
{
const ETextureIndex index = iter.first;
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter.second;
if (!texture_dict->mIsBakedTexture)
if( (index == TEX_SKIRT || index == TEX_SKIRT_TATTOO) && !gAgentAvatarp->isWearingWearableType(LLWearableType::WT_SKIRT) )
{
// TODO(BEQ): combine this with clause below once proven it works.
LL_DEBUGS("Avatar") << "Ignoring skirt related texture at index=" << index << LL_ENDL;
LLTextureEntry* entry = getTE((U8) index);
texture_id[index] = entry->getID();
entry->setID(IMG_DEFAULT_AVATAR);
}
if (!texture_dict->mIsBakedTexture || index >= getRegion()->getRegionMaxTEs())
{
LLTextureEntry* entry = getTE((U8) index);
texture_id[index] = entry->getID();
......@@ -3157,7 +3176,7 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const
{
const ETextureIndex index = iter.first;
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter.second;
if (!texture_dict->mIsBakedTexture)
if (!texture_dict->mIsBakedTexture || index >= getRegion()->getRegionMaxTEs())
{
LLTextureEntry* entry = getTE((U8) index);
entry->setID(texture_id[index]);
......@@ -3269,7 +3288,7 @@ void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile)
type_name.c_str(), wearable->getName().c_str() );
LLWearable::visual_param_vec_t v_params;
wearable->getVisualParams(v_params);
for (auto param : v_params)
for (auto* param : v_params)
{
dump_visual_param(file, param, param->getWeight());
}
......
......@@ -418,6 +418,7 @@ private:
F32 mDebugTextureLoadTimes[LLAvatarAppearanceDefines::TEX_NUM_INDICES][MAX_DISCARD_LEVEL+1]; // load time for each texture at each discard level
F32 mDebugBakedTextureTimes[LLAvatarAppearanceDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture
void debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
void checkBOMRebakeRequired();
// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0
//public:
......
......@@ -645,8 +645,7 @@ void LLVoiceChannelGroup::voiceCallCapCoro(std::string url)
result.erase(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS);
LLSD::map_const_iterator iter;
for (iter = result.beginMap(); iter != result.endMap(); ++iter)
for (LLSD::map_const_iterator iter = result.beginMap(), end = result.endMap(); iter != end; ++iter)
{
LL_DEBUGS("Voice") << "LLVoiceCallCapResponder::result got "
<< iter->first << LL_ENDL;
......
......@@ -1085,8 +1085,8 @@ void LLSpeakerVolumeStorage::load()
}
for (LLSD::map_const_iterator iter = settings_llsd.beginMap();
iter != settings_llsd.endMap(); ++iter)
for (LLSD::map_const_iterator iter = settings_llsd.beginMap(), iter_end = settings_llsd.endMap();
iter != iter_end; ++iter)
{
// Maintain compatibility with 1.23 non-linear saved volume levels
F32 volume = transformFromLegacyVolume((F32)iter->second.asReal());
......
......@@ -1025,8 +1025,8 @@ class LLVivoxSecurity final : public LLSingleton<LLVivoxSecurity>
virtual ~LLVivoxSecurity();
public:
std::string connectorHandle() { return mConnectorHandle; };
std::string accountHandle() { return mAccountHandle; };
const std::string& connectorHandle() { return mConnectorHandle; };
const std::string& accountHandle() { return mAccountHandle; };
#ifdef LL_LINUX
void setConnectorHandle(const std::string& handle) { mConnectorHandle = handle; }
......
......@@ -237,7 +237,6 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
mSculptChanged = FALSE;
mSpotLightPriority = 0.f;
mSkinInfoReceived = false;
mSkinInfoFailed = false;
mSkinInfo = NULL;
......@@ -1064,7 +1063,6 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
if (mSkinInfo && mSkinInfo->mMeshID != volume_params.getSculptID())
{
mSkinInfo = NULL;
mSkinInfoReceived = false;
mSkinInfoFailed = false;
}
......@@ -1078,7 +1076,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
}
}
if (!mSkinInfo && !isSkinInfoLoaded() && !hasSkinInfoFailed())
if (!mSkinInfo && !hasSkinInfoFailed())
{
mSkinInfo = gMeshRepo.getSkinInfo(volume_params.getSculptID(), this);
if (mSkinInfo)
......@@ -1119,6 +1117,7 @@ void LLVOVolume::updateSculptTexture()
mSculptTexture = LLViewerTextureManager::getFetchedTexture(id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
}
mSkinInfoFailed = false;
mSkinInfo = NULL;
}
else
......@@ -1170,29 +1169,17 @@ void LLVOVolume::notifyMeshLoaded()
updateVisualComplexity();
}
void LLVOVolume::notifySkinInfoLoaded(LLMeshSkinInfo* skin)
void LLVOVolume::notifySkinInfoLoaded(const LLMeshSkinInfo* skin)
{
mSkinInfoFailed = false;
mSkinInfoReceived = true;
mSkinInfo = skin;
mSculptChanged = TRUE;
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_RIGGED, TRUE);
if (getAvatar() && !isAnimatedObject())
{
getAvatar()->addAttachmentOverridesForObject(this);
}
if (getControlAvatar() && isAnimatedObject())
{
getControlAvatar()->addAttachmentOverridesForObject(this);
}
notifyMeshLoaded();
}
void LLVOVolume::notifySkinInfoUnavailable()
{
mSkinInfoFailed = true;
mSkinInfoReceived = false;
mSkinInfo = nullptr;
}
......@@ -3125,7 +3112,7 @@ S32 LLVOVolume::getFaceIndexWithMediaImpl(const LLViewerMediaImpl* media_impl, S
//----------------------------------------------------------------------------
void LLVOVolume::setLightTextureID(LLUUID id)
void LLVOVolume::setLightTextureID(const LLUUID& id)
{
LLViewerTexture* old_texturep = getLightTexture(); // same as mLightTexture, but inits if nessesary
if (id.notNull())
......@@ -3166,7 +3153,7 @@ void LLVOVolume::setLightTextureID(LLUUID id)
}
}
void LLVOVolume::setSpotLightParams(LLVector3 params)
void LLVOVolume::setSpotLightParams(const LLVector3& params)
{
LLLightImageParams* param_block = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE);
if (param_block && param_block->getParams() != params)
......@@ -5083,7 +5070,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
bool selected = pObj->isSelected();
if ( (pObj->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) &&
( (!RlvActions::isRlvEnabled()) ||
( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) &&
( ((!pObj->isHUDAttachment()) || (!RlvAttachmentLocks::instance().isLockedAttachment(pObj->getRootEdit()))) &&
(RlvActions::canEdit(pObj)) ) ) )
// [/RVLa:KB]
{
......
......@@ -249,8 +249,8 @@ public:
void setLightRadius(F32 radius);
void setLightFalloff(F32 falloff);
void setLightCutoff(F32 cutoff);
void setLightTextureID(LLUUID id);
void setSpotLightParams(LLVector3 params);
void setLightTextureID(const LLUUID& id);
void setSpotLightParams(const LLVector3& params);
BOOL getIsLight() const;
LLColor3 getLightBaseColor() const; // not scaled by intensity
......@@ -334,7 +334,7 @@ public:
void updateVisualComplexity();
void notifyMeshLoaded();
void notifySkinInfoLoaded(LLMeshSkinInfo* skin);
void notifySkinInfoLoaded(const LLMeshSkinInfo* skin);
void notifySkinInfoUnavailable();
// Returns 'true' iff the media data for this object is in flight
......@@ -414,12 +414,10 @@ private:
LLPointer<LLRiggedVolume> mRiggedVolume;
bool isSkinInfoLoaded() { return mSkinInfoReceived; }
bool hasSkinInfoFailed() { return mSkinInfoFailed; }
bool hasSkinInfoFailed() const { return mSkinInfoFailed; }
bool mSkinInfoReceived;
bool mSkinInfoFailed;
LLMeshSkinInfo *mSkinInfo;
const LLMeshSkinInfo *mSkinInfo;
// statics
public:
......
......@@ -230,7 +230,8 @@ void LLWaterParamSet::mix(LLWaterParamSet& src, LLWaterParamSet& dest, F32 weigh
LLSD srcVal, destVal; // LLSD holders for get/set calls, reusable
// Iterate through values
for(LLSD::map_iterator iter = mParamValues.beginMap(); iter != mParamValues.endMap(); ++iter)
for(LLSD::map_iterator iter = mParamValues.beginMap(),
iter_end = mParamValues.endMap(); iter != iter_end; ++iter)
{
// If param exists in both src and dest, set the holder variables, otherwise skip
if(src.mParamValues.has(iter->first) && dest.mParamValues.has(iter->first))
......
......@@ -132,8 +132,8 @@ public:
inline void LLWaterParamSet::setAll(const LLSD& val)
{
if(val.isMap()) {
LLSD::map_const_iterator mIt = val.beginMap();
for(; mIt != val.endMap(); mIt++)
for(LLSD::map_const_iterator mIt = val.beginMap(), end_it = val.endMap(); mIt != end_it; ++mIt)
{
mParamValues[mIt->first] = mIt->second;
}
......@@ -145,7 +145,7 @@ inline void LLWaterParamSet::updateHashedNames()
{
mParamHashedNames.clear();
// Iterate through values
for(LLSD::map_iterator iter = mParamValues.beginMap(); iter != mParamValues.endMap(); ++iter)
for(LLSD::map_iterator iter = mParamValues.beginMap(), end = mParamValues.endMap(); iter != end; ++iter)
{
mParamHashedNames.emplace_back(iter->first);
}
......
......@@ -897,12 +897,12 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
{
case LLAssetType::AT_BODYPART:
case LLAssetType::AT_CLOTHING:
eWearMask = gRlvWearableLocks.canWear(item);
rlvCanRemove |= (is_worn) ? gRlvWearableLocks.canRemove(item) : false;
eWearMask = RlvWearableLocks::instance().canWear(item);
rlvCanRemove |= (is_worn) ? RlvWearableLocks::instance().canRemove(item) : false;
break;
case LLAssetType::AT_OBJECT:
eWearMask = gRlvAttachmentLocks.canAttach(item);
rlvCanRemove |= (is_worn) ? gRlvAttachmentLocks.canDetach(item) : false;
eWearMask = RlvAttachmentLocks::instance().canAttach(item);
rlvCanRemove |= (is_worn) ? RlvAttachmentLocks::instance().canDetach(item) : false;
break;
default:
break;
......
......@@ -84,7 +84,7 @@ LLCore::HttpHeaders::ptr_t LLWebProfile::buildDefaultHeaders()
auto httpHeaders = std::make_shared<LLCore::HttpHeaders>();
LLSD headers = LLViewerMedia::getInstance()->getHeaders();
for (LLSD::map_iterator it = headers.beginMap(); it != headers.endMap(); ++it)
for (LLSD::map_iterator it = headers.beginMap(), end = headers.endMap(); it != end; ++it)
{
httpHeaders->append((*it).first, (*it).second.asStringRef());
}
......
......@@ -242,7 +242,7 @@ LLSD LLWLParamManager::createSkyMap(std::map<LLWLParamKey, LLWLParamSet> refs)
void LLWLParamManager::addAllSkies(const LLWLParamKey::EScope scope, const LLSD& sky_presets)
{
for(LLSD::map_const_iterator iter = sky_presets.beginMap(); iter != sky_presets.endMap(); ++iter)
for(LLSD::map_const_iterator iter = sky_presets.beginMap(), end = sky_presets.endMap(); iter != end; ++iter)
{
LLWLParamSet set;
set.setAll(iter->second);
......
......@@ -291,7 +291,7 @@ void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight)
LLSD destVal;
// Iterate through values
for(LLSD::map_iterator iter = mParamValues.beginMap(); iter != mParamValues.endMap(); ++iter)
for(auto iter = mParamValues.beginMap(), end = mParamValues.endMap(); iter != end; ++iter)
{
// If param exists in both src and dest, set the holder variables, otherwise skip
if(src.mParamValues.has(iter->first) && dest.mParamValues.has(iter->first))
......@@ -398,7 +398,7 @@ void LLWLParamSet::updateHashedNames()
{
mParamHashedNames.clear();
// Iterate through values
for(auto iter = mParamValues.beginMap(); iter != mParamValues.endMap(); ++iter)
for(auto iter = mParamValues.beginMap(), end = mParamValues.endMap(); iter != end; ++iter)
{
mParamHashedNames.emplace_back(iter->first);
}
......
......@@ -1337,7 +1337,7 @@ void send_agent_resume()
LLAppViewer::instance()->resumeMainloopTimeout();
}
static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin)
static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin, F32 width_scale_factor)
{
LLVector3d pos_local;
......@@ -1345,6 +1345,9 @@ static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3
pos_local.mdV[VY] = (compact_local >> 8) & 0xFFU;
pos_local.mdV[VX] = (compact_local >> 16) & 0xFFU;
// Scaling for OpenSim VarRegions
pos_local.mdV[VX] *= width_scale_factor;
pos_local.mdV[VY] *= width_scale_factor;
return region_origin + pos_local;
}
......@@ -1378,11 +1381,11 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
{
if(positions != nullptr)
{
positions->emplace_back(pos_global);
positions->emplace_back(std::move(pos_global));
}
if(avatar_ids != nullptr)
{
avatar_ids->emplace_back(uuid);
avatar_ids->emplace_back(std::move(uuid));
}
}
}
......@@ -1396,7 +1399,7 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
{
LLUUID uuid = regionp->mMapAvatarIDs[i];
if (uuid.isNull()) continue;
LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars[i], origin_global);
LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars[i], origin_global, regionp->getWidthScaleFactor());
if(dist_vec_squared(pos_global, relative_to) <= radius_squared)
{
// if this avatar doesn't already exist in the list, add it
......@@ -1404,9 +1407,9 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector<LLVector3d>* positi
{
if (positions != nullptr)
{
positions->emplace_back(pos_global);
positions->emplace_back(std::move(pos_global));
}
avatar_ids->emplace_back(uuid);
avatar_ids->emplace_back(std::move(uuid));
}
}
}
......@@ -1436,7 +1439,7 @@ void LLWorld::getAvatars(pos_map_t* umap, const LLVector3d& relative_to, F32 rad
if (!uuid.isNull()
&& dist_vec_squared(pos_global, relative_to) <= radius_squared)
{
umap->emplace(uuid, pos_global);
umap->emplace(std::move(uuid), std::move(pos_global));
}
}
}
......@@ -1450,10 +1453,10 @@ void LLWorld::getAvatars(pos_map_t* umap, const LLVector3d& relative_to, F32 rad
LLUUID uuid = regionp->mMapAvatarIDs[i];
if (uuid.isNull()) continue;
LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars[i], origin_global);
if(dist_vec_squared(pos_global, relative_to) <= radius_squared)
LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars[i], origin_global, regionp->getWidthScaleFactor());
if(dist_vec_squared(pos_global, relative_to) <= radius_squared && umap->find(uuid) == umap->end())
{
umap->emplace(uuid, pos_global);
umap->emplace(std::move(uuid), std::move(pos_global));
}
}
}
......@@ -1483,7 +1486,7 @@ void LLWorld::getAvatars(region_gpos_map_t* umap, const LLVector3d& relative_to,
if (uuid.notNull() && region
&& dist_vec_squared(pos_global, relative_to) <= radius_squared)
{
umap->emplace(uuid, regionp_gpos_pair_t(region, pos_global));
umap->emplace(std::move(uuid), std::make_pair(region, std::move(pos_global)));
}
}
}
......@@ -1497,10 +1500,10 @@ void LLWorld::getAvatars(region_gpos_map_t* umap, const LLVector3d& relative_to,
LLUUID uuid = regionp->mMapAvatarIDs[i];
if (uuid.isNull()) continue;
LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars[i], origin_global);
if (dist_vec_squared(pos_global, relative_to) <= radius_squared)
LLVector3d pos_global = unpackLocalToGlobalPosition(regionp->mMapAvatars[i], origin_global, regionp->getWidthScaleFactor());
if (dist_vec_squared(pos_global, relative_to) <= radius_squared && umap->find(uuid) == umap->end())
{
umap->emplace(uuid, regionp_gpos_pair_t(regionp, pos_global));
umap->emplace(std::move(uuid), std::make_pair(regionp, std::move(pos_global)));
}
}
}
......@@ -1525,7 +1528,7 @@ bool LLWorld::getAvatar(const LLUUID& idAvatar, LLVector3d& posAvatar) const
{
if (idAvatar == pRegion->mMapAvatarIDs[idxAgent])
{
posAvatar = unpackLocalToGlobalPosition(pRegion->mMapAvatars[idxAgent], pRegion->getOriginGlobal());
posAvatar = unpackLocalToGlobalPosition(pRegion->mMapAvatars[idxAgent], pRegion->getOriginGlobal(), pRegion->getWidthScaleFactor());
return true;
}
}
......
......@@ -59,9 +59,9 @@ class CapUrlMatches
{
public:
CapUrlMatches(std::set<LLViewerRegion*>& regions, std::set<std::string>& cap_names)
: mRegions(regions)
, mCapNames(cap_names)
{
mRegions = regions;
mCapNames = cap_names;
}
std::set<LLViewerRegion*> mRegions;
......
......@@ -122,11 +122,11 @@ public:
// void setWaterHeight (F32 water_height) { mWaterHeight = water_height; }
// Accessors
std::string getName() const { return mName; }
const std::string& getName() const { return mName; }
const std::string getFlagsString() const { return LLViewerRegion::regionFlagsToString(mRegionFlags); }
const std::string getAccessString() const { return LLViewerRegion::accessToString((U8)mAccess); }
const std::string getShortAccessString() const { return LLViewerRegion::accessToShortString(static_cast<U8>(mAccess)); } // <alchemy/>
const std::string getAccessIcon() const { return LLViewerRegion::getAccessIcon(static_cast<U8>(mAccess)); }
const std::string& getAccessString() const { return LLViewerRegion::accessToString((U8)mAccess); }
const std::string& getShortAccessString() const { return LLViewerRegion::accessToShortString(static_cast<U8>(mAccess)); } // <alchemy/>
const std::string& getAccessIcon() const { return LLViewerRegion::getAccessIcon(static_cast<U8>(mAccess)); }
const S32 getAgentCount() const; // Compute the total agents count
LLPointer<LLViewerFetchedTexture> getLandForSaleImage(); // Get the overlay image, fetch it if necessary
......
......@@ -201,7 +201,7 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**)
// name shouldn't be empty, see EXT-4568
if (name.empty() && accesscode != 255)
{
LL_WARNS("World Map") << "MapBlockReply returned an empty region name; not inserting in the world map" << LL_ENDL;
LL_WARNS("WorldMap") << "MapBlockReply returned an empty region name; not inserting in the world map" << LL_ENDL;
continue;
}
......