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

This commit is contained in:
Maciej Suminski 2013-06-26 10:43:58 +02:00
parent db74de74f5
commit 1367d33cd8
2 changed files with 11 additions and 4 deletions

View File

@ -73,15 +73,12 @@ VBO_VERTEX* VBO_ITEM::GetVertices()
if( m_isDirty )
Finish();
return m_container->GetVertices( this );
return m_container->GetVertices( m_offset );
}
void VBO_ITEM::ChangeColor( const COLOR4D& aColor )
{
if( m_isDirty )
Finish();
VBO_VERTEX* vertexPtr = GetVertices();
for( unsigned int i = 0; i < m_size; ++i )

View File

@ -112,6 +112,16 @@ public:
*/
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()
* Returns amount of vertices currently stored in the container.