Commit c9a917ee authored by jean-pierre charras's avatar jean-pierre charras

3d viewer: fix a few warning coverity (and a potential bug). fp libs wizard:...

3d viewer: fix a few warning coverity (and a potential bug). fp libs wizard: make it internationalized, and replace an untranslatable string created by grouping 3 strings by one translatable string.
parent 9a6deaeb
...@@ -73,6 +73,8 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, wxGLCanvas ) ...@@ -73,6 +73,8 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, wxGLCanvas )
EVT_MENU_RANGE( ID_POPUP_3D_VIEW_START, ID_POPUP_3D_VIEW_END, EDA_3D_CANVAS::OnPopUpMenu ) EVT_MENU_RANGE( ID_POPUP_3D_VIEW_START, ID_POPUP_3D_VIEW_END, EDA_3D_CANVAS::OnPopUpMenu )
END_EVENT_TABLE() END_EVENT_TABLE()
// Define an invalid value for some unsigned int indexes
#define INVALID_INDEX GL_INVALID_VALUE
EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) : EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) :
wxGLCanvas( parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize, wxGLCanvas( parent, wxID_ANY, attribList, wxDefaultPosition, wxDefaultSize,
...@@ -83,11 +85,10 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) : ...@@ -83,11 +85,10 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( EDA_3D_FRAME* parent, int* attribList ) :
m_shadow_init = false; m_shadow_init = false;
// set an invalide value to not yet initialized indexes managing // set an invalide value to not yet initialized indexes managing
// textures created to enhance 3D rendering // textures created to enhance 3D rendering
// (they are dummy values but we do not want uninitialized values) m_text_pcb = m_text_silk = INVALID_INDEX;
m_text_pcb = m_text_silk = -1; m_text_fake_shadow_front = INVALID_INDEX;
m_text_fake_shadow_front = -1; m_text_fake_shadow_back = INVALID_INDEX;
m_text_fake_shadow_back = -1; m_text_fake_shadow_board = INVALID_INDEX;
m_text_fake_shadow_board = -1;
// position of the front and back layers // position of the front and back layers
// (will be initialized to a better value later) // (will be initialized to a better value later)
...@@ -141,13 +142,15 @@ void EDA_3D_CANVAS::ClearLists( int aGlList ) ...@@ -141,13 +142,15 @@ void EDA_3D_CANVAS::ClearLists( int aGlList )
m_glLists[ii] = 0; m_glLists[ii] = 0;
} }
if( m_text_fake_shadow_front >= 0 ) // When m_text_fake_shadow_??? is set to INVALID_INDEX, textures are no yet
// created.
if( m_text_fake_shadow_front != INVALID_INDEX )
glDeleteTextures( 1, &m_text_fake_shadow_front ); glDeleteTextures( 1, &m_text_fake_shadow_front );
if( m_text_fake_shadow_back >= 0 ) if( m_text_fake_shadow_back != INVALID_INDEX )
glDeleteTextures( 1, &m_text_fake_shadow_back ); glDeleteTextures( 1, &m_text_fake_shadow_back );
if( m_text_fake_shadow_board >= 0 ) if( m_text_fake_shadow_board != INVALID_INDEX )
glDeleteTextures( 1, &m_text_fake_shadow_board ); glDeleteTextures( 1, &m_text_fake_shadow_board );
m_shadow_init = false; m_shadow_init = false;
......
...@@ -85,7 +85,7 @@ int ParseVertex( FILE* File, glm::vec3 &dst_vertex ); ...@@ -85,7 +85,7 @@ int ParseVertex( FILE* File, glm::vec3 &dst_vertex );
* parse a float value * parse a float value
* @param File file to read from * @param File file to read from
* @param dst_float destination float * @param dst_float destination float
* @return int - Return the number of floats readed * @return int - Return the number of floats readed (0 or 1)
*/ */
int ParseFloat( FILE* File, float *dst_float ); int ParseFloat( FILE* File, float *dst_float );
......
...@@ -61,6 +61,7 @@ VRML2_MODEL_PARSER::VRML2_MODEL_PARSER( S3D_MODEL_PARSER* aModelParser ) ...@@ -61,6 +61,7 @@ VRML2_MODEL_PARSER::VRML2_MODEL_PARSER( S3D_MODEL_PARSER* aModelParser )
m_debugSpacer = ""; m_debugSpacer = "";
m_counter_DEF_GROUP = 0; m_counter_DEF_GROUP = 0;
m_counter_USE_GROUP = 0; m_counter_USE_GROUP = 0;
m_discardLastGeometry = false;
} }
......
This diff is collapsed.
This diff is collapsed.
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 9 2015) // C++ code generated with wxFormBuilder (version Jun 5 2014)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <wx/artprov.h> #include <wx/artprov.h>
#include <wx/xrc/xmlres.h> #include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
...@@ -17,14 +18,15 @@ ...@@ -17,14 +18,15 @@
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/radiobut.h> #include <wx/radiobut.h>
#include <wx/sizer.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/hyperlink.h> #include <wx/sizer.h>
#include <wx/bitmap.h> #include <wx/bitmap.h>
#include <wx/image.h> #include <wx/image.h>
#include <wx/icon.h> #include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/hyperlink.h>
#include <wx/dirctrl.h> #include <wx/dirctrl.h>
#include <wx/checklst.h> #include <wx/checklst.h>
#include <wx/srchctrl.h> #include <wx/srchctrl.h>
...@@ -52,9 +54,8 @@ class WIZARD_FPLIB_TABLE_BASE : public wxWizard ...@@ -52,9 +54,8 @@ class WIZARD_FPLIB_TABLE_BASE : public wxWizard
wxStaticText* m_downloadDir; wxStaticText* m_downloadDir;
wxButton* m_btnBrowse; wxButton* m_btnBrowse;
wxStaticText* m_invalidDir; wxStaticText* m_invalidDir;
wxStaticText* m_staticText8; wxStaticBitmap* m_bitmapRepo;
wxHyperlinkCtrl* m_hyperlink1; wxHyperlinkCtrl* m_hyperlinkGithubKicad;
wxStaticText* m_staticText9;
wxStaticText* m_staticText7; wxStaticText* m_staticText7;
wxGenericDirCtrl* m_filePicker; wxGenericDirCtrl* m_filePicker;
wxStaticText* m_staticText112; wxStaticText* m_staticText112;
...@@ -84,7 +85,7 @@ class WIZARD_FPLIB_TABLE_BASE : public wxWizard ...@@ -84,7 +85,7 @@ class WIZARD_FPLIB_TABLE_BASE : public wxWizard
public: public:
WIZARD_FPLIB_TABLE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Add Footprint Libraries Wizard"), const wxBitmap& bitmap = wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ), const wxPoint& pos = wxDefaultPosition, long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); WIZARD_FPLIB_TABLE_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Add Footprint Libraries Wizard"), const wxBitmap& bitmap = wxArtProvider::GetBitmap( wxART_HELP_BOOK, wxART_FRAME_ICON ), const wxPoint& pos = wxDefaultPosition, long style = wxCAPTION|wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER );
WizardPages m_pages; WizardPages m_pages;
~WIZARD_FPLIB_TABLE_BASE(); ~WIZARD_FPLIB_TABLE_BASE();
......
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