summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2015-03-24 11:58:11 +1100
committerskidau <skidau@gmail.com>2015-03-24 11:58:11 +1100
commit01cb364c7a93500ce2fb22c4222947dabbdd0696 (patch)
treee8132f36c2719ae44f8edc362e7944baa0ed56c9 /Source/Core
parenta0138e19ccc0c7f9cf0a34a22866506d2e9ba409 (diff)
parentbc1d62036bc1b7bb656fa0d534909d4e6d7cda4c (diff)
Merge pull request #2243 from lioncash/osx-stuff
DolphinWX: Fix a crash that occurs on OSX.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/HotkeyManager.cpp28
-rw-r--r--Source/Core/DolphinWX/Frame.cpp4
2 files changed, 16 insertions, 16 deletions
diff --git a/Source/Core/Core/HotkeyManager.cpp b/Source/Core/Core/HotkeyManager.cpp
index 8c48c80c16..5a8f1f0c9f 100644
--- a/Source/Core/Core/HotkeyManager.cpp
+++ b/Source/Core/Core/HotkeyManager.cpp
@@ -117,11 +117,11 @@ const int num_hotkeys = (sizeof(hotkey_labels) / sizeof(hotkey_labels[0]));
namespace HotkeyManagerEmu
{
-u32 hotkeyDown[3];
-HotkeyStatus hotkey;
-bool enabled;
+static u32 s_hotkeyDown[3];
+static HotkeyStatus s_hotkey;
+static bool s_enabled;
-InputConfig s_config("Hotkeys", _trans("Hotkeys"), "Hotkeys");
+static InputConfig s_config("Hotkeys", _trans("Hotkeys"), "Hotkeys");
InputConfig* GetConfig()
{
@@ -130,36 +130,36 @@ InputConfig* GetConfig()
void GetStatus()
{
- hotkey.err = PAD_ERR_NONE;
+ s_hotkey.err = PAD_ERR_NONE;
// get input
- ((HotkeyManager*)s_config.controllers[0])->GetInput(&hotkey);
+ ((HotkeyManager*)s_config.controllers[0])->GetInput(&s_hotkey);
}
bool IsEnabled()
{
- return enabled;
+ return s_enabled;
}
void Enable(bool enable_toggle)
{
- enabled = enable_toggle;
+ s_enabled = enable_toggle;
}
bool IsPressed(int Id, bool held)
{
unsigned int set = Id / 32;
unsigned int setKey = Id % 32;
- if (hotkey.button[set] & (1 << setKey))
+ if (s_hotkey.button[set] & (1 << setKey))
{
- hotkeyDown[set] |= (1 << setKey);
+ s_hotkeyDown[set] |= (1 << setKey);
if (held)
return true;
}
else
{
- bool pressed = !!(hotkeyDown[set] & (1 << setKey));
- hotkeyDown[set] &= ~(1 << setKey);
+ bool pressed = !!(s_hotkeyDown[set] & (1 << setKey));
+ s_hotkeyDown[set] &= ~(1 << setKey);
if (pressed)
return true;
}
@@ -178,9 +178,9 @@ void Initialize(void* const hwnd)
s_config.LoadConfig(true);
for (unsigned int i = 0; i < 3; ++i)
- hotkeyDown[i] = 0;
+ s_hotkeyDown[i] = 0;
- enabled = true;
+ s_enabled = true;
}
void LoadConfig()
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index 1974717ef5..66d5409bc1 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -358,15 +358,15 @@ bool CFrame::InitControllers()
{
#if defined(HAVE_X11) && HAVE_X11
Window win = X11Utils::XWindowFromHandle(GetHandle());
- HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(win));
Pad::Initialize(reinterpret_cast<void*>(win));
Keyboard::Initialize(reinterpret_cast<void*>(win));
Wiimote::Initialize(reinterpret_cast<void*>(win));
+ HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(win));
#else
- HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(GetHandle()));
Pad::Initialize(reinterpret_cast<void*>(GetHandle()));
Keyboard::Initialize(reinterpret_cast<void*>(GetHandle()));
Wiimote::Initialize(reinterpret_cast<void*>(GetHandle()));
+ HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(GetHandle()));
#endif
return true;
}