diff options
Diffstat (limited to 'src/subway_map.cpp')
| -rw-r--r-- | src/subway_map.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
| diff --git a/src/subway_map.cpp b/src/subway_map.cpp index 7d9786d..f857270 100644 --- a/src/subway_map.cpp +++ b/src/subway_map.cpp | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | #include "subway_map.h" | 1 | #include "subway_map.h" |
| 2 | 2 | ||
| 3 | #include <wx/dcbuffer.h> | ||
| 4 | |||
| 3 | #include "game_data.h" | 5 | #include "game_data.h" |
| 4 | #include "global.h" | 6 | #include "global.h" |
| 5 | #include "tracker_state.h" | 7 | #include "tracker_state.h" |
| @@ -13,6 +15,8 @@ enum class ItemDrawType { | |||
| 13 | }; | 15 | }; |
| 14 | 16 | ||
| 15 | SubwayMap::SubwayMap(wxWindow *parent) : wxPanel(parent, wxID_ANY) { | 17 | SubwayMap::SubwayMap(wxWindow *parent) : wxPanel(parent, wxID_ANY) { |
| 18 | SetBackgroundStyle(wxBG_STYLE_PAINT); | ||
| 19 | |||
| 16 | map_image_ = | 20 | map_image_ = |
| 17 | wxImage(GetAbsolutePath("assets/subway.png").c_str(), wxBITMAP_TYPE_PNG); | 21 | wxImage(GetAbsolutePath("assets/subway.png").c_str(), wxBITMAP_TYPE_PNG); |
| 18 | if (!map_image_.IsOk()) { | 22 | if (!map_image_.IsOk()) { |
| @@ -47,7 +51,7 @@ void SubwayMap::OnPaint(wxPaintEvent &event) { | |||
| 47 | Redraw(); | 51 | Redraw(); |
| 48 | } | 52 | } |
| 49 | 53 | ||
| 50 | wxPaintDC dc(this); | 54 | wxBufferedPaintDC dc(this); |
| 51 | dc.DrawBitmap(rendered_, 0, 0); | 55 | dc.DrawBitmap(rendered_, 0, 0); |
| 52 | 56 | ||
| 53 | event.Skip(); | 57 | event.Skip(); |
