Commit 14408414 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: add optional throttle parameter to engineFPSLimit() to limit the...

engine: add optional throttle parameter to engineFPSLimit() to limit the framerate to the refresh rate in menus, etc
parent 301079ed
......@@ -332,7 +332,7 @@ static inline uint64_t calcFrameDelay(int maxFPS)
return tabledivide64(timerGetNanoTickRate(), maxFPS);
}
extern int engineFPSLimit(void);
extern int engineFPSLimit(bool const throttle = false);
#ifdef __cplusplus
}
#endif
......
......@@ -892,7 +892,7 @@ void maybe_redirect_outputs(void)
#endif
}
int engineFPSLimit(void)
int engineFPSLimit(bool const throttle)
{
static uint64_t nextFrameTicks;
static uint64_t savedFrameDelay;
......@@ -900,7 +900,7 @@ int engineFPSLimit(void)
if (r_maxfps == -2)
return true;
g_frameDelay = calcFrameDelay(r_maxfps);
g_frameDelay = calcFrameDelay(!throttle || ((unsigned)(r_maxfps-1) < (unsigned)refreshfreq) ? r_maxfps : -1);
uint64_t frameTicks = timerGetNanoTicks();
......
......@@ -396,7 +396,6 @@ void G_DrawFrags(void);
void G_HandleMirror(int32_t x, int32_t y, int32_t z, fix16_t a, fix16_t horiz, int32_t smoothratio);
void G_DrawRooms(int32_t playerNum,int32_t smoothratio);
void G_DrawTXDigiNumZ(int32_t starttile,int32_t x,int32_t y,int32_t n,int32_t s,int32_t pal,int32_t cs,int32_t x1,int32_t y1,int32_t x2,int32_t y2,int32_t z);
int engineFPSLimit(void);
EDUKE32_NORETURN void G_GameExit(const char *msg = nullptr);
void G_GameQuit(void);
void G_GetCrosshairColor(void);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment