Commit 4de43d7c authored by Maciej Suminski's avatar Maciej Suminski

Removed unnecessary functions from VBO_VERTEX.

parent 1fc0113b
...@@ -1641,17 +1641,17 @@ void OPENGL_GAL::computeUnitCircle() ...@@ -1641,17 +1641,17 @@ void OPENGL_GAL::computeUnitCircle()
// Insert in a display list and a vector // Insert in a display list and a vector
for( int i = 0; i < CIRCLE_POINTS; i++ ) for( int i = 0; i < CIRCLE_POINTS; i++ )
{ {
VBO_VERTEX v0( 0.0f, 0.0f, 0.0f ); VBO_VERTEX v0 = { 0.0f, 0.0f, 0.0f };
VBO_VERTEX v1( VBO_VERTEX v1 = {
cos( 2.0 * M_PI / CIRCLE_POINTS * i ), // x cos( 2.0 * M_PI / CIRCLE_POINTS * i ), // x
sin( 2.0 * M_PI / CIRCLE_POINTS * i ), // y sin( 2.0 * M_PI / CIRCLE_POINTS * i ), // y
0.0f // z 0.0f // z
); };
VBO_VERTEX v2( VBO_VERTEX v2 = {
cos( 2.0 * M_PI / CIRCLE_POINTS * ( i + 1 ) ), // x cos( 2.0 * M_PI / CIRCLE_POINTS * ( i + 1 ) ), // x
sin( 2.0 * M_PI / CIRCLE_POINTS * ( i + 1 ) ), // y sin( 2.0 * M_PI / CIRCLE_POINTS * ( i + 1 ) ), // y
0.0f // z 0.0f // z
); };
glVertex2d( 0, 0 ); glVertex2d( 0, 0 );
verticesCircle->PushVertex( &v0 ); verticesCircle->PushVertex( &v0 );
...@@ -1680,17 +1680,17 @@ void OPENGL_GAL::computeUnitSemiCircle() ...@@ -1680,17 +1680,17 @@ void OPENGL_GAL::computeUnitSemiCircle()
for( int i = 0; i < CIRCLE_POINTS / 2; ++i ) for( int i = 0; i < CIRCLE_POINTS / 2; ++i )
{ {
VBO_VERTEX v0( 0.0f, 0.0f, 0.0f ); VBO_VERTEX v0 = { 0.0f, 0.0f, 0.0f };
VBO_VERTEX v1( VBO_VERTEX v1 = {
cos( 2.0 * M_PI / CIRCLE_POINTS * i ), // x cos( 2.0 * M_PI / CIRCLE_POINTS * i ), // x
sin( 2.0 * M_PI / CIRCLE_POINTS * i ), // y sin( 2.0 * M_PI / CIRCLE_POINTS * i ), // y
0.0f // z 0.0f // z
); };
VBO_VERTEX v2( VBO_VERTEX v2 = {
cos( 2.0 * M_PI / CIRCLE_POINTS * ( i + 1 ) ), // x cos( 2.0 * M_PI / CIRCLE_POINTS * ( i + 1 ) ), // x
sin( 2.0 * M_PI / CIRCLE_POINTS * ( i + 1 ) ), // y sin( 2.0 * M_PI / CIRCLE_POINTS * ( i + 1 ) ), // y
0.0f // z 0.0f // z
); };
glVertex2d( 0, 0 ); glVertex2d( 0, 0 );
verticesSemiCircle->PushVertex( &v0 ); verticesSemiCircle->PushVertex( &v0 );
...@@ -1749,7 +1749,7 @@ void CALLBACK VertexCallback( GLvoid* aVertexPtr, void* aData ) ...@@ -1749,7 +1749,7 @@ void CALLBACK VertexCallback( GLvoid* aVertexPtr, void* aData )
if( vboItem ) if( vboItem )
{ {
VBO_VERTEX newVertex( vertex[0], vertex[1], vertex[2] ); VBO_VERTEX newVertex = { vertex[0], vertex[1], vertex[2] };
vboItem->PushVertex( &newVertex ); vboItem->PushVertex( &newVertex );
} }
else else
......
...@@ -557,7 +557,7 @@ private: ...@@ -557,7 +557,7 @@ private:
if( isGrouping ) if( isGrouping )
{ {
// New vertex coordinates for VBO // New vertex coordinates for VBO
VBO_VERTEX vertex( aX, aY, aZ ); VBO_VERTEX vertex = { aX, aY, aZ };
curVboItem->PushVertex( &vertex ); curVboItem->PushVertex( &vertex );
} }
else else
......
...@@ -44,22 +44,6 @@ typedef struct VBO_VERTEX ...@@ -44,22 +44,6 @@ typedef struct VBO_VERTEX
GLfloat r, g, b, a; // Color GLfloat r, g, b, a; // Color
GLfloat shader[4]; // Shader type & params GLfloat shader[4]; // Shader type & params
GLfloat _padding; GLfloat _padding;
VBO_VERTEX()
{}
VBO_VERTEX( const GLfloat aX, const GLfloat aY, const GLfloat aZ ) :
x( aX ), y( aY ), z( aZ )
{}
VBO_VERTEX( const GLfloat *aData ) :
x( aData[0] ), y( aData[1] ), z( aData[2] )
{}
operator GLfloat*()
{
return &x;
}
} VBO_VERTEX; } VBO_VERTEX;
class VBO_CONTAINER; class VBO_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