From 2e2bea3b0ca5730b615777fcfa4de678bf27672a Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 11 Oct 2013 14:26:09 +0200 Subject: [PATCH 1/3] Fixed IDs for the push and shove router menu --- pcbnew/router/router_tool.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 075cb17f7d..e38b77379c 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -55,14 +55,14 @@ ROUTER_TOOL::ROUTER_TOOL() : m_menu = new CONTEXT_MENU; m_menu->SetTitle( wxT( "Interactive router" ) ); // fixme: not implemented yet. Sorry. - m_menu->Add( wxT( "Cancel" ), 0 ); - m_menu->Add( wxT( "New track" ), 1 ); - m_menu->Add( wxT( "End track" ), 2 ); - m_menu->Add( wxT( "Auto-end track" ), 3 ); - m_menu->Add( wxT( "Place via" ), 4 ); - m_menu->Add( wxT( "Switch posture" ), 5 ); + m_menu->Add( wxT( "Cancel" ), 1 ); + m_menu->Add( wxT( "New track" ), 2 ); + m_menu->Add( wxT( "End track" ), 3 ); + m_menu->Add( wxT( "Auto-end track" ), 4 ); + m_menu->Add( wxT( "Place via" ), 5 ); + m_menu->Add( wxT( "Switch posture" ), 6 ); - m_menu->Add( wxT( "Routing options..." ), 6 ); + m_menu->Add( wxT( "Routing options..." ), 7 ); } From 31dbe2d2f4ea066225aa426e26b6e8d2f033a29a Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 14 Oct 2013 08:37:58 +0200 Subject: [PATCH 2/3] Marked pnsrouter as dependent on boost --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec2cdaea69..7a7bf0c001 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -415,6 +415,7 @@ add_dependencies( 3d-viewer boost ) add_dependencies( pcad2kicadpcb boost ) add_dependencies( polygon boost ) add_dependencies( pl_editor boost ) +add_dependencies( pnsrouter boost ) ############# From 75bb84704d71df637e151ac0b763c36098f06362 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 14 Oct 2013 11:39:21 +0200 Subject: [PATCH 3/3] Added error messages for OpenGL framebuffer errors. This should eliminate quiet segfaults in case of drivers that cannot handle multiple attachment points for framebuffers. --- common/gal/opengl/opengl_compositor.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/gal/opengl/opengl_compositor.cpp b/common/gal/opengl/opengl_compositor.cpp index 0a212af554..0dd5697191 100644 --- a/common/gal/opengl/opengl_compositor.cpp +++ b/common/gal/opengl/opengl_compositor.cpp @@ -95,8 +95,13 @@ unsigned int OPENGL_COMPOSITOR::CreateBuffer() { wxASSERT( m_initialized ); - if( m_buffers.size() >= m_maxBuffers ) + //if( usedBuffers() >= m_maxBuffers ) + { + wxLogError( wxT( "Cannot create more framebuffers. OpenGL rendering backend requires at" + "least 3 framebuffers. You may try to update/change " + "your graphic drivers." ) ); return 0; // Unfortunately we have no more free buffers left + } // GL_COLOR_ATTACHMENTn are consecutive integers GLuint attachmentPoint = GL_COLOR_ATTACHMENT0 + usedBuffers(); @@ -165,6 +170,8 @@ unsigned int OPENGL_COMPOSITOR::CreateBuffer() wxLogFatalError( wxT( "Cannot create the framebuffer." ) ); break; } + + return 0; } ClearBuffer(); @@ -218,6 +225,11 @@ void OPENGL_COMPOSITOR::ClearBuffer() void OPENGL_COMPOSITOR::DrawBuffer( unsigned int aBufferHandle ) { wxASSERT( m_initialized ); + if( aBufferHandle == 0 || aBufferHandle > usedBuffers() ) + { + wxLogError( wxT( "Wrong framebuffer handle" ) ); + return; + } // Switch to the main framebuffer and blit the scene glBindFramebuffer( GL_FRAMEBUFFER, DIRECT_RENDERING );