diff options
author | Oz Linden <oz@lindenlab.com> | 2011-01-24 11:44:43 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-01-24 11:44:43 -0500 |
commit | f57aa3e83f1b4286b1d6b5cc8bca20fb924cb002 (patch) | |
tree | 12dae11397876ce10d75eeabe5b1656ea18cd6ac /indra/newview/llvowater.cpp | |
parent | b429ff8ec3e1aebc60ff7f4d3376cfc8b9f2e669 (diff) | |
parent | f9b9c7a5816cf0b9627a4a50e73a663667937145 (diff) |
merge changes for i18n fixes
Diffstat (limited to 'indra/newview/llvowater.cpp')
-rw-r--r-- | indra/newview/llvowater.cpp | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 598938b710..71f08ec36d 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -60,8 +60,11 @@ 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, LL_VO_WATER, 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. mbCanSelect = FALSE; @@ -114,7 +117,7 @@ LLDrawable *LLVOWater::createDrawable(LLPipeline *pipeline) { pipeline->allocDrawable(this); mDrawable->setLit(FALSE); - mDrawable->setRenderType(LLPipeline::RENDER_TYPE_WATER); + mDrawable->setRenderType(mRenderType); LLDrawPoolWater *pool = (LLDrawPoolWater*) gPipeline.getPool(LLDrawPool::POOL_WATER); @@ -152,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); @@ -268,6 +277,11 @@ U32 LLVOWater::getPartitionType() const return LLViewerRegion::PARTITION_WATER; } +U32 LLVOVoidWater::getPartitionType() const +{ + return LLViewerRegion::PARTITION_VOIDWATER; +} + LLWaterPartition::LLWaterPartition() : LLSpatialPartition(0, FALSE, 0) { @@ -275,3 +289,9 @@ LLWaterPartition::LLWaterPartition() mDrawableType = LLPipeline::RENDER_TYPE_WATER; mPartitionType = LLViewerRegion::PARTITION_WATER; } + +LLVoidWaterPartition::LLVoidWaterPartition() +{ + mDrawableType = LLPipeline::RENDER_TYPE_VOIDWATER; + mPartitionType = LLViewerRegion::PARTITION_VOIDWATER; +} |