Rename RARCH_ACTION_STATE_ to RARCH_CTL_

This commit is contained in:
twinaphex 2015-11-30 21:28:55 +01:00
parent 1e8d666758
commit ca71e1a5bb
7 changed files with 51 additions and 51 deletions

View File

@ -319,7 +319,7 @@ void event_disk_control_append_image(const char *path)
* started out in a single disk case, and that this way * started out in a single disk case, and that this way
* of doing it makes the most sense. */ * of doing it makes the most sense. */
rarch_set_paths(path); rarch_set_paths(path);
rarch_ctl(RARCH_ACTION_STATE_FILL_PATHNAMES, NULL); rarch_ctl(RARCH_CTL_FILL_PATHNAMES, NULL);
} }
event_command(EVENT_CMD_AUTOSAVE_INIT); event_command(EVENT_CMD_AUTOSAVE_INIT);
@ -638,7 +638,7 @@ static bool event_init_content(void)
return true; return true;
if (!global->inited.core.no_content) if (!global->inited.core.no_content)
rarch_ctl(RARCH_ACTION_STATE_FILL_PATHNAMES, NULL); rarch_ctl(RARCH_CTL_FILL_PATHNAMES, NULL);
if (!init_content_file()) if (!init_content_file())
return false; return false;
@ -687,7 +687,7 @@ static bool event_init_core(void)
if((settings->sort_savestates_enable || settings->sort_savefiles_enable) && !global->inited.core.no_content) if((settings->sort_savestates_enable || settings->sort_savefiles_enable) && !global->inited.core.no_content)
set_paths_redirect(global->name.base); set_paths_redirect(global->name.base);
rarch_ctl(RARCH_ACTION_STATE_VERIFY_API_VERSION, NULL); rarch_ctl(RARCH_CTL_VERIFY_API_VERSION, NULL);
core.retro_init(); core.retro_init();
global->sram.use = (global->inited.core.type == CORE_TYPE_PLAIN) && global->sram.use = (global->inited.core.type == CORE_TYPE_PLAIN) &&
@ -1026,15 +1026,15 @@ bool event_command(enum event_command cmd)
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
event_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
#endif #endif
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT, NULL); rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL);
break; break;
#ifdef HAVE_FFMPEG #ifdef HAVE_FFMPEG
case EVENT_CMD_LOAD_CONTENT_FFMPEG: case EVENT_CMD_LOAD_CONTENT_FFMPEG:
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT_FFMPEG, NULL); rarch_ctl(RARCH_CTL_LOAD_CONTENT_FFMPEG, NULL);
break; break;
#endif #endif
case EVENT_CMD_LOAD_CONTENT_IMAGEVIEWER: case EVENT_CMD_LOAD_CONTENT_IMAGEVIEWER:
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT_IMAGEVIEWER, NULL); rarch_ctl(RARCH_CTL_LOAD_CONTENT_IMAGEVIEWER, NULL);
break; break;
case EVENT_CMD_LOAD_CONTENT: case EVENT_CMD_LOAD_CONTENT:
{ {
@ -1103,9 +1103,9 @@ bool event_command(enum event_command cmd)
case EVENT_CMD_MENU_TOGGLE: case EVENT_CMD_MENU_TOGGLE:
#ifdef HAVE_MENU #ifdef HAVE_MENU
if (menu_driver_alive()) if (menu_driver_alive())
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
else else
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
#endif #endif
break; break;
case EVENT_CMD_CONTROLLERS_INIT: case EVENT_CMD_CONTROLLERS_INIT:
@ -1147,7 +1147,7 @@ bool event_command(enum event_command cmd)
event_command(EVENT_CMD_LOAD_CORE_DEINIT); event_command(EVENT_CMD_LOAD_CORE_DEINIT);
break; break;
case EVENT_CMD_QUIT: case EVENT_CMD_QUIT:
rarch_ctl(RARCH_ACTION_STATE_QUIT, NULL); rarch_ctl(RARCH_CTL_QUIT, NULL);
break; break;
case EVENT_CMD_REINIT: case EVENT_CMD_REINIT:
{ {
@ -1400,17 +1400,17 @@ bool event_command(enum event_command cmd)
event_command(EVENT_CMD_DRIVERS_INIT); event_command(EVENT_CMD_DRIVERS_INIT);
break; break;
case EVENT_CMD_QUIT_RETROARCH: case EVENT_CMD_QUIT_RETROARCH:
rarch_ctl(RARCH_ACTION_STATE_FORCE_QUIT, NULL); rarch_ctl(RARCH_CTL_FORCE_QUIT, NULL);
break; break;
case EVENT_CMD_SHUTDOWN: case EVENT_CMD_SHUTDOWN:
#if defined(__linux__) && !defined(ANDROID) #if defined(__linux__) && !defined(ANDROID)
rarch_main_msg_queue_push("Shutting down...", 1, 180, true); rarch_main_msg_queue_push("Shutting down...", 1, 180, true);
rarch_ctl(RARCH_ACTION_STATE_FORCE_QUIT, NULL); rarch_ctl(RARCH_CTL_FORCE_QUIT, NULL);
system("shutdown -P now"); system("shutdown -P now");
#endif #endif
break; break;
case EVENT_CMD_RESUME: case EVENT_CMD_RESUME:
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
break; break;
case EVENT_CMD_RESTART_RETROARCH: case EVENT_CMD_RESTART_RETROARCH:
{ {

View File

@ -1306,7 +1306,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
if (driver->frontend_ctx && driver->frontend_ctx->set_fork) if (driver->frontend_ctx && driver->frontend_ctx->set_fork)
driver->frontend_ctx->set_fork(true, true); driver->frontend_ctx->set_fork(true, true);
#elif defined(HAVE_DYNAMIC) #elif defined(HAVE_DYNAMIC)
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT, NULL); rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL);
#endif #endif
if (cmd == RETRO_ENVIRONMENT_EXEC_ESCAPE) if (cmd == RETRO_ENVIRONMENT_EXEC_ESCAPE)

View File

@ -679,7 +679,7 @@ static int generic_action_ok(const char *path,
msg_force = true; msg_force = true;
menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force); menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force);
if (rarch_ctl(RARCH_ACTION_STATE_REPLACE_CONFIG, action_path)) if (rarch_ctl(RARCH_CTL_REPLACE_CONFIG, action_path))
{ {
bool pending_push = false; bool pending_push = false;
menu_navigation_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push); menu_navigation_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
@ -1362,7 +1362,7 @@ static int action_ok_file_load_or_resume(const char *path,
rarch_main_ctl(RARCH_MAIN_CTL_SET_CONTENT_PATH, menu->deferred_path); rarch_main_ctl(RARCH_MAIN_CTL_SET_CONTENT_PATH, menu->deferred_path);
event_command(EVENT_CMD_LOAD_CORE); event_command(EVENT_CMD_LOAD_CORE);
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT, NULL); rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL);
return -1; return -1;
} }

View File

@ -1174,7 +1174,7 @@ int rarch_main_init(int argc, char *argv[])
RARCH_LOG_OUTPUT("=================================================\n"); RARCH_LOG_OUTPUT("=================================================\n");
} }
rarch_ctl(RARCH_ACTION_STATE_VALIDATE_CPU_FEATURES, NULL); rarch_ctl(RARCH_CTL_VALIDATE_CPU_FEATURES, NULL);
config_load(); config_load();
rarch_task_init(); rarch_task_init();
@ -1329,7 +1329,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
switch(state) switch(state)
{ {
case RARCH_ACTION_STATE_REPLACE_CONFIG: case RARCH_CTL_REPLACE_CONFIG:
{ {
char *path = (char*)data; char *path = (char*)data;
@ -1350,7 +1350,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
} }
rarch_main_ctl(RARCH_MAIN_CTL_PREPARE_DUMMY, NULL); rarch_main_ctl(RARCH_MAIN_CTL_PREPARE_DUMMY, NULL);
return true; return true;
case RARCH_ACTION_STATE_MENU_RUNNING: case RARCH_CTL_MENU_RUNNING:
#ifdef HAVE_MENU #ifdef HAVE_MENU
menu_driver_toggle(true); menu_driver_toggle(true);
#endif #endif
@ -1359,36 +1359,36 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
event_command(EVENT_CMD_OVERLAY_DEINIT); event_command(EVENT_CMD_OVERLAY_DEINIT);
#endif #endif
break; break;
case RARCH_ACTION_STATE_LOAD_CONTENT: case RARCH_CTL_LOAD_CONTENT:
#ifdef HAVE_MENU #ifdef HAVE_MENU
/* If content loading fails, we go back to menu. */ /* If content loading fails, we go back to menu. */
if (!menu_load_content(CORE_TYPE_PLAIN)) if (!menu_load_content(CORE_TYPE_PLAIN))
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
#endif #endif
if (driver->frontend_ctx && driver->frontend_ctx->content_loaded) if (driver->frontend_ctx && driver->frontend_ctx->content_loaded)
driver->frontend_ctx->content_loaded(); driver->frontend_ctx->content_loaded();
break; break;
#ifdef HAVE_FFMPEG #ifdef HAVE_FFMPEG
case RARCH_ACTION_STATE_LOAD_CONTENT_FFMPEG: case RARCH_CTL_LOAD_CONTENT_FFMPEG:
#ifdef HAVE_MENU #ifdef HAVE_MENU
/* If content loading fails, we go back to menu. */ /* If content loading fails, we go back to menu. */
if (!menu_load_content(CORE_TYPE_FFMPEG)) if (!menu_load_content(CORE_TYPE_FFMPEG))
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
#endif #endif
if (driver->frontend_ctx && driver->frontend_ctx->content_loaded) if (driver->frontend_ctx && driver->frontend_ctx->content_loaded)
driver->frontend_ctx->content_loaded(); driver->frontend_ctx->content_loaded();
break; break;
#endif #endif
case RARCH_ACTION_STATE_LOAD_CONTENT_IMAGEVIEWER: case RARCH_CTL_LOAD_CONTENT_IMAGEVIEWER:
#ifdef HAVE_MENU #ifdef HAVE_MENU
/* If content loading fails, we go back to menu. */ /* If content loading fails, we go back to menu. */
if (!menu_load_content(CORE_TYPE_IMAGEVIEWER)) if (!menu_load_content(CORE_TYPE_IMAGEVIEWER))
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
#endif #endif
if (driver->frontend_ctx && driver->frontend_ctx->content_loaded) if (driver->frontend_ctx && driver->frontend_ctx->content_loaded)
driver->frontend_ctx->content_loaded(); driver->frontend_ctx->content_loaded();
break; break;
case RARCH_ACTION_STATE_MENU_RUNNING_FINISHED: case RARCH_CTL_MENU_RUNNING_FINISHED:
#ifdef HAVE_MENU #ifdef HAVE_MENU
menu_driver_toggle(false); menu_driver_toggle(false);
#endif #endif
@ -1398,15 +1398,15 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
event_command(EVENT_CMD_OVERLAY_INIT); event_command(EVENT_CMD_OVERLAY_INIT);
#endif #endif
break; break;
case RARCH_ACTION_STATE_QUIT: case RARCH_CTL_QUIT:
if (global) if (global)
system->shutdown = true; system->shutdown = true;
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
break; break;
case RARCH_ACTION_STATE_FORCE_QUIT: case RARCH_CTL_FORCE_QUIT:
rarch_ctl(RARCH_ACTION_STATE_QUIT, NULL); rarch_ctl(RARCH_CTL_QUIT, NULL);
break; break;
case RARCH_ACTION_STATE_VALIDATE_CPU_FEATURES: case RARCH_CTL_VALIDATE_CPU_FEATURES:
{ {
uint64_t cpu = retro_get_cpu_features(); uint64_t cpu = retro_get_cpu_features();
(void)cpu; (void)cpu;
@ -1425,14 +1425,14 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
#endif #endif
} }
break; break;
case RARCH_ACTION_STATE_VERIFY_API_VERSION: case RARCH_CTL_VERIFY_API_VERSION:
RARCH_LOG("Version of libretro API: %u\n", core.retro_api_version()); RARCH_LOG("Version of libretro API: %u\n", core.retro_api_version());
RARCH_LOG("Compiled against API: %u\n", RETRO_API_VERSION); RARCH_LOG("Compiled against API: %u\n", RETRO_API_VERSION);
if (core.retro_api_version() != RETRO_API_VERSION) if (core.retro_api_version() != RETRO_API_VERSION)
RARCH_WARN("%s\n", msg_hash_to_str(MSG_LIBRETRO_ABI_BREAK)); RARCH_WARN("%s\n", msg_hash_to_str(MSG_LIBRETRO_ABI_BREAK));
break; break;
case RARCH_ACTION_STATE_FILL_PATHNAMES: case RARCH_CTL_FILL_PATHNAMES:
rarch_init_savefile_paths(); rarch_init_savefile_paths();
strlcpy(global->bsv.movie_path, global->name.savefile, strlcpy(global->bsv.movie_path, global->name.savefile,
sizeof(global->bsv.movie_path)); sizeof(global->bsv.movie_path));
@ -1450,7 +1450,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
fill_pathname_noext(global->name.ips, global->name.base, ".ips", fill_pathname_noext(global->name.ips, global->name.base, ".ips",
sizeof(global->name.ips)); sizeof(global->name.ips));
break; break;
case RARCH_ACTION_STATE_NONE: case RARCH_CTL_NONE:
default: default:
return false; return false;
} }

View File

@ -55,28 +55,28 @@ extern "C" {
enum rarch_ctl_state enum rarch_ctl_state
{ {
RARCH_ACTION_STATE_NONE = 0, RARCH_CTL_NONE = 0,
RARCH_ACTION_STATE_LOAD_CONTENT, RARCH_CTL_LOAD_CONTENT,
#ifdef HAVE_FFMPEG #ifdef HAVE_FFMPEG
RARCH_ACTION_STATE_LOAD_CONTENT_FFMPEG, RARCH_CTL_LOAD_CONTENT_FFMPEG,
#endif #endif
RARCH_ACTION_STATE_LOAD_CONTENT_IMAGEVIEWER, RARCH_CTL_LOAD_CONTENT_IMAGEVIEWER,
RARCH_ACTION_STATE_MENU_RUNNING, RARCH_CTL_MENU_RUNNING,
RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, RARCH_CTL_MENU_RUNNING_FINISHED,
/* Replaces currently loaded configuration file with /* Replaces currently loaded configuration file with
* another one. Will load a dummy core to flush state * another one. Will load a dummy core to flush state
* properly. */ * properly. */
RARCH_ACTION_STATE_REPLACE_CONFIG, RARCH_CTL_REPLACE_CONFIG,
RARCH_ACTION_STATE_QUIT, RARCH_CTL_QUIT,
RARCH_ACTION_STATE_FORCE_QUIT, RARCH_CTL_FORCE_QUIT,
/* Compare libretro core API version against API version /* Compare libretro core API version against API version
* used by RetroArch. * used by RetroArch.
@ -84,16 +84,16 @@ enum rarch_ctl_state
* TODO - when libretro v2 gets added, allow for switching * TODO - when libretro v2 gets added, allow for switching
* between libretro version backend dynamically. * between libretro version backend dynamically.
*/ */
RARCH_ACTION_STATE_VERIFY_API_VERSION, RARCH_CTL_VERIFY_API_VERSION,
/* Validates CPU features for given processor architecture. /* Validates CPU features for given processor architecture.
* *
* Make sure we haven't compiled for something we cannot run. * Make sure we haven't compiled for something we cannot run.
* Ideally, code would get swapped out depending on CPU support, * Ideally, code would get swapped out depending on CPU support,
* but this will do for now. */ * but this will do for now. */
RARCH_ACTION_STATE_VALIDATE_CPU_FEATURES, RARCH_CTL_VALIDATE_CPU_FEATURES,
RARCH_ACTION_STATE_FILL_PATHNAMES RARCH_CTL_FILL_PATHNAMES
}; };
enum rarch_content_type enum rarch_content_type

View File

@ -794,7 +794,7 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data)
rarch_main_ctl(RARCH_MAIN_CTL_CLEAR_CONTENT_PATH, NULL); rarch_main_ctl(RARCH_MAIN_CTL_CLEAR_CONTENT_PATH, NULL);
rarch_ctl(RARCH_ACTION_STATE_LOAD_CONTENT, NULL); rarch_ctl(RARCH_CTL_LOAD_CONTENT, NULL);
} }
break; break;
case RARCH_MAIN_CTL_SET_CORE_SHUTDOWN: case RARCH_MAIN_CTL_SET_CORE_SHUTDOWN:
@ -1062,10 +1062,10 @@ int rarch_main_iterate(unsigned *sleep_ms)
if (menu_driver_alive()) if (menu_driver_alive())
{ {
if (global->inited.main && (global->inited.core.type != CORE_TYPE_DUMMY)) if (global->inited.main && (global->inited.core.type != CORE_TYPE_DUMMY))
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
} }
else else
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
} }
#endif #endif
@ -1086,7 +1086,7 @@ int rarch_main_iterate(unsigned *sleep_ms)
bool is_idle = rarch_main_ctl(RARCH_MAIN_CTL_IS_IDLE, NULL); bool is_idle = rarch_main_ctl(RARCH_MAIN_CTL_IS_IDLE, NULL);
if (menu_driver_iterate((enum menu_action)menu_input_frame_retropad(input, trigger_input)) == -1) if (menu_driver_iterate((enum menu_action)menu_input_frame_retropad(input, trigger_input)) == -1)
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
if (focused || !is_idle) if (focused || !is_idle)
menu_iterate_render(); menu_iterate_render();

View File

@ -47,7 +47,7 @@ static void rarch_enable_ui(void)
rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean); rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean);
rarch_main_ctl(RARCH_MAIN_CTL_SET_IDLE, &boolean); rarch_main_ctl(RARCH_MAIN_CTL_SET_IDLE, &boolean);
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
} }
static void rarch_disable_ui(void) static void rarch_disable_ui(void)
@ -58,7 +58,7 @@ static void rarch_disable_ui(void)
rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean); rarch_main_ctl(RARCH_MAIN_CTL_SET_PAUSED, &boolean);
rarch_main_ctl(RARCH_MAIN_CTL_SET_IDLE, &boolean); rarch_main_ctl(RARCH_MAIN_CTL_SET_IDLE, &boolean);
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL); rarch_ctl(RARCH_CTL_MENU_RUNNING_FINISHED, NULL);
} }
static void ui_companion_cocoatouch_event_command( static void ui_companion_cocoatouch_event_command(