diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-04-28 23:29:46 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-04-28 23:29:46 +0000 |
commit | 16baf6c9d43fc29e697b5a460439ca664897450c (patch) | |
tree | 6c3ae45c538cbc90408ab72f3a02564cf5dce754 /indra/newview/llviewerjointmesh.cpp | |
parent | 75ee8558abb662b6a0a6b559c61a9549818d2962 (diff) |
merge release-QAR-499 Viewer 1.20 RC 3
merge release-QAR-508 Viewer 1.20 RC 4
merge Branch_1-20-Viewer -r 85278 : 85828 -> release
Diffstat (limited to 'indra/newview/llviewerjointmesh.cpp')
-rw-r--r-- | indra/newview/llviewerjointmesh.cpp | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index fe00c25c63..ce23efe2f0 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -501,21 +501,6 @@ int compare_int(const void *a, const void *b) else return 0; } -void llDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) -{ - if (end-start+1 > (U32) gGLManager.mGLMaxVertexRange || - count > gGLManager.mGLMaxIndexRange) - { - glDrawElements(mode,count,type,indices); - } - else - { - glDrawRangeElements(mode,start,end,count,type,indices); - } - - gPipeline.addTrianglesDrawn(count/3); -} - //-------------------------------------------------------------------- // LLViewerJointMesh::drawShape() //-------------------------------------------------------------------- @@ -626,7 +611,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass) U32 start = mMesh->mFaceVertexOffset; U32 end = start + mMesh->mFaceVertexCount - 1; U32 count = mMesh->mFaceIndexCount; - U16* indicesp = ((U16*) mFace->mVertexBuffer->getIndicesPointer()) + mMesh->mFaceIndexOffset; + U32 offset = mMesh->mFaceIndexOffset; if (mMesh->hasWeights()) { @@ -636,23 +621,21 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass) { uploadJointMatrices(); } - llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp); - } - else - { - llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp); } + + mFace->mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset); } else { glPushMatrix(); LLMatrix4 jointToWorld = getWorldMatrix(); glMultMatrixf((GLfloat*)jointToWorld.mMatrix); - llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp); + mFace->mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset); glPopMatrix(); } + gPipeline.addTrianglesDrawn(count/3); - triangle_count += mMesh->mFaceIndexCount; + triangle_count += count; if (mTestImageName) { |