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.cpp281
1 files changed, 141 insertions, 140 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 71dcd03d04..6ffd2c4a4d 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -574,7 +574,7 @@ private:
// joint states to be animated
//-------------------------------------------------------------------------
LLPointer<LLJointState> mPelvisState;
- LLCharacter* mCharacter;
+ LLCharacter* mCharacter;
};
/**
@@ -677,15 +677,15 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mVisuallyMuteSetting(AV_RENDER_NORMALLY),
mMutedAVColor(LLColor4::white /* used for "uninitialize" */),
mFirstFullyVisible(TRUE),
- mFirstUseDelaySeconds(FIRST_APPEARANCE_CLOUD_MIN_DELAY),
mFullyLoaded(FALSE),
mPreviousFullyLoaded(FALSE),
mFullyLoadedInitialized(FALSE),
+ mFullyLoadedFrameCounter(0),
mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN),
mLoadedCallbacksPaused(FALSE),
mLoadedCallbackTextures(0),
mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar", false)),
- mLastRezzedStatus(-1),
+ mLastRezzedStatus(AV_REZZED_UNKNOWN),
mIsEditingAppearance(FALSE),
mUseLocalAppearance(FALSE),
mLastUpdateRequestCOFVersion(-1),
@@ -772,11 +772,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)
@@ -799,10 +797,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);
}
}
@@ -813,14 +811,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;
@@ -917,14 +915,34 @@ BOOL LLVOAvatar::hasGray() const
return !getIsCloud() && !isFullyTextured();
}
-S32 LLVOAvatar::getRezzedStatus() const
+ERezzedStatus LLVOAvatar::getRezzedStatus() const
{
- if (getIsCloud()) return 0;
- bool textured = isFullyTextured();
- if (textured && allBakedTexturesCompletelyDownloaded()) return 3;
- if (textured) return 2;
- llassert(hasGray());
- return 1; // gray
+ if (getIsCloud())
+ return AV_REZZED_CLOUD;
+ if (!isFullyTextured())
+ return AV_REZZED_GRAY;
+ if (!allBakedTexturesCompletelyDownloaded())
+ return AV_REZZED_TEXTURED; // "downloading"
+ return AV_REZZED_FULL;
+}
+
+// static
+std::string LLVOAvatar::rezStatusToString(ERezzedStatus rez_status)
+{
+ switch (rez_status)
+ {
+ case AV_REZZED_CLOUD:
+ return "cloud";
+ case AV_REZZED_GRAY:
+ return "gray";
+ case AV_REZZED_TEXTURED:
+ return "downloading";
+ case AV_REZZED_FULL:
+ return "full";
+ default:
+ ;
+ }
+ return "unknown";
}
void LLVOAvatar::deleteLayerSetCaches(bool clearAll)
@@ -953,15 +971,10 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars)
{
BOOL res = TRUE;
grey_avatars = 0;
- for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
- iter != LLCharacter::sInstances.end(); ++iter)
+ for (LLCharacter* character : LLCharacter::sInstances)
{
- LLVOAvatar* inst = (LLVOAvatar*) *iter;
- if( inst->isDead() )
- {
- continue;
- }
- else if( !inst->isFullyBaked() )
+ LLVOAvatar* inst = (LLVOAvatar*)character;
+ if (!inst->isDead() && !inst->isFullyBaked())
{
res = FALSE;
if (inst->mHasGrey)
@@ -974,33 +987,6 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars)
}
// static
-void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts)
-{
- counts.clear();
- counts.resize(4);
- for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
- iter != LLCharacter::sInstances.end(); ++iter)
- {
- LLVOAvatar* inst = (LLVOAvatar*) *iter;
- if (inst)
- {
- S32 rez_status = inst->getRezzedStatus();
- counts[rez_status]++;
- }
- }
-}
-
-// static
-std::string LLVOAvatar::rezStatusToString(S32 rez_status)
-{
- if (rez_status==0) return "cloud";
- if (rez_status==1) return "gray";
- if (rez_status==2) return "downloading";
- if (rez_status==3) return "full";
- return "unknown";
-}
-
-// static
void LLVOAvatar::dumpBakedStatus()
{
LLVector3d camera_pos_global = gAgentCamera.getCameraPositionGlobal();
@@ -2587,7 +2573,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
mNeedsExtentUpdate = ((LLDrawable::getCurrentFrame()+mID.mData[0])%upd_freq==0);
}
- LLScopedContextString str("avatar_idle_update " + getFullname());
+ LLScopedContextString str("avatar_idle_update " + getDebugName());
checkTextureLoading() ;
@@ -2679,7 +2665,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
// no need for high frequency
compl_upd_freq = 100;
}
- else if (mLastRezzedStatus <= 0) //cloud or init
+ else if (mLastRezzedStatus <= AV_REZZED_CLOUD) // cloud or initial
{
compl_upd_freq = 60;
}
@@ -2687,11 +2673,11 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time)
{
compl_upd_freq = 5;
}
- else if (mLastRezzedStatus == 1) //'grey', not fully loaded
+ else if (mLastRezzedStatus == AV_REZZED_GRAY) // 'gray', not fully loaded
{
compl_upd_freq = 40;
}
- else if (isInMuteList()) //cheap, buffers value from search
+ else if (isInMuteList()) // cheap, buffers value from search
{
compl_upd_freq = 100;
}
@@ -2813,7 +2799,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;
@@ -3055,17 +3041,17 @@ F32 LLVOAvatar::calcMorphAmount()
void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
{
// Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync
- if ( voice_enabled
- && mLastRezzedStatus > 0 // no point updating lip-sync for clouds
+ if (voice_enabled
+ && mLastRezzedStatus > AV_REZZED_CLOUD // no point updating lip-sync for clouds
&& (LLVoiceClient::getInstance()->lipSyncEnabled())
- && 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());
@@ -3073,7 +3059,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());
@@ -4165,16 +4151,16 @@ void LLVOAvatar::computeUpdatePeriod()
// 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;
}
- else if (mLastRezzedStatus <= 0)
+ else if (mLastRezzedStatus <= AV_REZZED_CLOUD)
{
// 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;
}
@@ -4614,7 +4600,7 @@ bool LLVOAvatar::updateCharacter(LLAgent &agent)
is_attachment = cav && cav->mRootVolp && cav->mRootVolp->isAttachment(); // For attached animated objects
}
- LLScopedContextString str("updateCharacter " + getFullname() + " is_control_avatar "
+ LLScopedContextString str("updateCharacter " + getDebugName() + " is_control_avatar "
+ boost::lexical_cast<std::string>(is_control_avatar)
+ " is_attachment " + boost::lexical_cast<std::string>(is_attachment));
@@ -6033,8 +6019,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");
@@ -6084,7 +6073,6 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)
}
return result;
-
}
//-----------------------------------------------------------------------------
@@ -6092,6 +6080,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;
@@ -6114,6 +6103,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;
@@ -6153,6 +6143,7 @@ void LLVOAvatar::stopMotionFromSource(const LLUUID& source_id)
//-----------------------------------------------------------------------------
// addDebugText()
//-----------------------------------------------------------------------------
+// virtual
void LLVOAvatar::addDebugText(const std::string& text)
{
mDebugText.append(1, '\n');
@@ -6160,8 +6151,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;
@@ -6171,6 +6176,7 @@ const LLUUID& LLVOAvatar::getID() const
// getJoint()
//-----------------------------------------------------------------------------
// RN: avatar joints are multi-rooted to include screen-based attachments
+// virtual
LLJoint *LLVOAvatar::getJoint( const std::string &name )
{
joint_map_t::iterator iter = mJointMap.find(name);
@@ -6286,7 +6292,7 @@ bool LLVOAvatar::jointIsRiggedTo(const LLJoint *joint) const
void LLVOAvatar::clearAttachmentOverrides()
{
- LLScopedContextString str("clearAttachmentOverrides " + getFullname());
+ LLScopedContextString str("clearAttachmentOverrides " + getDebugName());
for (S32 i=0; i<LL_CHARACTER_MAX_ANIMATED_JOINTS; i++)
{
@@ -6318,7 +6324,7 @@ void LLVOAvatar::clearAttachmentOverrides()
//-----------------------------------------------------------------------------
void LLVOAvatar::rebuildAttachmentOverrides()
{
- LLScopedContextString str("rebuildAttachmentOverrides " + getFullname());
+ LLScopedContextString str("rebuildAttachmentOverrides " + getDebugName());
LL_DEBUGS("AnimatedObjects") << "rebuilding" << LL_ENDL;
dumpStack("AnimatedObjectsStack");
@@ -6369,7 +6375,7 @@ void LLVOAvatar::rebuildAttachmentOverrides()
// -----------------------------------------------------------------------------
void LLVOAvatar::updateAttachmentOverrides()
{
- LLScopedContextString str("updateAttachmentOverrides " + getFullname());
+ LLScopedContextString str("updateAttachmentOverrides " + getDebugName());
LL_DEBUGS("AnimatedObjects") << "updating" << LL_ENDL;
dumpStack("AnimatedObjectsStack");
@@ -6447,11 +6453,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++)
{
@@ -6501,7 +6507,7 @@ void LLVOAvatar::addAttachmentOverridesForObject(LLViewerObject *vo, std::set<LL
return;
}
- LLScopedContextString str("addAttachmentOverridesForObject " + getFullname());
+ LLScopedContextString str("addAttachmentOverridesForObject " + getDebugName());
if (getOverallAppearance() != AOA_NORMAL)
{
@@ -6683,21 +6689,21 @@ 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)
@@ -8056,10 +8062,10 @@ bool LLVOAvatar::getIsCloud() const
);
}
-void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
+void LLVOAvatar::updateRezzedStatusTimers(ERezzedStatus rez_status)
{
- // State machine for rezzed status. Statuses are -1 on startup, 0
- // = cloud, 1 = gray, 2 = downloading, 3 = full.
+ // State machine for rezzed status.
+ // Statuses are -1 on startup, 0 = cloud, 1 = gray, 2 = downloading, 3 = full.
// Purpose is to collect time data for each it takes avatar to reach
// various loading landmarks: gray, textured (partial), textured fully.
@@ -8067,10 +8073,10 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
{
LL_DEBUGS("Avatar") << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << LL_ENDL;
- if (mLastRezzedStatus == -1 && rez_status != -1)
+ if (mLastRezzedStatus == AV_REZZED_UNKNOWN && rez_status != AV_REZZED_UNKNOWN)
{
// First time initialization, start all timers.
- for (S32 i = 1; i < 4; i++)
+ for (ERezzedStatus i = AV_REZZED_GRAY; i <= AV_REZZED_FULL; ++(S32&)i)
{
startPhase("load_" + LLVOAvatar::rezStatusToString(i));
startPhase("first_load_" + LLVOAvatar::rezStatusToString(i));
@@ -8079,7 +8085,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 (ERezzedStatus i = next(rez_status); i <= mLastRezzedStatus; ++(S32&)i)
{
startPhase("load_" + LLVOAvatar::rezStatusToString(i));
}
@@ -8087,12 +8093,12 @@ 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 (ERezzedStatus i = llmax(next(mLastRezzedStatus), AV_REZZED_GRAY); i <= rez_status; ++(S32&)i)
{
stopPhase("load_" + LLVOAvatar::rezStatusToString(i));
stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false);
}
- if (rez_status == 3)
+ if (rez_status == AV_REZZED_FULL)
{
// "fully loaded", mark any pending appearance change complete.
selfStopPhase("update_appearance_from_cof");
@@ -8102,6 +8108,7 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
updateVisualComplexity();
}
}
+
mLastRezzedStatus = rez_status;
}
}
@@ -8232,18 +8239,18 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse
// returns true if the value has changed.
BOOL LLVOAvatar::updateIsFullyLoaded()
{
- S32 rez_status = getRezzedStatus();
+ ERezzedStatus rez_status = getRezzedStatus();
bool loading = getIsCloud();
if (mFirstFullyVisible && !mIsControlAvatar)
{
- loading = ((rez_status < 2)
+ loading = ((rez_status < AV_REZZED_TEXTURED)
// Wait at least 60s for unfinished textures to finish on first load,
// don't wait forever, it might fail. Even if it will eventually load by
// itself and update mLoadedCallbackTextures (or fail and clean the list),
// avatars are more time-sensitive than textures and can't wait that long.
|| (mLoadedCallbackTextures < mCallbackTextureList.size() && mLastTexCallbackAddedTime.getElapsedTimeF32() < MAX_TEXTURE_WAIT_TIME_SEC)
|| !mPendingAttachment.empty()
- || (rez_status < 3 && !isFullyBaked())
+ || (rez_status < AV_REZZED_FULL && !isFullyBaked())
|| hasPendingAttachedMeshes()
);
}
@@ -8283,56 +8290,53 @@ void LLVOAvatar::updateRuthTimer(bool loading)
BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
{
- // 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).
- // And if viewer isn't aware of some parts yet, this gives them a chance
- // to arrive.
- const F32 LOADED_DELAY = 1.f;
-
if (loading)
{
mFullyLoadedTimer.reset();
+ mFullyLoaded = false;
}
-
- if (mFirstFullyVisible)
+ else if (!mFullyLoaded)
{
- if (!isSelf() && loading)
+ // 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, LODs to load.
+ const F32 LOADED_DELAY = 1.f;
+
+ F32 delay = LOADED_DELAY;
+ if (mFirstFullyVisible && !isSelf() && loading)
{
- // Note that textures can causes 60s delay on thier own
- // so this delay might end up on top of textures' delay
- mFirstUseDelaySeconds = llclamp(
- mFirstAppearanceMessageTimer.getElapsedTimeF32(),
- FIRST_APPEARANCE_CLOUD_MIN_DELAY,
- FIRST_APPEARANCE_CLOUD_MAX_DELAY);
+ delay = mFirstAppearanceMessageTimer.getElapsedTimeF32();
+ // Note that textures can causes 60s delay on thier own
+ // so this delay might end up on top of textures' delay
+ 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
- mFirstUseDelaySeconds *= 1.25;
- }
+ if (shouldImpostor())
+ {
+ // Impostors are less of a priority,
+ // let them stay cloud longer
+ delay *= 1.25;
+ }
}
- mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > mFirstUseDelaySeconds);
- }
- else
- {
- mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > LOADED_DELAY);
- }
- if (!mPreviousFullyLoaded && !loading && mFullyLoaded)
- {
- debugAvatarRezTime("AvatarRezNotification","fully loaded");
+ mFullyLoaded = mFullyLoadedTimer.getElapsedTimeF32() > delay;
+
+ if (!mPreviousFullyLoaded && !loading && mFullyLoaded)
+ {
+ debugAvatarRezTime("AvatarRezNotification", "fully loaded");
+ }
}
// 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);
+ (fully_loaded_changed || // 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
mPreviousFullyLoaded = mFullyLoaded;
mFullyLoadedInitialized = TRUE;
@@ -8350,6 +8354,7 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
mNeedsImpostorUpdate = TRUE;
mLastImpostorUpdateReason = 6;
}
+
return changed;
}
@@ -9222,12 +9227,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)
@@ -9409,7 +9414,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;
@@ -10041,17 +10046,13 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
std::string outprefix(prefix);
if (outprefix.empty())
{
- outprefix = getFullname() + (isSelf()?"_s":"_o");
+ outprefix = getDebugName() + (isSelf() ? "_s" : "_o");
}
- if (outprefix.empty())
- {
- outprefix = std::string("new_archetype");
- }
- 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();
@@ -10550,7 +10551,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;
std::vector<LLVOVolume*> volumes;
@@ -10588,7 +10589,7 @@ void LLVOAvatar::updateRiggingInfo()
}
//LL_INFOS() << "done update rig count is " << countRigInfoTab(mJointRiggingInfoTab) << LL_ENDL;
- LL_DEBUGS("RigSpammish") << getFullname() << " after update rig tab:" << LL_ENDL;
+ LL_DEBUGS("RigSpammish") << getDebugName() << " after update rig tab:" << LL_ENDL;
S32 joint_count, box_count;
showRigInfoTabExtents(this, mJointRiggingInfoTab, joint_count, box_count);
LL_DEBUGS("RigSpammish") << "uses " << joint_count << " joints " << " nonzero boxes: " << box_count << LL_ENDL;