diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2012-09-06 19:02:39 -0400 |
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2012-09-06 19:02:39 -0400 |
| commit | b6f0921099b9b2a0a582886ebd6383fa20eac2b0 (patch) | |
| tree | 9a2f099990176fad11c8904bfc7830f6e830a8f6 /indra/newview/llviewertextureanim.cpp | |
| parent | b12ade128ba2a7f1a10b283abcfa12bfb15f06d3 (diff) | |
| parent | 84884b06f206790ab5a4f52c7125665f9d32b7d8 (diff) | |
Automated merge with file:///Users/nat/linden/davep-viewer-development-rebased
Diffstat (limited to 'indra/newview/llviewertextureanim.cpp')
| -rw-r--r-- | indra/newview/llviewertextureanim.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/indra/newview/llviewertextureanim.cpp b/indra/newview/llviewertextureanim.cpp index 9f1ac7c49c..2b364851a7 100644 --- a/indra/newview/llviewertextureanim.cpp +++ b/indra/newview/llviewertextureanim.cpp @@ -27,21 +27,37 @@ #include "llviewerprecompiledheaders.h" #include "llviewertextureanim.h" +#include "llvovolume.h" #include "llmath.h" #include "llerror.h" -LLViewerTextureAnim::LLViewerTextureAnim() : LLTextureAnim() +std::vector<LLViewerTextureAnim*> LLViewerTextureAnim::sInstanceList; + +LLViewerTextureAnim::LLViewerTextureAnim(LLVOVolume* vobj) : LLTextureAnim() { + mVObj = vobj; mLastFrame = -1.f; // Force an update initially mLastTime = 0.f; mOffS = mOffT = 0; mScaleS = mScaleT = 1; mRot = 0; + + mInstanceIndex = sInstanceList.size(); + sInstanceList.push_back(this); } LLViewerTextureAnim::~LLViewerTextureAnim() { + S32 end_idx = sInstanceList.size()-1; + + if (end_idx != mInstanceIndex) + { + sInstanceList[mInstanceIndex] = sInstanceList[end_idx]; + sInstanceList[mInstanceIndex]->mInstanceIndex = mInstanceIndex; + } + + sInstanceList.pop_back(); } void LLViewerTextureAnim::reset() @@ -50,6 +66,14 @@ void LLViewerTextureAnim::reset() mTimer.reset(); } +//static +void LLViewerTextureAnim::updateClass() +{ + for (std::vector<LLViewerTextureAnim*>::iterator iter = sInstanceList.begin(); iter != sInstanceList.end(); ++iter) + { + (*iter)->mVObj->animateTextures(); + } +} S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t, F32 &scale_s, F32 &scale_t, |
