Commit fd6ab600 authored by Maciej Suminski's avatar Maciej Suminski

Bug fixes:

- VBO_CONTAINER::allocate() was returning wrong value in case of error
- framelimiter had wrong formula for computing destined period between frames
- removed _padding field from VBO_VERTEX, as it was not speeding up, but wasting memory
parent 929a849b
......@@ -127,7 +127,7 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool eraseBackground, const wxRect* rect )
// Framerate limiter
wxLongLong currentTimeStamp = wxGetLocalTimeMillis();
if( currentTimeStamp - m_timeStamp < ( 1 / FPS_LIMIT ) )
if( currentTimeStamp - m_timeStamp < ( 1000 / FPS_LIMIT ) )
return;
m_timeStamp = currentTimeStamp;
......
......@@ -755,8 +755,6 @@ void OPENGL_GAL::DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoin
void OPENGL_GAL::DrawPolyline( std::deque<VECTOR2D>& aPointList )
{
bool isFirstPoint = true;
if( isUseShader )
{
// This method reduces amount of triangles used for drawing
......@@ -771,6 +769,7 @@ void OPENGL_GAL::DrawPolyline( std::deque<VECTOR2D>& aPointList )
return;
}
bool isFirstPoint = true;
LineCap savedLineCap = lineCap;
bool isFirstLine = true;
VECTOR2D startEndVector;
......
......@@ -225,7 +225,9 @@ unsigned int VBO_CONTAINER::allocate( VBO_ITEM* aVboItem, unsigned int aSize )
// An error has occurred
if( !result )
{
return UINT_MAX;
}
}
// Look for the space with at least given size
......@@ -236,7 +238,9 @@ unsigned int VBO_CONTAINER::allocate( VBO_ITEM* aVboItem, unsigned int aSize )
// This means that there is enough space for
// storing vertices, but the space is not continous
if( !defragment() )
return false;
{
return UINT_MAX;
}
// We can take the first free chunk, as there is only one after defragmentation
// and we can be sure that it provides enough space to store the object
......@@ -245,6 +249,7 @@ unsigned int VBO_CONTAINER::allocate( VBO_ITEM* aVboItem, unsigned int aSize )
unsigned int chunkSize = it->first;
unsigned int chunkOffset = it->second;
m_freeChunks.erase( it );
wxASSERT( chunkSize >= aSize );
......
......@@ -41,7 +41,6 @@ typedef struct VBO_VERTEX
GLfloat x, y, z; // Coordinates
GLfloat r, g, b, a; // Color
GLfloat shader[4]; // Shader type & params
GLfloat _padding;
} VBO_VERTEX;
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