From 1b1216e53db89f12c63a1a3fc9a47c10b303c64a Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 14 May 2013 10:41:05 +0200 Subject: [PATCH] Modified SetOffset (VBO_ITEM/OpenGL GAL) function. --- common/gal/opengl/vbo_item.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/common/gal/opengl/vbo_item.cpp b/common/gal/opengl/vbo_item.cpp index 2ef84ccf5a..4663dada19 100644 --- a/common/gal/opengl/vbo_item.cpp +++ b/common/gal/opengl/vbo_item.cpp @@ -142,8 +142,18 @@ int VBO_ITEM::GetSize() const void VBO_ITEM::SetOffset( int aOffset ) { + if( m_offset == aOffset ) + return; + + int delta = aOffset - m_offset; + + // Change offset for all the stored indices + for( int i = 0; i < m_size; ++i ) + { + m_indices += delta; + } + m_offset = aOffset; - // TODO change offset for all the vertices? }