From f5ade9fb19a4e7f302d97094eb2ffc86cf64d9db Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sun, 16 Feb 2025 10:56:28 +0300 Subject: [PATCH] Remove idle func --- src/input.cc | 34 +--------------------------------- src/input.h | 3 --- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/input.cc b/src/input.cc index a74eee4..ff2f3c9 100644 --- a/src/input.cc +++ b/src/input.cc @@ -45,11 +45,6 @@ static void screenshotBlitter(unsigned char* src, int src_pitch, int a3, int x, static void buildNormalizedQwertyKeys(); static void _GNW95_process_key(KeyboardData* data); -static void idleImpl(); - -// 0x51E234 -static IdleFunc* _idle_func = nullptr; - // 0x51E23C static int gKeyboardKeyRepeatRate = 80; @@ -149,10 +144,6 @@ int inputInit(int a1) gTickerListHead = nullptr; gScreenshotKeyCode = KEY_ALT_C; - // SFALL: Set idle function. - // CE: Prevents frying CPU when window is not focused. - inputSetIdleFunc(idleImpl); - return 0; } @@ -696,22 +687,6 @@ int inputGetKeyboardKeyRepeatDelay() return gKeyboardKeyRepeatDelay; } -// NOTE: Unused. -// -// 0x4C9448 -void inputSetIdleFunc(IdleFunc* func) -{ - _idle_func = func; -} - -// NOTE: Unused. -// -// 0x4C9450 -IdleFunc* inputGetIdleFunc() -{ - return _idle_func; -} - // 0x4C9490 static void buildNormalizedQwertyKeys() { @@ -1171,17 +1146,10 @@ void _GNW95_lost_focus() while (!gProgramIsActive) { _GNW95_process_message(); - if (_idle_func != nullptr) { - _idle_func(); - } + SDL_Delay(125); } } -static void idleImpl() -{ - SDL_Delay(125); -} - void beginTextInput() { SDL_StartTextInput(); diff --git a/src/input.h b/src/input.h index 8d518be..c4db850 100644 --- a/src/input.h +++ b/src/input.h @@ -3,7 +3,6 @@ namespace fallout { -typedef void(IdleFunc)(); typedef void(TickerProc)(); typedef int(PauseHandler)(); @@ -35,8 +34,6 @@ void inputSetKeyboardKeyRepeatRate(int value); int inputGetKeyboardKeyRepeatRate(); void inputSetKeyboardKeyRepeatDelay(int value); int inputGetKeyboardKeyRepeatDelay(); -void inputSetIdleFunc(IdleFunc* func); -IdleFunc* inputGetIdleFunc(); int _GNW95_input_init(); void _GNW95_process_message(); void _GNW95_clear_time_stamps();