Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add hotkeys to increase/decrease the frame limit.
  • Loading branch information
RachelBryk committed Jul 30, 2013
1 parent a33b1fc commit 44d17b5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Source/Core/Core/Src/ConfigManager.cpp
Expand Up @@ -71,6 +71,8 @@ static const struct {
{ "ToggleAspectRatio", 0, 0 /* wxMOD_NONE */ },
{ "ToggleEFBCopies", 0, 0 /* wxMOD_NONE */ },
{ "ToggleFog", 0, 0 /* wxMOD_NONE */ },
{ "IncreaseFrameLimit", 0, 0 /* wxMOD_NONE */ },
{ "DecreaseFrameLimit", 0, 0 /* wxMOD_NONE */ },
{ "LoadStateSlot1", 340 /* WXK_F1 */, 0 /* wxMOD_NONE */ },
{ "LoadStateSlot2", 341 /* WXK_F2 */, 0 /* wxMOD_NONE */ },
{ "LoadStateSlot3", 342 /* WXK_F3 */, 0 /* wxMOD_NONE */ },
Expand Down
11 changes: 7 additions & 4 deletions Source/Core/Core/Src/CoreParameter.h
Expand Up @@ -34,10 +34,13 @@ enum Hotkey
HK_WIIMOTE4_CONNECT,
HK_BALANCEBOARD_CONNECT,

HK_INTERNAL_RES,
HK_ASPECT_RATIO,
HK_EFB_COPIES,
HK_FOG,
HK_TOGGLE_IR,
HK_TOGGLE_AR,
HK_TOGGLE_EFBCOPIES,
HK_TOGGLE_FOG,

HK_INCREASE_FRAME_LIMIT,
HK_DECREASE_FRAME_LIMIT,

HK_LOAD_STATE_SLOT_1,
HK_LOAD_STATE_SLOT_2,
Expand Down
18 changes: 14 additions & 4 deletions Source/Core/DolphinWX/Src/Frame.cpp
Expand Up @@ -846,20 +846,20 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
WiimoteId = 3;
else if (IsHotkey(event, HK_BALANCEBOARD_CONNECT))
WiimoteId = 4;
if (IsHotkey(event, HK_INTERNAL_RES))
if (IsHotkey(event, HK_TOGGLE_IR))
{
OSDChoice = 1;
// Toggle native resolution
if (++g_Config.iEFBScale > SCALE_4X)
g_Config.iEFBScale = SCALE_AUTO;
}
else if (IsHotkey(event, HK_ASPECT_RATIO))
else if (IsHotkey(event, HK_TOGGLE_AR))
{
OSDChoice = 2;
// Toggle aspect ratio
g_Config.iAspectRatio = (g_Config.iAspectRatio + 1) & 3;
}
else if (IsHotkey(event, HK_EFB_COPIES))
else if (IsHotkey(event, HK_TOGGLE_EFBCOPIES))
{
OSDChoice = 3;
// Toggle EFB copy
Expand All @@ -873,11 +873,21 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
g_Config.bCopyEFBToTexture = !g_Config.bCopyEFBToTexture;
}
}
else if (IsHotkey(event, HK_FOG))
else if (IsHotkey(event, HK_TOGGLE_FOG))
{
OSDChoice = 4;
g_Config.bDisableFog = !g_Config.bDisableFog;
}
else if (IsHotkey(event, HK_INCREASE_FRAME_LIMIT))
{
if (++SConfig::GetInstance().m_Framelimit > 0x19)
SConfig::GetInstance().m_Framelimit = 0;
}
else if (IsHotkey(event, HK_DECREASE_FRAME_LIMIT))
{
if (--SConfig::GetInstance().m_Framelimit > 0x19)
SConfig::GetInstance().m_Framelimit = 0x19;
}
else
{
unsigned int i = NUM_HOTKEYS;
Expand Down
3 changes: 3 additions & 0 deletions Source/Core/DolphinWX/Src/HotkeyDlg.cpp
Expand Up @@ -186,10 +186,13 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void)
_("Connect Wiimote 3"),
_("Connect Wiimote 4"),
_("Connect Balance Board"),

_("Toggle IR"),
_("Toggle Aspect Ratio"),
_("Toggle EFB Copies"),
_("Toggle Fog"),
_("Increase Frame limit"),
_("Decrease Frame limit"),

_("Load State Slot 1"),
_("Load State Slot 2"),
Expand Down

0 comments on commit 44d17b5

Please sign in to comment.