Make state static and move it to menu_display.c

This commit is contained in:
twinaphex 2015-09-25 21:25:37 +02:00
parent 6482969459
commit f6a7256f20
4 changed files with 7 additions and 8 deletions

View File

@ -650,7 +650,7 @@ static void *rgui_init(void)
if (!rgui)
goto error;
frame_buf = &menu->display.frame_buf;
frame_buf = menu_display_fb_get_ptr();
/* 4 extra lines to cache the checked background */
frame_buf->data = (uint16_t*)calloc(400 * (240 + 4), sizeof(uint16_t));

View File

@ -1821,7 +1821,7 @@ static void *xmb_init(void)
if (!menu)
goto error;
frame_buf = &menu->display.frame_buf;
frame_buf = menu_display_fb_get_ptr();
video_driver_get_size(&width, &height);

View File

@ -22,6 +22,8 @@
#include "../gfx/video_context_driver.h"
#include "../gfx/video_thread_wrapper.h"
static menu_framebuf_t frame_buf_state;
menu_display_t *menu_display_get_ptr(void)
{
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_display_t *disp = menu_display_get_ptr();
if (!disp)
return NULL;
return &disp->frame_buf;
return &frame_buf_state;
}
/**
@ -92,7 +91,8 @@ void menu_display_free(void *data)
menu_animation_free(disp->animation);
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)

View File

@ -60,7 +60,6 @@ typedef struct menu_display
{
bool msg_force;
menu_framebuf_t frame_buf;
menu_animation_t *animation;
struct