From 28b79e587291327e3058c7c746cb26026b517642 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 14 Jan 2013 03:49:24 +0100 Subject: [PATCH] (GX) Declutter message queue code in RGUI --- frontend/menu/rgui.c | 39 +-------------------------------------- gx/gx_video.c | 5 ----- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/frontend/menu/rgui.c b/frontend/menu/rgui.c index 24eaaa9b74..5399c21b77 100644 --- a/frontend/menu/rgui.c +++ b/frontend/menu/rgui.c @@ -135,7 +135,6 @@ struct rgui_handle rgui_list_t *folder_buf; int directory_ptr; bool need_refresh; - bool msg_force; char path_buf[PATH_MAX]; @@ -362,11 +361,6 @@ static void render_messagebox(rgui_handle_t *rgui, const char *message) static void render_text(rgui_handle_t *rgui) { - if (rgui->need_refresh && - (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU)) - && !rgui->msg_force) - return; - size_t begin = rgui->directory_ptr >= TERM_HEIGHT / 2 ? rgui->directory_ptr - TERM_HEIGHT / 2 : 0; size_t end = rgui->directory_ptr + TERM_HEIGHT <= rgui_list_size(rgui->folder_buf) ? @@ -539,22 +533,7 @@ static void render_text(rgui_handle_t *rgui) blit_line(rgui, x, y, message, i == rgui->directory_ptr); } - const char *message_queue; -#ifdef GEKKO - gx_video_t *gx = (gx_video_t*)driver.video_data; - if (rgui->msg_force) - { - message_queue = msg_queue_pull(g_extern.msg_queue); - rgui->msg_force = false; - } - else - { - message_queue = gx->msg; - } -#else - message_queue = msg_queue_pull(g_extern.msg_queue); -#endif - render_messagebox(rgui, message_queue); + render_messagebox(rgui, msg_queue_pull(g_extern.msg_queue)); } #ifdef GEKKO @@ -1001,11 +980,6 @@ int rgui_viewport_iterate(rgui_handle_t *rgui, rgui_action_t action) case RGUI_ACTION_SETTINGS: rgui_list_pop(rgui->path_stack); break; - - case RGUI_ACTION_MESSAGE: - rgui->msg_force = true; - break; - default: break; } @@ -1090,11 +1064,6 @@ int rgui_settings_iterate(rgui_handle_t *rgui, rgui_action_t action) rgui->directory_ptr = 0; rgui->need_refresh = true; break; - - case RGUI_ACTION_MESSAGE: - rgui->msg_force = true; - break; - default: break; } @@ -1217,7 +1186,6 @@ int rgui_iterate(rgui_handle_t *rgui, rgui_action_t action) console_load_game(rgui->path_buf); rmenu_settings_msg(S_MSG_LOADING_ROM, S_DELAY_1); rgui->need_refresh = true; // in case of zip extract - rgui->msg_force = true; ret = -1; } } @@ -1242,11 +1210,6 @@ int rgui_iterate(rgui_handle_t *rgui, rgui_action_t action) rgui->directory_ptr = 0; } return rgui_settings_iterate(rgui, RGUI_ACTION_REFRESH); - - case RGUI_ACTION_MESSAGE: - rgui->msg_force = true; - break; - default: break; } diff --git a/gx/gx_video.c b/gx/gx_video.c index aa035a6381..102448d165 100644 --- a/gx/gx_video.c +++ b/gx/gx_video.c @@ -874,11 +874,6 @@ static bool gx_frame(void *data, const void *frame, (void)data; - if (msg) - snprintf(gx->msg, sizeof(gx->msg), "%s", msg); - else - gx->msg[0] = 0; - if(!frame && !(lifecycle_mode_state & (1ULL << MODE_MENU_DRAW))) return true;