Split Func_input and Func_delta when unfocused

Without this, `fixedloop` will loop infinitely until focus is regained.
However, Emscripten won't actually know that focus is regained until
`fixedloop` returns.
This commit is contained in:
leo60228 2021-09-07 11:45:45 -04:00 committed by Misa Elizabeth Kai
parent 7430be69e3
commit d40af63aa3
1 changed files with 4 additions and 1 deletions

View File

@ -239,6 +239,10 @@ static void unfocused_run(void);
static const struct ImplFunc unfocused_func_list[] = {
{
Func_input, /* we still need polling when unfocused */
NULL
},
{
Func_delta,
unfocused_run
}
};
@ -785,7 +789,6 @@ static void unfocused_run(void)
#undef FLIP
}
graphics.render();
gameScreen.FlipScreen(graphics.flipmode);
//We are minimised, so lets put a bit of a delay to save CPU
#ifndef __EMSCRIPTEN__
SDL_Delay(100);