mirror of
https://github.com/libretro/RetroArch
synced 2025-01-26 18:35:22 +00:00
Fix CPU hogging issue on Android when paused.
This commit is contained in:
parent
813a659f8a
commit
35e17e5017
@ -41,6 +41,4 @@ struct droid
|
||||
|
||||
extern struct droid g_android;
|
||||
|
||||
bool android_run_events(struct android_app* android_app);
|
||||
|
||||
#endif
|
||||
|
@ -222,9 +222,9 @@ void engine_handle_cmd(struct android_app* android_app, int32_t cmd)
|
||||
|
||||
#define MAX_ARGS 32
|
||||
|
||||
bool android_run_events(struct android_app* android_app)
|
||||
static bool android_run_events(struct android_app* android_app)
|
||||
{
|
||||
int id = ALooper_pollOnce(0, NULL, 0, NULL);
|
||||
int id = ALooper_pollOnce(-1, NULL, NULL, NULL);
|
||||
|
||||
if (id == LOOPER_ID_MAIN)
|
||||
{
|
||||
@ -242,7 +242,7 @@ bool android_run_events(struct android_app* android_app)
|
||||
|
||||
if (cmd == APP_CMD_INIT_WINDOW)
|
||||
{
|
||||
if(g_extern.lifecycle_state & (1ULL << RARCH_REENTRANT))
|
||||
if (g_extern.lifecycle_state & (1ULL << RARCH_REENTRANT))
|
||||
init_drivers();
|
||||
|
||||
if (android_app->window != NULL)
|
||||
|
@ -166,7 +166,6 @@ static void gfx_ctx_check_window(bool *quit,
|
||||
{
|
||||
(void)frame_count;
|
||||
|
||||
int id;
|
||||
struct android_app* android_app = g_android.app;
|
||||
|
||||
*quit = false;
|
||||
@ -183,9 +182,7 @@ static void gfx_ctx_check_window(bool *quit,
|
||||
RARCH_PERFORMANCE_INIT(alooper_pollonce);
|
||||
RARCH_PERFORMANCE_START(alooper_pollonce);
|
||||
|
||||
id = ALooper_pollOnce(0, NULL, 0, NULL);
|
||||
|
||||
if(id == LOOPER_ID_MAIN)
|
||||
while (ALooper_pollOnce(0, NULL, NULL, NULL) == LOOPER_ID_MAIN)
|
||||
{
|
||||
int8_t cmd;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user