diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llspatialpartition.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/linden/indra/newview/llspatialpartition.cpp b/linden/indra/newview/llspatialpartition.cpp index 7d715be..c378aad 100644 --- a/linden/indra/newview/llspatialpartition.cpp +++ b/linden/indra/newview/llspatialpartition.cpp | |||
@@ -1906,9 +1906,8 @@ void pushVerts(LLDrawInfo* params, U32 mask) | |||
1906 | { | 1906 | { |
1907 | LLRenderPass::applyModelMatrix(*params); | 1907 | LLRenderPass::applyModelMatrix(*params); |
1908 | params->mVertexBuffer->setBuffer(mask); | 1908 | params->mVertexBuffer->setBuffer(mask); |
1909 | U16* indicesp = (U16*) params->mVertexBuffer->getIndicesPointer(); | 1909 | params->mVertexBuffer->drawRange(params->mParticle ? LLVertexBuffer::POINTS : LLVertexBuffer::TRIANGLES, |
1910 | glDrawRangeElements(params->mParticle ? GL_POINTS : GL_TRIANGLES, params->mStart, params->mEnd, params->mCount, | 1910 | params->mStart, params->mEnd, params->mCount, params->mOffset); |
1911 | GL_UNSIGNED_SHORT, indicesp+params->mOffset); | ||
1912 | } | 1911 | } |
1913 | 1912 | ||
1914 | void pushVerts(LLSpatialGroup* group, U32 mask) | 1913 | void pushVerts(LLSpatialGroup* group, U32 mask) |
@@ -1932,13 +1931,11 @@ void pushVerts(LLFace* face, U32 mask) | |||
1932 | if (buffer) | 1931 | if (buffer) |
1933 | { | 1932 | { |
1934 | buffer->setBuffer(mask); | 1933 | buffer->setBuffer(mask); |
1935 | U16* indicesp = (U16*) buffer->getIndicesPointer(); | ||
1936 | U16 start = face->getGeomStart(); | 1934 | U16 start = face->getGeomStart(); |
1937 | U16 end = start + face->getGeomCount()-1; | 1935 | U16 end = start + face->getGeomCount()-1; |
1938 | U32 count = face->getIndicesCount(); | 1936 | U32 count = face->getIndicesCount(); |
1939 | U16 offset = face->getIndicesStart(); | 1937 | U16 offset = face->getIndicesStart(); |
1940 | 1938 | buffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset); | |
1941 | glDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp + offset); | ||
1942 | } | 1939 | } |
1943 | 1940 | ||
1944 | } | 1941 | } |
@@ -1948,9 +1945,7 @@ void pushBufferVerts(LLVertexBuffer* buffer, U32 mask) | |||
1948 | if (buffer) | 1945 | if (buffer) |
1949 | { | 1946 | { |
1950 | buffer->setBuffer(mask); | 1947 | buffer->setBuffer(mask); |
1951 | U16* indicesp = (U16*) buffer->getIndicesPointer(); | 1948 | buffer->drawRange(LLVertexBuffer::TRIANGLES, 0, buffer->getRequestedVerts()-1, buffer->getRequestedIndices(), 0); |
1952 | glDrawRangeElements(GL_TRIANGLES, 0, buffer->getRequestedVerts(), buffer->getRequestedIndices(), | ||
1953 | GL_UNSIGNED_SHORT, indicesp); | ||
1954 | } | 1949 | } |
1955 | } | 1950 | } |
1956 | 1951 | ||
@@ -1999,9 +1994,8 @@ void pushVertsColorCoded(LLSpatialGroup* group, U32 mask) | |||
1999 | LLRenderPass::applyModelMatrix(*params); | 1994 | LLRenderPass::applyModelMatrix(*params); |
2000 | glColor4f(colors[col].mV[0], colors[col].mV[1], colors[col].mV[2], 0.5f); | 1995 | glColor4f(colors[col].mV[0], colors[col].mV[1], colors[col].mV[2], 0.5f); |
2001 | params->mVertexBuffer->setBuffer(mask); | 1996 | params->mVertexBuffer->setBuffer(mask); |
2002 | U16* indicesp = (U16*) params->mVertexBuffer->getIndicesPointer(); | 1997 | params->mVertexBuffer->drawRange(params->mParticle ? LLVertexBuffer::POINTS : LLVertexBuffer::TRIANGLES, |
2003 | glDrawRangeElements(params->mParticle ? GL_POINTS : GL_TRIANGLES, params->mStart, params->mEnd, params->mCount, | 1998 | params->mStart, params->mEnd, params->mCount, params->mOffset); |
2004 | GL_UNSIGNED_SHORT, indicesp+params->mOffset); | ||
2005 | col = (col+1)%col_count; | 1999 | col = (col+1)%col_count; |
2006 | } | 2000 | } |
2007 | } | 2001 | } |
@@ -2070,8 +2064,7 @@ void renderOctree(LLSpatialGroup* group) | |||
2070 | face->mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX); | 2064 | face->mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX); |
2071 | //drawBox((face->mExtents[0] + face->mExtents[1])*0.5f, | 2065 | //drawBox((face->mExtents[0] + face->mExtents[1])*0.5f, |
2072 | // (face->mExtents[1]-face->mExtents[0])*0.5f); | 2066 | // (face->mExtents[1]-face->mExtents[0])*0.5f); |
2073 | glDrawElements(GL_TRIANGLES, face->getIndicesCount(), GL_UNSIGNED_SHORT, | 2067 | face->mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, face->getIndicesCount(), face->getIndicesStart()); |
2074 | ((U16*) face->mVertexBuffer->getIndicesPointer())+face->getIndicesStart()); | ||
2075 | } | 2068 | } |
2076 | } | 2069 | } |
2077 | 2070 | ||