summaryrefslogtreecommitdiff
path: root/indra/newview/llflexibleobject.cpp
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2013-01-23 13:36:50 -0800
committerdolphin <dolphin@lindenlab.com>2013-01-23 13:36:50 -0800
commit3e8bc28c88f16c1b8bba496704ec3a6156a25e1d (patch)
treeaa52be0bc7aa10d578ba000b8cd69d40271477a0 /indra/newview/llflexibleobject.cpp
parent7e9ac192d779e77cad0a0b785510190215fbe7a6 (diff)
parenta30a2c492d06c9ef843a43c0ff0be6f2826d6d0b (diff)
Merge
Diffstat (limited to 'indra/newview/llflexibleobject.cpp')
-rw-r--r--indra/newview/llflexibleobject.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index 28d195d5e9..77a0cdffce 100644
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -48,7 +48,7 @@ std::vector<LLVolumeImplFlexible*> LLVolumeImplFlexible::sInstanceList;
std::vector<S32> LLVolumeImplFlexible::sUpdateDelay;
static LLFastTimer::DeclareTimer FTM_FLEXIBLE_REBUILD("Rebuild");
-static LLFastTimer::DeclareTimer FTM_DO_FLEXIBLE_UPDATE("Update");
+static LLFastTimer::DeclareTimer FTM_DO_FLEXIBLE_UPDATE("Flexible Update");
// LLFlexibleObjectData::pack/unpack now in llprimitive.cpp
@@ -66,7 +66,7 @@ LLVolumeImplFlexible::LLVolumeImplFlexible(LLViewerObject* vo, LLFlexibleObjectD
mSimulateRes = 0;
mFrameNum = 0;
mCollisionSphereRadius = 0.f;
- mRenderRes = 1;
+ mRenderRes = -1;
if(mVO->mDrawable.notNull())
{
@@ -350,23 +350,24 @@ void LLVolumeImplFlexible::doIdleUpdate()
{
bool visible = drawablep->isVisible();
- if ((mSimulateRes == 0) && visible)
+ if (mRenderRes == -1)
{
updateRenderRes();
gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_POSITION, FALSE);
+ sUpdateDelay[mInstanceIndex] = 0;
}
else
{
F32 pixel_area = mVO->getPixelArea();
- U32 update_period = (U32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f)))+1;
+ U32 update_period = (U32) (llmax((S32) (LLViewerCamera::getInstance()->getScreenPixelArea()*0.01f/(pixel_area*(sUpdateFactor+1.f))),0)+1);
// MAINT-1890 Clamp the update period to ensure that the update_period is no greater than 32 frames
update_period = llclamp(update_period, 0U, 32U);
if (visible)
{
if (!drawablep->isState(LLDrawable::IN_REBUILD_Q1) &&
- mVO->getPixelArea() > 256.f)
+ pixel_area > 256.f)
{
U32 id;
@@ -650,6 +651,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
mSection[i].mdPosition = (mSection[i].mPosition - mSection[i-1].mPosition) * inv_section_length;
// Create points
+ llassert(mRenderRes > -1)
S32 num_render_sections = 1<<mRenderRes;
if (path->getPathLength() != num_render_sections+1)
{