diff options
Diffstat (limited to 'linden/indra/newview/llviewertextureanim.cpp')
-rw-r--r-- | linden/indra/newview/llviewertextureanim.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/linden/indra/newview/llviewertextureanim.cpp b/linden/indra/newview/llviewertextureanim.cpp index 0766b83..bd4d0ef 100644 --- a/linden/indra/newview/llviewertextureanim.cpp +++ b/linden/indra/newview/llviewertextureanim.cpp | |||
@@ -36,6 +36,9 @@ LLViewerTextureAnim::LLViewerTextureAnim() : LLTextureAnim() | |||
36 | { | 36 | { |
37 | mLastFrame = -1.f; // Force an update initially | 37 | mLastFrame = -1.f; // Force an update initially |
38 | mLastTime = 0.f; | 38 | mLastTime = 0.f; |
39 | mOffS = mOffT = 0; | ||
40 | mScaleS = mScaleT = 1; | ||
41 | mRot = 0; | ||
39 | } | 42 | } |
40 | 43 | ||
41 | LLViewerTextureAnim::~LLViewerTextureAnim() | 44 | LLViewerTextureAnim::~LLViewerTextureAnim() |
@@ -167,13 +170,13 @@ S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t, | |||
167 | if (mMode & ROTATE) | 170 | if (mMode & ROTATE) |
168 | { | 171 | { |
169 | result |= ROTATE; | 172 | result |= ROTATE; |
170 | rot = frame_counter; | 173 | mRot = rot = frame_counter; |
171 | } | 174 | } |
172 | else if (mMode & SCALE) | 175 | else if (mMode & SCALE) |
173 | { | 176 | { |
174 | result |= SCALE; | 177 | result |= SCALE; |
175 | scale_s = frame_counter; | 178 | mScaleS = scale_s = frame_counter; |
176 | scale_t = frame_counter; | 179 | mScaleT = scale_t = frame_counter; |
177 | } | 180 | } |
178 | else | 181 | else |
179 | { | 182 | { |
@@ -187,22 +190,22 @@ S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t, | |||
187 | &&(mSizeY)) | 190 | &&(mSizeY)) |
188 | { | 191 | { |
189 | result |= SCALE; | 192 | result |= SCALE; |
190 | scale_s = 1.f/mSizeX; | 193 | mScaleS = scale_s = 1.f/mSizeX; |
191 | scale_t = 1.f/mSizeY; | 194 | mScaleT = scale_t = 1.f/mSizeY; |
192 | x_frame = fmod(frame_counter, mSizeX); | 195 | x_frame = fmod(frame_counter, mSizeX); |
193 | y_frame = (S32)(frame_counter / mSizeX); | 196 | y_frame = (S32)(frame_counter / mSizeX); |
194 | x_pos = x_frame * scale_s; | 197 | x_pos = x_frame * scale_s; |
195 | y_pos = y_frame * scale_t; | 198 | y_pos = y_frame * scale_t; |
196 | off_s = (-0.5f + 0.5f*scale_s)+ x_pos; | 199 | mOffS = off_s = (-0.5f + 0.5f*scale_s)+ x_pos; |
197 | off_t = (0.5f - 0.5f*scale_t) - y_pos; | 200 | mOffT = off_t = (0.5f - 0.5f*scale_t) - y_pos; |
198 | } | 201 | } |
199 | else | 202 | else |
200 | { | 203 | { |
201 | scale_s = 1.f; | 204 | mScaleS = scale_s = 1.f; |
202 | scale_t = 1.f; | 205 | mScaleT = scale_t = 1.f; |
203 | x_pos = frame_counter * scale_s; | 206 | x_pos = frame_counter * scale_s; |
204 | off_s = (-0.5f + 0.5f*scale_s)+ x_pos; | 207 | mOffS = off_s = (-0.5f + 0.5f*scale_s)+ x_pos; |
205 | off_t = 0.f; | 208 | mOffT = off_t = 0.f; |
206 | } | 209 | } |
207 | } | 210 | } |
208 | } | 211 | } |