Merge pull request #3812 from DanyalZia/patch-6

Add an option in UI to enable/disable frameskipping in unthrottle regardless of device
This commit is contained in:
Henrik Rydgård 2013-09-17 05:26:52 -07:00
commit f061288926
4 changed files with 8 additions and 5 deletions

View File

@ -147,6 +147,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename)
graphics->Get("FrameSkip", &iFrameSkip, 0);
graphics->Get("FrameRate", &iFpsLimit, 0);
graphics->Get("FrameSkipUnthrottle", &bFrameSkipUnthrottle, true);
graphics->Get("ForceMaxEmulatedFPS", &iForceMaxEmulatedFPS, 60);
#ifdef USING_GLES2
graphics->Get("AnisotropyLevel", &iAnisotropyLevel, 0);
@ -312,6 +313,7 @@ void Config::Save() {
graphics->Set("InternalResolution", iInternalResolution);
graphics->Set("FrameSkip", iFrameSkip);
graphics->Set("FrameRate", iFpsLimit);
graphics->Set("FrameSkipUnthrottle", bFrameSkipUnthrottle);
graphics->Set("ForceMaxEmulatedFPS", iForceMaxEmulatedFPS);
graphics->Set("AnisotropyLevel", iAnisotropyLevel);
graphics->Set("VertexCache", bVertexCache);

View File

@ -70,6 +70,7 @@ public:
bool bStretchToDisplay;
bool bVSync;
int iFrameSkip;
bool bFrameSkipUnthrottle;
int iWindowX;
int iWindowY;

View File

@ -409,10 +409,9 @@ void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
// we have nothing to do here.
bool doFrameSkip = g_Config.iFrameSkip != 0;
// On non windows, which is always vsync locked, we need to force frameskip when
// unthrottled.
#ifndef _WIN32
if (!throttle) {
if (!throttle && g_Config.bFrameSkipUnthrottle) {
doFrameSkip = true;
skipFrame = true;
if (numSkippedFrames >= 7) {
@ -420,7 +419,7 @@ void DoFrameTiming(bool &throttle, bool &skipFrame, float timestep) {
}
return;
}
#endif
if (!throttle && !doFrameSkip)
return;

View File

@ -114,6 +114,7 @@ void GameSettingsScreen::CreateViews() {
graphicsSettings->Add(new CheckBox(&cap60FPS_, gs->T("Force max 60 FPS (helps GoW)")));
static const char *customSpeed[] = {"Unlimited", "25%", "50%", "75%", "100%", "125%", "150%", "200%", "300%"};
graphicsSettings->Add(new PopupMultiChoice(&iAlternateSpeedPercent_, gs->T("Alternative Speed"), customSpeed, 0, ARRAY_SIZE(customSpeed), gs, screenManager()));
graphicsSettings->Add(new ItemHeader(gs->T("Features")));
graphicsSettings->Add(new CheckBox(&g_Config.bHardwareTransform, gs->T("Hardware Transform")));