Commit 1367d33c authored by Maciej Suminski's avatar Maciej Suminski

Small speed up for the color change function (OpenGL_GAL).

parent db74de74
...@@ -73,15 +73,12 @@ VBO_VERTEX* VBO_ITEM::GetVertices() ...@@ -73,15 +73,12 @@ VBO_VERTEX* VBO_ITEM::GetVertices()
if( m_isDirty ) if( m_isDirty )
Finish(); Finish();
return m_container->GetVertices( this ); return m_container->GetVertices( m_offset );
} }
void VBO_ITEM::ChangeColor( const COLOR4D& aColor ) void VBO_ITEM::ChangeColor( const COLOR4D& aColor )
{ {
if( m_isDirty )
Finish();
VBO_VERTEX* vertexPtr = GetVertices(); VBO_VERTEX* vertexPtr = GetVertices();
for( unsigned int i = 0; i < m_size; ++i ) for( unsigned int i = 0; i < m_size; ++i )
......
...@@ -112,6 +112,16 @@ public: ...@@ -112,6 +112,16 @@ public:
*/ */
VBO_VERTEX* GetVertices( const VBO_ITEM* aVboItem ) const; VBO_VERTEX* GetVertices( const VBO_ITEM* aVboItem ) const;
/**
* Function GetVertices()
* Returns vertices stored at the specific offset.
* @aOffest is the specific offset.
*/
inline VBO_VERTEX* GetVertices( unsigned int aOffset ) const
{
return &m_vertices[aOffset];
}
/** /**
* Function GetSize() * Function GetSize()
* Returns amount of vertices currently stored in the container. * Returns amount of vertices currently stored in the container.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment