mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Get rid of RARCH_CTL_SET_{IDLE/PAUSED}
This commit is contained in:
parent
adee2dbe72
commit
e447a4e8e6
@ -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. */
|
||||
|
22
retroarch.c
22
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;
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user