summaryrefslogtreecommitdiff
path: root/indra/newview/llface.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2012-10-16 21:02:48 -0400
committerNat Goodspeed <nat@lindenlab.com>2012-10-16 21:02:48 -0400
commitc370313676451f6e5cfd72bec314ad79bc653833 (patch)
tree1bd99330b482d828f8edc71691d177078123fd1e /indra/newview/llface.cpp
parent988767d5ec4631ad9f0099180a92c4f186553940 (diff)
parentf2e2ea99a351ca8663af460974137545d020b97f (diff)
Automated merge with file:///Users/nat/linden/viewer-sourceid
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r--indra/newview/llface.cpp63
1 files changed, 38 insertions, 25 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index 373b1930f5..4a0c94df33 100644
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -163,16 +163,10 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp)
mGeomCount = 0;
mGeomIndex = 0;
mIndicesCount = 0;
- if (drawablep->getRenderType() == LLPipeline::RENDER_TYPE_PARTICLES ||
- drawablep->getRenderType() == LLPipeline::RENDER_TYPE_HUD_PARTICLES)
- { //indicate to LLParticlePartition that this particle is uninitialized
- mIndicesIndex = 0xFFFFFFFF;
- }
- else
- {
- mIndicesIndex = 0;
- }
- mIndexInTex = 0;
+
+ //special value to indicate uninitialized position
+ mIndicesIndex = 0xFFFFFFFF;
+
mTexture = NULL;
mTEOffset = -1;
mTextureIndex = 255;
@@ -207,13 +201,10 @@ void LLFace::destroy()
mTexture->removeFace(this) ;
}
- if (mDrawablep.notNull() &&
- (mDrawablep->getRenderType() == LLPipeline::RENDER_TYPE_PARTICLES ||
- mDrawablep->getRenderType() == LLPipeline::RENDER_TYPE_HUD_PARTICLES) &&
- mIndicesIndex != 0xFFFFFFFF)
+ if (isState(LLFace::PARTICLE))
{
LLVOPartGroup::freeVBSlot(getGeomIndex()/4);
- mIndicesIndex = 0xFFFFFFFF;
+ clearState(LLFace::PARTICLE);
}
if (mDrawPoolp)
@@ -1207,19 +1198,25 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
if (num_indices + (S32) mIndicesIndex > mVertexBuffer->getNumIndices())
{
- llwarns << "Index buffer overflow!" << llendl;
- llwarns << "Indices Count: " << mIndicesCount
- << " VF Num Indices: " << num_indices
- << " Indices Index: " << mIndicesIndex
- << " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
- llwarns << " Face Index: " << f
- << " Pool Type: " << mPoolType << llendl;
+ if (gDebugGL)
+ {
+ llwarns << "Index buffer overflow!" << llendl;
+ llwarns << "Indices Count: " << mIndicesCount
+ << " VF Num Indices: " << num_indices
+ << " Indices Index: " << mIndicesIndex
+ << " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
+ llwarns << " Face Index: " << f
+ << " Pool Type: " << mPoolType << llendl;
+ }
return FALSE;
}
if (num_vertices + mGeomIndex > mVertexBuffer->getNumVerts())
{
- llwarns << "Vertex buffer overflow!" << llendl;
+ if (gDebugGL)
+ {
+ llwarns << "Vertex buffer overflow!" << llendl;
+ }
return FALSE;
}
}
@@ -1651,7 +1648,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (!do_xform)
{
LLFastTimer t(FTM_FACE_TEX_QUICK_NO_XFORM);
- LLVector4a::memcpyNonAliased16((F32*) tex_coords.get(), (F32*) vf.mTexCoords, num_vertices*2*sizeof(F32));
+ S32 tc_size = (num_vertices*2*sizeof(F32)+0xF) & ~0xF;
+ LLVector4a::memcpyNonAliased16((F32*) tex_coords.get(), (F32*) vf.mTexCoords, tc_size);
}
else
{
@@ -2169,6 +2167,12 @@ BOOL LLFace::hasMedia() const
const F32 LEAST_IMPORTANCE = 0.05f ;
const F32 LEAST_IMPORTANCE_FOR_LARGE_IMAGE = 0.3f ;
+void LLFace::resetVirtualSize()
+{
+ setVirtualSize(0.f);
+ mImportanceToCamera = 0.f;
+}
+
F32 LLFace::getTextureVirtualSize()
{
F32 radius;
@@ -2234,8 +2238,17 @@ BOOL LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
LLVector4a t;
t.load3(camera->getOrigin().mV);
lookAt.setSub(center, t);
+
F32 dist = lookAt.getLength3().getF32();
- dist = llmax(dist-size.getLength3().getF32(), 0.f);
+ dist = llmax(dist-size.getLength3().getF32(), 0.001f);
+ //ramp down distance for nearby objects
+ if (dist < 16.f)
+ {
+ dist /= 16.f;
+ dist *= dist;
+ dist *= 16.f;
+ }
+
lookAt.normalize3fast() ;
//get area of circle around node