[client] fix divide by zero fault with fpsMin disabled (set to 0)

This commit is contained in:
Geoffrey McRae 2020-11-08 10:58:18 +11:00
parent 8ace686df4
commit ed95f8863d
3 changed files with 4 additions and 4 deletions

View file

@ -21,4 +21,4 @@ Place, Suite 330, Boston, MA 02111-1307 USA
void config_init();
bool config_load(int argc, char * argv[]);
void config_free();
void config_free();

View file

@ -166,7 +166,7 @@ static int renderThread(void * unused)
while(state.state != APP_STATE_SHUTDOWN)
{
if (state.frameTime > 0)
if (params.fpsMin != 0)
{
lgWaitEventAbs(e_frame, &time);
clock_gettime(CLOCK_MONOTONIC, &time);
@ -1472,7 +1472,7 @@ static int lg_run()
// ensure renderer viewport is aware of the current window size
updatePositionInfo();
if (params.fpsMin == -1)
if (params.fpsMin <= 0)
{
// default 30 fps
state.frameTime = 1000000000ULL / 30ULL;

View file

@ -138,7 +138,7 @@ struct AppParams
bool center;
int x, y;
unsigned int w, h;
unsigned int fpsMin;
int fpsMin;
bool showFPS;
bool useSpiceInput;
bool useSpiceClipboard;