diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-04-15 15:00:13 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-04-15 15:00:13 -0400 |
commit | 384c954fb7f6fef583998f87968c01a831911a49 (patch) | |
tree | 8546f0e2801fabcead21062cd54326fb0792d819 /indra | |
parent | 7c170abf52813aa45e9bee656e3b5c12d7fbf47e (diff) |
EXT-6877 : Show avatar-as-cloud as "Loading..." in nametag
If you or others are a cloud, then your nametag will include a "(Loading...)" string.
Note: this required a small bit of code refactor so that you can query if an avatar (yourself or others) is a cloud; this was basically a rename from updateIsFullyLoaded into getIsCloud.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 54 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 4 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.h | 2 |
4 files changed, 43 insertions, 39 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f5e83ed025..981dd14093 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -655,6 +655,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mNameMute(FALSE), mRenderGroupTitles(sRenderGroupTitles), mNameAppearance(FALSE), + mNameCloud(FALSE), mFirstTEMessageReceived( FALSE ), mFirstAppearanceMessageReceived( FALSE ), mCulled( FALSE ), @@ -2769,25 +2770,20 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if (mNameText.notNull() && firstname && lastname) { - BOOL is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end(); - BOOL is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end(); - BOOL is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); - BOOL is_muted; - if (isSelf()) - { - is_muted = FALSE; - } - else - { - is_muted = LLMuteList::getInstance()->isMuted(getID()); - } + const BOOL is_away = mSignaledAnimations.find(ANIM_AGENT_AWAY) != mSignaledAnimations.end(); + const BOOL is_busy = mSignaledAnimations.find(ANIM_AGENT_BUSY) != mSignaledAnimations.end(); + const BOOL is_appearance = mSignaledAnimations.find(ANIM_AGENT_CUSTOMIZE) != mSignaledAnimations.end(); + const BOOL is_muted = isSelf() ? FALSE : LLMuteList::getInstance()->isMuted(getID()); + const BOOL is_cloud = getIsCloud(); 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_appearance != mNameAppearance + || is_cloud != mNameCloud + ) { std::string line; if (!sRenderGroupTitles) @@ -2841,7 +2837,12 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } line += ")"; } - if (is_appearance) + if (is_cloud) + { + line += "\n"; + line += "(" + LLTrans::getString("LoadingData") + ")"; + } + else if (is_appearance) { line += "\n"; line += LLTrans::getString("AvatarEditingAppearance"); @@ -2850,6 +2851,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) mNameBusy = is_busy; mNameMute = is_muted; mNameAppearance = is_appearance; + mNameCloud = is_cloud; mTitle = title ? title->getString() : ""; LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR); mNameString = utf8str_to_wstring(line); @@ -5823,27 +5825,29 @@ BOOL LLVOAvatar::isVisible() const && (mDrawable->isVisible() || mIsDummy); } -// call periodically to keep isFullyLoaded up to date. -// returns true if the value has changed. -BOOL LLVOAvatar::updateIsFullyLoaded() +// Determine if we have enough avatar data to render +BOOL LLVOAvatar::getIsCloud() { - // a "heuristic" to determine if we have enough avatar data to render - // (to avoid rendering a "Ruth" - DEV-3168) - BOOL loading = FALSE; - - // do we have a shape? + // Do we have a shape? if (visualParamWeightsAreDefault()) { - loading = TRUE; + return TRUE; } if (!isTextureDefined(TEX_LOWER_BAKED) || !isTextureDefined(TEX_UPPER_BAKED) || !isTextureDefined(TEX_HEAD_BAKED)) { - loading = TRUE; + return TRUE; } - + return FALSE; +} + +// call periodically to keep isFullyLoaded up to date. +// returns true if the value has changed. +BOOL LLVOAvatar::updateIsFullyLoaded() +{ + const BOOL loading = getIsCloud(); updateRuthTimer(loading); return processFullyLoadedChange(loading); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index d5485413f4..55753233b0 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -247,7 +247,8 @@ public: public: BOOL isFullyLoaded() const; protected: - virtual BOOL updateIsFullyLoaded(); + virtual BOOL getIsCloud(); + BOOL updateIsFullyLoaded(); BOOL processFullyLoadedChange(bool loading); void updateRuthTimer(bool loading); F32 calcMorphAmount(); @@ -828,6 +829,7 @@ private: BOOL mNameBusy; BOOL mNameMute; BOOL mNameAppearance; + BOOL mNameCloud; BOOL mRenderGroupTitles; //-------------------------------------------------------------------- diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 5cf115890b..5e9c139bc4 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1669,22 +1669,20 @@ void LLVOAvatarSelf::dumpTotalLocalTextureByteCount() llinfos << "Total Avatar LocTex GL:" << (gl_bytes/1024) << "KB" << llendl; } -BOOL LLVOAvatarSelf::updateIsFullyLoaded() +BOOL LLVOAvatarSelf::getIsCloud() { - BOOL loading = FALSE; - // do we have our body parts? if (gAgentWearables.getWearableCount(WT_SHAPE) == 0 || gAgentWearables.getWearableCount(WT_HAIR) == 0 || gAgentWearables.getWearableCount(WT_EYES) == 0 || gAgentWearables.getWearableCount(WT_SKIN) == 0) { - loading = TRUE; + return TRUE; } if (!isTextureDefined(TEX_HAIR, 0)) { - loading = TRUE; + return TRUE; } if (!mPreviousFullyLoaded) @@ -1692,13 +1690,13 @@ BOOL LLVOAvatarSelf::updateIsFullyLoaded() if (!isLocalTextureDataAvailable(mBakedTextureDatas[BAKED_LOWER].mTexLayerSet) && (!isTextureDefined(TEX_LOWER_BAKED, 0))) { - loading = TRUE; + return TRUE; } if (!isLocalTextureDataAvailable(mBakedTextureDatas[BAKED_UPPER].mTexLayerSet) && (!isTextureDefined(TEX_UPPER_BAKED, 0))) { - loading = TRUE; + return TRUE; } for (U32 i = 0; i < mBakedTextureDatas.size(); i++) @@ -1706,23 +1704,23 @@ BOOL LLVOAvatarSelf::updateIsFullyLoaded() if (i == BAKED_SKIRT && !isWearingWearableType(WT_SKIRT)) continue; - BakedTextureData& texture_data = mBakedTextureDatas[i]; + const BakedTextureData& texture_data = mBakedTextureDatas[i]; if (!isTextureDefined(texture_data.mTextureIndex, 0)) continue; // Check for the case that texture is defined but not sufficiently loaded to display anything. - LLViewerTexture* baked_img = getImage( texture_data.mTextureIndex, 0 ); + const LLViewerTexture* baked_img = getImage( texture_data.mTextureIndex, 0 ); if (!baked_img || !baked_img->hasGLTexture()) { - loading = TRUE; + return TRUE; } - } } - return processFullyLoadedChange(loading); + return FALSE; } + const LLUUID& LLVOAvatarSelf::grabLocalTexture(ETextureIndex type, U32 index) const { if (canGrabLocalTexture(type, index)) diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 9514abc5bc..24a2896eb0 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -120,7 +120,7 @@ public: // Loading state //-------------------------------------------------------------------- public: - /*virtual*/ BOOL updateIsFullyLoaded(); + /*virtual*/ BOOL getIsCloud(); private: BOOL mIsBaked; // are the stored baked textures up to date? |