Some cleanup.
This commit is contained in:
parent
5d704c9692
commit
062fc2d200
|
@ -48,6 +48,7 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
|
||||||
{
|
{
|
||||||
m_gal = NULL;
|
m_gal = NULL;
|
||||||
m_view = NULL;
|
m_view = NULL;
|
||||||
|
m_painter = NULL;
|
||||||
|
|
||||||
m_galShaderPath = std::string( ::wxGetCwd().mb_str() ) + "/../../gal/opengl/shader/";
|
m_galShaderPath = std::string( ::wxGetCwd().mb_str() ) + "/../../gal/opengl/shader/";
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <wx/dcbuffer.h>
|
#include <wx/dcbuffer.h>
|
||||||
#include <wx/rawbmp.h>
|
#include <wx/image.h>
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
|
|
||||||
#include <gal/cairo/cairo_gal.h>
|
#include <gal/cairo/cairo_gal.h>
|
||||||
|
@ -93,6 +93,9 @@ CAIRO_GAL::CAIRO_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
|
||||||
|
|
||||||
CAIRO_GAL::~CAIRO_GAL()
|
CAIRO_GAL::~CAIRO_GAL()
|
||||||
{
|
{
|
||||||
|
delete cursorPixels;
|
||||||
|
delete cursorPixelsSaved;
|
||||||
|
|
||||||
// TODO Deleting of list contents like groups and paths
|
// TODO Deleting of list contents like groups and paths
|
||||||
deleteBitmaps();
|
deleteBitmaps();
|
||||||
}
|
}
|
||||||
|
@ -196,7 +199,6 @@ void CAIRO_GAL::EndDrawing()
|
||||||
wxBitmap bmp( img );
|
wxBitmap bmp( img );
|
||||||
wxClientDC client_dc( this );
|
wxClientDC client_dc( this );
|
||||||
wxBufferedDC dc;
|
wxBufferedDC dc;
|
||||||
// client_dc.DrawBitmap(bmp, 0, 0, false);
|
|
||||||
dc.Init( &client_dc, bmp );
|
dc.Init( &client_dc, bmp );
|
||||||
|
|
||||||
// Destroy Cairo objects
|
// Destroy Cairo objects
|
||||||
|
@ -909,7 +911,7 @@ void CAIRO_GAL::allocateBitmaps()
|
||||||
|
|
||||||
bitmapBuffer = new unsigned int[bufferSize];
|
bitmapBuffer = new unsigned int[bufferSize];
|
||||||
bitmapBufferBackup = new unsigned int[bufferSize];
|
bitmapBufferBackup = new unsigned int[bufferSize];
|
||||||
wxOutput = new unsigned char[bufferSize * 4];
|
wxOutput = new unsigned char[bufferSize * 3];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -40,14 +40,7 @@ using namespace KiGfx;
|
||||||
// Prototypes
|
// Prototypes
|
||||||
void InitTesselatorCallbacks( GLUtesselator* aTesselator );
|
void InitTesselatorCallbacks( GLUtesselator* aTesselator );
|
||||||
|
|
||||||
// FIXME Checking of attributes
|
|
||||||
|
|
||||||
// #if defined(__WXGTK__)
|
|
||||||
const int glAttributes[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0 };
|
const int glAttributes[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0 };
|
||||||
// #elif defined(__WXMSW__)
|
|
||||||
// #define glAttributes NULL
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
|
|
||||||
OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
|
OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
|
||||||
wxEvtHandler* aPaintListener, bool isUseShaders, const wxString& aName ) :
|
wxEvtHandler* aPaintListener, bool isUseShaders, const wxString& aName ) :
|
||||||
|
|
|
@ -150,6 +150,10 @@ VIEW::VIEW( bool aIsDynamic, bool aUseGroups ) :
|
||||||
|
|
||||||
VIEW::~VIEW()
|
VIEW::~VIEW()
|
||||||
{
|
{
|
||||||
|
BOOST_FOREACH( LayerMap::value_type& l, m_layers )
|
||||||
|
{
|
||||||
|
delete l.second.items;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ void WX_VIEW_CONTROLS::onButton( wxMouseEvent& event )
|
||||||
{
|
{
|
||||||
m_isDragPanning = true;
|
m_isDragPanning = true;
|
||||||
m_dragStartPoint = VECTOR2D( event.GetX(), event.GetY() );
|
m_dragStartPoint = VECTOR2D( event.GetX(), event.GetY() );
|
||||||
m_lookStartPoint = m_view->GetCenter(); // ookAtPoint();
|
m_lookStartPoint = m_view->GetCenter();
|
||||||
}
|
}
|
||||||
else if( event.RightUp() )
|
else if( event.RightUp() )
|
||||||
{
|
{
|
||||||
|
|
|
@ -644,7 +644,7 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void DrawCursor( VECTOR2D aCursorPosition ) = 0;
|
virtual void DrawCursor( VECTOR2D aCursorPosition ) = 0;
|
||||||
|
|
||||||
void AdvanceDepth()
|
inline void AdvanceDepth()
|
||||||
{
|
{
|
||||||
layerDepth -= 0.1; // fixme: there should be a minimum step
|
layerDepth -= 0.1; // fixme: there should be a minimum step
|
||||||
}
|
}
|
||||||
|
@ -652,7 +652,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Stores current drawing depth on the depth stack.
|
* @brief Stores current drawing depth on the depth stack.
|
||||||
*/
|
*/
|
||||||
void PushDepth()
|
inline void PushDepth()
|
||||||
{
|
{
|
||||||
depthStack.push( layerDepth );
|
depthStack.push( layerDepth );
|
||||||
}
|
}
|
||||||
|
@ -660,7 +660,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief Restores previously stored drawing depth for the depth stack.
|
* @brief Restores previously stored drawing depth for the depth stack.
|
||||||
*/
|
*/
|
||||||
void PopDepth()
|
inline void PopDepth()
|
||||||
{
|
{
|
||||||
layerDepth = depthStack.top();
|
layerDepth = depthStack.top();
|
||||||
depthStack.pop();
|
depthStack.pop();
|
||||||
|
|
Loading…
Reference in New Issue