From a2fc2b1e4f87bc99731ec8e6fce12bc3d73c30a9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 18 Apr 2013 15:04:09 +0200 Subject: [PATCH] (RMenu XUI) Use menu_common --- frontend/menu/rmenu_xui.cpp | 8 ++++++-- frontend/menu/rmenu_xui.h | 2 ++ griffin/griffin.c | 16 ++++++++-------- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/frontend/menu/rmenu_xui.cpp b/frontend/menu/rmenu_xui.cpp index b4f279b47a..d11fa84004 100644 --- a/frontend/menu/rmenu_xui.cpp +++ b/frontend/menu/rmenu_xui.cpp @@ -1282,10 +1282,12 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled ) return 0; } -void menu_init (void) +rgui_handle_t *rgui_init (void) { HRESULT hr; + rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui)); + xdk_d3d_video_t *device_ptr = (xdk_d3d_video_t*)driver.video_data; bool hdmenus_allowed = (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_HD)); @@ -1355,9 +1357,11 @@ void menu_init (void) if (driver.video_poke && driver.video_poke->set_texture_enable) driver.video_poke->set_texture_frame(driver.video_data, NULL, true, 0, 0, 1.0f); + + return rgui; } -void menu_free (void) +void rgui_free (rgui_handle_t *rgui) { filebrowser_free(browser); app.Uninit(); diff --git a/frontend/menu/rmenu_xui.h b/frontend/menu/rmenu_xui.h index 015c1af0d3..4d5b7dc606 100644 --- a/frontend/menu/rmenu_xui.h +++ b/frontend/menu/rmenu_xui.h @@ -17,6 +17,8 @@ #ifndef _RMENU_XUI_H_ #define _RMENU_XUI_H_ +#include "menu_common.h" + enum { SETTING_EMU_REWIND_ENABLED = 0, diff --git a/griffin/griffin.c b/griffin/griffin.c index dea0a3e9cc..325ecfac43 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -18,6 +18,10 @@ #include "../msvc/msvc_compat.h" #endif +#if defined(HAVE_RMENU) || defined(HAVE_RGUI) || defined(HAVE_RMENU_XUI) +#define HAVE_MENU +#endif + /*============================================================ CONSOLE EXTENSIONS ============================================================ */ @@ -439,21 +443,17 @@ SCREENSHOTS /*============================================================ MENU ============================================================ */ -#if defined(HAVE_RMENU) || defined(HAVE_RGUI) || defined(HAVE_RMENU_XUI) +#ifdef HAVE_MENU #include "../frontend/menu/menu_common.c" -#endif #if defined(HAVE_RMENU_GUI) #include "../frontend/menu/rmenu.c" -#endif - -#ifdef HAVE_RGUI +#elif defined(HAVE_RGUI) #include "../frontend/menu/rgui.c" -#endif - -#if defined(HAVE_RMENU_XUI) +#elif defined(HAVE_RMENU_XUI) #include "../frontend/menu/rmenu_xui.cpp" #endif +#endif #ifdef __cplusplus extern "C" {