summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertextureanim.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2012-08-16 08:52:26 -0400
committerOz Linden <oz@lindenlab.com>2012-08-16 08:52:26 -0400
commita7d8b425097a7fab0a5a40d6a6b5770deb0bb7f9 (patch)
tree81e800d495674faa37d66c18db36cbfccd7fc5eb /indra/newview/llviewertextureanim.cpp
parentdf93749819c503a66bc0ad34aeb1c7bed3746df2 (diff)
parentb9e43dfd646990be236e44814ce3199de3391dc1 (diff)
merge up to latest viewer-development
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,