summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp294
1 files changed, 162 insertions, 132 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index a6d50af025..910f711a9d 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -576,7 +576,7 @@ private:
// joint states to be animated
//-------------------------------------------------------------------------
LLPointer<LLJointState> mPelvisState;
- LLCharacter* mCharacter;
+ LLCharacter* mCharacter;
};
/**
@@ -679,11 +679,13 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mVisuallyMuteSetting(AV_RENDER_NORMALLY),
mMutedAVColor(LLColor4::white /* used for "uninitialize" */),
mFirstFullyVisible(true),
+ mWaitingForMeshes(false),
mFirstDecloudTime(-1.f),
mFullyLoaded(false),
mPreviousFullyLoaded(false),
mFullyLoadedInitialized(false),
mLastCloudAttachmentCount(-1),
+ mFullyLoadedFrameCounter(0),
mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN),
mLoadedCallbacksPaused(false),
mLoadedCallbackTextures(0),
@@ -777,11 +779,9 @@ std::string LLVOAvatar::avString() const
{
return " " + getFullname() + " ";
}
- else
- {
- std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus());
- return " Avatar '" + getFullname() + "' " + viz_string + " ";
- }
+
+ std::string status = LLVOAvatar::rezStatusToString(getRezzedStatus());
+ return " Avatar '" + getDebugName() + "' " + status + " ";
}
void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment)
@@ -804,10 +804,10 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c
if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
{
LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
- args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32());
+ args["EXISTENCE"] = llformat("%d", (U32)mDebugExistenceTimer.getElapsedTimeF32());
+ args["TIME"] = llformat("%d", (U32)mRuthDebugTimer.getElapsedTimeF32());
args["NAME"] = getFullname();
- LLNotificationsUtil::add(notification_name,args);
+ LLNotificationsUtil::add(notification_name, args);
}
}
@@ -818,15 +818,14 @@ LLVOAvatar::~LLVOAvatar()
{
sInstances.remove(this);
- if (gSavedSettings.getBOOL("IMShowArrivalsDepartures"))
+ static LLCachedControl<bool> show_arrival_departures(gSavedSettings, "IMShowArrivalsDepartures", false);
+ if (show_arrival_departures && !isSelf())
{
- LLAvatarName av_name;
- LLAvatarNameCache::get(getID(), &av_name);
- auto display_name = av_name.getDisplayName();
- if (!display_name.empty())
+ auto full_name = getFullname();
+ if (!full_name.empty())
{
- LLChat chat{llformat("%s left.", display_name.c_str())};
- chat.mFromName = display_name;
+ LLChat chat{llformat("%s left.", full_name.c_str())};
+ chat.mFromName = full_name;
chat.mFromID = getID();
LLSD args;
args["COLOR"] = "ChatHistoryTextColor";
@@ -835,14 +834,14 @@ LLVOAvatar::~LLVOAvatar()
}
if (!mFullyLoaded)
{
- debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud");
+ debugAvatarRezTime("AvatarRezLeftCloudNotification", "left after ruth seconds as cloud");
}
else
{
- debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding");
+ debugAvatarRezTime("AvatarRezLeftNotification", "left sometime after declouding");
}
- if(mTuned)
+ if (mTuned)
{
LLPerfStats::tunedAvatars--;
mTuned = false;
@@ -936,12 +935,12 @@ bool LLVOAvatar::isFullyTextured() const
bool LLVOAvatar::hasGray() const
{
- return !getIsCloud() && !isFullyTextured();
+ return !getHasMissingParts() && !isFullyTextured();
}
S32 LLVOAvatar::getRezzedStatus() const
{
- if (getIsCloud()) return 0;
+ if (getHasMissingParts()) return 0;
bool textured = isFullyTextured();
bool all_baked_loaded = allBakedTexturesCompletelyDownloaded();
if (textured && all_baked_loaded && getAttachmentCount() == mSimAttachments.size()) return 4;
@@ -984,34 +983,49 @@ bool LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars)
++grey_avatars;
}
}
- return !grey_avatars;
+ return grey_avatars == 0;
}
// static
-void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts, F32& avg_cloud_time, S32& cloud_avatars)
+void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts, F32& avg_cloud_time, S32& cloud_avatars, S32& pending_meshes, S32& control_avatars)
{
counts.clear();
counts.resize(5);
avg_cloud_time = 0;
cloud_avatars = 0;
+ pending_meshes = 0;
+ control_avatars = 0;
S32 count_avg = 0;
for (LLCharacter* character : LLCharacter::sInstances)
{
- if (LLVOAvatar* inst = (LLVOAvatar*)character)
+ LLVOAvatar* inst = (LLVOAvatar*)character;
+ if (inst && !inst->isUIAvatar() && !inst->isSelf())
{
- S32 rez_status = inst->getRezzedStatus();
- counts[rez_status]++;
- F32 time = inst->getFirstDecloudTime();
- if (time >= 0)
+ if (inst->isControlAvatar())
{
- avg_cloud_time+=time;
- count_avg++;
+ control_avatars++;
}
- if (!inst->isFullyLoaded() || time < 0)
+ else
{
- // still renders as cloud
- cloud_avatars++;
+ S32 rez_status = inst->getRezzedStatus();
+ counts[rez_status]++;
+ F32 time = inst->getFirstDecloudTime();
+ if (time >= 0)
+ {
+ avg_cloud_time += time;
+ count_avg++;
+ }
+ if (!inst->isFullyLoaded() || time < 0)
+ {
+ // still renders as cloud
+ cloud_avatars++;
+ if (rez_status >= 4
+ && inst->mWaitingForMeshes)
+ {
+ pending_meshes++;
+ }
+ }
}
}
}
@@ -1028,7 +1042,7 @@ std::string LLVOAvatar::rezStatusToString(S32 rez_status)
switch (rez_status)
{
case 0:
- return "cloud";
+ return "missing parts";
case 1:
return "gray";
case 2:
@@ -1191,7 +1205,7 @@ void LLVOAvatar::initClass()
LLControlAvatar::sRegionChangedSlot = gAgent.addRegionChangedCallback(&LLControlAvatar::onRegionChanged);
- sCloudTexture = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.j2c");
+ sCloudTexture = LLViewerTextureManager::getFetchedTextureFromFile("cloud-particle.png");
}
@@ -2583,31 +2597,21 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys,
{
mDebugExistenceTimer.reset();
debugAvatarRezTime("AvatarRezArrivedNotification", "avatar arrived");
- if (gSavedSettings.getBOOL("IMShowArrivalsDepartures"))
- {
- uuid_vec_t uuids;
- std::vector<LLVector3d> positions;
- LLWorld::getInstance()->getAvatars(&uuids, &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("MPVNearMeRange"));
- auto pos_it = positions.begin();
- auto id_it = uuids.begin();
- for (;pos_it != positions.end() && id_it != uuids.end(); ++pos_it, ++id_it)
- {
- if (*id_it == getID() && !isSelf())
- {
- LLAvatarName av_name;
- LLAvatarNameCache::get(getID(), &av_name);
- auto display_name = av_name.getDisplayName();
- if (!display_name.empty())
- {
- LLChat chat{llformat("%s arrived (%.1f m).", display_name.c_str(), dist_vec(*pos_it, gAgent.getPositionGlobal()))};
- chat.mFromName = display_name;
- chat.mFromID = getID();
- LLSD args;
- args["COLOR"] = "ChatHistoryTextColor";
- LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
- }
- break;
- }
+ static LLCachedControl<bool> show_arrival_departures(gSavedSettings, "IMShowArrivalsDepartures", false);
+ if (show_arrival_departures && !isSelf())
+ {
+ auto full_name = getFullname();
+ if (!full_name.empty())
+ {
+ auto avatarsPositions = gAgent.getAvatarsPositions();
+ auto id = getID();
+ auto avatarPosition = avatarsPositions[id];
+ LLChat chat{std::string{full_name + " arrived" + (avatarPosition.isExactlyZero() ? "" : llformat(" (%.1f m)", dist_vec(avatarPosition, gAgent.getPositionGlobal()))) + "."}};
+ chat.mFromName = full_name;
+ chat.mFromID = id;
+ LLSD args;
+ args["COLOR"] = "ChatHistoryTextColor";
+ LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args);
}
}
}
@@ -3010,7 +3014,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
if (LLVOAvatar::sJointDebug)
{
- LL_INFOS() << getFullname() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << LL_ENDL;
+ LL_INFOS() << getDebugName() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << LL_ENDL;
}
LLJoint::sNumUpdates = 0;
@@ -3230,17 +3234,17 @@ F32 LLVOAvatar::calcMorphAmount() const
void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
{
// Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync
- if ( voice_enabled
+ if (voice_enabled
&& mLastRezzedStatus > 0 // no point updating lip-sync for clouds
&& LLVoiceVisualizer::getLipSyncEnabled()
- && LLVoiceClient::getInstance()->getIsSpeaking( mID ) )
+ && LLVoiceClient::getInstance()->getIsSpeaking(mID))
{
F32 ooh_morph_amount = 0.0f;
F32 aah_morph_amount = 0.0f;
mVoiceVisualizer->lipSyncOohAah( ooh_morph_amount, aah_morph_amount );
- if( mOohMorph )
+ if (mOohMorph)
{
F32 ooh_weight = mOohMorph->getMinWeight()
+ ooh_morph_amount * (mOohMorph->getMaxWeight() - mOohMorph->getMinWeight());
@@ -3248,7 +3252,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
mOohMorph->setWeight( ooh_weight);
}
- if( mAahMorph )
+ if (mAahMorph)
{
F32 aah_weight = mAahMorph->getMinWeight()
+ aah_morph_amount * (mAahMorph->getMaxWeight() - mAahMorph->getMinWeight());
@@ -3517,7 +3521,7 @@ void LLVOAvatar::idleUpdateNameTagText(bool new_name)
is_muted = isInMuteList();
}
bool is_friend = isBuddy();
- bool is_cloud = getIsCloud();
+ bool is_cloud = getHasMissingParts();
if (is_appearance != mNameAppearance)
{
@@ -4335,8 +4339,8 @@ void LLVOAvatar::computeUpdatePeriod()
{
const LLVector4a* ext = mDrawable->getSpatialExtents();
LLVector4a size;
- size.setSub(ext[1],ext[0]);
- F32 mag = size.getLength3().getF32()*0.5f;
+ size.setSub(ext[1], ext[0]);
+ F32 mag = size.getLength3().getF32() * 0.5f;
const S32 UPDATE_RATE_SLOW = 64;
const S32 UPDATE_RATE_MED = 48;
@@ -4346,14 +4350,14 @@ void LLVOAvatar::computeUpdatePeriod()
{ // visually muted avatars update at lowest rate
mUpdatePeriod = UPDATE_RATE_SLOW;
}
- else if (! shouldImpostor()
- || mDrawable->mDistanceWRTCamera < 1.f + mag)
+ else if (!shouldImpostor()
+ || mDrawable->mDistanceWRTCamera < 1.f + mag)
{ // first 25% of max visible avatars are not impostored
// also, don't impostor avatars whose bounding box may be penetrating the
// impostor camera near clip plane
mUpdatePeriod = 1;
}
- else if ( shouldImpostor(4.0) )
+ else if (shouldImpostor(4.0))
{ //background avatars are REALLY slow updating impostors
mUpdatePeriod = UPDATE_RATE_SLOW;
}
@@ -4362,7 +4366,7 @@ void LLVOAvatar::computeUpdatePeriod()
// Don't update cloud avatars too often
mUpdatePeriod = UPDATE_RATE_SLOW;
}
- else if ( shouldImpostor(3.0) )
+ else if (shouldImpostor(3.0))
{ //back 25% of max visible avatars are slow updating impostors
mUpdatePeriod = UPDATE_RATE_MED;
}
@@ -4793,14 +4797,6 @@ bool LLVOAvatar::updateCharacter(LLAgent &agent)
}
bool visible = isVisible();
- bool is_control_avatar = isControlAvatar(); // capture state to simplify tracing
- bool is_attachment = false;
-
- if (is_control_avatar)
- {
- LLControlAvatar *cav = dynamic_cast<LLControlAvatar*>(this);
- is_attachment = cav && cav->mRootVolp && cav->mRootVolp->isAttachment(); // For attached animated objects
- }
// For fading out the names above heads, only let the timer
// run if we're visible.
@@ -5474,7 +5470,7 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel)
gGL.begin(LLRender::LINES);
gGL.color4f(1.f,1.f,1.f,1.f);
F32 thickness = llmax(F32(5.0f-5.0f*(gFrameTimeSeconds-mLastImpostorUpdateFrameTime)),1.0f);
- glLineWidth(thickness);
+ //glLineWidth(thickness);
gGL.vertex3fv((pos+left-up).mV);
gGL.vertex3fv((pos-left-up).mV);
gGL.vertex3fv((pos-left-up).mV);
@@ -6211,8 +6207,11 @@ void LLVOAvatar::resetAnimations()
flushAllMotions();
}
-// Override selectively based on avatar sex and whether we're using new
-// animations.
+//-----------------------------------------------------------------------------
+// remapMotionID()
+// Override selectively based on avatar sex and whether we're using new animations.
+//-----------------------------------------------------------------------------
+// virtual
LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)
{
static LLCachedControl<bool> use_new_walk_run(gSavedSettings, "UseNewWalkRun");
@@ -6262,7 +6261,6 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)
}
return result;
-
}
//-----------------------------------------------------------------------------
@@ -6270,6 +6268,7 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)
// id is the asset if of the animation to start
// time_offset is the offset into the animation at which to start playing
//-----------------------------------------------------------------------------
+// virtual
bool LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
{
LL_DEBUGS("Motion") << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL;
@@ -6292,6 +6291,7 @@ bool LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
//-----------------------------------------------------------------------------
// stopMotion()
//-----------------------------------------------------------------------------
+// virtual
bool LLVOAvatar::stopMotion(const LLUUID& id, bool stop_immediate)
{
LL_DEBUGS("Motion") << "Motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL;
@@ -6331,6 +6331,7 @@ void LLVOAvatar::stopMotionFromSource(const LLUUID& source_id)
//-----------------------------------------------------------------------------
// addDebugText()
//-----------------------------------------------------------------------------
+// virtual
void LLVOAvatar::addDebugText(const std::string& text)
{
mDebugText.append(1, '\n');
@@ -6338,8 +6339,22 @@ void LLVOAvatar::addDebugText(const std::string& text)
}
//-----------------------------------------------------------------------------
+// getDebugName()
+//-----------------------------------------------------------------------------
+// virtual
+std::string LLVOAvatar::getDebugName() const
+{
+#if LL_RELEASE_WITH_DEBUG_INFO
+ return getFullname();
+#else
+ return getID().asString();
+#endif // LL_RELEASE_WITH_DEBUG_INFO
+}
+
+//-----------------------------------------------------------------------------
// getID()
//-----------------------------------------------------------------------------
+// virtual
const LLUUID& LLVOAvatar::getID() const
{
return mID;
@@ -6349,13 +6364,14 @@ const LLUUID& LLVOAvatar::getID() const
// getJoint()
//-----------------------------------------------------------------------------
// RN: avatar joints are multi-rooted to include screen-based attachments
-LLJoint *LLVOAvatar::getJoint( const std::string &name )
+// virtual
+LLJoint* LLVOAvatar::getJoint(std::string_view name)
{
joint_map_t::iterator iter = mJointMap.find(name);
- LLJoint* jointp = NULL;
+ LLJoint* jointp = nullptr;
- if (iter == mJointMap.end() || iter->second == NULL)
+ if (iter == mJointMap.end() || iter->second == nullptr)
{ //search for joint and cache found joint in lookup table
if (mJointAliasMap.empty())
{
@@ -6372,7 +6388,7 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name )
canonical_name = name;
}
jointp = mRoot->findJoint(canonical_name);
- mJointMap[name] = jointp;
+ mJointMap[std::string(name)] = jointp;
}
else
{ //return cached pointer
@@ -6474,6 +6490,7 @@ bool LLVOAvatar::jointIsRiggedTo(const LLJoint *joint) const
void LLVOAvatar::clearAttachmentOverrides()
{
+
for (S32 i=0; i<LL_CHARACTER_MAX_ANIMATED_JOINTS; i++)
{
LLJoint *pJoint = getJoint(i);
@@ -6504,6 +6521,7 @@ void LLVOAvatar::clearAttachmentOverrides()
//-----------------------------------------------------------------------------
void LLVOAvatar::rebuildAttachmentOverrides()
{
+
LL_DEBUGS("AnimatedObjects") << "rebuilding" << LL_ENDL;
clearAttachmentOverrides();
@@ -6552,6 +6570,7 @@ void LLVOAvatar::rebuildAttachmentOverrides()
// -----------------------------------------------------------------------------
void LLVOAvatar::updateAttachmentOverrides()
{
+
LL_DEBUGS("AnimatedObjects") << "updating" << LL_ENDL;
std::set<LLUUID> meshes_seen;
@@ -6627,11 +6646,11 @@ void LLVOAvatar::updateAttachmentOverrides()
}
}
pelvis_fixups = mPelvisFixups;
- //dumpArchetypeXML(getFullname() + "_paranoid_updated");
+ //dumpArchetypeXML(getDebugName() + "_paranoid_updated");
// Rebuild and compare
rebuildAttachmentOverrides();
- //dumpArchetypeXML(getFullname() + "_paranoid_rebuilt");
+ //dumpArchetypeXML(getDebugName() + "_paranoid_rebuilt");
bool mismatched = false;
for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++)
{
@@ -6860,22 +6879,22 @@ void LLVOAvatar::showAttachmentOverrides(bool verbose) const
{
std::stringstream ss;
std::copy(pos_names.begin(), pos_names.end(), std::ostream_iterator<std::string>(ss, ","));
- LL_INFOS() << getFullname() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL;
+ LL_INFOS() << avString() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL;
}
else
{
- LL_DEBUGS("Avatar") << getFullname() << " no attachment positions defined for any joints" << "\n" << LL_ENDL;
+ LL_DEBUGS("Avatar") << avString() << " no attachment positions defined for any joints" << "\n" << LL_ENDL;
}
if (scale_names.size())
{
std::stringstream ss;
std::copy(scale_names.begin(), scale_names.end(), std::ostream_iterator<std::string>(ss, ","));
- LL_INFOS() << getFullname() << " attachment scales defined for joints: " << ss.str() << "\n" << LL_ENDL;
+ LL_INFOS() << getDebugName() << " attachment scales defined for joints: " << ss.str() << "\n" << LL_ENDL;
}
else
{
- LL_INFOS() << getFullname() << " no attachment scales defined for any joints" << "\n" << LL_ENDL;
+ LL_INFOS() << getDebugName() << " no attachment scales defined for any joints" << "\n" << LL_ENDL;
}
if (!verbose)
@@ -8244,7 +8263,7 @@ bool LLVOAvatar::isVisible() const
}
// Determine if we have enough avatar data to render
-bool LLVOAvatar::getIsCloud() const
+bool LLVOAvatar::getHasMissingParts() const
{
if (mIsDummy)
{
@@ -8262,7 +8281,7 @@ bool LLVOAvatar::getIsCloud() const
void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
{
// State machine for rezzed status. Statuses are -1 on startup, 0
- // = cloud, 1 = gray, 2 = downloading, 3 = waiting for attachments, 4 = full.
+ // Statuses are -1 on startup, 0 = cloud, 1 = gray, 2 = downloading, 3 = waiting for attachments, 4 = full.
// Purpose is to collect time data for each it takes avatar to reach
// various loading landmarks: gray, textured (partial), textured fully.
@@ -8282,7 +8301,7 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
if (rez_status < mLastRezzedStatus)
{
// load level has decreased. start phase timers for higher load levels.
- for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++)
+ for (S32 i = rez_status + 1; i <= mLastRezzedStatus; i++)
{
startPhase("load_" + LLVOAvatar::rezStatusToString(i));
}
@@ -8290,7 +8309,7 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
else if (rez_status > mLastRezzedStatus)
{
// load level has increased. stop phase timers for lower and equal load levels.
- for (S32 i = llmax(mLastRezzedStatus+1,1); i <= rez_status; i++)
+ for (S32 i = llmax(mLastRezzedStatus + 1, 1); i <= rez_status; i++)
{
stopPhase("load_" + LLVOAvatar::rezStatusToString(i));
stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false);
@@ -8451,8 +8470,12 @@ bool LLVOAvatar::updateIsFullyLoaded()
|| (mLoadedCallbackTextures < mCallbackTextureList.size() && mLastTexCallbackAddedTime.getElapsedTimeF32() < MAX_TEXTURE_WAIT_TIME_SEC)
|| !mPendingAttachment.empty()
|| (rez_status < 3 && !isFullyBaked())
- || hasPendingAttachedMeshes()
);
+ if (!loading)
+ {
+ mWaitingForMeshes = hasPendingAttachedMeshes();
+ loading = mWaitingForMeshes;
+ }
// compare amount of attachments to one reported by simulator
if (!isSelf() && mLastCloudAttachmentCount < mSimAttachments.size() && mSimAttachments.size() > 0)
@@ -8531,19 +8554,19 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading)
F32 first_use_delay = FIRST_APPEARANCE_CLOUD_MIN_DELAY;
if (!isSelf() && loading)
{
- // Note that textures can causes 60s delay on thier own
- // so this delay might end up on top of textures' delay
- first_use_delay = llclamp(
- mFirstAppearanceMessageTimer.getElapsedTimeF32(),
- FIRST_APPEARANCE_CLOUD_MIN_DELAY,
- FIRST_APPEARANCE_CLOUD_MAX_DELAY);
+ // Note that textures can causes 60s delay on thier own
+ // so this delay might end up on top of textures' delay
+ first_use_delay = llclamp(
+ mFirstAppearanceMessageTimer.getElapsedTimeF32(),
+ FIRST_APPEARANCE_CLOUD_MIN_DELAY,
+ FIRST_APPEARANCE_CLOUD_MAX_DELAY);
- if (shouldImpostor())
- {
- // Impostors are less of a priority,
- // let them stay cloud longer
- first_use_delay *= FIRST_APPEARANCE_CLOUD_IMPOSTOR_MODIFIER;
- }
+ if (shouldImpostor())
+ {
+ // Impostors are less of a priority,
+ // let them stay cloud longer
+ first_use_delay *= FIRST_APPEARANCE_CLOUD_IMPOSTOR_MODIFIER;
+ }
}
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > first_use_delay);
}
@@ -8560,12 +8583,12 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading)
// did our loading state "change" from last call?
// FIXME runway - why are we updating every 30 calls even if nothing has changed?
// This causes updateLOD() to run every 30 frames, among other things.
+ bool fully_loaded_changed = (mFullyLoaded != mPreviousFullyLoaded);
const S32 UPDATE_RATE = 30;
bool changed =
((mFullyLoaded != mPreviousFullyLoaded) || // if the value is different from the previous call
- (!mFullyLoadedInitialized) || // if we've never been called before
- (mFullyLoadedFrameCounter % UPDATE_RATE == 0)); // every now and then issue a change
- bool fully_loaded_changed = (mFullyLoaded != mPreviousFullyLoaded);
+ (!mFullyLoadedInitialized) || // if we've never been called before
+ (mFullyLoadedFrameCounter % UPDATE_RATE == 0)); // every now and then issue a change
mPreviousFullyLoaded = mFullyLoaded;
mFullyLoadedInitialized = true;
@@ -8583,6 +8606,7 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading)
mNeedsImpostorUpdate = true;
mLastImpostorUpdateReason = 6;
}
+
return changed;
}
@@ -8938,6 +8962,7 @@ void LLVOAvatar::updateMeshTextures()
bool is_ltda = layerset
&& layerset->getViewerComposite()->isInitialized()
&& layerset->isLocalTextureDataAvailable();
+#ifndef __aarch64__
mBakedTextureDebugText += llformat("%4d %4s %4d %4d %4d %4d %4s\n",
i,
(layerset?"*":"0"),
@@ -8946,6 +8971,7 @@ void LLVOAvatar::updateMeshTextures()
is_layer_baked[i],
use_lkg_baked_layer[i],
last_id_string.c_str());
+#endif
}
for (U32 i=0; i < mBakedTextureDatas.size(); i++)
@@ -9477,12 +9503,12 @@ void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value)
void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,
const LLAppearanceMessageContents& contents)
{
- std::string outfilename = get_sequential_numbered_file_name(dump_prefix,".xml");
+ std::string outfilename = get_sequential_numbered_file_name(dump_prefix, ".xml");
const std::vector<F32>& params_for_dump = contents.mParamWeights;
const LLTEContents& tec = contents.mTEContents;
LLAPRFile outfile;
- std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename);
+ std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, outfilename);
outfile.open(fullpath, LL_APR_WB );
apr_file_t* file = outfile.getFileHandle();
if (!file)
@@ -9695,7 +9721,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
static LLCachedControl<bool> enable_verbose_dumps(gSavedSettings, "DebugAvatarAppearanceMessage");
static LLCachedControl<bool> block_avatar_appearance_messages(gSavedSettings, "BlockAvatarAppearanceMessages");
- std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_";
+ std::string dump_prefix = getDebugName() + (isSelf() ? "_s_" : "_o_");
if (block_avatar_appearance_messages)
{
LL_WARNS() << "Blocking AvatarAppearance message" << LL_ENDL;
@@ -10329,17 +10355,13 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
std::string outprefix(prefix);
if (outprefix.empty())
{
- outprefix = getFullname() + (isSelf()?"_s":"_o");
- }
- if (outprefix.empty())
- {
- outprefix = std::string("new_archetype");
+ outprefix = getDebugName() + (isSelf() ? "_s" : "_o");
}
- std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml");
+ std::string outfilename = get_sequential_numbered_file_name(outprefix, ".xml");
LLAPRFile outfile;
LLWearableType *wr_inst = LLWearableType::getInstance();
- std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename);
+ std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, outfilename);
if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB ))
{
apr_file_t* file = outfile.getFileHandle();
@@ -10825,7 +10847,7 @@ void LLVOAvatar::updateRiggingInfo()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
- LL_DEBUGS("RigSpammish") << getFullname() << " updating rig tab" << LL_ENDL;
+ LL_DEBUGS("RigSpammish") << getDebugName() << " updating rig tab" << LL_ENDL;
// use a local static for scratch space to avoid reallocation here
static std::vector<LLVOVolume*> volumes;
@@ -11820,16 +11842,24 @@ void LLVOAvatar::readProfileQuery(S32 retries)
}
else
- { // wait until next frame
- LLUUID id = getID();
+ {
+ // wait until next frame
+ const LLUUID id = getID();
- LL::WorkQueue::getInstance("mainloop")->post([id, retries] {
- LLVOAvatar* avatar = (LLVOAvatar*) gObjectList.findObject(id);
- if(avatar)
+ LL::WorkQueue::getInstance("mainloop")->post([id, retries]
+ {
+ LLViewerObject* object = gObjectList.findObject(id);
+ if (object
+ && !object->isDead()
+ && object->isAvatar()) // probably excessive, pcode isn't supposed to change
{
- avatar->readProfileQuery(retries);
+ LLVOAvatar* avatar = (LLVOAvatar*)object;
+ if (avatar)
+ {
+ avatar->readProfileQuery(retries);
+ }
}
- });
+ });
}
}