diff options
Diffstat (limited to 'linden/indra/newview/llvowlsky.cpp')
-rw-r--r-- | linden/indra/newview/llvowlsky.cpp | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/linden/indra/newview/llvowlsky.cpp b/linden/indra/newview/llvowlsky.cpp index 30d1397..159603e 100644 --- a/linden/indra/newview/llvowlsky.cpp +++ b/linden/indra/newview/llvowlsky.cpp | |||
@@ -484,17 +484,12 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) | |||
484 | 484 | ||
485 | void LLVOWLSky::drawStars(void) | 485 | void LLVOWLSky::drawStars(void) |
486 | { | 486 | { |
487 | glEnableClientState(GL_COLOR_ARRAY); | ||
488 | |||
489 | // render the stars as a sphere centered at viewer camera | 487 | // render the stars as a sphere centered at viewer camera |
490 | if (mStarsVerts.notNull()) | 488 | if (mStarsVerts.notNull()) |
491 | { | 489 | { |
492 | mStarsVerts->setBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK); | 490 | mStarsVerts->setBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK); |
493 | U16* indicesp = (U16*) mStarsVerts->getIndicesPointer(); | 491 | mStarsVerts->draw(LLVertexBuffer::POINTS, getStarsNumIndices(), 0); |
494 | glDrawElements(GL_POINTS, getStarsNumIndices(), GL_UNSIGNED_SHORT, indicesp); | ||
495 | } | 492 | } |
496 | |||
497 | glDisableClientState(GL_COLOR_ARRAY); | ||
498 | } | 493 | } |
499 | 494 | ||
500 | void LLVOWLSky::drawDome(void) | 495 | void LLVOWLSky::drawDome(void) |
@@ -507,19 +502,8 @@ void LLVOWLSky::drawDome(void) | |||
507 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); | 502 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); |
508 | 503 | ||
509 | const U32 data_mask = LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK; | 504 | const U32 data_mask = LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK; |
510 | 505 | ||
511 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); | ||
512 | |||
513 | #if DOME_SLICES | 506 | #if DOME_SLICES |
514 | //mFanVerts->setBuffer(data_mask); | ||
515 | //glDrawRangeElements( | ||
516 | // GL_TRIANGLES, | ||
517 | // 0, getFanNumVerts()-1, getFanNumIndices(), | ||
518 | // GL_UNSIGNED_SHORT, | ||
519 | // mFanVerts->getIndicesPointer()); | ||
520 | |||
521 | //gPipeline.addTrianglesDrawn(getFanNumIndices()/3); | ||
522 | |||
523 | std::vector< LLPointer<LLVertexBuffer> >::const_iterator strips_vbo_iter, end_strips; | 507 | std::vector< LLPointer<LLVertexBuffer> >::const_iterator strips_vbo_iter, end_strips; |
524 | end_strips = mStripsVerts.end(); | 508 | end_strips = mStripsVerts.end(); |
525 | for(strips_vbo_iter = mStripsVerts.begin(); strips_vbo_iter != end_strips; ++strips_vbo_iter) | 509 | for(strips_vbo_iter = mStripsVerts.begin(); strips_vbo_iter != end_strips; ++strips_vbo_iter) |
@@ -528,13 +512,10 @@ void LLVOWLSky::drawDome(void) | |||
528 | 512 | ||
529 | strips_segment->setBuffer(data_mask); | 513 | strips_segment->setBuffer(data_mask); |
530 | 514 | ||
531 | glDrawRangeElements( | 515 | strips_segment->drawRange( |
532 | //GL_TRIANGLES, | 516 | LLVertexBuffer::TRIANGLE_STRIP, |
533 | GL_TRIANGLE_STRIP, | 517 | 0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(), |
534 | 0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(), | 518 | 0); |
535 | GL_UNSIGNED_SHORT, | ||
536 | strips_segment->getIndicesPointer()); | ||
537 | |||
538 | gPipeline.addTrianglesDrawn(strips_segment->getRequestedIndices() - 2); | 519 | gPipeline.addTrianglesDrawn(strips_segment->getRequestedIndices() - 2); |
539 | } | 520 | } |
540 | 521 | ||
@@ -547,8 +528,6 @@ void LLVOWLSky::drawDome(void) | |||
547 | mStripsVerts->getIndicesPointer()); | 528 | mStripsVerts->getIndicesPointer()); |
548 | #endif | 529 | #endif |
549 | 530 | ||
550 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); | ||
551 | |||
552 | LLVertexBuffer::unbind(); | 531 | LLVertexBuffer::unbind(); |
553 | } | 532 | } |
554 | 533 | ||