mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-28 02:30:35 +00:00
Try to conserve on CPU usage when in sleep mode by skipping
menu rendering
This commit is contained in:
parent
3e4ba02c9c
commit
4a3b9ffc7c
@ -78,7 +78,7 @@ static int action_select_default(const char *path, const char *label, unsigned t
|
||||
if (action != MENU_ACTION_NOOP)
|
||||
ret = menu_entry_action(&entry, idx, action);
|
||||
|
||||
rarch_main_data_iterate();
|
||||
rarch_main_data_iterate(false);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -31,10 +31,11 @@ void rarch_main_data_deinit(void)
|
||||
rarch_task_deinit();
|
||||
}
|
||||
|
||||
void rarch_main_data_iterate(void)
|
||||
void rarch_main_data_iterate(bool sleeping)
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
menu_iterate_render();
|
||||
if (!sleeping)
|
||||
menu_iterate_render();
|
||||
#endif
|
||||
|
||||
if (data_runloop_msg[0] != '\0')
|
||||
|
@ -26,7 +26,7 @@ typedef int (*transfer_cb_t)(void *data, size_t len);
|
||||
|
||||
void rarch_main_data_clear_state(void);
|
||||
|
||||
void rarch_main_data_iterate(void);
|
||||
void rarch_main_data_iterate(bool sleeping);
|
||||
|
||||
void rarch_main_data_deinit(void);
|
||||
|
||||
|
@ -226,12 +226,16 @@ static void poll_iteration(void)
|
||||
int ret = 0;
|
||||
while (ret != -1)
|
||||
{
|
||||
bool sleeping = false;
|
||||
unsigned sleep_ms = 0;
|
||||
poll_iteration();
|
||||
ret = rarch_main_iterate(&sleep_ms);
|
||||
if (ret == 1 && sleep_ms > 0)
|
||||
{
|
||||
sleeping = true;
|
||||
retro_sleep(sleep_ms);
|
||||
rarch_main_data_iterate();
|
||||
}
|
||||
rarch_main_data_iterate(sleeping);
|
||||
while(CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.002, FALSE) == kCFRunLoopRunHandledSource);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user