mirror of
https://github.com/libretro/RetroArch
synced 2025-04-25 09:02:44 +00:00
Create menu_content_ctl
This commit is contained in:
parent
8709657d4d
commit
b646b548ff
@ -96,11 +96,11 @@ static void menu_content_environment_get(int *argc, char *argv[],
|
|||||||
* Returns: true (1) if successful, otherwise false (0).
|
* Returns: true (1) if successful, otherwise false (0).
|
||||||
**/
|
**/
|
||||||
|
|
||||||
bool menu_content_load(void)
|
static bool menu_content_load(void)
|
||||||
{
|
{
|
||||||
bool msg_force = true;
|
|
||||||
char name[PATH_MAX_LENGTH];
|
char name[PATH_MAX_LENGTH];
|
||||||
char msg[PATH_MAX_LENGTH];
|
char msg[PATH_MAX_LENGTH];
|
||||||
|
bool msg_force = true;
|
||||||
char *fullpath = NULL;
|
char *fullpath = NULL;
|
||||||
|
|
||||||
runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath);
|
runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath);
|
||||||
@ -134,6 +134,8 @@ bool menu_content_load(void)
|
|||||||
event_cmd_ctl(EVENT_CMD_VIDEO_SET_ASPECT_RATIO, NULL);
|
event_cmd_ctl(EVENT_CMD_VIDEO_SET_ASPECT_RATIO, NULL);
|
||||||
event_cmd_ctl(EVENT_CMD_RESUME, NULL);
|
event_cmd_ctl(EVENT_CMD_RESUME, NULL);
|
||||||
|
|
||||||
|
frontend_driver_content_loaded();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,3 +271,17 @@ int menu_content_defer_core(void *data, const char *dir,
|
|||||||
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, new_core_path);
|
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, new_core_path);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool menu_content_ctl(enum menu_content_ctl_state state, void *data)
|
||||||
|
{
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case MENU_CONTENT_CTL_LOAD:
|
||||||
|
return menu_content_load();
|
||||||
|
case MENU_CONTENT_CTL_NONE:
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@ -25,15 +25,16 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
enum menu_content_ctl_state
|
||||||
* menu_content_load:
|
{
|
||||||
*
|
MENU_CONTENT_CTL_NONE = 0,
|
||||||
* Loads content into currently selected core.
|
/* Loads content into currently selected core.
|
||||||
* Will also optionally push the content entry to the history playlist.
|
* Will also optionally push the content entry
|
||||||
*
|
* to the history playlist. */
|
||||||
* Returns: true (1) if successful, otherwise false (0).
|
MENU_CONTENT_CTL_LOAD
|
||||||
**/
|
};
|
||||||
bool menu_content_load(void);
|
|
||||||
|
bool menu_content_ctl(enum menu_content_ctl_state state, void *data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* menu_content_playlist_load:
|
* menu_content_playlist_load:
|
||||||
|
@ -1477,10 +1477,9 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
|
|||||||
case RARCH_CTL_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_content_load())
|
if (!menu_content_ctl(MENU_CONTENT_CTL_LOAD, NULL))
|
||||||
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
rarch_ctl(RARCH_CTL_MENU_RUNNING, NULL);
|
||||||
#endif
|
#endif
|
||||||
frontend_driver_content_loaded();
|
|
||||||
break;
|
break;
|
||||||
case RARCH_CTL_MENU_RUNNING_FINISHED:
|
case RARCH_CTL_MENU_RUNNING_FINISHED:
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
|
Loading…
x
Reference in New Issue
Block a user