diff --git a/Projects/CodeBlocks/SleepyHead.depend b/Projects/CodeBlocks/SleepyHead.depend index f652e52a..60077713 100644 --- a/Projects/CodeBlocks/SleepyHead.depend +++ b/Projects/CodeBlocks/SleepyHead.depend @@ -4134,7 +4134,7 @@ "sleeplib/machine.h" "graph.h" -1305215599 /usr/include/wx-2.9/wx/dcgraph.h +1307528666 /usr/include/wx-2.9/wx/dcgraph.h "wx/dc.h" "wx/geometry.h" "wx/graphics.h" @@ -4145,7 +4145,7 @@ "wx/gdicmn.h" "wx/math.h" -1305215599 /usr/include/wx-2.9/wx/graphics.h +1307528666 /usr/include/wx-2.9/wx/graphics.h "wx/defs.h" "wx/geometry.h" "wx/dynarray.h" @@ -8210,12 +8210,12 @@ "wx/treebase.h" "wx/hashmap.h" -1307618682 source:/home/mark/projects/git/sleepyhead/src/GUIFrame.cpp +1307708368 source:/home/mark/projects/git/sleepyhead/src/GUIFrame.cpp "wx/wxprec.h" "GUIFrame.h" -1307618682 /home/mark/projects/git/sleepyhead/src/GUIFrame.h +1307708368 /home/mark/projects/git/sleepyhead/src/GUIFrame.h @@ -8258,7 +8258,7 @@ 1307418393 /home/mark/projects/git/sleepyhead/src/SleepyHeadApp.h -1307618623 /home/mark/projects/git/sleepyhead/src/SleepyHeadMain.h +1307708712 /home/mark/projects/git/sleepyhead/src/SleepyHeadMain.h "SleepyHeadApp.h" @@ -8304,7 +8304,7 @@ -1307704847 /home/mark/projects/git/sleepyhead/src/version.h +1307708812 /home/mark/projects/git/sleepyhead/src/version.h 1307627540 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h "machine.h" @@ -8322,7 +8322,7 @@ "preferences.h" "tinyxml/tinyxml.h" -1307698043 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp +1307708727 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp "wx_pch.h" "version.h" @@ -8342,10 +8342,11 @@ "sleeplib/profiles.h" "sleeplib/machine_loader.h" -1307704772 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp +1307708472 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp + "graph.h" "sleeplib/profiles.h" diff --git a/src/GUIFrame.cpp b/src/GUIFrame.cpp index 0bdc8dac..c2e40c86 100644 --- a/src/GUIFrame.cpp +++ b/src/GUIFrame.cpp @@ -64,6 +64,9 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons ViewMenuFruitsalad = new wxMenuItem( ViewMenu, wxID_ANY, wxString( _("Fruit Salad") ) , wxEmptyString, wxITEM_CHECK ); ViewMenu->Append( ViewMenuFruitsalad ); + ViewMenuAntiAliasing = new wxMenuItem( ViewMenu, wxID_ANY, wxString( _("Try Anti-Aliasing") ) , wxEmptyString, wxITEM_CHECK ); + ViewMenu->Append( ViewMenuAntiAliasing ); + wxMenuItem* m_separator2; m_separator2 = ViewMenu->AppendSeparator(); @@ -110,6 +113,7 @@ GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, cons this->Connect( ViewMenuSerial->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnShowSerial ) ); this->Connect( ViewMenuLinkGraph->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnLinkGraphs ) ); this->Connect( ViewMenuFruitsalad->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnFruitsalad ) ); + this->Connect( ViewMenuAntiAliasing->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnAntiAliasing ) ); this->Connect( ViewMenuFullscreen->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnFullscreen ) ); this->Connect( ToolsMenuScreenshot->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnScreenshot ) ); this->Connect( HelpMenuAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnAbout ) ); @@ -127,6 +131,7 @@ GUIFrame::~GUIFrame() this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnShowSerial ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnLinkGraphs ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnFruitsalad ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnAntiAliasing ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnFullscreen ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnScreenshot ) ); this->Disconnect( wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnAbout ) ); diff --git a/src/GUIFrame.h b/src/GUIFrame.h index 79a9388c..074104c5 100644 --- a/src/GUIFrame.h +++ b/src/GUIFrame.h @@ -50,6 +50,7 @@ class GUIFrame : public wxFrame wxMenuItem* ViewMenuSerial; wxMenuItem* ViewMenuLinkGraph; wxMenuItem* ViewMenuFruitsalad; + wxMenuItem* ViewMenuAntiAliasing; wxMenu* ProfileMenu; wxMenu* ToolsMenu; wxMenu* HelpMenu; @@ -65,6 +66,7 @@ class GUIFrame : public wxFrame virtual void OnShowSerial( wxCommandEvent& event ) { event.Skip(); } virtual void OnLinkGraphs( wxCommandEvent& event ) { event.Skip(); } virtual void OnFruitsalad( wxCommandEvent& event ) { event.Skip(); } + virtual void OnAntiAliasing( wxCommandEvent& event ) { event.Skip(); } virtual void OnFullscreen( wxCommandEvent& event ) { event.Skip(); } virtual void OnScreenshot( wxCommandEvent& event ) { event.Skip(); } virtual void OnAbout( wxCommandEvent& event ) { event.Skip(); } diff --git a/src/SleepyHeadMain.cpp b/src/SleepyHeadMain.cpp index b9abced2..9aa4c20a 100644 --- a/src/SleepyHeadMain.cpp +++ b/src/SleepyHeadMain.cpp @@ -85,6 +85,7 @@ SleepyHeadFrame::SleepyHeadFrame(wxFrame *frame) if (!pref.Exists("ShowSerialNumbers")) pref["ShowSerialNumbers"]=false; if (!pref.Exists("fruitsalad")) pref["fruitsalad"]=true; if (!pref.Exists("LinkGraphMovement")) pref["LinkGraphMovement"]=true; + if (!pref.Exists("UseAntiAliasing")) pref["UseAntiAliasing"]=false; if (!pref.Exists("ProfileVersion")) pref["ProfileVersion"]=(long)0; if (pref["ProfileVersion"].GetInteger()Check(pref["ShowSerialNumbers"]); ViewMenuFruitsalad->Check(pref["fruitsalad"]); ViewMenuLinkGraph->Check(pref["LinkGraphMovement"]); + ViewMenuAntiAliasing->Check(pref["UseAntiAliasing"]); // wxDisableAsserts(); @@ -268,6 +270,13 @@ void SleepyHeadFrame::OnShowSerial(wxCommandEvent& event) void SleepyHeadFrame::OnFruitsalad(wxCommandEvent& event) { pref["fruitsalad"]=event.IsChecked(); + Refresh(); +} +void SleepyHeadFrame::OnAntiAliasing( wxCommandEvent& event ) +{ + pref["UseAntiAliasing"]=event.IsChecked(); + Refresh(); + } void SleepyHeadFrame::OnAbout(wxCommandEvent &event) diff --git a/src/SleepyHeadMain.h b/src/SleepyHeadMain.h index 8a0359a6..c5985376 100644 --- a/src/SleepyHeadMain.h +++ b/src/SleepyHeadMain.h @@ -111,6 +111,7 @@ class SleepyHeadFrame: public GUIFrame virtual void OnProfileSelected(wxCommandEvent& event); virtual void OnFruitsalad(wxCommandEvent& event); virtual void OnLinkGraphs( wxCommandEvent& event ); + virtual void OnAntiAliasing( wxCommandEvent& event ); virtual void UpdateProfiles(); diff --git a/src/WxWizFrame.fbp b/src/WxWizFrame.fbp index 4fb47c8f..e927d3c6 100644 --- a/src/WxWizFrame.fbp +++ b/src/WxWizFrame.fbp @@ -335,6 +335,21 @@ OnFruitsalad + + + 0 + 1 + + wxID_ANY + wxITEM_CHECK + Try Anti-Aliasing + ViewMenuAntiAliasing + protected + + + OnAntiAliasing + + m_separator2 none diff --git a/src/graphs/graph.cpp b/src/graphs/graph.cpp index d1af74ae..b2df1af2 100644 --- a/src/graphs/graph.cpp +++ b/src/graphs/graph.cpp @@ -8,6 +8,7 @@ License: LGPL #include #include #include +#include #include #include "graph.h" #include "sleeplib/profiles.h" @@ -634,11 +635,18 @@ wxBitmap * gGraphWindow::RenderBitmap(int width,int height) void gGraphWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) { + wxDC *pdc; + if (pref["UseAntiAliasing"]) { + pdc=new wxGCDC(this); + } else { #if defined(__WXMSW__) - wxAutoBufferedPaintDC dc(this); + pdc=new wxAutoBufferedPaintDC(this); #else - wxPaintDC dc(this); + pdc=new wxPaintDC(this); #endif + } + wxDC &dc=*pdc; + GetClientSize(&m_scrX, &m_scrY); dc.SetPen( *wxTRANSPARENT_PEN ); @@ -677,7 +685,7 @@ void gGraphWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) if (m_mouseRBrect.width>0) dc.DrawRectangle(m_mouseRBrect); } - + delete pdc; } void gGraphWindow::OnSize(wxSizeEvent& event) { diff --git a/src/version.h b/src/version.h index 4eb36276..383e7687 100644 --- a/src/version.h +++ b/src/version.h @@ -16,14 +16,14 @@ namespace AutoVersion{ //Standard Version Type static const long MAJOR = 0; static const long MINOR = 7; - static const long BUILD = 4393; - static const long REVISION = 7184; + static const long BUILD = 4416; + static const long REVISION = 7311; //Miscellaneous Version Types - static const long BUILDS_COUNT = 3052; - #define RC_FILEVERSION 0,7,4393,7184 - #define RC_FILEVERSION_STRING "0, 7, 4393, 7184\0" - static const char FULLVERSION_STRING[] = "0.7.4393.7184"; + static const long BUILDS_COUNT = 3112; + #define RC_FILEVERSION 0,7,4416,7311 + #define RC_FILEVERSION_STRING "0, 7, 4416, 7311\0" + static const char FULLVERSION_STRING[] = "0.7.4416.7311"; //These values are to keep track of your versioning state, don't modify them. static const long BUILD_HISTORY = 0;