summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-07-27 12:53:54 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-07-27 12:53:54 -0700
commit3e038cd71b3f3bc74d206267e451773fb963d258 (patch)
tree63cdafa4fdcce40bf64ed65ddbf18519bf6b566b /indra/newview/llvoavatar.cpp
parentf82d0b171964a0b24ab0eca64febc0c1e3821138 (diff)
parent364566924188c7aed5d391bf9a226fc4779ba020 (diff)
Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-release.
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp805
1 files changed, 479 insertions, 326 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 82dadf1dc8..e5362261cf 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -102,6 +102,8 @@
#include "llvoicevisualizer.h" // Ventrella
#include "lldebugmessagebox.h"
+#include "llsdutil.h"
+
extern F32 SPEED_ADJUST_MAX;
extern F32 SPEED_ADJUST_MAX_SEC;
extern F32 ANIM_SPEED_MAX;
@@ -243,10 +245,10 @@ struct LLVOAvatarCollisionVolumeInfo : public LLInitParam::Block<LLVOAvatarColli
};
struct LLVOAvatarChildJoint : public LLInitParam::ChoiceBlock<LLVOAvatarChildJoint>
-{
+ {
Alternative<Lazy<struct LLVOAvatarBoneInfo, IS_A_BLOCK> > bone;
Alternative<LLVOAvatarCollisionVolumeInfo> collision_volume;
-
+
LLVOAvatarChildJoint()
: bone("bone"),
collision_volume("collision_volume")
@@ -638,7 +640,6 @@ F32 LLVOAvatar::sLODFactor = 1.f;
F32 LLVOAvatar::sPhysicsLODFactor = 1.f;
BOOL LLVOAvatar::sUseImpostors = FALSE;
BOOL LLVOAvatar::sJointDebug = FALSE;
-
F32 LLVOAvatar::sUnbakedTime = 0.f;
F32 LLVOAvatar::sUnbakedUpdateTime = 0.f;
F32 LLVOAvatar::sGreyTime = 0.f;
@@ -694,13 +695,16 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mNeedsSkin(FALSE),
mLastSkinTime(0.f),
mUpdatePeriod(1),
+ mFirstFullyVisible(TRUE),
mFullyLoaded(FALSE),
mPreviousFullyLoaded(FALSE),
mFullyLoadedInitialized(FALSE),
mSupportsAlphaLayers(FALSE),
mLoadedCallbacksPaused(FALSE),
mHasPelvisOffset( FALSE ),
- mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar"))
+ mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar")),
+ mLastRezzedStatus(-1)
+
{
LLMemType mt(LLMemType::MTYPE_AVATAR);
//VTResume(); // VTune
@@ -785,32 +789,46 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mLastPelvisFixup = 0.0f;
}
+std::string LLVOAvatar::avString() const
+{
+ std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus());
+ return " Avatar '" + getFullname() + "' " + viz_string + " ";
+}
+
+void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment)
+{
+ LL_INFOS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32()
+ << "sec ]"
+ << avString()
+ << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32()
+ << " Notification " << notification_name
+ << " : " << comment
+ << llendl;
+
+ if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
+ {
+ LLSD args;
+ args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
+ args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32());
+ args["NAME"] = getFullname();
+ LLNotificationsUtil::add(notification_name,args);
+ }
+}
+
//------------------------------------------------------------------------
// LLVOAvatar::~LLVOAvatar()
//------------------------------------------------------------------------
LLVOAvatar::~LLVOAvatar()
{
- if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
- {
if (!mFullyLoaded)
{
- llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' left after " << (U32)mRuthDebugTimer.getElapsedTimeF32() << " seconds as cloud." << llendl;
- LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
- args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32());
- args["NAME"] = getFullname();
- LLNotificationsUtil::add("AvatarRezLeftCloudNotification",args);
+ debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud");
}
else
{
- llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' left." << llendl;
- LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
- args["NAME"] = getFullname();
- LLNotificationsUtil::add("AvatarRezLeftNotification",args);
+ debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding");
}
- }
lldebugs << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << llendl;
mRoot.removeAllChildren();
@@ -859,6 +877,8 @@ LLVOAvatar::~LLVOAvatar()
mAnimationSources.clear();
LLLoadedCallbackEntry::cleanUpCallbackList(&mCallbackTextureList) ;
+ getPhases().clearPhases();
+
lldebugs << "LLVOAvatar Destructor end" << llendl;
}
@@ -896,6 +916,55 @@ BOOL LLVOAvatar::isFullyBaked()
return TRUE;
}
+BOOL LLVOAvatar::isFullyTextured() const
+{
+ for (S32 i = 0; i < mMeshLOD.size(); i++)
+ {
+ LLViewerJoint* joint = (LLViewerJoint*) mMeshLOD[i];
+ if (i==MESH_ID_SKIRT && !isWearingWearableType(LLWearableType::WT_SKIRT))
+ {
+ continue; // don't care about skirt textures if we're not wearing one.
+ }
+ if (!joint)
+ {
+ continue; // nonexistent LOD OK.
+ }
+ std::vector<LLViewerJointMesh*>::iterator meshIter = joint->mMeshParts.begin();
+ if (meshIter != joint->mMeshParts.end())
+ {
+ LLViewerJointMesh *mesh = (LLViewerJointMesh *) *meshIter;
+ if (!mesh)
+ {
+ continue; // nonexistent mesh OK
+ }
+ if (mesh->mTexture.notNull() && mesh->mTexture->hasGLTexture())
+ {
+ continue; // Mesh exists and has a baked texture.
+ }
+ if (mesh->mLayerSet && mesh->mLayerSet->hasComposite())
+ {
+ continue; // Mesh exists and has a composite texture.
+ }
+ // Fail
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+BOOL LLVOAvatar::hasGray() const
+{
+ return !getIsCloud() && !isFullyTextured();
+}
+
+S32 LLVOAvatar::getRezzedStatus() const
+{
+ if (getIsCloud()) return 0;
+ if (isFullyTextured()) return 2;
+ llassert(hasGray());
+ return 1; // gray
+}
+
void LLVOAvatar::deleteLayerSetCaches(bool clearAll)
{
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
@@ -911,7 +980,7 @@ void LLVOAvatar::deleteLayerSetCaches(bool clearAll)
}
if (mBakedTextureDatas[i].mMaskTexName)
{
- glDeleteTextures(1, (GLuint*)&(mBakedTextureDatas[i].mMaskTexName));
+ LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 0, -1, 1, (GLuint*)&(mBakedTextureDatas[i].mMaskTexName));
mBakedTextureDatas[i].mMaskTexName = 0 ;
}
}
@@ -943,6 +1012,31 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars)
}
// static
+void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts)
+{
+ counts.clear();
+ counts.resize(3);
+ for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
+ iter != LLCharacter::sInstances.end(); ++iter)
+ {
+ LLVOAvatar* inst = (LLVOAvatar*) *iter;
+ if (!inst)
+ continue;
+ 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 "textured";
+ return "unknown";
+}
+
+// static
void LLVOAvatar::dumpBakedStatus()
{
LLVector3d camera_pos_global = gAgentCamera.getCameraPositionGlobal();
@@ -1660,7 +1754,7 @@ BOOL LLVOAvatar::parseSkeletonFile(const std::string& filename)
//-------------------------------------------------------------------------
// parse the file
//-------------------------------------------------------------------------
-
+
LLXMLNodePtr skeleton_xml;
BOOL parsesuccess = LLXMLNode::parseFile(filename, skeleton_xml, NULL);
@@ -1731,7 +1825,7 @@ BOOL LLVOAvatar::setupBone(const LLVOAvatarChildJoint& info, LLViewerJoint* pare
{
return FALSE;
}
- }
+ }
}
else // collision volume
{
@@ -1792,9 +1886,9 @@ BOOL LLVOAvatar::buildSkeleton(const LLVOAvatarSkeletonInfo *info)
if (!setupBone(info->skeleton_root, NULL, current_volume_num, current_joint_num))
{
- llerrs << "Error parsing bone in skeleton file" << llendl;
- return FALSE;
- }
+ llerrs << "Error parsing bone in skeleton file" << llendl;
+ return FALSE;
+ }
return TRUE;
}
@@ -2004,13 +2098,19 @@ void LLVOAvatar::releaseMeshData()
if (mDrawable.notNull())
{
LLFace* facep = mDrawable->getFace(0);
+ if (facep)
+ {
facep->setSize(0, 0);
for(S32 i = mNumInitFaces ; i < mDrawable->getNumFaces(); i++)
{
facep = mDrawable->getFace(i);
+ if (facep)
+ {
facep->setSize(0, 0);
}
}
+ }
+ }
for (attachment_map_t::iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
@@ -2093,15 +2193,20 @@ void LLVOAvatar::updateMeshData()
part_index-- ;
}
- LLFace* facep ;
+ LLFace* facep = NULL;
if(f_num < mDrawable->getNumFaces())
{
facep = mDrawable->getFace(f_num);
}
else
{
- facep = mDrawable->addFace(mDrawable->getFace(0)->getPool(), mDrawable->getFace(0)->getTexture()) ;
+ facep = mDrawable->getFace(0);
+ if (facep)
+ {
+ facep = mDrawable->addFace(facep->getPool(), facep->getTexture()) ;
+ }
}
+ if (!facep) continue;
// resize immediately
facep->setSize(num_vertices, num_indices);
@@ -2252,18 +2357,12 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys,
U32 retval = LLViewerObject::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp);
// Print out arrival information once we have name of avatar.
- if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
- {
if (has_name && getNVPair("FirstName"))
{
mDebugExistenceTimer.reset();
- LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
- args["NAME"] = getFullname();
- LLNotificationsUtil::add("AvatarRezArrivedNotification",args);
- llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' arrived." << llendl;
+ debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived");
}
- }
+
if(retval & LLViewerObject::INVALID_UPDATE)
{
if (isSelf())
@@ -2773,16 +2872,16 @@ void LLVOAvatar::idleUpdateLoadingEffect()
// update visibility when avatar is partially loaded
if (updateIsFullyLoaded()) // changed?
{
- if (isFullyLoaded() && isSelf())
+ if (isFullyLoaded() && mFirstFullyVisible && isSelf())
{
- static bool first_fully_visible = true;
- if (first_fully_visible)
- {
- llinfos << "self isFullyLoaded, first_fully_visible" << llendl;
-
- first_fully_visible = false;
+ LL_INFOS("Avatar") << avString() << "self isFullyLoaded, mFirstFullyVisible" << LL_ENDL;
+ mFirstFullyVisible = FALSE;
LLAppearanceMgr::instance().onFirstFullyVisible();
}
+ if (isFullyLoaded() && mFirstFullyVisible && !isSelf())
+ {
+ LL_INFOS("Avatar") << avString() << "other isFullyLoaded, mFirstFullyVisible" << LL_ENDL;
+ mFirstFullyVisible = FALSE;
}
if (isFullyLoaded())
{
@@ -2926,43 +3025,43 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
return;
}
- BOOL new_name = FALSE;
- if (visible_chat != mVisibleChat)
- {
- mVisibleChat = visible_chat;
- new_name = TRUE;
- }
+ BOOL new_name = FALSE;
+ if (visible_chat != mVisibleChat)
+ {
+ mVisibleChat = visible_chat;
+ new_name = TRUE;
+ }
- if (sRenderGroupTitles != mRenderGroupTitles)
- {
- mRenderGroupTitles = sRenderGroupTitles;
- new_name = TRUE;
- }
-
- // First Calculate Alpha
- // If alpha > 0, create mNameText if necessary, otherwise delete it
- F32 alpha = 0.f;
- if (mAppAngle > 5.f)
+ if (sRenderGroupTitles != mRenderGroupTitles)
{
- const F32 START_FADE_TIME = NAME_SHOW_TIME - FADE_DURATION;
- if (!visible_chat && sRenderName == RENDER_NAME_FADE && time_visible > START_FADE_TIME)
+ mRenderGroupTitles = sRenderGroupTitles;
+ new_name = TRUE;
+ }
+
+ // First Calculate Alpha
+ // If alpha > 0, create mNameText if necessary, otherwise delete it
+ F32 alpha = 0.f;
+ if (mAppAngle > 5.f)
{
- alpha = 1.f - (time_visible - START_FADE_TIME) / FADE_DURATION;
+ const F32 START_FADE_TIME = NAME_SHOW_TIME - FADE_DURATION;
+ if (!visible_chat && sRenderName == RENDER_NAME_FADE && time_visible > START_FADE_TIME)
+ {
+ alpha = 1.f - (time_visible - START_FADE_TIME) / FADE_DURATION;
+ }
+ else
+ {
+ // ...not fading, full alpha
+ alpha = 1.f;
+ }
}
- else
+ else if (mAppAngle > 2.f)
{
- // ...not fading, full alpha
- alpha = 1.f;
+ // far away is faded out also
+ alpha = (mAppAngle-2.f)/3.f;
}
- }
- else if (mAppAngle > 2.f)
- {
- // far away is faded out also
- alpha = (mAppAngle-2.f)/3.f;
- }
if (alpha <= 0.f)
- {
+ {
if (mNameText)
{
mNameText->markDead();
@@ -2972,19 +3071,19 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
return;
}
- if (!mNameText)
- {
+ if (!mNameText)
+ {
mNameText = static_cast<LLHUDNameTag*>( LLHUDObject::addHUDObject(
LLHUDObject::LL_HUD_NAME_TAG) );
//mNameText->setMass(10.f);
- mNameText->setSourceObject(this);
+ mNameText->setSourceObject(this);
mNameText->setVertAlignment(LLHUDNameTag::ALIGN_VERT_TOP);
- mNameText->setVisibleOffScreen(TRUE);
- mNameText->setMaxLines(11);
- mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f);
- sNumVisibleChatBubbles++;
- new_name = TRUE;
- }
+ mNameText->setVisibleOffScreen(TRUE);
+ mNameText->setMaxLines(11);
+ mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f);
+ sNumVisibleChatBubbles++;
+ new_name = TRUE;
+ }
idleUpdateNameTagPosition(root_pos_last);
idleUpdateNameTagText(new_name);
@@ -3015,208 +3114,202 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
bool is_friend = LLAvatarTracker::instance().isBuddy(getID());
bool is_cloud = getIsCloud();
- if (gSavedSettings.getBOOL("DebugAvatarRezTime")
- && is_appearance != mNameAppearance)
+ if (is_appearance != mNameAppearance)
{
- LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
- args["NAME"] = getFullname();
if (is_appearance)
{
- LLNotificationsUtil::add("AvatarRezEnteredAppearanceNotification",args);
- llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' entered appearance mode." << llendl;
+ debugAvatarRezTime("AvatarRezEnteredAppearanceNotification","entered appearance mode");
}
else
{
- LLNotificationsUtil::add("AvatarRezLeftAppearanceNotification",args);
- llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' left appearance mode." << llendl;
+ debugAvatarRezTime("AvatarRezLeftAppearanceNotification","left appearance mode");
}
- }
- // Rebuild name tag if state change detected
- if (mNameString.empty()
- || new_name
- || (!title && !mTitle.empty())
- || (title && mTitle != title->getString())
- || is_away != mNameAway
- || is_busy != mNameBusy
- || is_muted != mNameMute
- || is_appearance != mNameAppearance
- || is_friend != mNameFriend
- || is_cloud != mNameCloud)
- {
- LLColor4 name_tag_color = getNameTagColor(is_friend);
+ // Rebuild name tag if state change detected
+ if (mNameString.empty()
+ || new_name
+ || (!title && !mTitle.empty())
+ || (title && mTitle != title->getString())
+ || is_away != mNameAway
+ || is_busy != mNameBusy
+ || is_muted != mNameMute
+ || is_appearance != mNameAppearance
+ || is_friend != mNameFriend
+ || is_cloud != mNameCloud)
+ {
+ LLColor4 name_tag_color = getNameTagColor(is_friend);
- clearNameTag();
+ clearNameTag();
- if (is_away || is_muted || is_busy || is_appearance)
- {
- std::string line;
- if (is_away)
- {
- line += LLTrans::getString("AvatarAway");
- line += ", ";
- }
- if (is_busy)
- {
- line += LLTrans::getString("AvatarBusy");
- line += ", ";
- }
- if (is_muted)
- {
- line += LLTrans::getString("AvatarMuted");
- line += ", ";
- }
- if (is_appearance)
+ if (is_away || is_muted || is_busy || is_appearance)
{
- line += LLTrans::getString("AvatarEditingAppearance");
- line += ", ";
+ std::string line;
+ if (is_away)
+ {
+ line += LLTrans::getString("AvatarAway");
+ line += ", ";
+ }
+ if (is_busy)
+ {
+ line += LLTrans::getString("AvatarBusy");
+ line += ", ";
+ }
+ if (is_muted)
+ {
+ line += LLTrans::getString("AvatarMuted");
+ line += ", ";
+ }
+ if (is_appearance)
+ {
+ line += LLTrans::getString("AvatarEditingAppearance");
+ line += ", ";
+ }
+ if (is_cloud)
+ {
+ line += LLTrans::getString("LoadingData");
+ line += ", ";
+ }
+ // trim last ", "
+ line.resize( line.length() - 2 );
+ addNameTagLine(line, name_tag_color, LLFontGL::NORMAL,
+ LLFontGL::getFontSansSerifSmall());
}
- if (is_cloud)
+
+ if (sRenderGroupTitles
+ && title && title->getString() && title->getString()[0] != '\0')
{
- line += LLTrans::getString("LoadingData");
- line += ", ";
+ std::string title_str = title->getString();
+ LLStringFn::replace_ascii_controlchars(title_str,LL_UNKNOWN_CHAR);
+ addNameTagLine(title_str, name_tag_color, LLFontGL::NORMAL,
+ LLFontGL::getFontSansSerifSmall());
}
- // trim last ", "
- line.resize( line.length() - 2 );
- addNameTagLine(line, name_tag_color, LLFontGL::NORMAL,
- LLFontGL::getFontSansSerifSmall());
- }
- if (sRenderGroupTitles
- && title && title->getString() && title->getString()[0] != '\0')
- {
- std::string title_str = title->getString();
- LLStringFn::replace_ascii_controlchars(title_str,LL_UNKNOWN_CHAR);
- addNameTagLine(title_str, name_tag_color, LLFontGL::NORMAL,
- LLFontGL::getFontSansSerifSmall());
- }
-
- static LLUICachedControl<bool> show_display_names("NameTagShowDisplayNames");
- static LLUICachedControl<bool> show_usernames("NameTagShowUsernames");
+ static LLUICachedControl<bool> show_display_names("NameTagShowDisplayNames");
+ static LLUICachedControl<bool> show_usernames("NameTagShowUsernames");
- if (LLAvatarNameCache::useDisplayNames())
- {
- LLAvatarName av_name;
- if (!LLAvatarNameCache::get(getID(), &av_name))
+ if (LLAvatarNameCache::useDisplayNames())
{
- // ...call this function back when the name arrives
- // and force a rebuild
- LLAvatarNameCache::get(getID(),
- boost::bind(&LLVOAvatar::clearNameTag, this));
- }
+ LLAvatarName av_name;
+ if (!LLAvatarNameCache::get(getID(), &av_name))
+ {
+ // ...call this function back when the name arrives
+ // and force a rebuild
+ LLAvatarNameCache::get(getID(),
+ boost::bind(&LLVOAvatar::clearNameTag, this));
+ }
- // Might be blank if name not available yet, that's OK
- if (show_display_names)
- {
- addNameTagLine(av_name.mDisplayName, name_tag_color, LLFontGL::NORMAL,
- LLFontGL::getFontSansSerif());
+ // Might be blank if name not available yet, that's OK
+ if (show_display_names)
+ {
+ addNameTagLine(av_name.mDisplayName, name_tag_color, LLFontGL::NORMAL,
+ LLFontGL::getFontSansSerif());
+ }
+ // Suppress SLID display if display name matches exactly (ugh)
+ if (show_usernames && !av_name.mIsDisplayNameDefault)
+ {
+ // *HACK: Desaturate the color
+ LLColor4 username_color = name_tag_color * 0.83f;
+ addNameTagLine(av_name.mUsername, username_color, LLFontGL::NORMAL,
+ LLFontGL::getFontSansSerifSmall());
+ }
}
- // Suppress SLID display if display name matches exactly (ugh)
- if (show_usernames && !av_name.mIsDisplayNameDefault)
+ else
{
- // *HACK: Desaturate the color
- LLColor4 username_color = name_tag_color * 0.83f;
- addNameTagLine(av_name.mUsername, username_color, LLFontGL::NORMAL,
- LLFontGL::getFontSansSerifSmall());
+ const LLFontGL* font = LLFontGL::getFontSansSerif();
+ std::string full_name = LLCacheName::buildFullName( firstname->getString(), lastname->getString() );
+ addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, font);
}
- }
- else
- {
- const LLFontGL* font = LLFontGL::getFontSansSerif();
- std::string full_name = LLCacheName::buildFullName( firstname->getString(), lastname->getString() );
- addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, font);
- }
-
- mNameAway = is_away;
- mNameBusy = is_busy;
- mNameMute = is_muted;
- mNameAppearance = is_appearance;
- mNameFriend = is_friend;
- mNameCloud = is_cloud;
- mTitle = title ? title->getString() : "";
- LLStringFn::replace_ascii_controlchars(mTitle, LL_UNKNOWN_CHAR);
- new_name = TRUE;
- }
- if (mVisibleChat)
- {
- mNameText->setFont(LLFontGL::getFontSansSerif());
- mNameText->setTextAlignment(LLHUDNameTag::ALIGN_TEXT_LEFT);
- mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f);
-
- char line[MAX_STRING]; /* Flawfinder: ignore */
- line[0] = '\0';
- 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);
- if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES)
- {
- ++chat_iter;
+ mNameAway = is_away;
+ mNameBusy = is_busy;
+ mNameMute = is_muted;
+ mNameAppearance = is_appearance;
+ mNameFriend = is_friend;
+ mNameCloud = is_cloud;
+ mTitle = title ? title->getString() : "";
+ LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR);
+ new_name = TRUE;
}
- for(; chat_iter != mChats.end(); ++chat_iter)
+ if (mVisibleChat)
{
- F32 chat_fade_amt = llclamp((F32)((LLFrameTimer::getElapsedSeconds() - chat_iter->mTime) / CHAT_FADE_TIME), 0.f, 4.f);
- LLFontGL::StyleFlags style;
- switch(chat_iter->mChatType)
- {
- case CHAT_TYPE_WHISPER:
- style = LLFontGL::ITALIC;
- break;
- case CHAT_TYPE_SHOUT:
- style = LLFontGL::BOLD;
- break;
- default:
- style = LLFontGL::NORMAL;
- break;
- }
- if (chat_fade_amt < 1.f)
+ mNameText->setFont(LLFontGL::getFontSansSerif());
+ mNameText->setTextAlignment(LLHUDNameTag::ALIGN_TEXT_LEFT);
+ mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f);
+
+ char line[MAX_STRING]; /* Flawfinder: ignore */
+ line[0] = '\0';
+ 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);
+ if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES)
{
- F32 u = clamp_rescale(chat_fade_amt, 0.9f, 1.f, 0.f, 1.f);
- mNameText->addLine(chat_iter->mText, lerp(new_chat, normal_chat, u), style);
+ ++chat_iter;
}
- else if (chat_fade_amt < 2.f)
+
+ for(; chat_iter != mChats.end(); ++chat_iter)
{
- F32 u = clamp_rescale(chat_fade_amt, 1.9f, 2.f, 0.f, 1.f);
- mNameText->addLine(chat_iter->mText, lerp(normal_chat, old_chat, u), style);
+ F32 chat_fade_amt = llclamp((F32)((LLFrameTimer::getElapsedSeconds() - chat_iter->mTime) / CHAT_FADE_TIME), 0.f, 4.f);
+ LLFontGL::StyleFlags style;
+ switch(chat_iter->mChatType)
+ {
+ case CHAT_TYPE_WHISPER:
+ style = LLFontGL::ITALIC;
+ break;
+ case CHAT_TYPE_SHOUT:
+ style = LLFontGL::BOLD;
+ break;
+ default:
+ style = LLFontGL::NORMAL;
+ break;
+ }
+ if (chat_fade_amt < 1.f)
+ {
+ F32 u = clamp_rescale(chat_fade_amt, 0.9f, 1.f, 0.f, 1.f);
+ mNameText->addLine(chat_iter->mText, lerp(new_chat, normal_chat, u), style);
+ }
+ else if (chat_fade_amt < 2.f)
+ {
+ F32 u = clamp_rescale(chat_fade_amt, 1.9f, 2.f, 0.f, 1.f);
+ mNameText->addLine(chat_iter->mText, lerp(normal_chat, old_chat, u), style);
+ }
+ else if (chat_fade_amt < 3.f)
+ {
+ // *NOTE: only remove lines down to minimum number
+ mNameText->addLine(chat_iter->mText, old_chat, style);
+ }
}
- else if (chat_fade_amt < 3.f)
+ mNameText->setVisibleOffScreen(TRUE);
+
+ if (mTyping)
{
- // *NOTE: only remove lines down to minimum number
- mNameText->addLine(chat_iter->mText, old_chat, style);
+ S32 dot_count = (llfloor(mTypingTimer.getElapsedTimeF32() * 3.f) + 2) % 3 + 1;
+ switch(dot_count)
+ {
+ case 1:
+ mNameText->addLine(".", new_chat);
+ break;
+ case 2:
+ mNameText->addLine("..", new_chat);
+ break;
+ case 3:
+ mNameText->addLine("...", new_chat);
+ break;
+ }
+
}
}
- mNameText->setVisibleOffScreen(TRUE);
-
- if (mTyping)
+ else
{
- S32 dot_count = (llfloor(mTypingTimer.getElapsedTimeF32() * 3.f) + 2) % 3 + 1;
- switch(dot_count)
- {
- case 1:
- mNameText->addLine(".", new_chat);
- break;
- case 2:
- mNameText->addLine("..", new_chat);
- break;
- case 3:
- mNameText->addLine("...", new_chat);
- break;
- }
-
+ // ...not using chat bubbles, just names
+ mNameText->setTextAlignment(LLHUDNameTag::ALIGN_TEXT_CENTER);
+ mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f);
+ mNameText->setVisibleOffScreen(FALSE);
}
}
- else
- {
- // ...not using chat bubbles, just names
- mNameText->setTextAlignment(LLHUDNameTag::ALIGN_TEXT_CENTER);
- mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f);
- mNameText->setVisibleOffScreen(FALSE);
- }
}
void LLVOAvatar::addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font)
@@ -3341,7 +3434,7 @@ LLColor4 LLVOAvatar::getNameTagColor(bool is_friend)
else
{
color_name = "NameTagMismatch";
- }
+ }
}
else
{
@@ -3434,7 +3527,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
{
mTimeVisible.reset();
}
-
+
//--------------------------------------------------------------------
// the rest should only be done occasionally for far away avatars
//--------------------------------------------------------------------
@@ -3969,7 +4062,7 @@ void LLVOAvatar::updateVisibility()
LLNameValue* firstname = getNVPair("FirstName");
if (firstname)
{
- llinfos << "Avatar " << firstname->getString() << " updating visiblity" << llendl;
+ LL_DEBUGS("Avatar") << avString() << " updating visibility" << LL_ENDL;
}
else
{
@@ -4088,11 +4181,11 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
{ //LOD changed or new mesh created, allocate new vertex buffer if needed
if (needs_rebuild || mDirtyMesh >= 2 || mVisibilityRank <= 4)
{
- updateMeshData();
+ updateMeshData();
mDirtyMesh = 0;
- mNeedsSkin = TRUE;
- mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY);
- }
+ mNeedsSkin = TRUE;
+ mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY);
+ }
}
if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) <= 0)
@@ -4117,13 +4210,17 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
mNeedsSkin = FALSE;
mLastSkinTime = gFrameTimeSeconds;
- LLVertexBuffer* vb = mDrawable->getFace(0)->getVertexBuffer();
+ LLFace * face = mDrawable->getFace(0);
+ if (face)
+ {
+ LLVertexBuffer* vb = face->getVertexBuffer();
if (vb)
{
vb->flush();
}
}
}
+ }
else
{
mNeedsSkin = FALSE;
@@ -4134,7 +4231,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass)
LLNameValue* firstname = getNVPair("FirstName");
if (firstname)
{
- llinfos << "Avatar " << firstname->getString() << " in render" << llendl;
+ LL_DEBUGS("Avatar") << avString() << " in render" << LL_ENDL;
}
else
{
@@ -5753,35 +5850,35 @@ BOOL LLVOAvatar::updateJointLODs()
F32 avatar_num_factor = clamp_rescale((F32)sNumVisibleAvatars, 8, 25, 1.f, avatar_num_min_factor);
F32 area_scale = 0.16f;
- if (isSelf())
- {
- if(gAgentCamera.cameraCustomizeAvatar() || gAgentCamera.cameraMouselook())
+ if (isSelf())
+ {
+ if(gAgentCamera.cameraCustomizeAvatar() || gAgentCamera.cameraMouselook())
+ {
+ mAdjustedPixelArea = MAX_PIXEL_AREA;
+ }
+ else
+ {
+ mAdjustedPixelArea = mPixelArea*area_scale;
+ }
+ }
+ else if (mIsDummy)
{
mAdjustedPixelArea = MAX_PIXEL_AREA;
}
else
{
- mAdjustedPixelArea = mPixelArea*area_scale;
+ // reported avatar pixel area is dependent on avatar render load, based on number of visible avatars
+ mAdjustedPixelArea = (F32)mPixelArea * area_scale * lod_factor * lod_factor * avatar_num_factor * avatar_num_factor;
}
- }
- else if (mIsDummy)
- {
- mAdjustedPixelArea = MAX_PIXEL_AREA;
- }
- else
- {
- // reported avatar pixel area is dependent on avatar render load, based on number of visible avatars
- mAdjustedPixelArea = (F32)mPixelArea * area_scale * lod_factor * lod_factor * avatar_num_factor * avatar_num_factor;
- }
- // now select meshes to render based on adjusted pixel area
- BOOL res = mRoot.updateLOD(mAdjustedPixelArea, TRUE);
- if (res)
- {
- sNumLODChangesThisFrame++;
- dirtyMesh(2);
- return TRUE;
- }
+ // now select meshes to render based on adjusted pixel area
+ BOOL res = mRoot.updateLOD(mAdjustedPixelArea, TRUE);
+ if (res)
+ {
+ sNumLODChangesThisFrame++;
+ dirtyMesh(2);
+ return TRUE;
+ }
return FALSE;
}
@@ -6073,20 +6170,20 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )
if (pSkinData
&& pSkinData->mJointNames.size() > 20 // full rig
&& pSkinData->mAlternateBindMatrix.size() > 0)
- {
- LLVOAvatar::resetJointPositionsToDefault();
- //Need to handle the repositioning of the cam, updating rig data etc during outfit editing
- //This handles the case where we detach a replacement rig.
- if ( gAgentCamera.cameraCustomizeAvatar() )
- {
- gAgent.unpauseAnimation();
- //Still want to refocus on head bone
- gAgentCamera.changeCameraToCustomizeAvatar();
+ {
+ LLVOAvatar::resetJointPositionsToDefault();
+ //Need to handle the repositioning of the cam, updating rig data etc during outfit editing
+ //This handles the case where we detach a replacement rig.
+ if ( gAgentCamera.cameraCustomizeAvatar() )
+ {
+ gAgent.unpauseAnimation();
+ //Still want to refocus on head bone
+ gAgentCamera.changeCameraToCustomizeAvatar();
+ }
+ }
}
}
}
- }
-}
//-----------------------------------------------------------------------------
// detachObject()
//-----------------------------------------------------------------------------
@@ -6337,10 +6434,10 @@ BOOL LLVOAvatar::isVisible() const
}
// Determine if we have enough avatar data to render
-BOOL LLVOAvatar::getIsCloud()
+BOOL LLVOAvatar::getIsCloud() const
{
// Do we have a shape?
- if (visualParamWeightsAreDefault())
+ if ((const_cast<LLVOAvatar*>(this))->visualParamWeightsAreDefault())
{
return TRUE;
}
@@ -6359,11 +6456,53 @@ BOOL LLVOAvatar::getIsCloud()
return FALSE;
}
+void LLVOAvatar::updateRezzedStatusTimers()
+{
+ // State machine for rezzed status. Statuses are 0 = cloud, 1 = gray, 2 = textured.
+ // Purpose is to collect time data for each period of cloud or cloud+gray.
+ S32 rez_status = getRezzedStatus();
+ if (rez_status != mLastRezzedStatus)
+ {
+ LL_DEBUGS("Avatar") << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << LL_ENDL;
+ bool is_cloud_or_gray = (rez_status==0 || rez_status==1);
+ bool was_cloud_or_gray = (mLastRezzedStatus==0 || mLastRezzedStatus==1);
+ bool is_cloud = (rez_status==0);
+ bool was_cloud = (mLastRezzedStatus==0);
+
+ // Non-cloud to cloud
+ if (is_cloud && !was_cloud)
+ {
+ // start cloud timer.
+ getPhases().startPhase("cloud");
+ }
+ else if (was_cloud && !is_cloud)
+ {
+ // stop cloud timer, which will capture stats.
+ getPhases().stopPhase("cloud");
+ }
+
+ // Non-cloud-or-gray to cloud-or-gray
+ if (is_cloud_or_gray && !was_cloud_or_gray)
+ {
+ // start cloud-or-gray timer.
+ getPhases().startPhase("cloud-or-gray");
+ }
+ else if (was_cloud_or_gray && !is_cloud_or_gray)
+ {
+ // stop cloud-or-gray timer, which will capture stats.
+ getPhases().stopPhase("cloud-or-gray");
+ }
+
+ mLastRezzedStatus = rez_status;
+ }
+}
+
// call periodically to keep isFullyLoaded up to date.
// returns true if the value has changed.
BOOL LLVOAvatar::updateIsFullyLoaded()
{
const BOOL loading = getIsCloud();
+ updateRezzedStatusTimers();
updateRuthTimer(loading);
return processFullyLoadedChange(loading);
}
@@ -6378,27 +6517,19 @@ void LLVOAvatar::updateRuthTimer(bool loading)
if (mPreviousFullyLoaded)
{
mRuthTimer.reset();
- if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
- {
- llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' became cloud." << llendl;
- LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
- args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32());
- args["NAME"] = getFullname();
- LLNotificationsUtil::add("AvatarRezCloudNotification",args);
- }
- mRuthDebugTimer.reset();
+ debugAvatarRezTime("AvatarRezCloudNotification","became cloud");
}
const F32 LOADING_TIMEOUT__SECONDS = 120.f;
if (mRuthTimer.getElapsedTimeF32() > LOADING_TIMEOUT__SECONDS)
{
- llinfos << "Ruth Timer timeout: Missing texture data for '" << getFullname() << "' "
+ LL_DEBUGS("Avatar") << avString()
+ << "Ruth Timer timeout: Missing texture data for '" << getFullname() << "' "
<< "( Params loaded : " << !visualParamWeightsAreDefault() << " ) "
<< "( Lower : " << isTextureDefined(TEX_LOWER_BAKED) << " ) "
<< "( Upper : " << isTextureDefined(TEX_UPPER_BAKED) << " ) "
<< "( Head : " << isTextureDefined(TEX_HEAD_BAKED) << " )."
- << llendl;
+ << LL_ENDL;
LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(getID());
mRuthTimer.reset();
@@ -6415,20 +6546,13 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE);
- if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
- {
if (!mPreviousFullyLoaded && !loading && mFullyLoaded)
{
- llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' resolved in " << (U32)mRuthDebugTimer.getElapsedTimeF32() << " seconds." << llendl;
- LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
- args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32());
- args["NAME"] = getFullname();
- LLNotificationsUtil::add("AvatarRezNotification",args);
- }
+ debugAvatarRezTime("AvatarRezNotification","fully loaded");
}
// did our loading state "change" from last call?
+ // runway - why are we updating every 30 calls even if nothing has changed?
const S32 UPDATE_RATE = 30;
BOOL changed =
((mFullyLoaded != mPreviousFullyLoaded) || // if the value is different from the previous call
@@ -6868,7 +6992,7 @@ LLColor4 LLVOAvatar::getDummyColor()
void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const
{
- llinfos << (isSelf() ? "Self: " : "Other: ") << context << llendl;
+ LL_DEBUGS("Avatar") << avString() << (isSelf() ? "Self: " : "Other: ") << context << LL_ENDL;
for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin();
iter != LLVOAvatarDictionary::getInstance()->getTextures().end();
++iter)
@@ -6878,23 +7002,23 @@ void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const
const LLViewerTexture* te_image = getImage(iter->first,0);
if( !te_image )
{
- llinfos << " " << texture_dict->mName << ": null ptr" << llendl;
+ LL_DEBUGS("Avatar") << avString() << " " << texture_dict->mName << ": null ptr" << LL_ENDL;
}
else if( te_image->getID().isNull() )
{
- llinfos << " " << texture_dict->mName << ": null UUID" << llendl;
+ LL_DEBUGS("Avatar") << avString() << " " << texture_dict->mName << ": null UUID" << LL_ENDL;
}
else if( te_image->getID() == IMG_DEFAULT )
{
- llinfos << " " << texture_dict->mName << ": IMG_DEFAULT" << llendl;
+ LL_DEBUGS("Avatar") << avString() << " " << texture_dict->mName << ": IMG_DEFAULT" << LL_ENDL;
}
else if( te_image->getID() == IMG_DEFAULT_AVATAR )
{
- llinfos << " " << texture_dict->mName << ": IMG_DEFAULT_AVATAR" << llendl;
+ LL_DEBUGS("Avatar") << avString() << " " << texture_dict->mName << ": IMG_DEFAULT_AVATAR" << LL_ENDL;
}
else
{
- llinfos << " " << texture_dict->mName << ": " << te_image->getID() << llendl;
+ LL_DEBUGS("Avatar") << avString() << " " << texture_dict->mName << ": " << te_image->getID() << LL_ENDL;
}
}
}
@@ -7021,6 +7145,7 @@ LLBBox LLVOAvatar::getHUDBBox() const
//-----------------------------------------------------------------------------
void LLVOAvatar::onFirstTEMessageReceived()
{
+ LL_INFOS("Avatar") << avString() << LL_ENDL;
if( !mFirstTEMessageReceived )
{
mFirstTEMessageReceived = TRUE;
@@ -7049,6 +7174,7 @@ void LLVOAvatar::onFirstTEMessageReceived()
image->setLoadedCallback( onBakedTextureMasksLoaded, MORPH_MASK_REQUESTED_DISCARD, TRUE, TRUE, new LLTextureMaskData( mID ),
src_callback_list, paused);
}
+ LL_DEBUGS("Avatar") << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << LL_ENDL;
image->setLoadedCallback( onInitialBakedTextureLoaded, MAX_DISCARD_LEVEL, FALSE, FALSE, new LLUUID( mID ),
src_callback_list, paused );
}
@@ -7107,14 +7233,16 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
LLMemType mt(LLMemType::MTYPE_AVATAR);
-// llinfos << "processAvatarAppearance start " << mID << llendl;
BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived;
-
mFirstAppearanceMessageReceived = TRUE;
+ LL_INFOS("Avatar") << avString() << "processAvatarAppearance start " << mID
+ << " first? " << is_first_appearance_message << " self? " << isSelf() << LL_ENDL;
+
+
if( isSelf() )
{
- llwarns << "Received AvatarAppearance for self" << llendl;
+ llwarns << avString() << "Received AvatarAppearance for self" << llendl;
if( mFirstTEMessageReceived )
{
// llinfos << "processAvatarAppearance end " << mID << llendl;
@@ -7145,7 +7273,10 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
}
- if( !is_first_appearance_message )
+ // runway - was
+ // if (!is_first_appearance_message )
+ // which means it would be called on second appearance message - probably wrong.
+ if (is_first_appearance_message )
{
onFirstTEMessageReceived();
}
@@ -7166,6 +7297,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing
if( num_blocks > 1 && !drop_visual_params_debug)
{
+ LL_DEBUGS("Avatar") << avString() << " handle visual params, num_blocks " << num_blocks << LL_ENDL;
BOOL params_changed = FALSE;
BOOL interp_params = FALSE;
@@ -7238,6 +7370,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
else
{
// AvatarAppearance message arrived without visual params
+ LL_DEBUGS("Avatar") << avString() << "no visual params" << LL_ENDL;
if (drop_visual_params_debug)
{
llinfos << "Debug-faked lack of parameters on AvatarAppearance for object: " << getID() << llendl;
@@ -7322,7 +7455,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture
}
U32 gl_name;
- LLImageGL::generateTextures(1, &gl_name );
+ LLImageGL::generateTextures(LLTexUnit::TT_TEXTURE, GL_ALPHA8, 1, &gl_name );
stop_glerror();
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, gl_name);
@@ -7359,7 +7492,7 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture
maskData->mLastDiscardLevel = discard_level;
if (self->mBakedTextureDatas[baked_index].mMaskTexName)
{
- LLImageGL::deleteTextures(1, &(self->mBakedTextureDatas[baked_index].mMaskTexName));
+ LLImageGL::deleteTextures(LLTexUnit::TT_TEXTURE, 0, -1, 1, &(self->mBakedTextureDatas[baked_index].mMaskTexName));
}
self->mBakedTextureDatas[baked_index].mMaskTexName = gl_name;
found_texture_id = true;
@@ -7390,9 +7523,16 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture
// static
void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata )
{
+
+
LLUUID *avatar_idp = (LLUUID *)userdata;
LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp);
+ if (selfp)
+ {
+ LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << LL_ENDL;
+ }
+
if (!success && selfp)
{
selfp->removeMissingBakedTextures();
@@ -7403,13 +7543,20 @@ void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerFetchedTextu
}
}
-void LLVOAvatar::onBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
+// Static
+void LLVOAvatar::onBakedTextureLoaded(BOOL success,
+ LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src,
+ S32 discard_level, BOOL final, void* userdata)
{
//llinfos << "onBakedTextureLoaded: " << src_vi->getID() << llendl;
LLUUID id = src_vi->getID();
LLUUID *avatar_idp = (LLUUID *)userdata;
LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp);
+ if (selfp)
+ {
+ LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << " id " << src_vi->getID() << LL_ENDL;
+ }
if (selfp && !success)
{
@@ -7436,6 +7583,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 );
if (id == image_baked->getID())
{
+ LL_DEBUGS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL;
mBakedTextureDatas[i].mIsLoaded = true;
mBakedTextureDatas[i].mLastTextureIndex = id;
mBakedTextureDatas[i].mIsUsed = true;
@@ -7610,6 +7758,9 @@ void LLVOAvatar::cullAvatarsByPixelArea()
}
}
+ // runway - this doesn't detect gray/grey state.
+ // think we just need to be checking self av since it's the only
+ // one with lltexlayer stuff.
S32 grey_avatars = 0;
if (LLVOAvatar::areAllNearbyInstancesBaked(grey_avatars))
{
@@ -8200,7 +8351,7 @@ BOOL LLVOAvatar::updateLOD()
BOOL res = updateJointLODs();
LLFace* facep = mDrawable->getFace(0);
- if (!facep->getVertexBuffer())
+ if (!facep || !facep->getVertexBuffer())
{
dirtyMesh(2);
}
@@ -8413,7 +8564,9 @@ void LLVOAvatar::idleUpdateRenderCost()
}
}
- setDebugText(llformat("%d", cost));
+
+ std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus());
+ setDebugText(llformat("%s %d", viz_string.c_str(), cost));
mVisualComplexity = cost;
F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f);
F32 red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f);