From 03952b75643be287295a4fc4b214ba7b29bfbf44 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 7 Apr 2024 03:00:31 -0500 Subject: [PATCH] GUI: fix division by zero when disabling frame rat e limit --- src/gui/gui.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 8ac6af652..0c4c43b44 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -6468,19 +6468,20 @@ bool FurnaceGUI::loop() { drawTimeEnd=SDL_GetPerformanceCounter(); swapTimeBegin=SDL_GetPerformanceCounter(); if (!settings.vsync || !rend->canVSync()) { - unsigned int presentDelay=SDL_GetPerformanceFrequency()/settings.frameRateLimit; - if ((nextPresentTime-swapTimeBegin)0) { + unsigned int presentDelay=SDL_GetPerformanceFrequency()/settings.frameRateLimit; + if ((nextPresentTime-swapTimeBegin)present();