about summary refs log tree commit diff stats
path: root/src/tracker_panel.cpp
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2024-05-14 11:40:58 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2024-05-14 11:40:58 -0400
commit34133b1e330a7d3c2a3e6a6bcd36deb5f95e8f13 (patch)
tree159acd53a925cb8d3e3d44f189b6827f4b27385d /src/tracker_panel.cpp
parent2bab4f7ae28d0d0b836f00e073816bc920e62d55 (diff)
downloadlingo-ap-tracker-34133b1e330a7d3c2a3e6a6bcd36deb5f95e8f13.tar.gz
lingo-ap-tracker-34133b1e330a7d3c2a3e6a6bcd36deb5f95e8f13.tar.bz2
lingo-ap-tracker-34133b1e330a7d3c2a3e6a6bcd36deb5f95e8f13.zip
Double buffered painting looks better
Diffstat (limited to 'src/tracker_panel.cpp')
-rw-r--r--src/tracker_panel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tracker_panel.cpp b/src/tracker_panel.cpp index 5f9f8ea..66bce81 100644 --- a/src/tracker_panel.cpp +++ b/src/tracker_panel.cpp
@@ -1,5 +1,7 @@
1#include "tracker_panel.h" 1#include "tracker_panel.h"
2 2
3#include <wx/dcbuffer.h>
4
3#include "ap_state.h" 5#include "ap_state.h"
4#include "area_popup.h" 6#include "area_popup.h"
5#include "game_data.h" 7#include "game_data.h"
@@ -13,6 +15,8 @@ constexpr int AREA_EFFECTIVE_SIZE = AREA_ACTUAL_SIZE + AREA_BORDER_SIZE * 2;
13constexpr int PLAYER_SIZE = 96; 15constexpr int PLAYER_SIZE = 96;
14 16
15TrackerPanel::TrackerPanel(wxWindow *parent) : wxPanel(parent, wxID_ANY) { 17TrackerPanel::TrackerPanel(wxWindow *parent) : wxPanel(parent, wxID_ANY) {
18 SetBackgroundStyle(wxBG_STYLE_PAINT);
19
16 map_image_ = wxImage(GetAbsolutePath("assets/lingo_map.png").c_str(), 20 map_image_ = wxImage(GetAbsolutePath("assets/lingo_map.png").c_str(),
17 wxBITMAP_TYPE_PNG); 21 wxBITMAP_TYPE_PNG);
18 if (!map_image_.IsOk()) { 22 if (!map_image_.IsOk()) {
@@ -54,7 +58,7 @@ void TrackerPanel::OnPaint(wxPaintEvent &event) {
54 Redraw(); 58 Redraw();
55 } 59 }
56 60
57 wxPaintDC dc(this); 61 wxBufferedPaintDC dc(this);
58 dc.DrawBitmap(rendered_, 0, 0); 62 dc.DrawBitmap(rendered_, 0, 0);
59 63
60 if (AP_GetPlayerPosition().has_value()) { 64 if (AP_GetPlayerPosition().has_value()) {