mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-30 19:50:24 +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,9 +31,10 @@ 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
|
||||
if (!sleeping)
|
||||
menu_iterate_render();
|
||||
#endif
|
||||
|
||||
|
@ -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