From d1483d1530e82a42e39a4619cce5020dc36e6f2a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 13 Feb 2015 19:11:53 +0100 Subject: [PATCH] (GX) Buildfix --- gfx/drivers/gx_gfx.c | 32 ++++++++++++++++++-------------- menu/menu.c | 5 +++-- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/gfx/drivers/gx_gfx.c b/gfx/drivers/gx_gfx.c index 9bb1b66bda..0d26faa34c 100644 --- a/gfx/drivers/gx_gfx.c +++ b/gfx/drivers/gx_gfx.c @@ -18,7 +18,7 @@ #include "../../driver.h" #include "../../general.h" #include "../drivers_font_renderer/bitmap.h" -#include "../../menu/menu.h" +#include "../../menu/menu_driver.h" #include "../video_viewport.h" #include "../video_monitor.h" @@ -118,6 +118,7 @@ void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines) max_width, max_height, i; bool progressive; gx_video_t *gx = (gx_video_t*)data; + menu_handle_t *menu = menu_driver_resolve(); (void)level; @@ -277,17 +278,17 @@ void gx_set_video_mode(void *data, unsigned fbWidth, unsigned lines) gx_mode.efbHeight, (gx_mode.viTVMode & 3) == VI_INTERLACE ? "interlaced" : "progressive"); - if (driver.menu) + if (menu) { - driver.menu->height = gx_mode.efbHeight / (gx->double_strike ? 1 : 2); - driver.menu->height &= ~3; - if (driver.menu->height > 240) - driver.menu->height = 240; + menu->frame_buf.height = gx_mode.efbHeight / (gx->double_strike ? 1 : 2); + menu->frame_buf.height &= ~3; + if (menu->frame_buf.height > 240) + menu->frame_buf.height = 240; - driver.menu->width = gx_mode.fbWidth / (gx_mode.fbWidth < 400 ? 1 : 2); - driver.menu->width &= ~3; - if (driver.menu->width > 400) - driver.menu->width = 400; + menu->frame_buf.width = gx_mode.fbWidth / (gx_mode.fbWidth < 400 ? 1 : 2); + menu->frame_buf.width &= ~3; + if (menu->frame_buf.width > 400) + menu->frame_buf.width = 400; } if (tvmode == VI_PAL) @@ -366,8 +367,8 @@ static void init_texture(void *data, unsigned width, unsigned height) if (driver.menu) { - menu_w = driver.menu->width; - menu_h = driver.menu->height; + menu_w = driver.menu->frame_buf.width; + menu_h = driver.menu->frame_buf.height; } __GX_InitTexObj(fb_ptr, g_tex.data, width, height, @@ -961,9 +962,12 @@ static bool gx_frame(void *data, const void *frame, if (gx->menu_texture_enable && gx->menu_data) { convert_texture16(gx->menu_data, menu_tex.data, - driver.menu->width, driver.menu->height, driver.menu->width * 2); + driver.menu->frame_buf.width, + driver.menu->frame_buf.height, + driver.menu->frame_buf.width * 2); DCFlushRange(menu_tex.data, - driver.menu->width * driver.menu->height * 2); + driver.menu->frame_buf.width * + driver.menu->frame_buf.height * 2); } __GX_InvalidateTexAll(__gx); diff --git a/menu/menu.c b/menu/menu.c index 60a701ed85..a95c7506fe 100644 --- a/menu/menu.c +++ b/menu/menu.c @@ -293,11 +293,12 @@ void menu_free(void *data) void menu_apply_deferred_settings(void) { rarch_setting_t *setting = NULL; + menu_handle_t *menu = menu_driver_resolve(); - if (!driver.menu) + if (!menu) return; - setting = (rarch_setting_t*)driver.menu->list_settings; + setting = (rarch_setting_t*)menu->list_settings; if (!setting) return;