Add set/get functions for IsFramelimiterTempDisabled

This commit is contained in:
degasus 2014-04-30 12:50:29 +02:00
parent 8483811b39
commit 30586f4d29
6 changed files with 18 additions and 7 deletions

View File

@ -124,7 +124,7 @@ void CMixer::PushSamples(const short *samples, unsigned int num_samples)
if (*PowerPC::GetStatePtr() != PowerPC::CPU_RUNNING || soundStream->IsMuted())
break;
// Shortcut key for Throttle Skipping
if (Core::IsFramelimiterTempDisabled)
if (Core::GetIsFramelimiterTempDisabled())
break;
SLEEP(1);
soundStream->Update();

View File

@ -90,7 +90,17 @@ static bool g_requestRefreshInfo = false;
static int g_pauseAndLockDepth = 0;
SCoreStartupParameter g_CoreStartupParameter;
bool IsFramelimiterTempDisabled = false;
static bool IsFramelimiterTempDisabled = false;
bool GetIsFramelimiterTempDisabled()
{
return IsFramelimiterTempDisabled;
}
void SetIsFramelimiterTempDisabled(bool disable)
{
IsFramelimiterTempDisabled = disable;
}
std::string GetStateFileName() { return g_stateFileName; }
void SetStateFileName(std::string val) { g_stateFileName = val; }

View File

@ -24,7 +24,8 @@ namespace Core
// TODO: kill, use SConfig instead
extern SCoreStartupParameter g_CoreStartupParameter;
extern bool IsFramelimiterTempDisabled;
bool GetIsFramelimiterTempDisabled();
void SetIsFramelimiterTempDisabled(bool disable);
void Callback_VideoCopiedToXFB(bool video_update);

View File

@ -238,7 +238,7 @@ void ThrottleCallback(u64 last_time, int cyclesLate)
int diff = (u32)last_time - time;
const SConfig& config = SConfig::GetInstance();
bool frame_limiter = config.m_Framelimit && config.m_Framelimit != 2 && !Core::IsFramelimiterTempDisabled;
bool frame_limiter = config.m_Framelimit && config.m_Framelimit != 2 && !Core::GetIsFramelimiterTempDisabled();
u32 next_event = GetTicksPerSecond()/1000;
if (SConfig::GetInstance().m_Framelimit > 2)
{

View File

@ -942,7 +942,7 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
}
else if (IsHotkey(event, HK_TOGGLE_THROTTLE))
{
Core::IsFramelimiterTempDisabled = true;
Core::SetIsFramelimiterTempDisabled(true);
}
else if (IsHotkey(event, HK_INCREASE_FRAME_LIMIT))
{
@ -1049,7 +1049,7 @@ void CFrame::OnKeyUp(wxKeyEvent& event)
{
if (IsHotkey(event, HK_TOGGLE_THROTTLE))
{
Core::IsFramelimiterTempDisabled = false;
Core::SetIsFramelimiterTempDisabled(false);
}
}
else

View File

@ -276,5 +276,5 @@ void VideoConfig::Save(const std::string& ini_file)
bool VideoConfig::IsVSync()
{
return Core::IsFramelimiterTempDisabled ? false : bVSync;
return bVSync && !Core::GetIsFramelimiterTempDisabled();
}