diff options
author | Jacek Antonelli | 2008-08-15 23:45:44 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:44 -0500 |
commit | acfdcf2b1deeb04698174c78e8cb22b093445bb1 (patch) | |
tree | 811293650bcf81d01ea7c54d7c2cf263110aa329 /linden/indra/newview/lldrawpoolbump.cpp | |
parent | Second Life viewer sources 1.20.2 (diff) | |
download | meta-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/lldrawpoolbump.cpp | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/linden/indra/newview/lldrawpoolbump.cpp b/linden/indra/newview/lldrawpoolbump.cpp index 2345406..7e8b9d6 100644 --- a/linden/indra/newview/lldrawpoolbump.cpp +++ b/linden/indra/newview/lldrawpoolbump.cpp | |||
@@ -316,12 +316,8 @@ void LLDrawPoolBump::beginShiny(bool invisible) | |||
316 | mShiny = TRUE; | 316 | mShiny = TRUE; |
317 | sVertexMask = VERTEX_MASK_SHINY; | 317 | sVertexMask = VERTEX_MASK_SHINY; |
318 | // Second pass: environment map | 318 | // Second pass: environment map |
319 | glEnableClientState(GL_VERTEX_ARRAY); | ||
320 | glEnableClientState(GL_NORMAL_ARRAY); | ||
321 | glEnableClientState(GL_COLOR_ARRAY); | ||
322 | if (!invisible && mVertexShaderLevel > 1) | 319 | if (!invisible && mVertexShaderLevel > 1) |
323 | { | 320 | { |
324 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); | ||
325 | sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD; | 321 | sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD; |
326 | } | 322 | } |
327 | 323 | ||
@@ -456,13 +452,7 @@ void LLDrawPoolBump::endShiny(bool invisible) | |||
456 | 452 | ||
457 | LLImageGL::unbindTexture(0, GL_TEXTURE_2D); | 453 | LLImageGL::unbindTexture(0, GL_TEXTURE_2D); |
458 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | 454 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
459 | glDisableClientState(GL_NORMAL_ARRAY); | 455 | |
460 | glDisableClientState(GL_COLOR_ARRAY); | ||
461 | if (!invisible && mVertexShaderLevel > 1) | ||
462 | { | ||
463 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); | ||
464 | } | ||
465 | |||
466 | diffuse_channel = -1; | 456 | diffuse_channel = -1; |
467 | cube_channel = 0; | 457 | cube_channel = 0; |
468 | mShiny = FALSE; | 458 | mShiny = FALSE; |
@@ -479,10 +469,6 @@ void LLDrawPoolBump::beginFullbrightShiny() | |||
479 | sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD; | 469 | sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD; |
480 | 470 | ||
481 | // Second pass: environment map | 471 | // Second pass: environment map |
482 | glEnableClientState(GL_VERTEX_ARRAY); | ||
483 | glEnableClientState(GL_NORMAL_ARRAY); | ||
484 | glEnableClientState(GL_COLOR_ARRAY); | ||
485 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); | ||
486 | 472 | ||
487 | if (LLPipeline::sUnderWaterRender) | 473 | if (LLPipeline::sUnderWaterRender) |
488 | { | 474 | { |
@@ -564,9 +550,6 @@ void LLDrawPoolBump::endFullbrightShiny() | |||
564 | 550 | ||
565 | LLImageGL::unbindTexture(0, GL_TEXTURE_2D); | 551 | LLImageGL::unbindTexture(0, GL_TEXTURE_2D); |
566 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | 552 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
567 | glDisableClientState(GL_NORMAL_ARRAY); | ||
568 | glDisableClientState(GL_COLOR_ARRAY); | ||
569 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); | ||
570 | 553 | ||
571 | diffuse_channel = -1; | 554 | diffuse_channel = -1; |
572 | cube_channel = 0; | 555 | cube_channel = 0; |
@@ -607,9 +590,7 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL | |||
607 | applyModelMatrix(params); | 590 | applyModelMatrix(params); |
608 | 591 | ||
609 | params.mVertexBuffer->setBuffer(mask); | 592 | params.mVertexBuffer->setBuffer(mask); |
610 | U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer(); | 593 | params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); |
611 | glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount, | ||
612 | GL_UNSIGNED_SHORT, indices_pointer+params.mOffset); | ||
613 | gPipeline.addTrianglesDrawn(params.mCount/3); | 594 | gPipeline.addTrianglesDrawn(params.mCount/3); |
614 | } | 595 | } |
615 | } | 596 | } |
@@ -670,8 +651,6 @@ void LLDrawPoolBump::beginBump() | |||
670 | // TEXTURE UNIT 0 | 651 | // TEXTURE UNIT 0 |
671 | // Output.rgb = texture at texture coord 0 | 652 | // Output.rgb = texture at texture coord 0 |
672 | glActiveTextureARB(GL_TEXTURE0_ARB); | 653 | glActiveTextureARB(GL_TEXTURE0_ARB); |
673 | glClientActiveTextureARB(GL_TEXTURE0_ARB); | ||
674 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); | ||
675 | 654 | ||
676 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); | 655 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); |
677 | glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); | 656 | glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); |
@@ -686,8 +665,6 @@ void LLDrawPoolBump::beginBump() | |||
686 | 665 | ||
687 | // TEXTURE UNIT 1 | 666 | // TEXTURE UNIT 1 |
688 | glActiveTextureARB(GL_TEXTURE1_ARB); | 667 | glActiveTextureARB(GL_TEXTURE1_ARB); |
689 | glClientActiveTextureARB(GL_TEXTURE1_ARB); | ||
690 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); | ||
691 | 668 | ||
692 | glEnable(GL_TEXTURE_2D); // Texture unit 1 | 669 | glEnable(GL_TEXTURE_2D); // Texture unit 1 |
693 | 670 | ||
@@ -752,15 +729,11 @@ void LLDrawPoolBump::endBump() | |||
752 | 729 | ||
753 | // Disable texture unit 1 | 730 | // Disable texture unit 1 |
754 | glActiveTextureARB(GL_TEXTURE1_ARB); | 731 | glActiveTextureARB(GL_TEXTURE1_ARB); |
755 | glClientActiveTextureARB(GL_TEXTURE1_ARB); | ||
756 | glDisable(GL_TEXTURE_2D); // Texture unit 1 | 732 | glDisable(GL_TEXTURE_2D); // Texture unit 1 |
757 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); | ||
758 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | 733 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
759 | 734 | ||
760 | // Disable texture unit 0 | 735 | // Disable texture unit 0 |
761 | glActiveTextureARB(GL_TEXTURE0_ARB); | 736 | glActiveTextureARB(GL_TEXTURE0_ARB); |
762 | glClientActiveTextureARB(GL_TEXTURE0_ARB); | ||
763 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); | ||
764 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | 737 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
765 | 738 | ||
766 | gGL.blendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); | 739 | gGL.blendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); |
@@ -1091,10 +1064,6 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerImage *src_vi, LLIma | |||
1091 | 1064 | ||
1092 | void LLDrawPoolBump::renderBump(U32 type, U32 mask) | 1065 | void LLDrawPoolBump::renderBump(U32 type, U32 mask) |
1093 | { | 1066 | { |
1094 | #if !LL_RELEASE_FOR_DOWNLOAD | ||
1095 | LLGLState::checkClientArrays(mask); | ||
1096 | #endif | ||
1097 | |||
1098 | LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type); | 1067 | LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type); |
1099 | LLCullResult::drawinfo_list_t::iterator end = gPipeline.endRenderMap(type); | 1068 | LLCullResult::drawinfo_list_t::iterator end = gPipeline.endRenderMap(type); |
1100 | 1069 | ||
@@ -1178,11 +1147,8 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) | |||
1178 | } | 1147 | } |
1179 | 1148 | ||
1180 | params.mVertexBuffer->setBuffer(mask); | 1149 | params.mVertexBuffer->setBuffer(mask); |
1181 | U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer(); | 1150 | params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); |
1182 | glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount, | ||
1183 | GL_UNSIGNED_SHORT, indices_pointer+params.mOffset); | ||
1184 | gPipeline.addTrianglesDrawn(params.mCount/3); | 1151 | gPipeline.addTrianglesDrawn(params.mCount/3); |
1185 | |||
1186 | if (params.mTextureMatrix) | 1152 | if (params.mTextureMatrix) |
1187 | { | 1153 | { |
1188 | if (mShiny) | 1154 | if (mShiny) |