diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2016-07-14 17:45:59 +0200 |
|---|---|---|
| committer | Léo Lam <leo@innovatetechnologi.es> | 2016-07-29 17:18:37 +0200 |
| commit | 93f5df419521171c11e16d6a8ff84b9d0d8fd6c0 (patch) | |
| tree | f0d915225a6221acc88716b6f7f8c62a1963fc7a /Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp | |
| parent | 0d783f0869eaef163a318ab4d79744f592ed1cc5 (diff) | |
ControllerInterface: Add RemoveDevice()
This adds RemoveDevice() to ControllerInterface, fixes ExpressionParser
and some other code to support device removals without crashing,
and adds an IsValid() method to Device, to prepare for hotplugging.
Diffstat (limited to 'Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp b/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp index 13dcea4e2f..8f972c9091 100644 --- a/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp +++ b/Source/Core/DolphinWX/InputConfigDiagBitmaps.cpp @@ -4,7 +4,6 @@ #include <cstring> #include <memory> -#include <mutex> #include <string> #include <vector> #include <wx/bitmap.h> @@ -125,6 +124,7 @@ static void DrawButton(unsigned int* const bitmasks, unsigned int buttons, unsig } else { + auto lock = ControllerEmu::GetStateLock(); unsigned char amt = 255 - g->control_group->controls[(row * 8) + n]->control_ref->State() * 128; dc.SetBrush(wxBrush(wxColour(amt, amt, amt))); } @@ -232,17 +232,15 @@ static void DrawControlGroupBox(wxDC& dc, ControlGroupBox* g) } // raw dot - { - ControlState xx, yy; - xx = g->control_group->controls[3]->control_ref->State(); - xx -= g->control_group->controls[2]->control_ref->State(); - yy = g->control_group->controls[1]->control_ref->State(); - yy -= g->control_group->controls[0]->control_ref->State(); + ControlState xx, yy; + xx = g->control_group->controls[3]->control_ref->State(); + xx -= g->control_group->controls[2]->control_ref->State(); + yy = g->control_group->controls[1]->control_ref->State(); + yy -= g->control_group->controls[0]->control_ref->State(); - dc.SetPen(*wxGREY_PEN); - dc.SetBrush(*wxGREY_BRUSH); - DrawCoordinate(dc, xx, yy); - } + dc.SetPen(*wxGREY_PEN); + dc.SetBrush(*wxGREY_BRUSH); + DrawCoordinate(dc, xx, yy); // adjusted dot if (x != 0 || y != 0) @@ -403,6 +401,7 @@ static void DrawControlGroupBox(wxDC& dc, ControlGroupBox* g) for (unsigned int n = 0; n < trigger_count; ++n) { dc.SetBrush(*wxRED_BRUSH); + ControlState trig_d = g->control_group->controls[n]->control_ref->State(); ControlState trig_a = @@ -465,6 +464,7 @@ void InputConfigDialog::UpdateBitmaps(wxTimerEvent& WXUNUSED(event)) GamepadPage* const current_page = (GamepadPage*)m_pad_notebook->GetPage(m_pad_notebook->GetSelection()); + auto lock = ControllerEmu::GetStateLock(); for (ControlGroupBox* g : current_page->control_groups) { // if this control group has a bitmap |
