Add MENU_DISPLAY_CTL_MSG_FORCE/MENU_DISPLAY_CTL_SET_MSG_FORCE

This commit is contained in:
twinaphex 2015-09-26 23:51:35 +02:00
parent 5b0671d572
commit f83e26ea32
7 changed files with 46 additions and 25 deletions

View File

@ -501,16 +501,17 @@ static int generic_action_ok(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx,
unsigned id, unsigned flush_id)
{
bool msg_force;
char action_path[PATH_MAX_LENGTH];
unsigned flush_type = 0;
int ret = 0;
const char *menu_path = NULL;
const char *flush_char = NULL;
global_t *global = global_get_ptr();
menu_display_t *disp = menu_display_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
if (!menu || !menu_list)
goto error;
@ -558,10 +559,10 @@ static int generic_action_ok(const char *path,
break;
case ACTION_OK_LOAD_CONFIG_FILE:
flush_char = NULL;
flush_type = MENU_SETTINGS;
disp->msg_force = true;
flush_char = NULL;
flush_type = MENU_SETTINGS;
msg_force = true;
menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force);
if (rarch_replace_config(action_path))
{

View File

@ -413,7 +413,6 @@ static void rgui_render(void)
uint16_t *fb_data = NULL;
rgui_t *rgui = NULL;
menu_handle_t *menu = menu_driver_get_ptr();
menu_display_t *disp = menu_display_get_ptr();
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
uint64_t *frame_count = video_driver_get_frame_count();
@ -433,8 +432,11 @@ static void rgui_render(void)
if (!rgui->force_redraw)
{
bool is_idle;
if (menu_entries_needs_refresh() && menu_driver_alive() && !disp->msg_force)
bool is_idle, msg_force;
menu_display_ctl(MENU_DISPLAY_CTL_MSG_FORCE, &msg_force);
if (menu_entries_needs_refresh() && menu_driver_alive() && !msg_force)
return;
rarch_main_ctl(RARCH_MAIN_CTL_IS_IDLE, &is_idle);
@ -605,10 +607,12 @@ static void rgui_render(void)
#ifdef GEKKO
const char *message_queue;
if (disp->msg_force)
if (msg_force)
{
msg_force = false;
message_queue = rarch_main_msg_queue_pull();
disp->msg_force = false;
menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force);
}
else
message_queue = driver->current_msg;

View File

@ -123,13 +123,13 @@ end:
static void rmenu_render(void)
{
bool msg_force;
size_t begin, end, i, j, selection;
struct font_params font_parms = {0};
char title[256] = {0};
char title_buf[256] = {0};
char title_msg[64] = {0};
menu_handle_t *menu = menu_driver_get_ptr();
menu_display_t *disp = menu_display_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
uint64_t *frame_count = video_driver_get_frame_count();
size_t entries_end = menu_entries_get_end();
@ -146,8 +146,10 @@ static void rmenu_render(void)
return;
}
menu_display_ctl(MENU_DISPLAY_CTL_MSG_FORCE, &msg_force);
if (menu_entries_needs_refresh() && menu_driver_alive()
&& !disp->msg_force)
&& !msg_force)
return;
menu_display_fb_unset_dirty();

View File

@ -530,7 +530,7 @@ static void rmenu_xui_set_list_text(int index, const wchar_t* leftText,
static void rmenu_xui_render(void)
{
bool display_kb;
bool display_kb, msg_force;
unsigned fb_width;
size_t end, i, selection;
char title[PATH_MAX_LENGTH] = {0};
@ -538,17 +538,17 @@ static void rmenu_xui_render(void)
const char *label = NULL;
unsigned menu_type = 0;
menu_handle_t *menu = menu_driver_get_ptr();
menu_display_t *disp = menu_display_get_ptr();
uint64_t frame_count = video_driver_get_frame_count();
menu_display_ctl(MENU_DISPLAY_CTL_WIDTH, &fb_width);
menu_display_ctl(MENU_DISPLAY_CTL_WIDTH, &fb_width);
menu_display_ctl(MENU_DISPLAY_CTL_MSG_FORCE, &msg_force);
if (!menu)
return;
if (
menu_entries_needs_refresh() &&
menu_driver_alive() &&
!disp->msg_force
!msg_force
)
return;

View File

@ -87,14 +87,13 @@ static void menu_push_to_history_playlist(void)
**/
bool menu_load_content(enum rarch_core_type type)
{
bool msg_force = true;
menu_handle_t *menu = menu_driver_get_ptr();
menu_display_t *disp = menu_display_get_ptr();
driver_t *driver = driver_get_ptr();
global_t *global = global_get_ptr();
/* redraw menu frame */
if (disp)
disp->msg_force = true;
menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force);
menu_iterate(true, MENU_ACTION_NOOP);
menu_iterate_render();
@ -109,9 +108,6 @@ bool menu_load_content(enum rarch_core_type type)
snprintf(msg, sizeof(msg), "Failed to load %s.\n", name);
menu_display_msg_queue_push(msg, 1, 90, false);
if (disp)
disp->msg_force = true;
return false;
}
@ -132,9 +128,9 @@ int menu_common_load_content(
const char *core_path, const char *fullpath,
bool persist, enum rarch_core_type type)
{
bool msg_force = true;
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
menu_display_t *disp = menu_display_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
enum event_command cmd = EVENT_CMD_NONE;
@ -171,7 +167,7 @@ int menu_common_load_content(
event_command(cmd);
menu_list_flush_stack(menu_list, NULL, MENU_SETTINGS);
disp->msg_force = true;
menu_display_ctl(MENU_DISPLAY_CTL_SET_MSG_FORCE, &msg_force);
generic_action_ok_displaylist_push("",
"", 0, 0, 0, ACTION_OK_DL_CONTENT_SETTINGS);

View File

@ -310,6 +310,22 @@ bool menu_display_ctl(enum menu_display_ctl_state state, void *data)
frame_buf->pitch = *ptr;
}
return true;
case MENU_DISPLAY_CTL_MSG_FORCE:
{
bool *ptr = (bool*)data;
if (!ptr)
return false;
*ptr = disp->msg_force;
}
return true;
case MENU_DISPLAY_CTL_SET_MSG_FORCE:
{
bool *ptr = (bool*)data;
if (!ptr)
return false;
disp->msg_force = *ptr;
}
return true;
case MENU_DISPLAY_CTL_FONT_DATA_INIT:
{
bool *ptr = (bool*)data;

View File

@ -51,7 +51,9 @@ enum menu_display_ctl_state
MENU_DISPLAY_CTL_FONT_DATA_INIT,
MENU_DISPLAY_CTL_SET_FONT_DATA_INIT,
MENU_DISPLAY_CTL_FONT_SIZE,
MENU_DISPLAY_CTL_SET_FONT_SIZE
MENU_DISPLAY_CTL_SET_FONT_SIZE,
MENU_DISPLAY_CTL_MSG_FORCE,
MENU_DISPLAY_CTL_SET_MSG_FORCE
};
typedef struct menu_display