diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llvoavatar.cpp | 68 |
1 files changed, 44 insertions, 24 deletions
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 3b62c63..cd90c59 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp | |||
@@ -685,16 +685,16 @@ S32 LLVOAvatar::sNumVisibleAvatars = 0; | |||
685 | S32 LLVOAvatar::sNumLODChangesThisFrame = 0; | 685 | S32 LLVOAvatar::sNumLODChangesThisFrame = 0; |
686 | LLSD LLVOAvatar::sClientResolutionList; | 686 | LLSD LLVOAvatar::sClientResolutionList; |
687 | 687 | ||
688 | const LLUUID LLVOAvatar::sStepSoundOnLand = LLUUID("e8af4a28-aa83-4310-a7c4-c047e15ea0df"); | 688 | const LLUUID LLVOAvatar::sStepSoundOnLand("e8af4a28-aa83-4310-a7c4-c047e15ea0df"); |
689 | const LLUUID LLVOAvatar::sStepSounds[LL_MCODE_END] = | 689 | const LLUUID LLVOAvatar::sStepSounds[LL_MCODE_END] = |
690 | { | 690 | { |
691 | LLUUID(SND_STONE_RUBBER), | 691 | SND_STONE_RUBBER, |
692 | LLUUID(SND_METAL_RUBBER), | 692 | SND_METAL_RUBBER, |
693 | LLUUID(SND_GLASS_RUBBER), | 693 | SND_GLASS_RUBBER, |
694 | LLUUID(SND_WOOD_RUBBER), | 694 | SND_WOOD_RUBBER, |
695 | LLUUID(SND_FLESH_RUBBER), | 695 | SND_FLESH_RUBBER, |
696 | LLUUID(SND_RUBBER_PLASTIC), | 696 | SND_RUBBER_PLASTIC, |
697 | LLUUID(SND_RUBBER_RUBBER) | 697 | SND_RUBBER_RUBBER |
698 | }; | 698 | }; |
699 | 699 | ||
700 | S32 LLVOAvatar::sRenderName = RENDER_NAME_ALWAYS; | 700 | S32 LLVOAvatar::sRenderName = RENDER_NAME_ALWAYS; |
@@ -3467,13 +3467,19 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) | |||
3467 | } | 3467 | } |
3468 | 3468 | ||
3469 | const F32 time_visible = mTimeVisible.getElapsedTimeF32(); | 3469 | const F32 time_visible = mTimeVisible.getElapsedTimeF32(); |
3470 | const F32 NAME_SHOW_TIME = gSavedSettings.getF32("RenderNameShowTime"); // seconds | 3470 | |
3471 | const F32 FADE_DURATION = gSavedSettings.getF32("RenderNameFadeDuration"); // seconds | 3471 | static F32* sRenderNameShowTime = rebind_llcontrol<F32>("RenderNameShowTime", &gSavedSettings, true); |
3472 | static F32* sRenderNameFadeDuration = rebind_llcontrol<F32>("RenderNameFadeDuration", &gSavedSettings, true); | ||
3473 | |||
3474 | |||
3475 | const F32 NAME_SHOW_TIME = *sRenderNameShowTime; // seconds | ||
3476 | const F32 FADE_DURATION = *sRenderNameFadeDuration; // seconds | ||
3472 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b | 3477 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0b |
3473 | bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); | 3478 | bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); |
3474 | // [/RLVa:KB] | 3479 | // [/RLVa:KB] |
3475 | BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; | 3480 | BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; |
3476 | BOOL visible_chat = gSavedSettings.getBOOL("UseChatBubbles") && (mChats.size() || mTyping); | 3481 | static BOOL* sUseChatBubbles = rebind_llcontrol<BOOL>("UseChatBubbles", &gSavedSettings, true); |
3482 | BOOL visible_chat = *sUseChatBubbles && (mChats.size() || mTyping); | ||
3477 | BOOL render_name = visible_chat || | 3483 | BOOL render_name = visible_chat || |
3478 | (visible_avatar && | 3484 | (visible_avatar && |
3479 | // [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.0h | 3485 | // [RLVa:KB] - Checked: 2009-08-11 (RLVa-1.0.1h) | Added: RLVa-1.0.0h |
@@ -3515,6 +3521,9 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) | |||
3515 | mRenderGroupTitles = sRenderGroupTitles; | 3521 | mRenderGroupTitles = sRenderGroupTitles; |
3516 | new_name = TRUE; | 3522 | new_name = TRUE; |
3517 | } | 3523 | } |
3524 | |||
3525 | static LLColor4* sAvatarNameColor = rebind_llcontrol<LLColor4>("AvatarNameColor", &gColors, true); | ||
3526 | |||
3518 | std::string client; | 3527 | std::string client; |
3519 | // First Calculate Alpha | 3528 | // First Calculate Alpha |
3520 | // If alpha > 0, create mNameText if necessary, otherwise delete it | 3529 | // If alpha > 0, create mNameText if necessary, otherwise delete it |
@@ -3555,7 +3564,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) | |||
3555 | new_name = TRUE; | 3564 | new_name = TRUE; |
3556 | } | 3565 | } |
3557 | 3566 | ||
3558 | LLColor4 avatar_name_color = gColors.getColor( "AvatarNameColor" ); | 3567 | LLColor4 avatar_name_color = (*sAvatarNameColor); |
3559 | LLColor4 client_color = avatar_name_color; | 3568 | LLColor4 client_color = avatar_name_color; |
3560 | 3569 | ||
3561 | if(!mIsSelf) //don't know your own client ? | 3570 | if(!mIsSelf) //don't know your own client ? |
@@ -3570,11 +3579,14 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) | |||
3570 | // Set your own name to the Imprudence color -- MC | 3579 | // Set your own name to the Imprudence color -- MC |
3571 | client_color = LLColor4(0.79f,0.44f,0.88f); | 3580 | client_color = LLColor4(0.79f,0.44f,0.88f); |
3572 | } | 3581 | } |
3573 | if (gSavedSettings.getBOOL("ShowClientColor")) | 3582 | |
3583 | static BOOL* sShowClientColor = rebind_llcontrol<BOOL>("ShowClientColor", &gSavedSettings, true); | ||
3584 | static BOOL* sShowClientNameTag = rebind_llcontrol<BOOL>("ShowClientNameTag", &gSavedSettings, true); | ||
3585 | if (*sShowClientColor) | ||
3574 | { | 3586 | { |
3575 | avatar_name_color = client_color; | 3587 | avatar_name_color = client_color; |
3576 | } | 3588 | } |
3577 | if (!gSavedSettings.getBOOL("ShowClientNameTag")) | 3589 | if (!(*sShowClientNameTag)) |
3578 | { | 3590 | { |
3579 | client.clear(); | 3591 | client.clear(); |
3580 | } | 3592 | } |
@@ -3667,7 +3679,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) | |||
3667 | 3679 | ||
3668 | BOOL need_comma = FALSE; | 3680 | BOOL need_comma = FALSE; |
3669 | 3681 | ||
3670 | bool show_client = client.length() != 0 && gSavedSettings.getBOOL("ShowClientNameTag"); | 3682 | static BOOL* sShowClientNameTag = rebind_llcontrol<BOOL>("ShowClientNameTag", &gSavedSettings, true); |
3683 | bool show_client = client.length() != 0 && (*sShowClientNameTag); | ||
3671 | if (is_away || is_muted || is_busy || show_client) | 3684 | if (is_away || is_muted || is_busy || show_client) |
3672 | { | 3685 | { |
3673 | line += " ("; | 3686 | line += " ("; |
@@ -3736,7 +3749,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) | |||
3736 | std::deque<LLChat>::iterator chat_iter = mChats.begin(); | 3749 | std::deque<LLChat>::iterator chat_iter = mChats.begin(); |
3737 | mNameText->clearString(); | 3750 | mNameText->clearString(); |
3738 | 3751 | ||
3739 | LLColor4 new_chat = gColors.getColor( "AvatarNameColor" ); | 3752 | LLColor4 new_chat = (*sAvatarNameColor); |
3740 | LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); | 3753 | LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); |
3741 | LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); | 3754 | LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); |
3742 | if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) | 3755 | if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) |
@@ -3798,14 +3811,20 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) | |||
3798 | } | 3811 | } |
3799 | else | 3812 | else |
3800 | { | 3813 | { |
3801 | if (gSavedSettings.getBOOL("SmallAvatarNames")) | 3814 | S32 style = LLFontGL::NORMAL; |
3815 | |||
3816 | if (!mIsSelf && gSavedSettings.getBOOL("HighlightFriends")) | ||
3802 | { | 3817 | { |
3803 | mNameText->setFont(LLFontGL::getFontSansSerif()); | 3818 | if (is_agent_friend(this->getID())) // Ele: bold for friends |
3819 | style |= LLFontGL::BOLD; | ||
3804 | } | 3820 | } |
3821 | |||
3822 | static BOOL* sSmallAvatarNames = rebind_llcontrol<BOOL>("SmallAvatarNames", &gSavedSettings, true); | ||
3823 | if (*sSmallAvatarNames) | ||
3824 | mNameText->setFont(LLFontGL::getFont(LLFontDescriptor("SansSerif","Medium",style))); | ||
3805 | else | 3825 | else |
3806 | { | 3826 | mNameText->setFont(LLFontGL::getFont(LLFontDescriptor("SansSerif","Large",style))); |
3807 | mNameText->setFont(LLFontGL::getFontSansSerifBig()); | 3827 | |
3808 | } | ||
3809 | mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER); | 3828 | mNameText->setTextAlignment(LLHUDText::ALIGN_TEXT_CENTER); |
3810 | mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); | 3829 | mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); |
3811 | mNameText->setVisibleOffScreen(FALSE); | 3830 | mNameText->setVisibleOffScreen(FALSE); |
@@ -5133,7 +5152,7 @@ void LLVOAvatar::updateTextures(LLAgent &agent) // KL SD version | |||
5133 | if (texture_dict->mIsLocalTexture) | 5152 | if (texture_dict->mIsLocalTexture) |
5134 | { | 5153 | { |
5135 | addLocalTextureStats((ETextureIndex)index, imagep, texel_area_ratio, render_avatar, layer_baked[baked_index]); | 5154 | addLocalTextureStats((ETextureIndex)index, imagep, texel_area_ratio, render_avatar, layer_baked[baked_index]); |
5136 | } | 5155 | } |
5137 | else if (texture_dict->mIsBakedTexture) | 5156 | else if (texture_dict->mIsBakedTexture) |
5138 | { | 5157 | { |
5139 | if (layer_baked[baked_index]) | 5158 | if (layer_baked[baked_index]) |
@@ -7358,7 +7377,8 @@ BOOL LLVOAvatar::updateIsFullyLoaded() | |||
7358 | 7377 | ||
7359 | BOOL LLVOAvatar::isFullyLoaded() | 7378 | BOOL LLVOAvatar::isFullyLoaded() |
7360 | { | 7379 | { |
7361 | if (gSavedSettings.getBOOL("RenderUnloadedAvatar")) | 7380 | static BOOL* sRenderUnloadedAvatar = rebind_llcontrol<BOOL>("RenderUnloadedAvatar", &gSavedSettings, true); |
7381 | if (*sRenderUnloadedAvatar) | ||
7362 | return TRUE; | 7382 | return TRUE; |
7363 | else | 7383 | else |
7364 | return mFullyLoaded; | 7384 | return mFullyLoaded; |
@@ -7685,7 +7705,7 @@ void LLVOAvatar::updateMeshTextures() | |||
7685 | for (U32 i = 0; i < mBakedTextureData[BAKED_HAIR].mMeshes.size(); i++) | 7705 | for (U32 i = 0; i < mBakedTextureData[BAKED_HAIR].mMeshes.size(); i++) |
7686 | { | 7706 | { |
7687 | mBakedTextureData[BAKED_HAIR].mMeshes[i]->setColor( 1.f, 1.f, 1.f, 1.f ); | 7707 | mBakedTextureData[BAKED_HAIR].mMeshes[i]->setColor( 1.f, 1.f, 1.f, 1.f ); |
7688 | } | 7708 | } |
7689 | mHasBakedHair = TRUE; | 7709 | mHasBakedHair = TRUE; |
7690 | } | 7710 | } |
7691 | 7711 | ||