Delete runloop_prepare_dummy

This commit is contained in:
twinaphex 2016-05-16 17:19:16 +02:00
parent d681d30249
commit e10270d459
5 changed files with 29 additions and 21 deletions

View File

@ -56,6 +56,7 @@
#include "managers/state_manager.h"
#include "system.h"
#include "ui/ui_companion_driver.h"
#include "tasks/tasks_internal.h"
#include "list_special.h"
#ifdef HAVE_CHEEVOS
@ -1558,6 +1559,7 @@ static void command_event_main_state(unsigned cmd)
**/
bool command_event(enum event_command cmd, void *data)
{
content_ctx_info_t content_info = {0};
unsigned i = 0;
bool boolean = false;
settings_t *settings = config_get_ptr();
@ -1719,7 +1721,14 @@ bool command_event(enum event_command cmd, void *data)
return false;
break;
case CMD_EVENT_UNLOAD_CORE:
runloop_prepare_dummy();
if (!rarch_task_push_content_load_default(
NULL, NULL,
true,
&content_info,
CORE_TYPE_DUMMY,
CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE,
NULL, NULL))
return false;
command_event(CMD_EVENT_LOAD_CORE_DEINIT, NULL);
break;
case CMD_EVENT_QUIT:

View File

@ -62,6 +62,7 @@
#include "runloop.h"
#include "managers/cheat_manager.h"
#include "system.h"
#include "tasks/tasks_internal.h"
#include "git_version.h"
@ -1519,6 +1520,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data)
* properly. */
bool retroarch_replace_config(char *path)
{
content_ctx_info_t content_info = {0};
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
@ -1539,7 +1541,14 @@ bool retroarch_replace_config(char *path)
*settings->path.libretro = '\0'; /* Load core in new config. */
runloop_prepare_dummy();
if (!rarch_task_push_content_load_default(
NULL, NULL,
true,
&content_info,
CORE_TYPE_DUMMY,
CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE,
NULL, NULL))
return false;
return true;
}

View File

@ -727,7 +727,6 @@ void runloop_iterate_data(void)
task_queue_ctl(TASK_QUEUE_CTL_CHECK, NULL);
}
static bool runloop_is_frame_count_end(void)
{
uint64_t *frame_count =
@ -735,20 +734,6 @@ static bool runloop_is_frame_count_end(void)
return runloop_max_frames && (*frame_count >= runloop_max_frames);
}
bool runloop_prepare_dummy(void)
{
content_ctx_info_t content_info = {0};
runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL);
return rarch_task_push_content_load_default(
NULL, NULL,
true,
&content_info,
CORE_TYPE_DUMMY,
CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE,
NULL, NULL);
}
bool runloop_ctl(enum runloop_ctl_state state, void *data)
{
settings_t *settings = config_get_ptr();
@ -1261,7 +1246,14 @@ static void runloop_iterate_linefeed_overlay(settings_t *settings)
* Aborts core shutdown if invoked. */
static int runloop_iterate_time_to_exit_load_dummy(void)
{
if (!runloop_prepare_dummy())
content_ctx_info_t content_info = {0};
if (!rarch_task_push_content_load_default(
NULL, NULL,
true,
&content_info,
CORE_TYPE_DUMMY,
CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE,
NULL, NULL))
return -1;
runloop_ctl(RUNLOOP_CTL_UNSET_SHUTDOWN, NULL);

View File

@ -312,11 +312,8 @@ void runloop_msg_queue_push(const char *msg, unsigned prio,
char* runloop_msg_queue_pull(void);
bool runloop_prepare_dummy(void);
bool runloop_ctl(enum runloop_ctl_state state, void *data);
#ifdef __cplusplus
}
#endif

View File

@ -1937,6 +1937,7 @@ bool rarch_task_push_content_load_default(
switch (mode)
{
case CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE:
runloop_ctl(RUNLOOP_CTL_STATE_FREE, NULL);
#ifdef HAVE_MENU
menu_driver_ctl(RARCH_MENU_CTL_UNSET_LOAD_NO_CONTENT, NULL);
#endif