Merge pull request #81 from degasus/skip_framelimit_hotkey

Add a hotkey for disabling the framelimit.
This commit is contained in:
Tony Wasserka
2014-05-01 12:40:01 +02:00
13 changed files with 38 additions and 38 deletions

View File

@ -940,6 +940,10 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
OSDChoice = 4;
g_Config.bDisableFog = !g_Config.bDisableFog;
}
else if (IsHotkey(event, HK_TOGGLE_THROTTLE))
{
Core::SetIsFramelimiterTempDisabled(true);
}
else if (IsHotkey(event, HK_INCREASE_FRAME_LIMIT))
{
if (++SConfig::GetInstance().m_Framelimit > 0x19)
@ -1040,7 +1044,18 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
void CFrame::OnKeyUp(wxKeyEvent& event)
{
event.Skip();
if(Core::GetState() != Core::CORE_UNINITIALIZED &&
(RendererHasFocus() || TASInputHasFocus()))
{
if (IsHotkey(event, HK_TOGGLE_THROTTLE))
{
Core::SetIsFramelimiterTempDisabled(false);
}
}
else
{
event.Skip();
}
}
void CFrame::OnMouse(wxMouseEvent& event)

View File

@ -233,6 +233,7 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void)
_("Toggle Aspect Ratio"),
_("Toggle EFB Copies"),
_("Toggle Fog"),
_("Toggle Frame limit"),
_("Increase Frame limit"),
_("Decrease Frame limit"),

View File

@ -620,25 +620,6 @@ void Host_UpdateBreakPointView()
}
}
bool Host_GetKeyState(int keycode)
{
#ifdef _WIN32
return (0 != GetAsyncKeyState(keycode));
#elif defined __WXGTK__
std::unique_lock<std::recursive_mutex> lk(main_frame->keystate_lock, std::try_to_lock);
if (!lk.owns_lock())
return false;
bool key_pressed;
if (!wxIsMainThread()) wxMutexGuiEnter();
key_pressed = wxGetKeyState(wxKeyCode(keycode));
if (!wxIsMainThread()) wxMutexGuiLeave();
return key_pressed;
#else
return wxGetKeyState(wxKeyCode(keycode));
#endif
}
void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
{
main_frame->GetRenderWindowSize(x, y, width, height);

View File

@ -85,11 +85,6 @@ void Host_UpdateMainFrame()
void Host_UpdateBreakPointView(){}
bool Host_GetKeyState(int keycode)
{
return false;
}
void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
{
x = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos;

View File

@ -79,11 +79,6 @@ void Host_UpdateMainFrame()
void Host_UpdateBreakPointView(){}
bool Host_GetKeyState(int keycode)
{
return false;
}
void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
{
x = SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos;