mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
(Android) Do Android pausing in a different way
This commit is contained in:
parent
7a67348b3c
commit
627fd567a9
@ -60,5 +60,6 @@ struct jni_out_params_char
|
||||
extern struct droid g_android;
|
||||
|
||||
void jni_get_char_argv(struct jni_params *params, struct jni_out_params_char *out_params);
|
||||
bool android_run_events(struct android_app* android_app);
|
||||
|
||||
#endif
|
||||
|
@ -260,7 +260,7 @@ void engine_handle_cmd(struct android_app* android_app, int32_t cmd)
|
||||
|
||||
#define MAX_ARGS 32
|
||||
|
||||
static bool android_run_events(struct android_app* android_app)
|
||||
bool android_run_events(struct android_app* android_app)
|
||||
{
|
||||
// Read all pending events.
|
||||
int id;
|
||||
@ -444,12 +444,7 @@ static void* android_app_entry(void* param)
|
||||
RARCH_LOG("RetroArch started.\n");
|
||||
rarch_init_msg_queue();
|
||||
g_android.last_orient = AConfiguration_getOrientation(android_app->config);
|
||||
while (rarch_main_iterate())
|
||||
{
|
||||
if(g_android.activity_paused)
|
||||
if(!android_run_events(android_app))
|
||||
goto exit;
|
||||
}
|
||||
while(rarch_main_iterate());
|
||||
RARCH_LOG("RetroArch stopped.\n");
|
||||
}
|
||||
|
||||
@ -488,7 +483,7 @@ exit:
|
||||
}
|
||||
|
||||
|
||||
static void android_app_write_cmd(struct android_app* android_app, int8_t cmd)
|
||||
static inline void android_app_write_cmd(struct android_app* android_app, int8_t cmd)
|
||||
{
|
||||
if (write(android_app->msgwrite, &cmd, sizeof(cmd)) != sizeof(cmd))
|
||||
RARCH_ERR("Failure writing android_app cmd: %s\n", strerror(errno));
|
||||
|
@ -2752,6 +2752,11 @@ bool rarch_main_iterate(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
if(g_android.activity_paused)
|
||||
return android_run_events(g_android.app);
|
||||
#endif
|
||||
|
||||
// Time to drop?
|
||||
if (input_key_pressed_func(RARCH_QUIT_KEY) ||
|
||||
!video_alive_func())
|
||||
|
Loading…
x
Reference in New Issue
Block a user