diff options
Diffstat (limited to 'linden/indra/newview/llvotextbubble.cpp')
-rw-r--r-- | linden/indra/newview/llvotextbubble.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/linden/indra/newview/llvotextbubble.cpp b/linden/indra/newview/llvotextbubble.cpp index 5424cc8..ba53bd3 100644 --- a/linden/indra/newview/llvotextbubble.cpp +++ b/linden/indra/newview/llvotextbubble.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2001&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2001-2008, Linden Research, Inc. | 7 | * Copyright (c) 2001-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -118,30 +118,16 @@ BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) | |||
118 | void LLVOTextBubble::updateTextures(LLAgent &agent) | 118 | void LLVOTextBubble::updateTextures(LLAgent &agent) |
119 | { | 119 | { |
120 | // Update the image levels of all textures... | 120 | // Update the image levels of all textures... |
121 | // First we do some quick checks. | ||
122 | U32 i; | ||
123 | 121 | ||
124 | // This doesn't take into account whether the object is in front | 122 | for (U32 i = 0; i < getNumTEs(); i++) |
125 | // or behind... | ||
126 | |||
127 | LLVector3 position_local = getPositionAgent() - agent.getCameraPositionAgent(); | ||
128 | F32 dot_product = position_local * agent.getFrameAgent().getAtAxis(); | ||
129 | F32 cos_angle = dot_product / position_local.magVec(); | ||
130 | |||
131 | if (cos_angle > 1.f) | ||
132 | { | ||
133 | cos_angle = 1.f; | ||
134 | } | ||
135 | |||
136 | for (i = 0; i < getNumTEs(); i++) | ||
137 | { | 123 | { |
138 | const LLTextureEntry *te = getTE(i); | 124 | const LLTextureEntry *te = getTE(i); |
139 | F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT); | 125 | F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT); |
140 | 126 | texel_area_ratio = llclamp(texel_area_ratio, .125f, 16.f); | |
141 | LLViewerImage *imagep = getTEImage(i); | 127 | LLViewerImage *imagep = getTEImage(i); |
142 | if (imagep) | 128 | if (imagep) |
143 | { | 129 | { |
144 | imagep->addTextureStats(mPixelArea, texel_area_ratio, cos_angle); | 130 | imagep->addTextureStats(mPixelArea / texel_area_ratio); |
145 | } | 131 | } |
146 | } | 132 | } |
147 | } | 133 | } |