summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawable.cpp')
-rw-r--r--indra/newview/lldrawable.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index 3bb2c45a24..aa67ea2524 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -50,6 +50,7 @@
#include "llviewerobjectlist.h"
#include "llviewerwindow.h"
#include "llvocache.h"
+#include "lldrawpoolavatar.h"
const F32 MIN_INTERPOLATE_DISTANCE_SQUARED = 0.001f * 0.001f;
const F32 MAX_INTERPOLATE_DISTANCE_SQUARED = 10.f * 10.f;
@@ -143,6 +144,28 @@ void LLDrawable::init(bool new_entry)
initVisible(sCurVisible - 2);//invisible for the current frame and the last frame.
}
+void LLDrawable::unload()
+{
+ LLVOVolume *pVVol = getVOVolume();
+ pVVol->setNoLOD();
+
+ for (S32 i = 0; i < getNumFaces(); i++)
+ {
+ LLFace* facep = getFace(i);
+ if (facep->isState(LLFace::RIGGED))
+ {
+ LLDrawPoolAvatar* pool = (LLDrawPoolAvatar*)facep->getPool();
+ if (pool) {
+ pool->removeRiggedFace(facep);
+ }
+ facep->setVertexBuffer(NULL);
+ }
+ facep->clearState(LLFace::RIGGED);
+ }
+
+ pVVol->markForUpdate(TRUE);
+}
+
// static
void LLDrawable::initClass()
{