diff --git a/common/drawpanel_gal.cpp b/common/drawpanel_gal.cpp index c346247925..822d368739 100644 --- a/common/drawpanel_gal.cpp +++ b/common/drawpanel_gal.cpp @@ -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; diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index e42d3f0fe3..b3382b3ca3 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -755,8 +755,6 @@ void OPENGL_GAL::DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoin void OPENGL_GAL::DrawPolyline( std::deque& 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& aPointList ) return; } + bool isFirstPoint = true; LineCap savedLineCap = lineCap; bool isFirstLine = true; VECTOR2D startEndVector; diff --git a/common/gal/opengl/vbo_container.cpp b/common/gal/opengl/vbo_container.cpp index 80269fc18e..471ebd59f8 100644 --- a/common/gal/opengl/vbo_container.cpp +++ b/common/gal/opengl/vbo_container.cpp @@ -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 ); diff --git a/include/gal/opengl/vbo_item.h b/include/gal/opengl/vbo_item.h index e87a3e8c17..e0e6edc8f1 100644 --- a/include/gal/opengl/vbo_item.h +++ b/include/gal/opengl/vbo_item.h @@ -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;