summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerchat.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-05-02 07:24:15 -0400
committerOz Linden <oz@lindenlab.com>2011-05-02 07:24:15 -0400
commita32daa0c10b285354e94e0e8bf0cc6c5ffce09a5 (patch)
treec2ba5f181935b95d2f23406c41917401cd4be963 /indra/newview/llviewerchat.cpp
parent929bde3ed08f9a1d2a8f4c9821b0d51c11d895e9 (diff)
parent89216a6c213c126b8ab6dacaeb21340fa8f7a001 (diff)
merge changes for vwr-25126
Diffstat (limited to 'indra/newview/llviewerchat.cpp')
-rw-r--r--indra/newview/llviewerchat.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/newview/llviewerchat.cpp b/indra/newview/llviewerchat.cpp
index f5484ff010..e7a0d17c3a 100644
--- a/indra/newview/llviewerchat.cpp
+++ b/indra/newview/llviewerchat.cpp
@@ -90,8 +90,9 @@ void LLViewerChat::getChatColor(const LLChat& chat, LLColor4& r_color)
if (!chat.mPosAgent.isExactlyZero())
{
LLVector3 pos_agent = gAgent.getPositionAgent();
- F32 distance = dist_vec(pos_agent, chat.mPosAgent);
- if (distance > gAgent.getNearChatRadius())
+ F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent);
+ F32 dist_near_chat = gAgent.getNearChatRadius();
+ if (distance_squared > dist_near_chat * dist_near_chat)
{
// diminish far-off chat
r_color.mV[VALPHA] = 0.8f;
@@ -155,8 +156,9 @@ void LLViewerChat::getChatColor(const LLChat& chat, std::string& r_color_name, F
if (!chat.mPosAgent.isExactlyZero())
{
LLVector3 pos_agent = gAgent.getPositionAgent();
- F32 distance = dist_vec(pos_agent, chat.mPosAgent);
- if (distance > gAgent.getNearChatRadius())
+ F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent);
+ F32 dist_near_chat = gAgent.getNearChatRadius();
+ if (distance_squared > dist_near_chat * dist_near_chat)
{
// diminish far-off chat
r_color_alpha = 0.8f;