mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-22 12:40:31 +00:00
Refactor CLEAR_INPUT
This commit is contained in:
parent
a8ef5ff80e
commit
ca1066d60e
@ -82,7 +82,8 @@ static int main_entry_iterate_clear_input(args_type() args)
|
||||
/* Restore libretro keyboard callback. */
|
||||
g_extern.system.key_event = key_event;
|
||||
|
||||
g_extern.lifecycle_state &= ~(1ULL << MODE_CLEAR_INPUT);
|
||||
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_FLUSH_INPUT_FINISHED);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -173,11 +174,8 @@ static int main_entry_iterate_menu(args_type() args)
|
||||
driver_set_nonblock_state(driver.nonblock_state);
|
||||
|
||||
rarch_main_command(RARCH_CMD_AUDIO_START);
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_FLUSH_INPUT);
|
||||
|
||||
g_extern.lifecycle_state |= (1ULL << MODE_CLEAR_INPUT);
|
||||
|
||||
/* If QUIT state came from command interface, we'll only see it
|
||||
* once due to MODE_CLEAR_INPUT. */
|
||||
if (input_key_pressed_func(RARCH_QUIT_KEY) ||
|
||||
!driver.video->alive(driver.video_data))
|
||||
return 1;
|
||||
|
@ -144,6 +144,8 @@ enum action_state
|
||||
RARCH_ACTION_STATE_MENU_RUNNING,
|
||||
RARCH_ACTION_STATE_MENU_RUNNING_FINISHED,
|
||||
RARCH_ACTION_STATE_EXITSPAWN,
|
||||
RARCH_ACTION_STATE_FLUSH_INPUT,
|
||||
RARCH_ACTION_STATE_FLUSH_INPUT_FINISHED,
|
||||
RARCH_ACTION_STATE_QUIT,
|
||||
};
|
||||
|
||||
|
@ -3336,6 +3336,12 @@ void rarch_main_set_state(unsigned cmd)
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED);
|
||||
rarch_main_set_state(RARCH_ACTION_STATE_RUNNING_FINISHED);
|
||||
break;
|
||||
case RARCH_ACTION_STATE_FLUSH_INPUT:
|
||||
g_extern.lifecycle_state |= (1ULL << MODE_CLEAR_INPUT);
|
||||
break;
|
||||
case RARCH_ACTION_STATE_FLUSH_INPUT_FINISHED:
|
||||
g_extern.lifecycle_state &= ~(1ULL << MODE_CLEAR_INPUT);
|
||||
break;
|
||||
case RARCH_ACTION_STATE_NONE:
|
||||
default:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user