Add idle func

This commit is contained in:
Alexander Batalov 2022-08-16 14:24:57 +03:00
parent 0f60556b73
commit cfca07f7f2
1 changed files with 11 additions and 0 deletions

View File

@ -17,6 +17,8 @@
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
static void idleImpl();
// 0x51E234 // 0x51E234
IdleFunc* _idle_func = NULL; IdleFunc* _idle_func = NULL;
@ -411,6 +413,10 @@ int coreInit(int a1)
gTickerListHead = NULL; gTickerListHead = NULL;
gScreenshotKeyCode = KEY_ALT_C; gScreenshotKeyCode = KEY_ALT_C;
// SFALL: Set idle function.
// CE: Prevents frying CPU when window is not focused.
inputSetIdleFunc(idleImpl);
return 0; return 0;
} }
@ -4907,3 +4913,8 @@ void convertMouseWheelToArrowKey(int* keyCodePtr)
} }
} }
} }
static void idleImpl()
{
SDL_Delay(125);
}