diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index b98bcd985e..87c6833b87 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -435,14 +435,15 @@ static void android_input_poll_main_cmd(void) case APP_CMD_GAINED_FOCUS: { - bool boolean = false; - bool enable_accelerometer = (android_app->sensor_state_mask & + runloop_state_t *runloop_st = runloop_state_get_ptr(); + bool enable_accelerometer = (android_app->sensor_state_mask & (UINT64_C(1) << RETRO_SENSOR_ACCELEROMETER_DISABLE)); - bool enable_gyroscope = (android_app->sensor_state_mask & + bool enable_gyroscope = (android_app->sensor_state_mask & (UINT64_C(1) << RETRO_SENSOR_GYROSCOPE_DISABLE)); - retroarch_ctl(RARCH_CTL_SET_PAUSED, &boolean); - retroarch_ctl(RARCH_CTL_SET_IDLE, &boolean); + + runloop_st->flags &= ~(RUNLOOP_FLAG_PAUSED + | RUNLOOP_FLAG_IDLE); video_driver_unset_stub_frame(); if (enable_accelerometer) @@ -462,7 +463,6 @@ static void android_input_poll_main_cmd(void) break; case APP_CMD_LOST_FOCUS: { - bool boolean = true; bool disable_accelerometer = (android_app->sensor_state_mask & (UINT64_C(1) << RETRO_SENSOR_ACCELEROMETER_ENABLE)) && android_app->accelerometerSensor; @@ -470,8 +470,8 @@ static void android_input_poll_main_cmd(void) (UINT64_C(1) << RETRO_SENSOR_GYROSCOPE_ENABLE)) && android_app->gyroscopeSensor; - retroarch_ctl(RARCH_CTL_SET_PAUSED, &boolean); - retroarch_ctl(RARCH_CTL_SET_IDLE, &boolean); + runloop_st->flags |= (RUNLOOP_FLAG_PAUSED + | RUNLOOP_FLAG_IDLE); video_driver_set_stub_frame(); /* Avoid draining battery while app is not being used. */ diff --git a/retroarch.c b/retroarch.c index f40b01981f..1441ba95e7 100644 --- a/retroarch.c +++ b/retroarch.c @@ -5545,28 +5545,6 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data) sizeof(input_st->analog_requested)); } break; - case RARCH_CTL_SET_IDLE: - { - bool *ptr = (bool*)data; - if (!ptr) - return false; - if (*ptr) - runloop_st->flags |= RUNLOOP_FLAG_IDLE; - else - runloop_st->flags &= ~RUNLOOP_FLAG_IDLE; - } - break; - case RARCH_CTL_SET_PAUSED: - { - bool *ptr = (bool*)data; - if (!ptr) - return false; - if (*ptr) - runloop_st->flags |= RUNLOOP_FLAG_PAUSED; - else - runloop_st->flags &= ~RUNLOOP_FLAG_PAUSED; - } - break; case RARCH_CTL_SET_SHUTDOWN: runloop_st->flags |= RUNLOOP_FLAG_SHUTDOWN_INITIATED; break; diff --git a/retroarch_types.h b/retroarch_types.h index c802d63986..451fa1e814 100644 --- a/retroarch_types.h +++ b/retroarch_types.h @@ -71,8 +71,6 @@ enum rarch_ctl_state RARCH_CTL_HAS_SET_SUBSYSTEMS, - RARCH_CTL_SET_IDLE, - RARCH_CTL_SET_WINDOWED_SCALE, #ifdef HAVE_CONFIGFILE @@ -85,8 +83,6 @@ enum rarch_ctl_state RARCH_CTL_SET_MISSING_BIOS, RARCH_CTL_UNSET_MISSING_BIOS, - RARCH_CTL_SET_PAUSED, - RARCH_CTL_SET_SHUTDOWN, /* Runloop state */