Fixed Config saving

Fps limit now saves in configuration. It can also be edited there to
allow for any value of fps.
This commit is contained in:
Steven Cherry 2013-05-11 09:03:33 -05:00
parent e7622ebbd6
commit ddf8b26c87
4 changed files with 6 additions and 6 deletions

View file

@ -98,6 +98,7 @@ void Config::Load(const char *iniFileName)
graphics->Get("SSAA", &SSAntiAliasing, 0);
graphics->Get("VBO", &bUseVBO, false);
graphics->Get("FrameSkip", &iFrameSkip, 0);
graphics->Get("FrameRate", &iFpsLimit, 60);
graphics->Get("UseMediaEngine", &bUseMediaEngine, true);
#ifdef USING_GLES2
graphics->Get("AnisotropyLevel", &iAnisotropyLevel, 0);
@ -195,6 +196,7 @@ void Config::Save()
graphics->Set("SSAA", SSAntiAliasing);
graphics->Set("VBO", bUseVBO);
graphics->Set("FrameSkip", iFrameSkip);
graphics->Set("FrameRate", iFpsLimit);
graphics->Set("UseMediaEngine", bUseMediaEngine);
graphics->Set("AnisotropyLevel", iAnisotropyLevel);
graphics->Set("VertexCache", bVertexCache);

View file

@ -67,5 +67,4 @@ struct CoreParameter
// Can be modified at runtime.
bool unthrottle;
int fpsLimit;
double customLimit;
};

View file

@ -310,7 +310,7 @@ void DoFrameTiming(bool &throttle, bool &skipFrame, int &fpsLimiter, double &cus
curFrameTime = time_now_d();
if (nextFrameTime == 0.0)
nextFrameTime = time_now_d() + 1.0 / 60;
nextFrameTime = time_now_d() + 1.0 / 60.0;
if (curFrameTime > nextFrameTime && doFrameSkip) {
// Argh, we are falling behind! Let's skip a frame and see if we catch up.
@ -322,8 +322,8 @@ void DoFrameTiming(bool &throttle, bool &skipFrame, int &fpsLimiter, double &cus
if (curFrameTime < nextFrameTime && throttle)
{
// If time gap is huge just jump (somebody unthrottled)
if (nextFrameTime - curFrameTime > 1.0 / 30) {
nextFrameTime = curFrameTime + 1.0 / 60;
if (nextFrameTime - curFrameTime > 1.0 / 30.0) {
nextFrameTime = curFrameTime + 1.0 / 60.0;
} else {
// Wait until we've catched up.
while (time_now_d() < nextFrameTime) {
@ -343,7 +343,7 @@ void DoFrameTiming(bool &throttle, bool &skipFrame, int &fpsLimiter, double &cus
} else if (fpsLimiter == 1) {
nextFrameTime = std::max(nextFrameTime + 1.0 / customLimiter, time_now_d() - maxFallBehindFrames / customLimiter);
} else if (fpsLimiter == 2) {
nextFrameTime = std::max(nextFrameTime + 1.0 / 2000.0, time_now_d() - maxFallBehindFrames / 2000.0);
return;
}
else {
nextFrameTime = nextFrameTime + 1.0 / 60;

View file

@ -187,7 +187,6 @@ namespace MainWindow
}
void setFpsLimit(int fps) {
g_Config.iFpsLimit = fps;
if(gpu) gpu->ClearCacheNextFrame();
}
BOOL Show(HINSTANCE hInstance, int nCmdShow)