aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerjointmesh.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:44 -0500
committerJacek Antonelli2008-08-15 23:45:44 -0500
commitacfdcf2b1deeb04698174c78e8cb22b093445bb1 (patch)
tree811293650bcf81d01ea7c54d7c2cf263110aa329 /linden/indra/newview/llviewerjointmesh.cpp
parentSecond Life viewer sources 1.20.2 (diff)
downloadmeta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.zip
meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.gz
meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.bz2
meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.xz
Second Life viewer sources 1.20.3
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerjointmesh.cpp29
1 files changed, 6 insertions, 23 deletions
diff --git a/linden/indra/newview/llviewerjointmesh.cpp b/linden/indra/newview/llviewerjointmesh.cpp
index b87d564..4a0f0b8 100644
--- a/linden/indra/newview/llviewerjointmesh.cpp
+++ b/linden/indra/newview/llviewerjointmesh.cpp
@@ -501,21 +501,6 @@ int compare_int(const void *a, const void *b)
501 else return 0; 501 else return 0;
502} 502}
503 503
504void llDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices)
505{
506 if (end-start+1 > (U32) gGLManager.mGLMaxVertexRange ||
507 count > gGLManager.mGLMaxIndexRange)
508 {
509 glDrawElements(mode,count,type,indices);
510 }
511 else
512 {
513 glDrawRangeElements(mode,start,end,count,type,indices);
514 }
515
516 gPipeline.addTrianglesDrawn(count/3);
517}
518
519//-------------------------------------------------------------------- 504//--------------------------------------------------------------------
520// LLViewerJointMesh::drawShape() 505// LLViewerJointMesh::drawShape()
521//-------------------------------------------------------------------- 506//--------------------------------------------------------------------
@@ -626,7 +611,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass)
626 U32 start = mMesh->mFaceVertexOffset; 611 U32 start = mMesh->mFaceVertexOffset;
627 U32 end = start + mMesh->mFaceVertexCount - 1; 612 U32 end = start + mMesh->mFaceVertexCount - 1;
628 U32 count = mMesh->mFaceIndexCount; 613 U32 count = mMesh->mFaceIndexCount;
629 U16* indicesp = ((U16*) mFace->mVertexBuffer->getIndicesPointer()) + mMesh->mFaceIndexOffset; 614 U32 offset = mMesh->mFaceIndexOffset;
630 615
631 if (mMesh->hasWeights()) 616 if (mMesh->hasWeights())
632 { 617 {
@@ -636,23 +621,21 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass)
636 { 621 {
637 uploadJointMatrices(); 622 uploadJointMatrices();
638 } 623 }
639 llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp);
640 }
641 else
642 {
643 llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp);
644 } 624 }
625
626 mFace->mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset);
645 } 627 }
646 else 628 else
647 { 629 {
648 glPushMatrix(); 630 glPushMatrix();
649 LLMatrix4 jointToWorld = getWorldMatrix(); 631 LLMatrix4 jointToWorld = getWorldMatrix();
650 glMultMatrixf((GLfloat*)jointToWorld.mMatrix); 632 glMultMatrixf((GLfloat*)jointToWorld.mMatrix);
651 llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp); 633 mFace->mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset);
652 glPopMatrix(); 634 glPopMatrix();
653 } 635 }
636 gPipeline.addTrianglesDrawn(count/3);
654 637
655 triangle_count += mMesh->mFaceIndexCount; 638 triangle_count += count;
656 639
657 if (mTestImageName) 640 if (mTestImageName)
658 { 641 {