Commit 062fc2d2 authored by Maciej Suminski's avatar Maciej Suminski

Some cleanup.

parent 5d704c96
......@@ -46,8 +46,9 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
GalType aGalType ) :
wxWindow( aParentWindow, aWindowId, aPosition, aSize )
{
m_gal = NULL;
m_view = NULL;
m_gal = NULL;
m_view = NULL;
m_painter = NULL;
m_galShaderPath = std::string( ::wxGetCwd().mb_str() ) + "/../../gal/opengl/shader/";
......
......@@ -25,7 +25,7 @@
*/
#include <wx/dcbuffer.h>
#include <wx/rawbmp.h>
#include <wx/image.h>
#include <wx/log.h>
#include <gal/cairo/cairo_gal.h>
......@@ -93,6 +93,9 @@ CAIRO_GAL::CAIRO_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
CAIRO_GAL::~CAIRO_GAL()
{
delete cursorPixels;
delete cursorPixelsSaved;
// TODO Deleting of list contents like groups and paths
deleteBitmaps();
}
......@@ -192,11 +195,10 @@ void CAIRO_GAL::EndDrawing()
*wxOutputPtr++ = value & 0xff; // Blue pixel
}
wxImage img( (int) screenSize.x, (int) screenSize.y, (unsigned char*) wxOutput, true);
wxImage img( (int) screenSize.x, (int) screenSize.y, (unsigned char*) wxOutput, true );
wxBitmap bmp( img );
wxClientDC client_dc( this );
wxBufferedDC dc;
// client_dc.DrawBitmap(bmp, 0, 0, false);
dc.Init( &client_dc, bmp );
// Destroy Cairo objects
......@@ -909,7 +911,7 @@ void CAIRO_GAL::allocateBitmaps()
bitmapBuffer = 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
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 };
// #elif defined(__WXMSW__)
// #define glAttributes NULL
// #endif
OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
wxEvtHandler* aPaintListener, bool isUseShaders, const wxString& aName ) :
......
......@@ -150,6 +150,10 @@ VIEW::VIEW( bool aIsDynamic, bool aUseGroups ) :
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_dragStartPoint = VECTOR2D( event.GetX(), event.GetY() );
m_lookStartPoint = m_view->GetCenter(); // ookAtPoint();
m_lookStartPoint = m_view->GetCenter();
}
else if( event.RightUp() )
{
......
......@@ -644,7 +644,7 @@ public:
*/
virtual void DrawCursor( VECTOR2D aCursorPosition ) = 0;
void AdvanceDepth()
inline void AdvanceDepth()
{
layerDepth -= 0.1; // fixme: there should be a minimum step
}
......@@ -652,7 +652,7 @@ public:
/**
* @brief Stores current drawing depth on the depth stack.
*/
void PushDepth()
inline void PushDepth()
{
depthStack.push( layerDepth );
}
......@@ -660,7 +660,7 @@ public:
/**
* @brief Restores previously stored drawing depth for the depth stack.
*/
void PopDepth()
inline void PopDepth()
{
layerDepth = depthStack.top();
depthStack.pop();
......
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