diff options
author | Dave SIMmONs <simon@lindenlab.com> | 2010-11-19 13:22:07 -0800 |
---|---|---|
committer | Dave SIMmONs <simon@lindenlab.com> | 2010-11-19 13:22:07 -0800 |
commit | 2eec4949cc49f3c59cdc278be0e7eed1e092b167 (patch) | |
tree | c46a24bf021dccd724ba199bcf48a9b9b6ff0aca /indra/newview/llvowater.cpp | |
parent | 9053aa7d1cb53445f7c7e8d929e3850807b52228 (diff) | |
parent | 1139584b026db86fd20364d0eb21b6e2351f8fb1 (diff) |
Merge latest from lindenlab/viewer-development
Diffstat (limited to 'indra/newview/llvowater.cpp')
-rw-r--r-- | indra/newview/llvowater.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 9280eb8fa4..71f08ec36d 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -60,8 +60,10 @@ const U32 WIDTH = (N_RES * WAVE_STEP); //128.f //64 // width of wave tile, in const F32 WAVE_STEP_INV = (1. / WAVE_STEP); -LLVOWater::LLVOWater(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp) -: LLStaticViewerObject(id, pcode, regionp), +LLVOWater::LLVOWater(const LLUUID &id, + const LLPCode pcode, + LLViewerRegion *regionp) : + LLStaticViewerObject(id, pcode, regionp), mRenderType(LLPipeline::RENDER_TYPE_WATER) { // Terrain must draw during selection passes so it can block objects behind it. @@ -153,11 +155,17 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable) LLStrider<U16> indicesp; U16 index_offset; - S32 size = 16; - S32 num_quads = size*size; - face->setSize(4*num_quads, 6*num_quads); + // A quad is 4 vertices and 6 indices (making 2 triangles) + static const unsigned int vertices_per_quad = 4; + static const unsigned int indices_per_quad = 6; + const S32 size = gSavedSettings.getBOOL("RenderTransparentWater") ? 16 : 1; + + const S32 num_quads = size * size; + face->setSize(vertices_per_quad * num_quads, + indices_per_quad * num_quads); + if (face->mVertexBuffer.isNull()) { face->mVertexBuffer = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_DYNAMIC_DRAW_ARB); |