From 00c861f9678d21fc10a4cf481158732cf88c3805 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 8 Mar 2011 14:14:33 -0600 Subject: SH-1085 Fix for crash when disabling "mirror" and a face is selected. --- indra/newview/llface.cpp | 22 ++++++++++++++++++++-- indra/newview/llface.h | 4 ++-- 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 10847e7067..290115417f 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -384,6 +384,24 @@ void LLFace::setSize(S32 num_vertices, S32 num_indices, bool align) llassert(verify()); } +void LLFace::setGeomIndex(U16 idx) +{ + if (mGeomIndex != idx) + { + mGeomIndex = idx; + mVertexBuffer = NULL; + } +} + +void LLFace::setIndicesIndex(S32 idx) +{ + if (mIndicesIndex != idx) + { + mIndicesIndex = idx; + mVertexBuffer = NULL; + } +} + //============================================================================ U16 LLFace::getGeometryAvatar( @@ -1858,7 +1876,7 @@ BOOL LLFace::verify(const U32* indices_array) const } // First, check whether the face data fits within the pool's range. - if ((mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts()) + if ((mGeomIndex + mGeomCount) > mVertexBuffer->getRequestedVerts()) { ok = FALSE; llinfos << "Face references invalid vertices!" << llendl; @@ -1877,7 +1895,7 @@ BOOL LLFace::verify(const U32* indices_array) const llinfos << "Face has bogus indices count" << llendl; } - if (mIndicesIndex + mIndicesCount > mVertexBuffer->getNumIndices()) + if (mIndicesIndex + mIndicesCount > mVertexBuffer->getRequestedIndices()) { ok = FALSE; llinfos << "Face references invalid indices!" << llendl; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 1f69dd145e..b2170c4cf3 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -196,8 +196,8 @@ public: BOOL verify(const U32* indices_array = NULL) const; void printDebugInfo() const; - void setGeomIndex(U16 idx) { mGeomIndex = idx; } - void setIndicesIndex(S32 idx) { mIndicesIndex = idx; } + void setGeomIndex(U16 idx); + void setIndicesIndex(S32 idx); void setDrawInfo(LLDrawInfo* draw_info); F32 getTextureVirtualSize() ; -- cgit v1.2.3