mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Move more variables to menu_display_t
This commit is contained in:
parent
0ee9e06f8c
commit
b2a7000519
@ -509,6 +509,7 @@ static int action_iterate_main(const char *label, unsigned action)
|
||||
int ret = 0;
|
||||
menu_handle_t *menu = menu_driver_get_ptr();
|
||||
menu_navigation_t *nav = menu_navigation_get_ptr();
|
||||
menu_display_t *disp = menu_display_get_ptr();
|
||||
menu_list_t *menu_list = menu_list_get_ptr();
|
||||
uint32_t hash = djb2_calculate(label);
|
||||
if (!menu || !menu_list)
|
||||
@ -543,7 +544,7 @@ static int action_iterate_main(const char *label, unsigned action)
|
||||
ret = action_iterate_load_open_zip(label, msg, sizeof(msg), action);
|
||||
break;
|
||||
case ITERATE_TYPE_MESSAGE:
|
||||
strlcpy(msg, menu->message_contents, sizeof(msg));
|
||||
strlcpy(msg, disp->message_contents, sizeof(msg));
|
||||
pop_selected = &nav->selection_ptr;
|
||||
do_messagebox = true;
|
||||
do_pop_stack = true;
|
||||
|
13
menu/menu.c
13
menu/menu.c
@ -154,6 +154,7 @@ void menu_common_load_content(bool persist)
|
||||
void *menu_init(const void *data)
|
||||
{
|
||||
menu_handle_t *menu = NULL;
|
||||
menu_display_t *disp = NULL;
|
||||
menu_ctx_driver_t *menu_ctx = (menu_ctx_driver_t*)data;
|
||||
global_t *global = global_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
@ -179,6 +180,7 @@ void *menu_init(const void *data)
|
||||
if (!menu->shader)
|
||||
goto error;
|
||||
#endif
|
||||
|
||||
menu->push_start_screen = settings->menu_show_start_screen;
|
||||
settings->menu_show_start_screen = false;
|
||||
|
||||
@ -187,7 +189,9 @@ void *menu_init(const void *data)
|
||||
if (!menu_display_init(menu))
|
||||
goto error;
|
||||
|
||||
rarch_assert(menu->msg_queue = msg_queue_new(8));
|
||||
disp = &menu->display;
|
||||
|
||||
rarch_assert(disp->msg_queue = msg_queue_new(8));
|
||||
|
||||
menu_display_fb_set_dirty();
|
||||
menu_driver_set_alive();
|
||||
@ -236,8 +240,9 @@ static void menu_free_list(menu_handle_t *menu)
|
||||
void menu_free(menu_handle_t *menu)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
menu_display_t *disp = menu_display_get_ptr();
|
||||
|
||||
if (!menu)
|
||||
if (!menu || !disp)
|
||||
return;
|
||||
|
||||
menu_free_list(menu);
|
||||
@ -258,10 +263,6 @@ void menu_free(menu_handle_t *menu)
|
||||
libretro_free_system_info(&global->menu.info);
|
||||
#endif
|
||||
|
||||
if (menu->msg_queue)
|
||||
msg_queue_free(menu->msg_queue);
|
||||
menu->msg_queue = NULL;
|
||||
|
||||
menu_display_free(menu);
|
||||
|
||||
menu_list_free(menu->menu_list);
|
||||
|
@ -116,14 +116,19 @@ static void menu_display_fb_free(menu_framebuf_t *frame_buf)
|
||||
|
||||
void menu_display_free(void *data)
|
||||
{
|
||||
menu_handle_t *menu = (menu_handle_t*)data;
|
||||
if (!menu)
|
||||
menu_handle_t *menu = (menu_handle_t*)data;
|
||||
menu_display_t *disp = menu ? &menu->display : NULL;
|
||||
if (!menu || !disp)
|
||||
return;
|
||||
|
||||
if (disp->msg_queue)
|
||||
msg_queue_free(disp->msg_queue);
|
||||
disp->msg_queue = NULL;
|
||||
|
||||
menu_animation_free(menu->animation);
|
||||
menu->animation = NULL;
|
||||
|
||||
menu_display_fb_free(&menu->display.frame_buf);
|
||||
menu_display_fb_free(&disp->frame_buf);
|
||||
}
|
||||
|
||||
bool menu_display_init(void *data)
|
||||
|
@ -20,6 +20,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <boolean.h>
|
||||
|
||||
#include <queues/message_queue.h>
|
||||
|
||||
#include "../gfx/font_renderer_driver.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -49,6 +51,14 @@ typedef struct menu_display
|
||||
} font;
|
||||
|
||||
unsigned header_height;
|
||||
|
||||
/* This buffer can be used to display generic OK messages to the user.
|
||||
* Fill it and call
|
||||
* menu_list_push(driver->menu->menu_stack, "", "message", 0, 0);
|
||||
*/
|
||||
char message_contents[PATH_MAX_LENGTH];
|
||||
|
||||
msg_queue_t *msg_queue;
|
||||
} menu_display_t;
|
||||
|
||||
menu_display_t *menu_display_get_ptr(void);
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include <stdint.h>
|
||||
#include <boolean.h>
|
||||
#include <retro_miscellaneous.h>
|
||||
#include <queues/message_queue.h>
|
||||
#include "menu_animation.h"
|
||||
#include "menu_display.h"
|
||||
#include "menu_displaylist.h"
|
||||
@ -73,21 +72,14 @@ typedef struct
|
||||
bool defer_core;
|
||||
char deferred_path[PATH_MAX_LENGTH];
|
||||
|
||||
/* This buffer can be used to display generic OK messages to the user.
|
||||
* Fill it and call
|
||||
* menu_list_push(driver->menu->menu_stack, "", "message", 0, 0);
|
||||
*/
|
||||
char message_contents[PATH_MAX_LENGTH];
|
||||
|
||||
msg_queue_t *msg_queue;
|
||||
|
||||
char default_glslp[PATH_MAX_LENGTH];
|
||||
char default_cgp[PATH_MAX_LENGTH];
|
||||
|
||||
/* Menu display */
|
||||
menu_display_t display;
|
||||
|
||||
bool load_no_content;
|
||||
|
||||
/* Menu shader */
|
||||
char default_glslp[PATH_MAX_LENGTH];
|
||||
char default_cgp[PATH_MAX_LENGTH];
|
||||
struct video_shader *shader;
|
||||
|
||||
menu_input_t input;
|
||||
|
Loading…
x
Reference in New Issue
Block a user