Add RUNLOOP_CTL_DATA_ITERATE
This commit is contained in:
parent
746b7dde73
commit
a8c6fc150b
|
@ -32,7 +32,7 @@ static void emscripten_mainloop(void)
|
||||||
int ret = runloop_iterate(&sleep_ms);
|
int ret = runloop_iterate(&sleep_ms);
|
||||||
if (ret == 1 && sleep_ms > 0)
|
if (ret == 1 && sleep_ms > 0)
|
||||||
retro_sleep(sleep_ms);
|
retro_sleep(sleep_ms);
|
||||||
runloop_data_iterate();
|
runloop_ctl(RUNLOOP_CTL_DATA_ITERATE, NULL);
|
||||||
if (ret != -1)
|
if (ret != -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -758,7 +758,7 @@ static void android_app_entry(void *data)
|
||||||
|
|
||||||
if (ret == 1 && sleep_ms > 0)
|
if (ret == 1 && sleep_ms > 0)
|
||||||
retro_sleep(sleep_ms);
|
retro_sleep(sleep_ms);
|
||||||
runloop_data_iterate();
|
runloop_ctl(RUNLOOP_CTL_DATA_ITERATE, NULL);
|
||||||
}while (ret != -1);
|
}while (ret != -1);
|
||||||
|
|
||||||
main_exit(data);
|
main_exit(data);
|
||||||
|
|
|
@ -311,7 +311,7 @@ int rarch_main(int argc, char *argv[], void *data)
|
||||||
|
|
||||||
if (ret == 1 && sleep_ms > 0)
|
if (ret == 1 && sleep_ms > 0)
|
||||||
retro_sleep(sleep_ms);
|
retro_sleep(sleep_ms);
|
||||||
runloop_data_iterate();
|
runloop_ctl(RUNLOOP_CTL_DATA_ITERATE, NULL);
|
||||||
}while(ret != -1);
|
}while(ret != -1);
|
||||||
|
|
||||||
main_exit(args);
|
main_exit(args);
|
||||||
|
|
|
@ -78,7 +78,7 @@ static int action_select_default(const char *path, const char *label, unsigned t
|
||||||
if (action != MENU_ACTION_NOOP)
|
if (action != MENU_ACTION_NOOP)
|
||||||
ret = menu_entry_action(&entry, idx, action);
|
ret = menu_entry_action(&entry, idx, action);
|
||||||
|
|
||||||
runloop_data_iterate();
|
runloop_ctl(RUNLOOP_CTL_DATA_ITERATE, NULL);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -482,6 +482,9 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
|
case RUNLOOP_CTL_DATA_ITERATE:
|
||||||
|
rarch_task_check();
|
||||||
|
return true;
|
||||||
case RUNLOOP_CTL_SHADER_DIR_DEINIT:
|
case RUNLOOP_CTL_SHADER_DIR_DEINIT:
|
||||||
shader_dir_free();
|
shader_dir_free();
|
||||||
return true;
|
return true;
|
||||||
|
@ -1397,12 +1400,6 @@ end:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void runloop_data_iterate(void)
|
|
||||||
{
|
|
||||||
rarch_task_check();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void data_runloop_osd_msg(const char *msg, size_t len)
|
void data_runloop_osd_msg(const char *msg, size_t len)
|
||||||
{
|
{
|
||||||
runloop_msg_queue_push(msg, 1, 10, true);
|
runloop_msg_queue_push(msg, 1, 10, true);
|
||||||
|
|
|
@ -103,6 +103,7 @@ enum runloop_ctl_state
|
||||||
RUNLOOP_CTL_SYSTEM_INFO_GET,
|
RUNLOOP_CTL_SYSTEM_INFO_GET,
|
||||||
RUNLOOP_CTL_SYSTEM_INFO_INIT,
|
RUNLOOP_CTL_SYSTEM_INFO_INIT,
|
||||||
RUNLOOP_CTL_SYSTEM_INFO_FREE,
|
RUNLOOP_CTL_SYSTEM_INFO_FREE,
|
||||||
|
RUNLOOP_CTL_DATA_ITERATE,
|
||||||
RUNLOOP_CTL_PREPARE_DUMMY
|
RUNLOOP_CTL_PREPARE_DUMMY
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -316,8 +317,6 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data);
|
||||||
|
|
||||||
typedef int (*transfer_cb_t)(void *data, size_t len);
|
typedef int (*transfer_cb_t)(void *data, size_t len);
|
||||||
|
|
||||||
void runloop_data_iterate(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -753,7 +753,7 @@ didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||||
- (void)menuSelect: (uint32_t) i
|
- (void)menuSelect: (uint32_t) i
|
||||||
{
|
{
|
||||||
menu_entry_select(i);
|
menu_entry_select(i);
|
||||||
runloop_data_iterate();
|
runloop_ctl(RUNLOOP_CTL_DATA_ITERATE, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)menuBack
|
- (void)menuBack
|
||||||
|
|
|
@ -232,7 +232,7 @@ static void poll_iteration(void)
|
||||||
ret = runloop_iterate(&sleep_ms);
|
ret = runloop_iterate(&sleep_ms);
|
||||||
if (ret == 1 && sleep_ms > 0)
|
if (ret == 1 && sleep_ms > 0)
|
||||||
retro_sleep(sleep_ms);
|
retro_sleep(sleep_ms);
|
||||||
runloop_data_iterate();
|
runloop_ctl(RUNLOOP_CTL_DATA_ITERATE, NULL);
|
||||||
while(CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.002, FALSE) == kCFRunLoopRunHandledSource);
|
while(CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.002, FALSE) == kCFRunLoopRunHandledSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ static void rarch_draw_observer(CFRunLoopObserverRef observer,
|
||||||
|
|
||||||
if (ret == 1 && !ui_companion_is_on_foreground() && sleep_ms > 0)
|
if (ret == 1 && !ui_companion_is_on_foreground() && sleep_ms > 0)
|
||||||
retro_sleep(sleep_ms);
|
retro_sleep(sleep_ms);
|
||||||
runloop_data_iterate();
|
runloop_ctl(RUNLOOP_CTL_DATA_ITERATE, NULL);
|
||||||
|
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue