diff options
Diffstat (limited to 'src/libui_sdl/main.cpp')
-rw-r--r-- | src/libui_sdl/main.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index b30c81b..ee6b80d 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -404,7 +404,6 @@ int EmuThreadFunc(void* burp) u32 lasttick = starttick; u32 lastmeasuretick = lasttick; u32 fpslimitcount = 0; - bool limitfps = true; char melontitle[100]; while (EmuRunning != 0) @@ -516,7 +515,7 @@ int EmuThreadFunc(void* burp) lasttick = curtick; u32 wantedtick = starttick + (u32)((float)fpslimitcount * framerate); - if (curtick < wantedtick && limitfps) + if (curtick < wantedtick && Config::LimitFPS) { SDL_Delay(wantedtick - curtick); } @@ -1533,6 +1532,12 @@ void OnSetScreenFiltering(uiMenuItem* item, uiWindow* window, void* blarg) else Config::ScreenFilter = 0; } +void OnSetLimitFPS(uiMenuItem* item, uiWindow* window, void* blarg) +{ + int chk = uiMenuItemChecked(item); + if (chk != 0) Config::LimitFPS = true; + else Config::LimitFPS = false; +} void ApplyNewSettings() { @@ -1765,6 +1770,10 @@ int main(int argc, char** argv) uiMenuItemOnClicked(menuitem, OnSetScreenFiltering, NULL); uiMenuItemSetChecked(menuitem, Config::ScreenFilter==1); + menuitem = uiMenuAppendCheckItem(menu, "Limit framerate"); + uiMenuItemOnClicked(menuitem, OnSetLimitFPS, NULL); + uiMenuItemSetChecked(menuitem, Config::LimitFPS==1); + int w = Config::WindowWidth; int h = Config::WindowHeight; |