Make state static and move it to menu_display.c
This commit is contained in:
parent
6482969459
commit
f6a7256f20
|
@ -650,7 +650,7 @@ static void *rgui_init(void)
|
||||||
if (!rgui)
|
if (!rgui)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
frame_buf = &menu->display.frame_buf;
|
frame_buf = menu_display_fb_get_ptr();
|
||||||
|
|
||||||
/* 4 extra lines to cache the checked background */
|
/* 4 extra lines to cache the checked background */
|
||||||
frame_buf->data = (uint16_t*)calloc(400 * (240 + 4), sizeof(uint16_t));
|
frame_buf->data = (uint16_t*)calloc(400 * (240 + 4), sizeof(uint16_t));
|
||||||
|
|
|
@ -1821,7 +1821,7 @@ static void *xmb_init(void)
|
||||||
if (!menu)
|
if (!menu)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
frame_buf = &menu->display.frame_buf;
|
frame_buf = menu_display_fb_get_ptr();
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
video_driver_get_size(&width, &height);
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
#include "../gfx/video_context_driver.h"
|
#include "../gfx/video_context_driver.h"
|
||||||
#include "../gfx/video_thread_wrapper.h"
|
#include "../gfx/video_thread_wrapper.h"
|
||||||
|
|
||||||
|
static menu_framebuf_t frame_buf_state;
|
||||||
|
|
||||||
menu_display_t *menu_display_get_ptr(void)
|
menu_display_t *menu_display_get_ptr(void)
|
||||||
{
|
{
|
||||||
menu_handle_t *menu = menu_driver_get_ptr();
|
menu_handle_t *menu = menu_driver_get_ptr();
|
||||||
|
@ -32,10 +34,7 @@ menu_display_t *menu_display_get_ptr(void)
|
||||||
|
|
||||||
menu_framebuf_t *menu_display_fb_get_ptr(void)
|
menu_framebuf_t *menu_display_fb_get_ptr(void)
|
||||||
{
|
{
|
||||||
menu_display_t *disp = menu_display_get_ptr();
|
return &frame_buf_state;
|
||||||
if (!disp)
|
|
||||||
return NULL;
|
|
||||||
return &disp->frame_buf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,7 +91,8 @@ void menu_display_free(void *data)
|
||||||
menu_animation_free(disp->animation);
|
menu_animation_free(disp->animation);
|
||||||
disp->animation = NULL;
|
disp->animation = NULL;
|
||||||
|
|
||||||
menu_display_fb_free(&disp->frame_buf);
|
menu_display_fb_free(&frame_buf_state);
|
||||||
|
memset(&frame_buf_state, 0, sizeof(menu_framebuf_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool menu_display_init(void *data)
|
bool menu_display_init(void *data)
|
||||||
|
|
|
@ -60,7 +60,6 @@ typedef struct menu_display
|
||||||
{
|
{
|
||||||
bool msg_force;
|
bool msg_force;
|
||||||
|
|
||||||
menu_framebuf_t frame_buf;
|
|
||||||
menu_animation_t *animation;
|
menu_animation_t *animation;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
|
Loading…
Reference in New Issue