Merge pull request #27 from rkitover/master
fix backcompat on unix for config brkn in 7a7a72f
This commit is contained in:
commit
179987f8c4
|
@ -6,14 +6,6 @@
|
||||||
class BasicDrawingPanel : public DrawingPanel, public wxPanel {
|
class BasicDrawingPanel : public DrawingPanel, public wxPanel {
|
||||||
public:
|
public:
|
||||||
BasicDrawingPanel(wxWindow* parent, int _width, int _height);
|
BasicDrawingPanel(wxWindow* parent, int _width, int _height);
|
||||||
wxWindow* GetWindow()
|
|
||||||
{
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
void Delete()
|
|
||||||
{
|
|
||||||
Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void PaintEv2(wxPaintEvent& ev)
|
void PaintEv2(wxPaintEvent& ev)
|
||||||
|
@ -33,14 +25,6 @@ class GLDrawingPanel : public DrawingPanel, public wxGLCanvas {
|
||||||
public:
|
public:
|
||||||
GLDrawingPanel(wxWindow* parent, int _width, int _height);
|
GLDrawingPanel(wxWindow* parent, int _width, int _height);
|
||||||
virtual ~GLDrawingPanel();
|
virtual ~GLDrawingPanel();
|
||||||
wxWindow* GetWindow()
|
|
||||||
{
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
void Delete()
|
|
||||||
{
|
|
||||||
Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void PaintEv2(wxPaintEvent& ev)
|
void PaintEv2(wxPaintEvent& ev)
|
||||||
|
@ -64,14 +48,6 @@ protected:
|
||||||
class DXDrawingPanel : public DrawingPanel, public wxPanel {
|
class DXDrawingPanel : public DrawingPanel, public wxPanel {
|
||||||
public:
|
public:
|
||||||
DXDrawingPanel(wxWindow* parent, int _width, int _height);
|
DXDrawingPanel(wxWindow* parent, int _width, int _height);
|
||||||
wxWindow* GetWindow()
|
|
||||||
{
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
void Delete()
|
|
||||||
{
|
|
||||||
Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void PaintEv2(wxPaintEvent& ev)
|
void PaintEv2(wxPaintEvent& ev)
|
||||||
|
@ -93,14 +69,6 @@ class CairoDrawingPanel : public DrawingPanel, public wxPanel {
|
||||||
public:
|
public:
|
||||||
CairoDrawingPanel(wxWindow* parent, int _width, int _height);
|
CairoDrawingPanel(wxWindow* parent, int _width, int _height);
|
||||||
~CairoDrawingPanel();
|
~CairoDrawingPanel();
|
||||||
wxWindow* GetWindow()
|
|
||||||
{
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
void Delete()
|
|
||||||
{
|
|
||||||
Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void PaintEv2(wxPaintEvent& ev)
|
void PaintEv2(wxPaintEvent& ev)
|
||||||
|
|
|
@ -53,7 +53,11 @@ static void get_config_path(wxPathList& path, bool exists = true)
|
||||||
{
|
{
|
||||||
// we want paths with "visualboyadvance-m" not "vbam", so change appname temporarily
|
// we want paths with "visualboyadvance-m" not "vbam", so change appname temporarily
|
||||||
wxString current_app_name = wxGetApp().GetAppName();
|
wxString current_app_name = wxGetApp().GetAppName();
|
||||||
|
|
||||||
|
// keep config path as ~/.vbam on UNIX for now for backcompat
|
||||||
|
#if defined(__WXMSW__) || defined(__WXMAC__)
|
||||||
wxGetApp().SetAppName(_("visualboyadvance-m"));
|
wxGetApp().SetAppName(_("visualboyadvance-m"));
|
||||||
|
#endif
|
||||||
|
|
||||||
// local config dir first, then global
|
// local config dir first, then global
|
||||||
// locale-specific res first, then main
|
// locale-specific res first, then main
|
||||||
|
|
|
@ -628,9 +628,11 @@ public:
|
||||||
DrawingPanel(int _width, int _height);
|
DrawingPanel(int _width, int _height);
|
||||||
~DrawingPanel();
|
~DrawingPanel();
|
||||||
void DrawArea(uint8_t** pixels);
|
void DrawArea(uint8_t** pixels);
|
||||||
// the following wouldn't be necessary with virtual inheritance
|
|
||||||
virtual wxWindow* GetWindow() = 0;
|
// using dynamic_cast<> to not force trivial reimplementation in concrete classes
|
||||||
virtual void Delete() = 0;
|
// TODO: figure something out for PaintEv as well
|
||||||
|
virtual wxWindow* GetWindow() { return dynamic_cast<wxWindow*>(this); }
|
||||||
|
virtual void Delete() { (dynamic_cast<wxWindow*>(this))->Destroy(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void DrawArea(wxWindowDC&) = 0;
|
virtual void DrawArea(wxWindowDC&) = 0;
|
||||||
|
|
Loading…
Reference in New Issue