command_event should only be used for events that the user can call,

so start moving things that the user shouldn't call to rarch_main_ctl
instead
This commit is contained in:
twinaphex 2015-11-29 00:15:51 +01:00
parent c5f547b02b
commit bd6b79fdee
5 changed files with 14 additions and 14 deletions

View File

@ -1625,13 +1625,6 @@ bool event_command(enum event_command cmd)
if (global->sram.use)
event_command(EVENT_CMD_AUTOSAVE_INIT);
break;
case EVENT_CMD_MSG_QUEUE_DEINIT:
rarch_main_msg_queue_free();
break;
case EVENT_CMD_MSG_QUEUE_INIT:
event_command(EVENT_CMD_MSG_QUEUE_DEINIT);
rarch_main_msg_queue_init();
break;
case EVENT_CMD_BSV_MOVIE_DEINIT:
if (!global)
break;

View File

@ -147,10 +147,6 @@ enum event_command
EVENT_CMD_SAVEFILES_INIT,
/* Deinitializes savefiles. */
EVENT_CMD_SAVEFILES_DEINIT,
/* Initializes message queue. */
EVENT_CMD_MSG_QUEUE_INIT,
/* Deinitializes message queue. */
EVENT_CMD_MSG_QUEUE_DEINIT,
/* Initializes cheats. */
EVENT_CMD_CHEATS_INIT,
/* Deinitializes cheats. */

View File

@ -1090,12 +1090,12 @@ void rarch_main_new(void)
init_state();
main_init_state_config();
event_command(EVENT_CMD_MSG_QUEUE_INIT);
rarch_main_ctl(RARCH_MAIN_CTL_MSG_QUEUE_INIT, NULL);
}
void rarch_main_free(void)
{
event_command(EVENT_CMD_MSG_QUEUE_DEINIT);
rarch_main_ctl(RARCH_MAIN_CTL_MSG_QUEUE_DEINIT, NULL);
event_command(EVENT_CMD_DRIVERS_DEINIT);
event_command(EVENT_CMD_LOG_FILE_DEINIT);

View File

@ -646,6 +646,13 @@ bool rarch_main_ctl(enum rarch_main_ctl_state state, void *data)
*ptr = main_is_paused;
}
break;
case RARCH_MAIN_CTL_MSG_QUEUE_DEINIT:
rarch_main_msg_queue_free();
break;
case RARCH_MAIN_CTL_MSG_QUEUE_INIT:
rarch_main_ctl(RARCH_MAIN_CTL_MSG_QUEUE_DEINIT, NULL);
rarch_main_msg_queue_init();
break;
default:
return false;
}

View File

@ -65,7 +65,11 @@ enum rarch_main_ctl_state
RARCH_MAIN_CTL_CHECK_MOVIE_RECORD,
/* Checks if slowmotion toggle/hold was being pressed and/or held. */
RARCH_MAIN_CTL_CHECK_SLOWMOTION,
RARCH_MAIN_CTL_CHECK_PAUSE_STATE
RARCH_MAIN_CTL_CHECK_PAUSE_STATE,
/* Initializes message queue. */
RARCH_MAIN_CTL_MSG_QUEUE_INIT,
/* Deinitializes message queue. */
RARCH_MAIN_CTL_MSG_QUEUE_DEINIT
};
typedef struct rarch_dir_list