Add idle func
This commit is contained in:
parent
0f60556b73
commit
cfca07f7f2
11
src/core.cc
11
src/core.cc
|
@ -17,6 +17,8 @@
|
|||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
static void idleImpl();
|
||||
|
||||
// 0x51E234
|
||||
IdleFunc* _idle_func = NULL;
|
||||
|
||||
|
@ -411,6 +413,10 @@ int coreInit(int a1)
|
|||
gTickerListHead = NULL;
|
||||
gScreenshotKeyCode = KEY_ALT_C;
|
||||
|
||||
// SFALL: Set idle function.
|
||||
// CE: Prevents frying CPU when window is not focused.
|
||||
inputSetIdleFunc(idleImpl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -4907,3 +4913,8 @@ void convertMouseWheelToArrowKey(int* keyCodePtr)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void idleImpl()
|
||||
{
|
||||
SDL_Delay(125);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue