summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertextureanim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewertextureanim.cpp')
-rw-r--r--indra/newview/llviewertextureanim.cpp26
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,