Slightly smarter flexi update handling, plus extra nullchecks.

This commit is contained in:
Shyotl
2011-05-20 16:07:47 -05:00
parent 9a29428b39
commit 285c19090e
4 changed files with 15 additions and 6 deletions

View File

@@ -366,7 +366,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
{
LLVolume* volume = mVO->getVolume();
LLPath *path = &volume->getPath();
if (mSimulateRes == 0)
if ((mSimulateRes == 0 || !mInitialized) && mVO->mDrawable->isVisible()) // if its uninitialized but not visible, what then? - Nyx
{
mVO->markForUpdate(TRUE);
if (!doIdleUpdate(gAgent, *LLWorld::getInstance(), 0.0))
@@ -694,7 +694,11 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
}
volume->updateRelativeXform();
doFlexibleUpdate();
if (mRenderRes > -1)
{
doFlexibleUpdate();
}
// Object may have been rotated, which means it needs a rebuild. See SL-47220
BOOL rotated = FALSE;

View File

@@ -37,7 +37,6 @@
#include "llviewercontrol.h"
#include "llagent.h"
#include "lldrawable.h"
#include "llface.h"
#include "llsky.h"

View File

@@ -982,6 +982,11 @@ void LLVOVolume::updateFaceFlags()
for (S32 i = 0; i < getVolume()->getNumFaces(); i++)
{
LLFace *face = mDrawable->getFace(i);
if (!face)
{
return;
}
BOOL fullbright = getTE(i)->getFullbright();
face->clearState(LLFace::FULLBRIGHT | LLFace::HUD_RENDER | LLFace::LIGHT);
@@ -1054,6 +1059,10 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
for (S32 i = 0; i < getVolume()->getNumFaces(); i++)
{
LLFace *face = mDrawable->getFace(i);
if (!face)
{
continue;
}
res &= face->genVolumeBBoxes(*getVolume(), i,
mRelativeXform, mRelativeXformInvTrans,
(mVolumeImpl && mVolumeImpl->isVolumeGlobal()) || force_global);

View File

@@ -37,7 +37,6 @@
#include "imageids.h"
#include "llviewercontrol.h"
#include "llagent.h"
#include "lldrawable.h"
#include "lldrawpoolwater.h"
#include "llface.h"
@@ -56,8 +55,6 @@ const BOOL gUseRoam = FALSE;
///////////////////////////////////
#include "randgauss.h"
template<class T> inline T LERP(T a, T b, F32 factor)
{
return a + (b - a) * factor;