mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Rewrite limit_frame_time
This commit is contained in:
parent
aa961dba9e
commit
64b535872d
12
retroarch.c
12
retroarch.c
@ -2531,12 +2531,18 @@ static inline void update_frame_time(void)
|
||||
|
||||
static inline void limit_frame_time(void)
|
||||
{
|
||||
float ffr;
|
||||
double effective_fps, mft_f;
|
||||
retro_time_t current = rarch_get_time_usec();
|
||||
retro_time_t target = 0, to_sleep_ms = 0;
|
||||
|
||||
g_extern.frame_limit.minimum_frame_time = (retro_time_t)
|
||||
roundf(1000000.0f / (g_extern.system.av_info.timing.fps *
|
||||
g_settings.fastforward_ratio));
|
||||
ffr = g_settings.fastforward_ratio;
|
||||
if (ffr < 0.0)
|
||||
ffr = -1.0;
|
||||
effective_fps = (g_extern.system.av_info.timing.fps * ffr);
|
||||
mft_f = 1000000.0f / effective_fps;
|
||||
|
||||
g_extern.frame_limit.minimum_frame_time = (retro_time_t) roundf(mft_f);
|
||||
|
||||
target = g_extern.frame_limit.last_frame_time +
|
||||
g_extern.frame_limit.minimum_frame_time;
|
||||
|
Loading…
x
Reference in New Issue
Block a user