diff --git a/common/gal/opengl/gpu_manager.cpp b/common/gal/opengl/gpu_manager.cpp index 2cba5cc6bd..dc4f210094 100644 --- a/common/gal/opengl/gpu_manager.cpp +++ b/common/gal/opengl/gpu_manager.cpp @@ -136,8 +136,9 @@ void GPU_CACHED_MANAGER::DrawAll() { wxASSERT( m_isDrawing ); - m_indicesSize = m_container->GetSize(); for( unsigned int i = 0; i < m_indicesSize; *m_indicesPtr++ = i++ ); + + m_indicesSize = m_container->GetSize(); } diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 9bd4c67153..281e1d25d3 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -1615,8 +1615,8 @@ void CALLBACK VertexCallback( GLvoid* aVertexPtr, void* aData ) OPENGL_GAL::TessParams* param = static_cast( aData ); VERTEX_MANAGER* vboManager = param->vboManager; - if( vboManager ) - vboManager->Vertex( vertex[0], vertex[1], vertex[2] ); + assert( vboManager ); + vboManager->Vertex( vertex[0], vertex[1], vertex[2] ); } diff --git a/common/gal/opengl/vertex_manager.cpp b/common/gal/opengl/vertex_manager.cpp index 6ee70ca403..5e9b393b0a 100644 --- a/common/gal/opengl/vertex_manager.cpp +++ b/common/gal/opengl/vertex_manager.cpp @@ -239,12 +239,9 @@ void VERTEX_MANAGER::BeginDrawing() const void VERTEX_MANAGER::DrawItem( const VERTEX_ITEM& aItem ) const { int size = aItem.GetSize(); + int offset = aItem.GetOffset(); - if( size > 0 ) - { - int offset = aItem.GetOffset(); - m_gpu->DrawIndices( offset, size ); - } + m_gpu->DrawIndices( offset, size ); }