2012-04-21 21:13:50 +00:00
/* RetroArch - A frontend for libretro.
2013-01-01 00:37:37 +00:00
* Copyright ( C ) 2010 - 2013 - Hans - Kristian Arntzen
* Copyright ( C ) 2011 - 2013 - Daniel De Matteis
2012-01-22 00:43:54 +00:00
*
2012-04-21 21:13:50 +00:00
* RetroArch is free software : you can redistribute it and / or modify it under the terms
2012-01-22 00:43:54 +00:00
* of the GNU General Public License as published by the Free Software Found -
* ation , either version 3 of the License , or ( at your option ) any later version .
*
2012-04-21 21:13:50 +00:00
* RetroArch is distributed in the hope that it will be useful , but WITHOUT ANY WARRANTY ;
2012-01-22 00:43:54 +00:00
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE . See the GNU General Public License for more details .
*
2012-04-21 21:31:57 +00:00
* You should have received a copy of the GNU General Public License along with RetroArch .
2012-01-22 00:43:54 +00:00
* If not , see < http : //www.gnu.org/licenses/>.
*/
2012-01-23 21:22:54 +00:00
# include <stdint.h>
2012-01-22 00:43:54 +00:00
# include <xtl.h>
2013-03-09 21:30:35 +00:00
# include <xui.h>
# include <xuiapp.h>
2013-01-09 16:49:43 +00:00
# include "rmenu_xui.h"
2013-01-09 16:59:23 +00:00
# include "utils/file_browser.h"
2012-07-28 14:10:31 +00:00
2012-07-28 13:54:35 +00:00
# include "../../console/rarch_console.h"
2012-07-28 14:10:31 +00:00
2013-03-09 02:20:33 +00:00
# include "../../gfx/gfx_common.h"
2012-09-30 16:29:32 +00:00
# include "../../gfx/gfx_context.h"
2012-06-22 05:38:53 +00:00
# include "../../message.h"
# include "../../general.h"
2012-01-24 00:06:12 +00:00
2013-01-23 17:02:56 +00:00
enum {
2013-05-10 01:36:32 +00:00
MENU_XUI_ITEM_HW_TEXTURE_FILTER = 0 ,
MENU_XUI_ITEM_GAMMA_CORRECTION_ENABLED ,
MENU_XUI_ITEM_ASPECT_RATIO ,
2013-01-23 17:02:56 +00:00
MENU_XUI_ITEM_RESIZE_MODE ,
2013-05-09 18:24:58 +00:00
MENU_XUI_ITEM_ORIENTATION ,
} ;
2013-05-10 17:02:24 +00:00
enum {
MENU_XUI_ITEM_AUDIO_MUTE_AUDIO = 0 ,
} ;
2013-05-09 18:24:58 +00:00
enum
{
2013-05-25 22:37:00 +00:00
INGAME_MENU_REWIND_ENABLED = 0 ,
INGAME_MENU_REWIND_GRANULARITY ,
SETTING_EMU_SHOW_INFO_MSG ,
2013-05-09 18:24:58 +00:00
SETTING_EMU_SHOW_DEBUG_INFO_MSG ,
2013-01-23 17:02:56 +00:00
} ;
2013-03-30 07:16:58 +00:00
enum
{
S_LBL_ASPECT_RATIO = 0 ,
S_LBL_RARCH_VERSION ,
S_LBL_ROTATION ,
S_LBL_LOAD_STATE_SLOT ,
S_LBL_SAVE_STATE_SLOT ,
S_LBL_REWIND_GRANULARITY ,
} ;
2013-05-09 13:12:22 +00:00
HXUIOBJ m_menulist ;
HXUIOBJ m_menutitle ;
2013-05-09 16:12:54 +00:00
HXUIOBJ m_menutitlebottom ;
2013-05-06 01:05:21 +00:00
HXUIOBJ m_back ;
2013-05-10 15:14:22 +00:00
HXUIOBJ root_menu ;
HXUIOBJ current_menu ;
2013-05-06 00:44:13 +00:00
2013-03-09 21:30:35 +00:00
class CRetroArch : public CXuiModule
{
protected :
virtual HRESULT RegisterXuiClasses ( ) ;
virtual HRESULT UnregisterXuiClasses ( ) ;
} ;
2013-05-10 01:54:20 +00:00
# define CREATE_CLASS(class_type, class_name) \
class class_type : public CXuiSceneImpl \
{ \
public : \
HRESULT OnInit ( XUIMessageInit * pInitData , int & bHandled ) ; \
HRESULT OnNotifyPress ( HXUIOBJ hObjPressed , int & bHandled ) ; \
HRESULT OnControlNavigate ( XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled ) ; \
\
HRESULT DispatchMessageMap ( XUIMessage * pMessage ) \
{ \
if ( pMessage - > dwMessage = = XM_INIT ) \
{ \
XUIMessageInit * pData = ( XUIMessageInit * ) pMessage - > pvData ; \
return OnInit ( pData , pMessage - > bHandled ) ; \
} \
if ( pMessage - > dwMessage = = XM_CONTROL_NAVIGATE ) \
{ \
XUIMessageControlNavigate * pData = ( XUIMessageControlNavigate * ) pMessage - > pvData ; \
return OnControlNavigate ( pData , pMessage - > bHandled ) ; \
} \
if ( pMessage - > dwMessage = = XM_NOTIFY ) \
{ \
XUINotify * pNotify = ( XUINotify * ) pMessage - > pvData ; \
if ( pNotify - > dwNotify = = XN_PRESS ) \
return OnNotifyPress ( pNotify - > hObjSource , pMessage - > bHandled ) ; \
} \
return __super : : DispatchMessageMap ( pMessage ) ; \
} \
\
static HRESULT Register ( ) \
{ \
HXUICLASS hClass ; \
XUIClass cls ; \
memset ( & cls , 0x00 , sizeof ( cls ) ) ; \
cls . szClassName = class_name ; \
cls . szBaseClassName = XUI_CLASS_SCENE ; \
cls . Methods . CreateInstance = ( PFN_CREATEINST ) ( CreateInstance ) ; \
cls . Methods . DestroyInstance = ( PFN_DESTROYINST ) DestroyInstance ; \
cls . Methods . ObjectProc = ( PFN_OBJECT_PROC ) _ObjectProc ; \
cls . pPropDefs = _GetPropDef ( & cls . dwPropDefCount ) ; \
HRESULT hr = XuiRegisterClass ( & cls , & hClass ) ; \
if ( FAILED ( hr ) ) \
return hr ; \
return S_OK ; \
} \
\
static HRESULT APIENTRY CreateInstance ( HXUIOBJ hObj , void * * ppvObj ) \
{ \
* ppvObj = NULL ; \
class_type * pThis = new class_type ( ) ; \
if ( ! pThis ) \
return E_OUTOFMEMORY ; \
pThis - > m_hObj = hObj ; \
HRESULT hr = pThis - > OnCreate ( ) ; \
if ( FAILED ( hr ) ) \
{ \
DestroyInstance ( pThis ) ; \
return hr ; \
} \
* ppvObj = pThis ; \
return S_OK ; \
} \
\
static HRESULT APIENTRY DestroyInstance ( void * pvObj ) \
{ \
class_type * pThis = ( class_type * ) pvObj ; \
delete pThis ; \
return S_OK ; \
} \
}
2013-05-09 16:44:35 +00:00
2013-05-10 01:54:20 +00:00
CREATE_CLASS ( CRetroArchMain , L " RetroArchMain " ) ;
CREATE_CLASS ( CRetroArchFileBrowser , L " RetroArchFileBrowser " ) ;
CREATE_CLASS ( CRetroArchCoreBrowser , L " RetroArchCoreBrowser " ) ;
CREATE_CLASS ( CRetroArchShaderBrowser , L " RetroArchShaderBrowser " ) ;
2013-05-10 16:25:17 +00:00
CREATE_CLASS ( CRetroArchVideoOptions , L " RetroArchVideoOptions " ) ;
2013-05-10 17:02:24 +00:00
CREATE_CLASS ( CRetroArchAudioOptions , L " RetroArchAudioOptions " ) ;
2013-05-10 18:40:38 +00:00
CREATE_CLASS ( CRetroArchCoreOptions , L " RetroArchCoreOptions " ) ;
2013-05-10 01:54:20 +00:00
CREATE_CLASS ( CRetroArchSettings , L " RetroArchSettings " ) ;
CREATE_CLASS ( CRetroArchControls , L " RetroArchControls " ) ;
2013-05-10 20:01:35 +00:00
CREATE_CLASS ( CRetroArchLoadGameHistory , L " RetroArchLoadGameHistory " ) ;
2013-03-09 21:30:35 +00:00
2012-05-29 13:25:39 +00:00
CRetroArch app ;
2012-07-28 20:36:49 +00:00
2012-05-29 17:51:35 +00:00
wchar_t strw_buffer [ PATH_MAX ] ;
2012-07-28 20:51:33 +00:00
char str_buffer [ PATH_MAX ] ;
2012-01-22 20:47:34 +00:00
2013-01-11 05:10:21 +00:00
static int process_input_ret = 0 ;
2012-01-22 00:43:54 +00:00
/* Register custom classes */
2012-04-21 21:48:05 +00:00
HRESULT CRetroArch : : RegisterXuiClasses ( void )
2012-01-22 00:43:54 +00:00
{
2012-04-21 22:11:48 +00:00
CRetroArchMain : : Register ( ) ;
CRetroArchFileBrowser : : Register ( ) ;
CRetroArchCoreBrowser : : Register ( ) ;
2012-05-21 16:01:51 +00:00
CRetroArchShaderBrowser : : Register ( ) ;
2013-05-10 16:25:17 +00:00
CRetroArchVideoOptions : : Register ( ) ;
2013-05-10 17:02:24 +00:00
CRetroArchAudioOptions : : Register ( ) ;
2013-05-10 18:40:38 +00:00
CRetroArchCoreOptions : : Register ( ) ;
2012-05-23 06:37:31 +00:00
CRetroArchControls : : Register ( ) ;
2012-04-21 22:11:48 +00:00
CRetroArchSettings : : Register ( ) ;
2013-05-10 20:01:35 +00:00
CRetroArchLoadGameHistory : : Register ( ) ;
2012-04-10 19:23:42 +00:00
2012-05-29 02:39:54 +00:00
return 0 ;
2012-01-22 00:43:54 +00:00
}
/* Unregister custom classes */
2012-04-21 21:48:05 +00:00
HRESULT CRetroArch : : UnregisterXuiClasses ( void )
2012-01-22 00:43:54 +00:00
{
2013-05-08 00:11:06 +00:00
XuiUnregisterClass ( L " RetroArchMain " ) ;
XuiUnregisterClass ( L " RetroArchCoreBrowser " ) ;
XuiUnregisterClass ( L " RetroArchShaderBrowser " ) ;
XuiUnregisterClass ( L " RetroArchFileBrowser " ) ;
2013-05-10 16:25:17 +00:00
XuiUnregisterClass ( L " RetroArchVideoOptions " ) ;
2013-05-10 17:02:24 +00:00
XuiUnregisterClass ( L " RetroArchAudioOptions " ) ;
2013-05-10 18:40:38 +00:00
XuiUnregisterClass ( L " RetroArchCoreOptions " ) ;
2013-05-08 00:11:06 +00:00
XuiUnregisterClass ( L " RetroArchControls " ) ;
XuiUnregisterClass ( L " RetroArchSettings " ) ;
2013-05-10 20:01:35 +00:00
XuiUnregisterClass ( L " RetroArchLoadGameHistory " ) ;
2012-04-10 19:23:42 +00:00
2012-05-29 02:39:54 +00:00
return 0 ;
2012-01-22 00:43:54 +00:00
}
2013-03-09 21:23:40 +00:00
static void menu_settings_create_menu_item_label_w ( wchar_t * strwbuf , unsigned setting , size_t size )
{
char str [ PATH_MAX ] ;
2013-03-23 17:11:03 +00:00
switch ( setting )
{
case S_LBL_ASPECT_RATIO :
snprintf ( str , size , " Aspect Ratio: %s " , aspectratio_lut [ g_settings . video . aspect_ratio_idx ] . name ) ;
break ;
case S_LBL_RARCH_VERSION :
snprintf ( str , size , " RetroArch %s " , PACKAGE_VERSION ) ;
break ;
case S_LBL_ROTATION :
2013-09-27 23:46:55 +00:00
snprintf ( str , size , " Rotation: %s " , rotation_lut [ g_settings . video . rotation ] ) ;
2013-03-23 17:11:03 +00:00
break ;
case S_LBL_LOAD_STATE_SLOT :
snprintf ( str , size , " Load State #%d " , g_extern . state_slot ) ;
break ;
case S_LBL_SAVE_STATE_SLOT :
snprintf ( str , size , " Save State #%d " , g_extern . state_slot ) ;
break ;
case S_LBL_REWIND_GRANULARITY :
snprintf ( str , size , " Rewind granularity: %d " , g_settings . rewind_granularity ) ;
break ;
}
2013-04-11 15:18:23 +00:00
mbstowcs ( strwbuf , str , size / sizeof ( wchar_t ) ) ;
2013-03-09 21:23:40 +00:00
}
2013-04-18 17:05:43 +00:00
void filebrowser_fetch_directory_entries ( uint64_t action )
2013-01-23 18:33:26 +00:00
{
2013-04-18 17:05:43 +00:00
filebrowser_update ( rgui - > browser , action , rgui - > browser - > current_dir . extensions ) ;
2013-01-23 18:33:26 +00:00
2013-04-18 15:27:11 +00:00
mbstowcs ( strw_buffer , rgui - > browser - > current_dir . directory_path , sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
2013-05-09 19:46:13 +00:00
XuiTextElementSetText ( m_menutitle , strw_buffer ) ;
2013-01-23 18:33:26 +00:00
2013-05-09 19:46:13 +00:00
XuiListDeleteItems ( m_menulist , 0 , XuiListGetItemCount ( m_menulist ) ) ;
XuiListInsertItems ( m_menulist , 0 , rgui - > browser - > list - > size ) ;
2013-01-23 18:33:26 +00:00
2013-04-18 15:27:11 +00:00
for ( unsigned i = 0 ; i < rgui - > browser - > list - > size ; i + + )
2013-01-23 18:33:26 +00:00
{
char fname_tmp [ 256 ] ;
2013-04-18 15:27:11 +00:00
fill_pathname_base ( fname_tmp , rgui - > browser - > list - > elems [ i ] . data , sizeof ( fname_tmp ) ) ;
2013-04-11 15:18:23 +00:00
mbstowcs ( strw_buffer , fname_tmp , sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
2013-05-09 19:46:13 +00:00
XuiListSetText ( m_menulist , i , strw_buffer ) ;
2013-01-23 18:33:26 +00:00
}
}
2012-04-21 22:11:48 +00:00
HRESULT CRetroArchFileBrowser : : OnInit ( XUIMessageInit * pInitData , BOOL & bHandled )
2012-02-08 14:23:12 +00:00
{
2013-05-09 19:46:13 +00:00
GetChildById ( L " XuiMenuList " , & m_menulist ) ;
GetChildById ( L " XuiTxtTitle " , & m_menutitle ) ;
GetChildById ( L " XuiTxtBottom " , & m_menutitlebottom ) ;
2012-02-08 14:23:12 +00:00
2013-04-23 20:38:00 +00:00
filebrowser_set_root_and_ext ( rgui - > browser , rgui - > info . valid_extensions ,
2013-05-09 16:44:35 +00:00
default_paths . filebrowser_startup_dir ) ;
2012-08-22 01:56:57 +00:00
2013-09-29 15:53:26 +00:00
filebrowser_fetch_directory_entries ( FILEBROWSER_ACTION_OK ) ;
2012-03-05 12:06:24 +00:00
2012-05-29 02:39:54 +00:00
return 0 ;
2012-03-05 12:06:24 +00:00
}
2012-08-22 01:56:57 +00:00
HRESULT CRetroArchFileBrowser : : OnNotifyPress ( HXUIOBJ hObjPressed , BOOL & bHandled )
2012-03-05 12:06:24 +00:00
{
2012-08-22 01:56:57 +00:00
char path [ PATH_MAX ] ;
2013-01-11 05:10:21 +00:00
process_input_ret = 0 ;
2012-02-08 14:23:12 +00:00
2013-05-09 19:46:13 +00:00
if ( hObjPressed = = m_menulist )
2012-08-22 01:56:57 +00:00
{
2013-05-09 19:46:13 +00:00
int index = XuiListGetCurSel ( m_menulist , NULL ) ;
wcstombs ( str_buffer , ( const wchar_t * ) XuiListGetText ( m_menulist , index ) , sizeof ( str_buffer ) ) ;
2013-04-18 15:27:11 +00:00
if ( path_file_exists ( rgui - > browser - > list - > elems [ index ] . data ) )
2012-08-22 01:56:57 +00:00
{
2013-09-19 08:04:49 +00:00
fill_pathname_join ( g_extern . fullpath , rgui - > browser - > current_dir . directory_path , str_buffer , sizeof ( g_extern . fullpath ) ) ;
2013-01-22 00:12:02 +00:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_LOAD_GAME ) ;
2013-04-28 13:00:37 +00:00
process_input_ret = - 1 ;
2012-08-22 01:56:57 +00:00
}
2013-04-18 15:27:11 +00:00
else if ( rgui - > browser - > list - > elems [ index ] . attr . b )
2012-08-22 01:56:57 +00:00
{
2013-09-19 08:04:49 +00:00
fill_pathname_join ( path , rgui - > browser - > current_dir . directory_path , str_buffer , sizeof ( path ) ) ;
2013-04-23 20:38:00 +00:00
filebrowser_set_root_and_ext ( rgui - > browser , rgui - > info . valid_extensions , path ) ;
2013-09-29 15:53:26 +00:00
filebrowser_fetch_directory_entries ( FILEBROWSER_ACTION_OK ) ;
2012-08-22 01:56:57 +00:00
}
}
2012-05-21 16:01:51 +00:00
2012-08-22 01:56:57 +00:00
bHandled = TRUE ;
2012-05-21 16:01:51 +00:00
2012-05-29 02:39:54 +00:00
return 0 ;
2012-05-21 16:01:51 +00:00
}
2013-03-13 00:07:27 +00:00
static void set_dpad_emulation_label ( unsigned port , char * str , size_t sizeof_str )
{
switch ( g_settings . input . dpad_emulation [ port ] )
{
2013-03-14 01:24:57 +00:00
case ANALOG_DPAD_NONE :
2013-09-19 09:11:51 +00:00
strlcpy ( str , " D-Pad Emulation: None " , sizeof_str ) ;
2013-03-13 00:07:27 +00:00
break ;
2013-03-14 01:24:57 +00:00
case ANALOG_DPAD_LSTICK :
2013-09-19 09:11:51 +00:00
strlcpy ( str , " D-Pad Emulation: Left Stick " , sizeof_str ) ;
2013-03-13 00:07:27 +00:00
break ;
2013-03-14 01:24:57 +00:00
case ANALOG_DPAD_RSTICK :
2013-09-19 09:11:51 +00:00
strlcpy ( str , " D-Pad Emulation: Right Stick " , sizeof_str ) ;
2013-03-13 00:07:27 +00:00
break ;
}
}
2013-05-09 16:12:54 +00:00
static void init_menulist ( unsigned menu_id )
2012-05-23 06:37:31 +00:00
{
2013-05-09 13:12:22 +00:00
XuiListDeleteItems ( m_menulist , 0 , XuiListGetItemCount ( m_menulist ) ) ;
2012-05-23 06:37:31 +00:00
2013-05-09 16:12:54 +00:00
switch ( menu_id )
{
2013-05-10 18:40:38 +00:00
case INGAME_MENU_CORE_OPTIONS_MODE :
if ( g_extern . system . core_options )
{
size_t opts = core_option_size ( g_extern . system . core_options ) ;
for ( size_t i = 0 ; i < opts ; i + + )
{
char label [ 256 ] ;
strlcpy ( label , core_option_get_desc ( g_extern . system . core_options , i ) ,
sizeof ( label ) ) ;
snprintf ( label , sizeof ( label ) , " %s : %s " , label ,
core_option_get_val ( g_extern . system . core_options , i ) ) ;
mbstowcs ( strw_buffer , label ,
sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
XuiListInsertItems ( m_menulist , i , 1 ) ;
XuiListSetText ( m_menulist , i , strw_buffer ) ;
}
}
else
{
XuiListInsertItems ( m_menulist , 0 , 1 ) ;
XuiListSetText ( m_menulist , 0 , L " No options available. " ) ;
}
break ;
2013-05-10 20:01:35 +00:00
case INGAME_MENU_LOAD_GAME_HISTORY_MODE :
{
size_t history_size = rom_history_size ( rgui - > history ) ;
if ( history_size )
{
size_t opts = history_size ;
for ( size_t i = 0 ; i < opts ; i + + )
{
const char * path = NULL ;
const char * core_path = NULL ;
const char * core_name = NULL ;
rom_history_get_index ( rgui - > history , i ,
& path , & core_path , & core_name ) ;
char path_short [ PATH_MAX ] ;
fill_pathname ( path_short , path_basename ( path ) , " " , sizeof ( path_short ) ) ;
char fill_buf [ PATH_MAX ] ;
snprintf ( fill_buf , sizeof ( fill_buf ) , " %s (%s) " ,
path_short , core_name ) ;
mbstowcs ( strw_buffer , fill_buf , sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
XuiListInsertItems ( m_menulist , i , 1 ) ;
XuiListSetText ( m_menulist , i , strw_buffer ) ;
}
}
else
{
XuiListInsertItems ( m_menulist , 0 , 1 ) ;
XuiListSetText ( m_menulist , 0 , L " No history available. " ) ;
}
}
break ;
2013-05-09 16:12:54 +00:00
case INGAME_MENU_INPUT_OPTIONS_MODE :
{
unsigned i ;
char buttons [ RARCH_FIRST_META_KEY ] [ 128 ] ;
2013-05-09 16:44:35 +00:00
unsigned keybind_end = RETRO_DEVICE_ID_JOYPAD_R3 + 1 ;
2012-08-21 19:31:15 +00:00
2013-05-09 16:44:35 +00:00
for ( i = 0 ; i < keybind_end ; i + + )
{
struct platform_bind key_label ;
strlcpy ( key_label . desc , " Unknown " , sizeof ( key_label . desc ) ) ;
key_label . joykey = g_settings . input . binds [ rgui - > current_pad ] [ i ] . joykey ;
2013-05-06 00:55:39 +00:00
2013-05-09 16:44:35 +00:00
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( & key_label , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
snprintf ( buttons [ i ] , sizeof ( buttons [ i ] ) , " %s #%d: %s " ,
g_settings . input . binds [ rgui - > current_pad ] [ i ] . desc ,
rgui - > current_pad , key_label . desc ) ;
mbstowcs ( strw_buffer , buttons [ i ] , sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
XuiListInsertItems ( m_menulist , i , 1 ) ;
XuiListSetText ( m_menulist , i , strw_buffer ) ;
}
set_dpad_emulation_label ( rgui - > current_pad , buttons [ 0 ] , sizeof ( buttons [ 0 ] ) ) ;
mbstowcs ( strw_buffer , buttons [ 0 ] , sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
XuiListInsertItems ( m_menulist , keybind_end , 1 ) ;
XuiListSetText ( m_menulist , SETTING_CONTROLS_DPAD_EMULATION , strw_buffer ) ;
XuiListInsertItems ( m_menulist , keybind_end + 1 , 1 ) ;
XuiListSetText ( m_menulist , SETTING_CONTROLS_DEFAULT_ALL , L " Reset all buttons to default " ) ;
2013-05-09 16:12:54 +00:00
}
break ;
case INGAME_MENU_SETTINGS_MODE :
2013-05-25 22:37:00 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_REWIND_ENABLED , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_REWIND_ENABLED , g_settings . rewind_enable ? L " Rewind: ON " : L " Rewind: OFF " ) ;
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_REWIND_GRANULARITY , sizeof ( strw_buffer ) ) ;
XuiListInsertItems ( m_menulist , INGAME_MENU_REWIND_GRANULARITY , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_REWIND_GRANULARITY , strw_buffer ) ;
2013-05-09 16:44:35 +00:00
2013-05-09 18:07:12 +00:00
XuiListInsertItems ( m_menulist , SETTING_EMU_SHOW_INFO_MSG , 1 ) ;
2013-05-09 16:44:35 +00:00
XuiListSetText ( m_menulist , SETTING_EMU_SHOW_INFO_MSG , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) ) ? L " Info Messages: ON " : L " Info Messages: OFF " ) ;
2013-05-09 18:07:12 +00:00
XuiListInsertItems ( m_menulist , SETTING_EMU_SHOW_DEBUG_INFO_MSG , 1 ) ;
2013-05-09 16:44:35 +00:00
XuiListSetText ( m_menulist , SETTING_EMU_SHOW_DEBUG_INFO_MSG , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_FPS_DRAW ) ) ? L " Debug Info Messages: ON " : L " Debug Info messages: OFF " ) ;
break ;
2013-05-09 16:12:54 +00:00
case INGAME_MENU_MAIN_MODE :
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_CHANGE_LIBRETRO_CORE , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_CHANGE_LIBRETRO_CORE , L " Core ... " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_LOAD_GAME_HISTORY_MODE , 1 ) ;
2013-05-09 18:24:58 +00:00
XuiListSetText ( m_menulist , INGAME_MENU_LOAD_GAME_HISTORY_MODE , L " Load Game (History) ... " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_CHANGE_GAME , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_CHANGE_GAME , L " Load Game ... " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_CORE_OPTIONS_MODE , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_CORE_OPTIONS_MODE , L " Core Options ... " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_VIDEO_OPTIONS_MODE , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_VIDEO_OPTIONS_MODE , L " Video Options ... " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_AUDIO_OPTIONS_MODE , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_AUDIO_OPTIONS_MODE , L " Audio Options ... " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_INPUT_OPTIONS_MODE , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_INPUT_OPTIONS_MODE , L " Input Options ... " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_PATH_OPTIONS_MODE , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_PATH_OPTIONS_MODE , L " Path Options ... " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_SETTINGS_MODE , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_SETTINGS_MODE , L " Settings ... " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 18:07:12 +00:00
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_LOAD_STATE_SLOT , sizeof ( strw_buffer ) ) ;
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_LOAD_STATE , 1 ) ;
2013-05-09 18:07:12 +00:00
XuiListSetText ( m_menulist , INGAME_MENU_LOAD_STATE , strw_buffer ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 18:07:12 +00:00
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_SAVE_STATE_SLOT , sizeof ( strw_buffer ) ) ;
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_SAVE_STATE , 1 ) ;
2013-05-09 18:07:12 +00:00
XuiListSetText ( m_menulist , INGAME_MENU_SAVE_STATE , strw_buffer ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_SCREENSHOT_MODE , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_SCREENSHOT_MODE , L " Take Screenshot " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_RETURN_TO_GAME , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_RETURN_TO_GAME , L " Resume Game " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_RESET , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_RESET , L " Restart Game " ) ;
2013-05-09 16:12:54 +00:00
2013-05-09 16:44:35 +00:00
XuiListInsertItems ( m_menulist , INGAME_MENU_QUIT_RETROARCH , 1 ) ;
XuiListSetText ( m_menulist , INGAME_MENU_QUIT_RETROARCH , L " Quit RetroArch " ) ;
break ;
2013-05-09 16:12:54 +00:00
}
}
2013-09-29 15:53:26 +00:00
unsigned xui_input_to_rgui_action ( unsigned input )
{
switch ( input )
{
case XUI_CONTROL_NAVIGATE_LEFT :
return RGUI_ACTION_LEFT ;
case XUI_CONTROL_NAVIGATE_RIGHT :
return RGUI_ACTION_RIGHT ;
case XUI_CONTROL_NAVIGATE_UP :
return RGUI_ACTION_UP ;
case XUI_CONTROL_NAVIGATE_DOWN :
return RGUI_ACTION_DOWN ;
case XUI_CONTROL_NAVIGATE_OK :
return RGUI_ACTION_OK ;
}
return RGUI_ACTION_NOOP ;
}
2013-05-10 20:01:35 +00:00
HRESULT CRetroArchLoadGameHistory : : OnControlNavigate (
XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled )
{
2013-05-10 20:44:58 +00:00
unsigned current_index = XuiListGetCurSel ( m_menulist , NULL ) ;
unsigned input = pControlNavigateData - > nControlNavigate ;
2013-09-29 15:39:43 +00:00
unsigned action = xui_input_to_rgui_action ( input ) ;
2013-05-10 20:44:58 +00:00
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_OK )
2013-05-10 20:44:58 +00:00
{
load_menu_game_history ( current_index ) ;
process_input_ret = - 1 ;
}
2013-05-10 20:01:35 +00:00
bHandled = TRUE ;
2013-09-29 15:39:43 +00:00
switch ( action )
2013-05-10 20:01:35 +00:00
{
2013-09-29 15:39:43 +00:00
case RGUI_ACTION_LEFT :
case RGUI_ACTION_RIGHT :
case RGUI_ACTION_UP :
case RGUI_ACTION_DOWN :
2013-05-10 20:01:35 +00:00
pControlNavigateData - > hObjDest = pControlNavigateData - > hObjSource ;
break ;
default :
break ;
}
return 0 ;
}
2013-05-09 16:12:54 +00:00
HRESULT CRetroArchControls : : OnInit ( XUIMessageInit * pInitData , BOOL & bHandled )
{
GetChildById ( L " XuiMenuList " , & m_menulist ) ;
GetChildById ( L " XuiBackButton " , & m_back ) ;
GetChildById ( L " XuiTxtTitle " , & m_menutitle ) ;
XuiTextElementSetText ( m_menutitle , L " Input options " ) ;
init_menulist ( INGAME_MENU_INPUT_OPTIONS_MODE ) ;
2012-11-18 01:57:42 +00:00
2012-05-29 02:39:54 +00:00
return 0 ;
2012-05-23 06:37:31 +00:00
}
2013-05-10 01:54:20 +00:00
HRESULT CRetroArchFileBrowser : : OnControlNavigate (
XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled )
{
bHandled = TRUE ;
2013-09-29 15:39:43 +00:00
unsigned input = pControlNavigateData - > nControlNavigate ;
unsigned action = xui_input_to_rgui_action ( input ) ;
2013-05-10 01:54:20 +00:00
2013-09-29 15:39:43 +00:00
switch ( action )
2013-05-10 01:54:20 +00:00
{
2013-09-29 15:39:43 +00:00
case RGUI_ACTION_LEFT :
case RGUI_ACTION_RIGHT :
case RGUI_ACTION_UP :
case RGUI_ACTION_DOWN :
2013-05-10 01:54:20 +00:00
pControlNavigateData - > hObjDest = pControlNavigateData - > hObjSource ;
break ;
default :
break ;
}
return 0 ;
}
HRESULT CRetroArchShaderBrowser : : OnControlNavigate (
XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled )
{
2013-09-29 15:39:43 +00:00
unsigned input = pControlNavigateData - > nControlNavigate ;
unsigned action = xui_input_to_rgui_action ( input ) ;
2013-05-10 01:54:20 +00:00
bHandled = TRUE ;
2013-09-29 15:39:43 +00:00
switch ( action )
2013-05-10 01:54:20 +00:00
{
2013-09-29 15:39:43 +00:00
case RGUI_ACTION_LEFT :
case RGUI_ACTION_RIGHT :
case RGUI_ACTION_UP :
case RGUI_ACTION_DOWN :
2013-05-10 01:54:20 +00:00
pControlNavigateData - > hObjDest = pControlNavigateData - > hObjSource ;
break ;
default :
break ;
}
return 0 ;
}
HRESULT CRetroArchCoreBrowser : : OnControlNavigate (
XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled )
{
2013-09-29 15:39:43 +00:00
unsigned input = pControlNavigateData - > nControlNavigate ;
unsigned action = xui_input_to_rgui_action ( input ) ;
2013-05-10 01:54:20 +00:00
bHandled = TRUE ;
2013-09-29 15:39:43 +00:00
switch ( action )
2013-05-10 01:54:20 +00:00
{
2013-09-29 15:39:43 +00:00
case RGUI_ACTION_LEFT :
case RGUI_ACTION_RIGHT :
case RGUI_ACTION_UP :
case RGUI_ACTION_DOWN :
2013-05-10 01:54:20 +00:00
pControlNavigateData - > hObjDest = pControlNavigateData - > hObjSource ;
break ;
default :
break ;
}
return 0 ;
}
2013-09-29 15:08:42 +00:00
2012-06-30 11:37:18 +00:00
HRESULT CRetroArchControls : : OnControlNavigate (
2012-11-18 01:57:42 +00:00
XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled )
2012-05-23 06:37:31 +00:00
{
char button [ 128 ] ;
char buttons [ RARCH_FIRST_META_KEY ] [ 128 ] ;
2013-05-09 13:12:22 +00:00
int i , current_index ;
2012-11-18 01:57:42 +00:00
2012-05-23 06:37:31 +00:00
for ( i = 0 ; i < RARCH_FIRST_META_KEY ; i + + )
{
2013-03-14 20:55:10 +00:00
struct platform_bind key_label ;
strlcpy ( key_label . desc , " Unknown " , sizeof ( key_label . desc ) ) ;
2013-05-09 13:12:22 +00:00
key_label . joykey = g_settings . input . binds [ rgui - > current_pad ] [ i ] . joykey ;
2013-03-14 20:55:10 +00:00
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( & key_label , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
2012-06-30 11:37:18 +00:00
snprintf ( buttons [ i ] , sizeof ( buttons [ i ] ) , " %s #%d: %s " ,
2013-05-09 13:12:22 +00:00
g_settings . input . binds [ rgui - > current_pad ] [ i ] . desc , rgui - > current_pad ,
2013-03-14 20:55:10 +00:00
key_label . desc ) ;
2013-04-11 15:18:23 +00:00
mbstowcs ( strw_buffer , buttons [ i ] , sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
2013-05-09 13:12:22 +00:00
XuiListSetText ( m_menulist , i , strw_buffer ) ;
2012-05-23 06:37:31 +00:00
}
2013-05-09 16:44:35 +00:00
current_index = XuiListGetCurSel ( m_menulist , NULL ) ;
unsigned input = pControlNavigateData - > nControlNavigate ;
2013-09-29 15:08:42 +00:00
unsigned action = xui_input_to_rgui_action ( input ) ;
2012-05-23 06:37:31 +00:00
2013-05-09 16:44:35 +00:00
switch ( current_index )
2012-05-29 13:25:39 +00:00
{
2013-05-09 16:44:35 +00:00
case SETTING_CONTROLS_DPAD_EMULATION :
2013-09-29 15:04:43 +00:00
menu_set_settings ( RGUI_SETTINGS_BIND_DPAD_EMULATION , action ) ;
2012-05-29 17:51:35 +00:00
break ;
2013-05-09 16:44:35 +00:00
case SETTING_CONTROLS_DEFAULT_ALL :
break ;
default :
2013-09-29 15:04:43 +00:00
if ( action = = RGUI_ACTION_LEFT )
2013-05-09 16:44:35 +00:00
{
struct platform_bind key_label ;
strlcpy ( key_label . desc , " Unknown " , sizeof ( key_label . desc ) ) ;
key_label . joykey = g_settings . input . binds [ rgui - > current_pad ] [ current_index ] . joykey ;
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( & key_label , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( driver . input_data , g_settings . input . device [ rgui - > current_pad ] ,
rgui - > current_pad , current_index , ( 1ULL < < KEYBINDS_ACTION_DECREMENT_BIND ) ) ;
snprintf ( button , sizeof ( button ) , " %s #%d: %s " ,
g_settings . input . binds [ rgui - > current_pad ] [ current_index ] . desc ,
rgui - > current_pad , key_label . desc ) ;
mbstowcs ( strw_buffer , button , sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
XuiListSetText ( m_menulist , current_index , strw_buffer ) ;
}
2013-09-29 15:04:43 +00:00
else if ( action = = RGUI_ACTION_RIGHT )
2013-05-09 16:44:35 +00:00
{
struct platform_bind key_label ;
strlcpy ( key_label . desc , " Unknown " , sizeof ( key_label . desc ) ) ;
key_label . joykey = g_settings . input . binds [ rgui - > current_pad ] [ current_index ] . joykey ;
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( & key_label , 0 , 0 , 0 , ( 1ULL < < KEYBINDS_ACTION_GET_BIND_LABEL ) ) ;
if ( driver . input - > set_keybinds )
driver . input - > set_keybinds ( driver . input_data , g_settings . input . device [ rgui - > current_pad ] ,
rgui - > current_pad , current_index , ( 1ULL < < KEYBINDS_ACTION_INCREMENT_BIND ) ) ;
snprintf ( button , sizeof ( button ) , " %s #%d: %s " ,
g_settings . input . binds [ rgui - > current_pad ] [ current_index ] . desc , rgui - > current_pad ,
key_label . desc ) ;
mbstowcs ( strw_buffer , button , sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
XuiListSetText ( m_menulist , current_index , strw_buffer ) ;
}
2012-05-29 17:51:35 +00:00
break ;
2012-05-29 13:25:39 +00:00
}
2012-05-23 06:37:31 +00:00
2013-05-09 13:12:22 +00:00
set_dpad_emulation_label ( rgui - > current_pad , button , sizeof ( button ) ) ;
2013-03-13 00:07:27 +00:00
2013-04-11 15:18:23 +00:00
mbstowcs ( strw_buffer , button , sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
2013-05-09 13:12:22 +00:00
XuiListSetText ( m_menulist , SETTING_CONTROLS_DPAD_EMULATION , strw_buffer ) ;
XuiListSetText ( m_menulist , SETTING_CONTROLS_DEFAULT_ALL , L " Reset all buttons to default " ) ;
2012-08-21 19:31:15 +00:00
2012-11-18 01:57:42 +00:00
return 0 ;
2012-05-23 06:37:31 +00:00
}
2013-05-10 20:01:35 +00:00
HRESULT CRetroArchLoadGameHistory : : OnNotifyPress ( HXUIOBJ hObjPressed , int & bHandled )
{
if ( hObjPressed = = m_menulist )
{
XUIMessageControlNavigate controls ;
controls . nControlNavigate = ( XUI_CONTROL_NAVIGATE ) XUI_CONTROL_NAVIGATE_OK ;
OnControlNavigate ( & controls , bHandled ) ;
}
bHandled = TRUE ;
return 0 ;
}
2012-05-23 06:37:31 +00:00
HRESULT CRetroArchControls : : OnNotifyPress ( HXUIOBJ hObjPressed , int & bHandled )
{
2013-05-09 13:12:22 +00:00
if ( hObjPressed = = m_menulist )
2012-05-23 06:37:31 +00:00
{
2013-05-09 16:12:54 +00:00
XUIMessageControlNavigate controls ;
controls . nControlNavigate = ( XUI_CONTROL_NAVIGATE ) XUI_CONTROL_NAVIGATE_OK ;
OnControlNavigate ( & controls , bHandled ) ;
2012-05-23 06:37:31 +00:00
}
bHandled = TRUE ;
2012-05-29 02:39:54 +00:00
return 0 ;
2012-05-23 06:37:31 +00:00
}
2013-05-10 20:01:35 +00:00
HRESULT CRetroArchLoadGameHistory : : OnInit ( XUIMessageInit * pInitData , BOOL & bHandled )
{
GetChildById ( L " XuiMenuList " , & m_menulist ) ;
GetChildById ( L " XuiBackButton " , & m_back ) ;
GetChildById ( L " XuiTxtTitle " , & m_menutitle ) ;
XuiTextElementSetText ( m_menutitle , L " Load History " ) ;
init_menulist ( INGAME_MENU_LOAD_GAME_HISTORY_MODE ) ;
return 0 ;
}
2012-04-21 22:11:48 +00:00
HRESULT CRetroArchSettings : : OnInit ( XUIMessageInit * pInitData , BOOL & bHandled )
2012-01-24 05:55:27 +00:00
{
2013-05-09 13:12:22 +00:00
GetChildById ( L " XuiMenuList " , & m_menulist ) ;
2012-04-10 19:23:42 +00:00
GetChildById ( L " XuiBackButton " , & m_back ) ;
2013-05-09 13:12:22 +00:00
GetChildById ( L " XuiTxtTitle " , & m_menutitle ) ;
2012-02-09 02:10:20 +00:00
2013-05-09 13:12:22 +00:00
XuiTextElementSetText ( m_menutitle , L " Settings " ) ;
2013-05-09 11:25:02 +00:00
2013-05-09 16:12:54 +00:00
init_menulist ( INGAME_MENU_SETTINGS_MODE ) ;
2012-08-22 01:56:57 +00:00
return 0 ;
}
2012-05-24 09:34:10 +00:00
HRESULT CRetroArchSettings : : OnControlNavigate ( XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled )
{
int current_index ;
2012-11-19 03:46:48 +00:00
xdk_d3d_video_t * device_ptr = ( xdk_d3d_video_t * ) driver . video_data ;
2012-11-18 01:57:42 +00:00
2013-05-09 13:12:22 +00:00
current_index = XuiListGetCurSel ( m_menulist , NULL ) ;
2012-05-24 09:34:10 +00:00
2013-05-09 16:44:35 +00:00
unsigned input = pControlNavigateData - > nControlNavigate ;
2013-09-29 15:08:42 +00:00
unsigned action = xui_input_to_rgui_action ( input ) ;
2013-05-09 16:44:35 +00:00
switch ( current_index )
2012-05-29 13:25:39 +00:00
{
2013-06-03 18:42:04 +00:00
case INGAME_MENU_REWIND_ENABLED :
2013-09-29 15:04:43 +00:00
menu_set_settings ( RGUI_SETTINGS_REWIND_ENABLE , action ) ;
2013-06-03 18:42:04 +00:00
XuiListSetText ( m_menulist , INGAME_MENU_REWIND_ENABLED , g_settings . rewind_enable ? L " Rewind: ON " : L " Rewind: OFF " ) ;
break ;
case INGAME_MENU_REWIND_GRANULARITY :
2013-09-29 15:04:43 +00:00
menu_set_settings ( RGUI_SETTINGS_REWIND_GRANULARITY , action ) ;
2013-06-03 18:42:04 +00:00
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_REWIND_GRANULARITY , sizeof ( strw_buffer ) ) ;
XuiListSetText ( m_menulist , INGAME_MENU_REWIND_GRANULARITY , strw_buffer ) ;
break ;
2013-05-09 16:44:35 +00:00
case SETTING_EMU_SHOW_INFO_MSG :
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_LEFT )
2013-05-09 16:44:35 +00:00
{
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_INFO_DRAW ) ;
else
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_INFO_DRAW ) ;
XuiListSetText ( m_menulist , SETTING_EMU_SHOW_INFO_MSG , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) ) ? L " Info messages: ON " : L " Info messages: OFF " ) ;
}
2013-09-29 15:39:43 +00:00
else if ( action = = RGUI_ACTION_RIGHT | | action = = RGUI_ACTION_OK )
2013-05-09 16:44:35 +00:00
{
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) )
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_INFO_DRAW ) ;
else
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_INFO_DRAW ) ;
XuiListSetText ( m_menulist , SETTING_EMU_SHOW_INFO_MSG , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_INFO_DRAW ) ) ? L " Info messages: ON " : L " Info messages: OFF " ) ;
}
break ;
case SETTING_EMU_SHOW_DEBUG_INFO_MSG :
2013-09-29 15:04:43 +00:00
menu_set_settings ( RGUI_SETTINGS_DEBUG_TEXT , action ) ;
XuiListSetText ( m_menulist , SETTING_EMU_SHOW_DEBUG_INFO_MSG , ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_FPS_DRAW ) ) ? L " Debug Info messages: ON " : L " Debug Info messages: OFF " ) ;
2013-05-09 16:44:35 +00:00
break ;
default :
2012-11-18 01:57:42 +00:00
break ;
2012-05-29 13:25:39 +00:00
}
2012-05-24 09:34:10 +00:00
2012-06-30 11:37:18 +00:00
bHandled = TRUE ;
2012-11-18 01:57:42 +00:00
2013-09-29 15:04:43 +00:00
switch ( action )
2012-06-30 11:37:18 +00:00
{
2013-09-29 15:04:43 +00:00
case RGUI_ACTION_LEFT :
case RGUI_ACTION_RIGHT :
case RGUI_ACTION_UP :
case RGUI_ACTION_DOWN :
2012-06-30 11:37:18 +00:00
pControlNavigateData - > hObjDest = pControlNavigateData - > hObjSource ;
break ;
default :
break ;
2012-11-18 01:57:42 +00:00
}
2012-05-29 17:00:13 +00:00
2012-11-18 01:57:42 +00:00
return 0 ;
2012-05-24 09:34:10 +00:00
}
2013-05-09 16:12:54 +00:00
HRESULT CRetroArchSettings : : OnNotifyPress ( HXUIOBJ hObjPressed , int & bHandled )
{
process_input_ret = 0 ;
if ( hObjPressed = = m_menulist )
{
XUIMessageControlNavigate controls ;
controls . nControlNavigate = ( XUI_CONTROL_NAVIGATE ) XUI_CONTROL_NAVIGATE_OK ;
OnControlNavigate ( & controls , bHandled ) ;
}
bHandled = TRUE ;
return 0 ;
}
2013-05-10 18:40:38 +00:00
HRESULT CRetroArchCoreOptions : : OnInit ( XUIMessageInit * pInitData , BOOL & bHandled )
{
GetChildById ( L " XuiMenuList " , & m_menulist ) ;
GetChildById ( L " XuiBackButton " , & m_back ) ;
GetChildById ( L " XuiTxtTitle " , & m_menutitle ) ;
XuiListDeleteItems ( m_menulist , 0 , XuiListGetItemCount ( m_menulist ) ) ;
XuiTextElementSetText ( m_menutitle , L " Core Options " ) ;
init_menulist ( INGAME_MENU_CORE_OPTIONS_MODE ) ;
return 0 ;
}
HRESULT CRetroArchCoreOptions : : OnNotifyPress ( HXUIOBJ hObjPressed , int & bHandled )
{
process_input_ret = 0 ;
if ( hObjPressed = = m_menulist )
{
XUIMessageControlNavigate controls ;
controls . nControlNavigate = ( XUI_CONTROL_NAVIGATE ) XUI_CONTROL_NAVIGATE_OK ;
OnControlNavigate ( & controls , bHandled ) ;
}
bHandled = TRUE ;
return 0 ;
}
HRESULT CRetroArchCoreOptions : : OnControlNavigate ( XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled )
{
unsigned current_index = XuiListGetCurSel ( m_menulist , NULL ) ;
unsigned input = pControlNavigateData - > nControlNavigate ;
2013-09-29 15:08:42 +00:00
unsigned action = xui_input_to_rgui_action ( input ) ;
2013-05-10 18:40:38 +00:00
size_t opts = core_option_size ( g_extern . system . core_options ) ;
if ( ( current_index < opts ) & & opts > 0 )
{
bool update_item = false ;
2013-09-29 15:04:43 +00:00
switch ( action )
2013-05-10 18:40:38 +00:00
{
2013-09-29 15:04:43 +00:00
case RGUI_ACTION_LEFT :
2013-05-10 18:40:38 +00:00
core_option_prev ( g_extern . system . core_options , current_index ) ;
update_item = true ;
break ;
2013-09-29 15:04:43 +00:00
case RGUI_ACTION_RIGHT :
2013-05-10 18:40:38 +00:00
core_option_next ( g_extern . system . core_options , current_index ) ;
update_item = true ;
break ;
}
if ( update_item )
{
char label [ 256 ] ;
strlcpy ( label , core_option_get_desc ( g_extern . system . core_options , current_index ) ,
sizeof ( label ) ) ;
snprintf ( label , sizeof ( label ) , " %s : %s " , label ,
core_option_get_val ( g_extern . system . core_options , current_index ) ) ;
mbstowcs ( strw_buffer , label ,
sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
XuiListSetText ( m_menulist , current_index , strw_buffer ) ;
}
}
bHandled = TRUE ;
2013-09-29 15:04:43 +00:00
switch ( action )
2013-05-10 18:40:38 +00:00
{
2013-09-29 15:04:43 +00:00
case RGUI_ACTION_LEFT :
case RGUI_ACTION_RIGHT :
case RGUI_ACTION_UP :
case RGUI_ACTION_DOWN :
2013-05-10 18:40:38 +00:00
pControlNavigateData - > hObjDest = pControlNavigateData - > hObjSource ;
break ;
default :
break ;
}
return 0 ;
}
2013-05-10 17:02:24 +00:00
HRESULT CRetroArchAudioOptions : : OnInit ( XUIMessageInit * pInitData , BOOL & bHandled )
{
GetChildById ( L " XuiMenuList " , & m_menulist ) ;
GetChildById ( L " XuiBackButton " , & m_back ) ;
GetChildById ( L " XuiTxtTitle " , & m_menutitle ) ;
XuiListDeleteItems ( m_menulist , 0 , XuiListGetItemCount ( m_menulist ) ) ;
XuiTextElementSetText ( m_menutitle , L " Audio Options " ) ;
XuiListInsertItems ( m_menulist , MENU_XUI_ITEM_AUDIO_MUTE_AUDIO , 1 ) ;
XuiListSetText ( m_menulist , MENU_XUI_ITEM_AUDIO_MUTE_AUDIO , g_extern . audio_data . mute ? L " Mute Audio : ON " : L " Mute Audio : OFF " ) ;
return 0 ;
}
HRESULT CRetroArchAudioOptions : : OnControlNavigate ( XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled )
{
2013-05-10 18:40:38 +00:00
int current_index = XuiListGetCurSel ( m_menulist , NULL ) ;
2013-05-10 17:02:24 +00:00
unsigned input = pControlNavigateData - > nControlNavigate ;
2013-09-29 15:08:42 +00:00
unsigned action = xui_input_to_rgui_action ( input ) ;
2013-05-10 17:02:24 +00:00
switch ( current_index )
{
case MENU_XUI_ITEM_AUDIO_MUTE_AUDIO :
2013-09-29 15:04:43 +00:00
menu_set_settings ( RGUI_SETTINGS_AUDIO_MUTE , action ) ;
XuiListSetText ( m_menulist , MENU_XUI_ITEM_AUDIO_MUTE_AUDIO , g_extern . audio_data . mute ? L " Mute Audio : ON " : L " Mute Audio : OFF " ) ;
2013-05-10 17:02:24 +00:00
break ;
}
bHandled = TRUE ;
2013-09-29 15:04:43 +00:00
switch ( action )
2013-05-10 17:02:24 +00:00
{
2013-09-29 15:04:43 +00:00
case RGUI_ACTION_LEFT :
case RGUI_ACTION_RIGHT :
case RGUI_ACTION_UP :
case RGUI_ACTION_DOWN :
2013-05-10 17:02:24 +00:00
pControlNavigateData - > hObjDest = pControlNavigateData - > hObjSource ;
break ;
default :
break ;
}
return 0 ;
}
HRESULT CRetroArchAudioOptions : : OnNotifyPress ( HXUIOBJ hObjPressed , int & bHandled )
{
process_input_ret = 0 ;
if ( hObjPressed = = m_menulist )
{
XUIMessageControlNavigate controls ;
controls . nControlNavigate = ( XUI_CONTROL_NAVIGATE ) XUI_CONTROL_NAVIGATE_OK ;
OnControlNavigate ( & controls , bHandled ) ;
}
bHandled = TRUE ;
return 0 ;
}
2013-05-10 16:25:17 +00:00
HRESULT CRetroArchVideoOptions : : OnInit ( XUIMessageInit * pInitData , BOOL & bHandled )
2012-02-14 01:41:35 +00:00
{
2013-05-09 13:12:22 +00:00
GetChildById ( L " XuiMenuList " , & m_menulist ) ;
2012-04-10 19:23:42 +00:00
GetChildById ( L " XuiBackButton " , & m_back ) ;
2013-05-09 13:12:22 +00:00
GetChildById ( L " XuiTxtTitle " , & m_menutitle ) ;
2012-05-29 13:25:39 +00:00
2013-05-09 13:12:22 +00:00
XuiListDeleteItems ( m_menulist , 0 , XuiListGetItemCount ( m_menulist ) ) ;
2012-11-18 01:57:42 +00:00
2013-05-09 18:07:12 +00:00
XuiTextElementSetText ( m_menutitle , L " Video Options " ) ;
2013-05-06 00:40:15 +00:00
2013-05-10 01:36:32 +00:00
XuiListInsertItems ( m_menulist , MENU_XUI_ITEM_HW_TEXTURE_FILTER , 1 ) ;
XuiListSetText ( m_menulist , MENU_XUI_ITEM_HW_TEXTURE_FILTER , g_settings . video . smooth ? L " Default Filter: Linear " : L " Default Filter: Nearest " ) ;
XuiListInsertItems ( m_menulist , MENU_XUI_ITEM_GAMMA_CORRECTION_ENABLED , 1 ) ;
XuiListSetText ( m_menulist , MENU_XUI_ITEM_GAMMA_CORRECTION_ENABLED , g_extern . console . screen . gamma_correction ? L " Gamma Correction: ON " : L " Gamma correction: OFF " ) ;
2013-05-06 00:40:15 +00:00
if ( driver . video_poke - > set_aspect_ratio )
driver . video_poke - > set_aspect_ratio ( driver . video_data , g_settings . video . aspect_ratio_idx ) ;
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_ASPECT_RATIO , sizeof ( strw_buffer ) ) ;
2013-05-09 18:07:12 +00:00
XuiListInsertItems ( m_menulist , MENU_XUI_ITEM_ASPECT_RATIO , 1 ) ;
2013-05-09 13:12:22 +00:00
XuiListSetText ( m_menulist , MENU_XUI_ITEM_ASPECT_RATIO , strw_buffer ) ;
2013-05-06 00:40:15 +00:00
2013-05-09 18:24:58 +00:00
XuiListInsertItems ( m_menulist , MENU_XUI_ITEM_RESIZE_MODE , 1 ) ;
XuiListSetText ( m_menulist , MENU_XUI_ITEM_RESIZE_MODE , L " Custom Ratio ... " ) ;
2013-09-27 23:46:55 +00:00
driver . video - > set_rotation ( driver . video_data , g_settings . video . rotation ) ;
2013-05-06 00:40:15 +00:00
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_ROTATION , sizeof ( strw_buffer ) ) ;
2013-05-09 18:07:12 +00:00
XuiListInsertItems ( m_menulist , MENU_XUI_ITEM_ORIENTATION , 1 ) ;
2013-05-09 13:12:22 +00:00
XuiListSetText ( m_menulist , MENU_XUI_ITEM_ORIENTATION , strw_buffer ) ;
2013-05-06 00:40:15 +00:00
2012-05-29 02:39:54 +00:00
return 0 ;
2012-02-14 01:41:35 +00:00
}
2013-05-10 16:25:17 +00:00
HRESULT CRetroArchVideoOptions : : OnControlNavigate ( XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled )
2012-05-29 17:00:13 +00:00
{
bool aspectratio_changed = false ;
int current_index ;
2012-11-18 01:57:42 +00:00
2013-05-09 13:12:22 +00:00
current_index = XuiListGetCurSel ( m_menulist , NULL ) ;
2012-05-29 17:00:13 +00:00
2013-05-09 16:46:06 +00:00
unsigned input = pControlNavigateData - > nControlNavigate ;
2013-09-29 15:08:42 +00:00
unsigned action = xui_input_to_rgui_action ( input ) ;
2013-05-09 16:44:35 +00:00
switch ( current_index )
2012-05-29 17:00:13 +00:00
{
2013-05-10 01:36:32 +00:00
case MENU_XUI_ITEM_HW_TEXTURE_FILTER :
2013-09-29 15:04:43 +00:00
menu_set_settings ( RGUI_SETTINGS_VIDEO_FILTER , action ) ;
XuiListSetText ( m_menulist , MENU_XUI_ITEM_HW_TEXTURE_FILTER , g_settings . video . smooth ? L " Default Filter: Linear " : L " Default Filter: Nearest " ) ;
2013-05-10 01:36:32 +00:00
break ;
case MENU_XUI_ITEM_GAMMA_CORRECTION_ENABLED :
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_LEFT | |
action = = RGUI_ACTION_RIGHT | |
action = = RGUI_ACTION_OK )
2013-05-10 01:36:32 +00:00
{
g_extern . console . screen . gamma_correction = g_extern . console . screen . gamma_correction ? 0 : 1 ;
XuiListSetText ( m_menulist , MENU_XUI_ITEM_GAMMA_CORRECTION_ENABLED , g_extern . console . screen . gamma_correction ? L " Gamma correction: ON " : L " Gamma correction: OFF " ) ;
msg_queue_push ( g_extern . msg_queue , " You need to restart for this change to take effect. \n " , 1 , 90 ) ;
}
break ;
2013-05-09 16:44:35 +00:00
case MENU_XUI_ITEM_ASPECT_RATIO :
2013-09-29 15:04:43 +00:00
menu_set_settings ( RGUI_SETTINGS_VIDEO_ASPECT_RATIO , action ) ;
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_ASPECT_RATIO , sizeof ( strw_buffer ) ) ;
XuiListSetText ( m_menulist , MENU_XUI_ITEM_ASPECT_RATIO , strw_buffer ) ;
2012-05-29 17:00:13 +00:00
break ;
2013-05-09 16:44:35 +00:00
case MENU_XUI_ITEM_ORIENTATION :
2013-09-29 15:04:43 +00:00
menu_set_settings ( RGUI_SETTINGS_VIDEO_ROTATION , action ) ;
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_ROTATION , sizeof ( strw_buffer ) ) ;
XuiListSetText ( m_menulist , MENU_XUI_ITEM_ORIENTATION , strw_buffer ) ;
driver . video - > set_rotation ( driver . video_data , g_settings . video . rotation ) ;
2012-05-29 17:00:13 +00:00
break ;
}
bHandled = TRUE ;
2013-09-29 15:04:43 +00:00
switch ( action )
2012-06-30 11:37:18 +00:00
{
2013-09-29 15:04:43 +00:00
case RGUI_ACTION_LEFT :
case RGUI_ACTION_RIGHT :
case RGUI_ACTION_UP :
case RGUI_ACTION_DOWN :
2012-06-30 11:37:18 +00:00
pControlNavigateData - > hObjDest = pControlNavigateData - > hObjSource ;
2012-11-18 01:57:42 +00:00
break ;
2012-06-30 11:37:18 +00:00
default :
break ;
2012-11-18 01:57:42 +00:00
}
2012-05-29 17:00:13 +00:00
return 0 ;
}
2013-05-10 16:25:17 +00:00
HRESULT CRetroArchVideoOptions : : OnNotifyPress ( HXUIOBJ hObjPressed , int & bHandled )
2012-02-14 01:41:35 +00:00
{
2013-01-11 05:10:21 +00:00
process_input_ret = 0 ;
2012-04-10 19:23:42 +00:00
2013-05-09 13:12:22 +00:00
if ( hObjPressed = = m_menulist )
2012-04-10 19:23:42 +00:00
{
2013-05-09 16:12:54 +00:00
XUIMessageControlNavigate controls ;
controls . nControlNavigate = ( XUI_CONTROL_NAVIGATE ) XUI_CONTROL_NAVIGATE_OK ;
OnControlNavigate ( & controls , bHandled ) ;
2012-04-10 19:23:42 +00:00
}
bHandled = TRUE ;
2012-02-14 01:41:35 +00:00
2012-05-29 02:39:54 +00:00
return 0 ;
2012-02-14 01:41:35 +00:00
}
2012-08-22 01:56:57 +00:00
HRESULT CRetroArchShaderBrowser : : OnInit ( XUIMessageInit * pInitData , BOOL & bHandled )
2012-02-04 19:33:51 +00:00
{
2013-05-09 19:46:13 +00:00
GetChildById ( L " XuiMenuList " , & m_menulist ) ;
GetChildById ( L " XuiTxtTitle " , & m_menutitle ) ;
GetChildById ( L " XuiTxtBottom " , & m_menutitlebottom ) ;
2012-04-10 19:23:42 +00:00
2013-04-18 15:27:11 +00:00
filebrowser_set_root_and_ext ( rgui - > browser , " cg " , " game: \\ media \\ shaders " ) ;
2013-09-29 15:53:26 +00:00
filebrowser_fetch_directory_entries ( FILEBROWSER_ACTION_OK ) ;
2012-04-10 19:23:42 +00:00
2012-05-29 02:39:54 +00:00
return 0 ;
2012-03-05 12:06:24 +00:00
}
2012-05-21 16:01:51 +00:00
HRESULT CRetroArchShaderBrowser : : OnNotifyPress ( HXUIOBJ hObjPressed , BOOL & bHandled )
{
2012-05-28 15:34:58 +00:00
char path [ PATH_MAX ] ;
2013-01-11 05:10:21 +00:00
process_input_ret = 0 ;
2012-05-21 16:01:51 +00:00
2013-05-09 19:46:13 +00:00
if ( hObjPressed = = m_menulist )
2012-05-21 16:01:51 +00:00
{
2013-05-09 19:46:13 +00:00
int index = XuiListGetCurSel ( m_menulist , NULL ) ;
2013-04-18 15:27:11 +00:00
if ( path_file_exists ( rgui - > browser - > list - > elems [ index ] . data ) )
2013-05-09 19:46:13 +00:00
wcstombs ( str_buffer , ( const wchar_t * ) XuiListGetText ( m_menulist , index ) , sizeof ( str_buffer ) ) ;
2013-04-18 15:27:11 +00:00
else if ( rgui - > browser - > list - > elems [ index ] . attr . b )
2012-05-21 16:01:51 +00:00
{
2013-05-09 19:46:13 +00:00
wcstombs ( str_buffer , ( const wchar_t * ) XuiListGetText ( m_menulist , index ) , sizeof ( str_buffer ) ) ;
2013-09-19 08:04:49 +00:00
fill_pathname_join ( path , rgui - > browser - > current_dir . directory_path , str_buffer , sizeof ( path ) ) ;
2013-04-18 15:27:11 +00:00
filebrowser_set_root_and_ext ( rgui - > browser , " cg " , path ) ;
2013-09-29 15:53:26 +00:00
filebrowser_fetch_directory_entries ( FILEBROWSER_ACTION_OK ) ;
2012-05-21 16:01:51 +00:00
}
}
bHandled = TRUE ;
2012-05-29 02:39:54 +00:00
return 0 ;
2012-05-21 16:01:51 +00:00
}
2012-08-22 01:56:57 +00:00
HRESULT CRetroArchCoreBrowser : : OnInit ( XUIMessageInit * pInitData , BOOL & bHandled )
{
2013-05-09 19:46:13 +00:00
GetChildById ( L " XuiMenuList " , & m_menulist ) ;
GetChildById ( L " XuiTxtTitle " , & m_menutitle ) ;
GetChildById ( L " XuiTxtBottom " , & m_menutitlebottom ) ;
2012-08-22 01:56:57 +00:00
2013-04-18 15:27:11 +00:00
filebrowser_set_root_and_ext ( rgui - > browser , " xex|XEX " , " game: " ) ;
2013-09-29 15:53:26 +00:00
filebrowser_fetch_directory_entries ( FILEBROWSER_ACTION_OK ) ;
2012-08-22 01:56:57 +00:00
return 0 ;
}
2012-04-21 22:11:48 +00:00
HRESULT CRetroArchCoreBrowser : : OnNotifyPress ( HXUIOBJ hObjPressed , BOOL & bHandled )
2012-03-05 12:06:24 +00:00
{
2012-05-28 15:34:58 +00:00
char path [ PATH_MAX ] ;
2012-04-10 19:23:42 +00:00
2013-01-11 05:10:21 +00:00
process_input_ret = 0 ;
2013-05-09 19:46:13 +00:00
if ( hObjPressed = = m_menulist )
2012-04-10 19:23:42 +00:00
{
2013-05-09 19:46:13 +00:00
int index = XuiListGetCurSel ( m_menulist , NULL ) ;
wcstombs ( str_buffer , ( const wchar_t * ) XuiListGetText ( m_menulist , index ) , sizeof ( str_buffer ) ) ;
2013-04-18 15:27:11 +00:00
if ( path_file_exists ( rgui - > browser - > list - > elems [ index ] . data ) )
2012-04-10 19:23:42 +00:00
{
2013-09-19 08:04:49 +00:00
fill_pathname_join ( path , rgui - > browser - > current_dir . directory_path , str_buffer , sizeof ( path ) ) ;
2013-09-15 16:49:18 +00:00
rarch_environment_cb ( RETRO_ENVIRONMENT_SET_LIBRETRO_PATH , ( void * ) path ) ;
2013-08-24 21:08:40 +00:00
2013-01-12 02:13:03 +00:00
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_EXITSPAWN ) ;
2013-01-11 05:10:21 +00:00
process_input_ret = - 1 ;
2012-04-10 19:23:42 +00:00
}
2013-04-18 15:27:11 +00:00
else if ( rgui - > browser - > list - > elems [ index ] . attr . b )
2012-04-10 19:23:42 +00:00
{
2013-09-19 08:04:49 +00:00
fill_pathname_join ( path , rgui - > browser - > current_dir . directory_path , str_buffer , sizeof ( path ) ) ;
2013-04-18 15:27:11 +00:00
filebrowser_set_root_and_ext ( rgui - > browser , " xex|XEX " , path ) ;
2013-09-29 15:53:26 +00:00
filebrowser_fetch_directory_entries ( FILEBROWSER_ACTION_OK ) ;
2012-04-10 19:23:42 +00:00
}
}
bHandled = TRUE ;
2012-05-29 02:39:54 +00:00
return 0 ;
2012-02-04 19:33:51 +00:00
}
2012-08-22 01:56:57 +00:00
HRESULT CRetroArchMain : : OnInit ( XUIMessageInit * pInitData , BOOL & bHandled )
2012-01-24 05:55:27 +00:00
{
2013-05-09 16:12:54 +00:00
GetChildById ( L " XuiMenuList " , & m_menulist ) ;
2013-05-09 13:12:22 +00:00
GetChildById ( L " XuiTxtTitle " , & m_menutitle ) ;
2013-05-09 16:12:54 +00:00
GetChildById ( L " XuiTxtBottom " , & m_menutitlebottom ) ;
init_menulist ( INGAME_MENU_MAIN_MODE ) ;
2012-06-30 11:37:18 +00:00
2013-04-11 15:18:23 +00:00
mbstowcs ( strw_buffer , g_extern . title_buf , sizeof ( strw_buffer ) / sizeof ( wchar_t ) ) ;
2013-05-09 16:12:54 +00:00
XuiTextElementSetText ( m_menutitlebottom , strw_buffer ) ;
2013-05-09 20:26:47 +00:00
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_RARCH_VERSION , sizeof ( strw_buffer ) ) ;
XuiTextElementSetText ( m_menutitle , strw_buffer ) ;
2012-06-30 11:37:18 +00:00
2012-05-29 02:39:54 +00:00
return 0 ;
2012-01-24 05:55:27 +00:00
}
2013-05-09 16:12:54 +00:00
HRESULT CRetroArchMain : : OnControlNavigate ( XUIMessageControlNavigate * pControlNavigateData , BOOL & bHandled )
2012-01-23 23:02:02 +00:00
{
2012-07-07 17:15:06 +00:00
xdk_d3d_video_t * vid = ( xdk_d3d_video_t * ) driver . video_data ;
2012-04-10 19:23:42 +00:00
HRESULT hr ;
2013-05-09 16:12:54 +00:00
int current_index ;
bool hdmenus_allowed = ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_HD ) ) ;
2012-04-10 19:23:42 +00:00
2013-05-09 16:44:35 +00:00
current_index = XuiListGetCurSel ( m_menulist , NULL ) ;
2012-04-10 19:23:42 +00:00
2013-05-09 16:44:35 +00:00
unsigned input = pControlNavigateData - > nControlNavigate ;
2013-09-29 15:08:42 +00:00
unsigned action = xui_input_to_rgui_action ( input ) ;
2012-05-28 20:43:08 +00:00
2013-05-10 15:14:22 +00:00
HXUIOBJ current_obj = current_menu ;
2013-05-09 16:44:35 +00:00
switch ( current_index )
{
case INGAME_MENU_CHANGE_LIBRETRO_CORE :
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_OK )
2013-05-09 16:44:35 +00:00
{
2013-05-10 15:14:22 +00:00
hr = XuiSceneCreate ( hdmenus_allowed ? L " file://game:/media/hd/ " : L " file://game:/media/sd/ " , L " rarch_libretrocore_browser.xur " , NULL , & current_menu ) ;
2013-05-09 16:44:35 +00:00
if ( hr < 0 )
RARCH_ERR ( " Failed to load scene. \n " ) ;
2012-04-10 19:23:42 +00:00
2013-05-10 15:14:22 +00:00
XuiSceneNavigateForward ( current_obj , false , current_menu , XUSER_INDEX_FOCUS ) ;
2013-05-09 16:44:35 +00:00
}
break ;
case INGAME_MENU_LOAD_GAME_HISTORY_MODE :
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_OK )
2013-05-10 20:01:35 +00:00
{
hr = XuiSceneCreate ( hdmenus_allowed ? L " file://game:/media/hd/ " : L " file://game:/media/sd/ " , L " rarch_load_game_history.xur " , NULL , & current_menu ) ;
if ( hr < 0 )
RARCH_ERR ( " Failed to load scene. \n " ) ;
XuiSceneNavigateForward ( current_obj , false , current_menu , XUSER_INDEX_FOCUS ) ;
}
2013-05-09 16:44:35 +00:00
break ;
case INGAME_MENU_CHANGE_GAME :
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_OK )
2013-05-09 16:44:35 +00:00
{
2013-05-10 15:14:22 +00:00
hr = XuiSceneCreate ( hdmenus_allowed ? L " file://game:/media/hd/ " : L " file://game:/media/sd/ " , L " rarch_filebrowser.xur " , NULL , & current_menu ) ;
2012-05-28 20:43:08 +00:00
2013-05-09 16:12:54 +00:00
if ( hr < 0 )
RARCH_ERR ( " Failed to load scene. \n " ) ;
2012-05-23 06:37:31 +00:00
2013-05-10 15:14:22 +00:00
XuiSceneNavigateForward ( current_obj , false , current_menu , XUSER_INDEX_FOCUS ) ;
2013-05-09 16:44:35 +00:00
}
break ;
case INGAME_MENU_CORE_OPTIONS_MODE :
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_OK )
2013-05-10 18:40:38 +00:00
{
hr = XuiSceneCreate ( hdmenus_allowed ? L " file://game:/media/hd/ " : L " file://game:/media/sd/ " , L " rarch_core_options.xur " , NULL , & current_menu ) ;
if ( hr < 0 )
RARCH_ERR ( " Failed to load scene. \n " ) ;
XuiSceneNavigateForward ( current_obj , false , current_menu , XUSER_INDEX_FOCUS ) ;
}
2013-05-09 16:44:35 +00:00
break ;
case INGAME_MENU_VIDEO_OPTIONS_MODE :
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_OK )
2013-05-09 16:44:35 +00:00
{
2013-05-10 16:36:59 +00:00
hr = XuiSceneCreate ( hdmenus_allowed ? L " file://game:/media/hd/ " : L " file://game:/media/sd/ " , L " rarch_video_options.xur " , NULL , & current_menu ) ;
2012-05-28 20:43:08 +00:00
2013-05-09 16:12:54 +00:00
if ( hr < 0 )
RARCH_ERR ( " Failed to load scene. \n " ) ;
2013-05-10 15:14:22 +00:00
XuiSceneNavigateForward ( current_obj , false , current_menu , XUSER_INDEX_FOCUS ) ;
2013-05-09 16:44:35 +00:00
}
break ;
case INGAME_MENU_AUDIO_OPTIONS_MODE :
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_OK )
2013-05-10 17:02:24 +00:00
{
hr = XuiSceneCreate ( hdmenus_allowed ? L " file://game:/media/hd/ " : L " file://game:/media/sd/ " , L " rarch_audio_options.xur " , NULL , & current_menu ) ;
if ( hr < 0 )
RARCH_ERR ( " Failed to load scene. \n " ) ;
XuiSceneNavigateForward ( current_obj , false , current_menu , XUSER_INDEX_FOCUS ) ;
}
2013-05-09 16:44:35 +00:00
break ;
case INGAME_MENU_INPUT_OPTIONS_MODE :
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_OK )
2013-05-09 16:44:35 +00:00
{
2013-05-10 15:14:22 +00:00
hr = XuiSceneCreate ( hdmenus_allowed ? L " file://game:/media/hd/ " : L " file://game:/media/sd/ " , L " rarch_controls.xur " , NULL , & current_menu ) ;
2012-04-10 19:23:42 +00:00
2013-05-09 16:12:54 +00:00
if ( hr < 0 )
RARCH_ERR ( " Failed to load scene. \n " ) ;
2012-05-29 00:32:34 +00:00
2013-05-10 15:14:22 +00:00
XuiSceneNavigateForward ( current_obj , false , current_menu , XUSER_INDEX_FOCUS ) ;
2013-05-09 16:44:35 +00:00
}
break ;
case INGAME_MENU_PATH_OPTIONS_MODE :
break ;
case INGAME_MENU_SETTINGS_MODE :
2013-09-29 15:39:43 +00:00
if ( action = = RGUI_ACTION_OK )
2013-05-09 16:44:35 +00:00
{
2013-05-10 15:14:22 +00:00
hr = XuiSceneCreate ( hdmenus_allowed ? L " file://game:/media/hd/ " : L " file://game:/media/sd/ " , L " rarch_settings.xur " , NULL , & current_menu ) ;
2013-05-09 16:12:54 +00:00
if ( hr < 0 )
RARCH_ERR ( " Failed to load scene. \n " ) ;
2013-05-10 15:14:22 +00:00
XuiSceneNavigateForward ( current_obj , false , current_menu , XUSER_INDEX_FOCUS ) ;
2013-05-09 16:44:35 +00:00
}
break ;
case INGAME_MENU_LOAD_STATE :
2013-09-29 15:04:43 +00:00
process_input_ret = menu_set_settings ( RGUI_SETTINGS_SAVESTATE_LOAD , action ) ;
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_LOAD_STATE_SLOT , sizeof ( strw_buffer ) ) ;
XuiListSetText ( m_menulist , INGAME_MENU_LOAD_STATE , strw_buffer ) ;
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_SAVE_STATE_SLOT , sizeof ( strw_buffer ) ) ;
XuiListSetText ( m_menulist , INGAME_MENU_SAVE_STATE , strw_buffer ) ;
break ;
2013-05-09 16:44:35 +00:00
case INGAME_MENU_SAVE_STATE :
2013-09-29 15:04:43 +00:00
process_input_ret = menu_set_settings ( RGUI_SETTINGS_SAVESTATE_SAVE , action ) ;
2013-05-09 18:24:58 +00:00
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_LOAD_STATE_SLOT , sizeof ( strw_buffer ) ) ;
XuiListSetText ( m_menulist , INGAME_MENU_LOAD_STATE , strw_buffer ) ;
menu_settings_create_menu_item_label_w ( strw_buffer , S_LBL_SAVE_STATE_SLOT , sizeof ( strw_buffer ) ) ;
XuiListSetText ( m_menulist , INGAME_MENU_SAVE_STATE , strw_buffer ) ;
2013-05-09 16:44:35 +00:00
break ;
case INGAME_MENU_SCREENSHOT_MODE :
break ;
case INGAME_MENU_RETURN_TO_GAME :
2013-09-29 15:04:43 +00:00
process_input_ret = menu_set_settings ( RGUI_SETTINGS_RESUME_GAME , action ) ;
2013-05-09 16:44:35 +00:00
break ;
case INGAME_MENU_RESET :
2013-09-29 15:04:43 +00:00
process_input_ret = menu_set_settings ( RGUI_SETTINGS_RESTART_GAME , action ) ;
2013-05-09 16:44:35 +00:00
break ;
case INGAME_MENU_QUIT_RETROARCH :
2013-09-29 15:04:43 +00:00
process_input_ret = menu_set_settings ( RGUI_SETTINGS_QUIT_RARCH , action ) ;
2013-05-09 16:12:54 +00:00
break ;
2012-04-10 19:23:42 +00:00
}
2013-05-09 16:12:54 +00:00
bHandled = TRUE ;
2012-05-28 20:43:08 +00:00
2013-09-29 15:04:43 +00:00
switch ( action )
2013-05-09 16:12:54 +00:00
{
2013-09-29 15:04:43 +00:00
case RGUI_ACTION_LEFT :
case RGUI_ACTION_RIGHT :
case RGUI_ACTION_UP :
case RGUI_ACTION_DOWN :
2013-05-09 16:12:54 +00:00
pControlNavigateData - > hObjDest = pControlNavigateData - > hObjSource ;
break ;
default :
break ;
2012-04-10 19:23:42 +00:00
}
2013-05-09 16:12:54 +00:00
return 0 ;
}
HRESULT CRetroArchMain : : OnNotifyPress ( HXUIOBJ hObjPressed , int & bHandled )
{
if ( hObjPressed = = m_menulist )
2013-01-10 21:42:12 +00:00
{
2013-05-09 16:12:54 +00:00
XUIMessageControlNavigate controls ;
controls . nControlNavigate = ( XUI_CONTROL_NAVIGATE ) XUI_CONTROL_NAVIGATE_OK ;
OnControlNavigate ( & controls , bHandled ) ;
2013-01-10 21:42:12 +00:00
}
2012-04-10 19:23:42 +00:00
bHandled = TRUE ;
2012-05-28 12:05:28 +00:00
return 0 ;
2012-01-23 23:02:02 +00:00
}
2013-09-19 13:01:17 +00:00
static void * rgui_init ( void )
2012-01-22 20:47:34 +00:00
{
2012-04-10 19:23:42 +00:00
HRESULT hr ;
2012-01-22 20:47:34 +00:00
2013-04-18 13:04:09 +00:00
rgui_handle_t * rgui = ( rgui_handle_t * ) calloc ( 1 , sizeof ( * rgui ) ) ;
2012-11-19 03:46:48 +00:00
xdk_d3d_video_t * device_ptr = ( xdk_d3d_video_t * ) driver . video_data ;
2012-04-10 19:23:42 +00:00
2013-01-12 02:13:03 +00:00
bool hdmenus_allowed = ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_HD ) ) ;
2012-06-05 19:01:25 +00:00
2013-01-08 16:15:43 +00:00
if ( hdmenus_allowed )
RARCH_LOG ( " HD menus enabled. \n " ) ;
2012-11-20 00:40:52 +00:00
D3DPRESENT_PARAMETERS d3dpp ;
2012-11-20 01:51:00 +00:00
video_info_t video_info = { 0 } ;
video_info . vsync = g_settings . video . vsync ;
video_info . force_aspect = false ;
video_info . smooth = g_settings . video . smooth ;
video_info . input_scale = 2 ;
video_info . fullscreen = true ;
2012-11-20 22:54:35 +00:00
video_info . rgb32 = false ;
2012-11-20 01:51:00 +00:00
xdk_d3d_generate_pp ( & d3dpp , & video_info ) ;
2012-11-20 00:40:52 +00:00
hr = app . InitShared ( device_ptr - > d3d_render_device , & d3dpp , XuiPNGTextureLoader ) ;
2012-04-10 19:23:42 +00:00
2013-01-08 16:15:43 +00:00
if ( hr ! = S_OK )
2012-04-10 19:23:42 +00:00
{
2012-04-21 21:25:32 +00:00
RARCH_ERR ( " Failed initializing XUI application. \n " ) ;
2013-04-18 13:11:28 +00:00
return NULL ;
2012-04-10 19:23:42 +00:00
}
/* Register font */
2013-04-18 13:33:25 +00:00
TypefaceDescriptor typeface = { 0 } ;
typeface . szTypeface = L " Arial Unicode MS " ;
typeface . szLocator = L " file://game:/media/rarch.ttf " ;
typeface . szReserved1 = NULL ;
2013-05-09 16:44:35 +00:00
2013-04-18 13:33:25 +00:00
hr = XuiRegisterTypeface ( & typeface , TRUE ) ;
2013-01-08 16:15:43 +00:00
if ( hr ! = S_OK )
2012-04-10 19:23:42 +00:00
{
2012-04-21 21:25:32 +00:00
RARCH_ERR ( " Failed to register default typeface. \n " ) ;
2013-04-18 13:11:28 +00:00
return NULL ;
2012-04-10 19:23:42 +00:00
}
2013-04-18 13:33:25 +00:00
hr = XuiLoadVisualFromBinary ( L " file://game:/media/rarch_scene_skin.xur " , NULL ) ;
2013-01-08 16:15:43 +00:00
if ( hr ! = S_OK )
2012-04-10 19:23:42 +00:00
{
2012-04-21 21:25:32 +00:00
RARCH_ERR ( " Failed to load skin. \n " ) ;
2013-04-18 13:11:28 +00:00
return NULL ;
2012-04-10 19:23:42 +00:00
}
2013-05-10 15:14:22 +00:00
hr = XuiSceneCreate ( hdmenus_allowed ? L " file://game:/media/hd/ " : L " file://game:/media/sd/ " , L " rarch_main.xur " , NULL , & root_menu ) ;
2013-01-08 16:15:43 +00:00
if ( hr ! = S_OK )
2012-04-10 19:23:42 +00:00
{
2012-04-21 21:25:32 +00:00
RARCH_ERR ( " Failed to create scene 'rarch_main.xur'. \n " ) ;
2013-04-18 13:11:28 +00:00
return NULL ;
2012-04-10 19:23:42 +00:00
}
2013-05-10 15:14:22 +00:00
current_menu = root_menu ;
hr = XuiSceneNavigateFirst ( app . GetRootObj ( ) , current_menu , XUSER_INDEX_FOCUS ) ;
2013-01-08 16:15:43 +00:00
if ( hr ! = S_OK )
{
RARCH_ERR ( " XuiSceneNavigateFirst failed. \n " ) ;
2013-04-18 13:11:28 +00:00
return NULL ;
2013-01-08 16:15:43 +00:00
}
2012-04-10 19:23:42 +00:00
2013-04-13 20:38:57 +00:00
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 ) ;
2013-04-18 13:04:09 +00:00
return rgui ;
2012-01-22 21:45:32 +00:00
}
2013-09-19 13:01:17 +00:00
static void rgui_free ( void * data )
2012-04-17 03:35:25 +00:00
{
2013-09-19 13:01:17 +00:00
rgui_handle_t * rgui = ( rgui_handle_t * ) data ;
2012-05-29 13:25:39 +00:00
app . Uninit ( ) ;
2012-04-17 03:35:25 +00:00
}
2012-06-28 16:53:35 +00:00
static void ingame_menu_resize ( void )
{
2012-06-30 11:37:18 +00:00
XINPUT_STATE state ;
XInputGetState ( 0 , & state ) ;
if ( state . Gamepad . wButtons & XINPUT_GAMEPAD_DPAD_LEFT | | state . Gamepad . sThumbLX < - DEADZONE )
2012-10-15 04:24:39 +00:00
g_extern . console . screen . viewports . custom_vp . x - = 1 ;
2012-06-30 11:37:18 +00:00
else if ( state . Gamepad . wButtons & XINPUT_GAMEPAD_DPAD_RIGHT | | state . Gamepad . sThumbLX > DEADZONE )
2012-10-15 04:24:39 +00:00
g_extern . console . screen . viewports . custom_vp . x + = 1 ;
2012-06-30 11:37:18 +00:00
if ( state . Gamepad . wButtons & XINPUT_GAMEPAD_DPAD_UP | | state . Gamepad . sThumbLY > DEADZONE )
2012-10-15 04:24:39 +00:00
g_extern . console . screen . viewports . custom_vp . y + = 1 ;
2012-06-30 11:37:18 +00:00
else if ( state . Gamepad . wButtons & XINPUT_GAMEPAD_DPAD_DOWN | | state . Gamepad . sThumbLY < - DEADZONE )
2012-10-15 04:24:39 +00:00
g_extern . console . screen . viewports . custom_vp . y - = 1 ;
2012-06-30 11:37:18 +00:00
if ( state . Gamepad . sThumbRX < - DEADZONE | | state . Gamepad . wButtons & XINPUT_GAMEPAD_LEFT_THUMB )
2012-10-15 04:24:39 +00:00
g_extern . console . screen . viewports . custom_vp . width - = 1 ;
2012-06-30 11:37:18 +00:00
else if ( state . Gamepad . sThumbRX > DEADZONE | | state . Gamepad . wButtons & XINPUT_GAMEPAD_RIGHT_THUMB )
2012-10-15 04:24:39 +00:00
g_extern . console . screen . viewports . custom_vp . width + = 1 ;
2012-06-30 11:37:18 +00:00
if ( state . Gamepad . sThumbRY > DEADZONE | | state . Gamepad . wButtons & XINPUT_GAMEPAD_LEFT_SHOULDER )
2012-10-15 04:24:39 +00:00
g_extern . console . screen . viewports . custom_vp . height + = 1 ;
2012-06-30 11:37:18 +00:00
else if ( state . Gamepad . sThumbRY < - DEADZONE | | state . Gamepad . wButtons & XINPUT_GAMEPAD_RIGHT_SHOULDER )
2012-10-15 04:24:39 +00:00
g_extern . console . screen . viewports . custom_vp . height - = 1 ;
2012-06-30 11:37:18 +00:00
if ( state . Gamepad . wButtons & XINPUT_GAMEPAD_Y )
{
2012-10-15 04:24:39 +00:00
g_extern . console . screen . viewports . custom_vp . x = 0 ;
g_extern . console . screen . viewports . custom_vp . y = 0 ;
g_extern . console . screen . viewports . custom_vp . width = 1280 ; //FIXME: hardcoded
g_extern . console . screen . viewports . custom_vp . height = 720 ; //FIXME: hardcoded
2012-06-30 11:37:18 +00:00
}
2012-06-28 16:53:35 +00:00
}
2013-03-09 15:22:11 +00:00
bool menu_iterate ( void )
2012-01-22 21:45:32 +00:00
{
2012-11-19 03:46:48 +00:00
xdk_d3d_video_t * device_ptr = ( xdk_d3d_video_t * ) driver . video_data ;
2012-04-10 19:23:42 +00:00
2013-01-12 02:13:03 +00:00
if ( g_extern . lifecycle_mode_state & ( 1ULL < < MODE_MENU_PREINIT ) )
2012-12-15 15:39:30 +00:00
{
2013-01-12 02:13:03 +00:00
g_extern . lifecycle_mode_state & = ~ ( 1ULL < < MODE_MENU_PREINIT ) ;
2013-04-27 20:49:43 +00:00
/* FIXME - hack for now */
rgui - > delay_count = 0 ;
2012-12-15 15:39:30 +00:00
}
2012-04-10 19:23:42 +00:00
2013-05-09 16:12:54 +00:00
rgui - > trigger_state = 0 ;
2012-12-15 15:39:30 +00:00
XINPUT_STATE state ;
XInputGetState ( 0 , & state ) ;
2012-04-10 19:23:42 +00:00
2013-05-10 15:14:22 +00:00
if ( ( state . Gamepad . wButtons & XINPUT_GAMEPAD_B ) & & current_menu ! = root_menu )
2013-05-09 16:12:54 +00:00
rgui - > trigger_state = RGUI_ACTION_CANCEL ;
else if ( ( state . Gamepad . wButtons & XINPUT_GAMEPAD_A ) )
rgui - > trigger_state = RGUI_ACTION_OK ;
2013-04-27 20:49:43 +00:00
/* FIXME - hack for now */
if ( rgui - > delay_count > 30 )
{
2013-05-09 16:44:35 +00:00
bool rmenu_enable = ( ( state . Gamepad . wButtons & XINPUT_GAMEPAD_LEFT_THUMB ) & &
( state . Gamepad . wButtons & XINPUT_GAMEPAD_RIGHT_THUMB )
) & & g_extern . main_is_init ;
2013-03-11 01:07:50 +00:00
2013-05-09 16:44:35 +00:00
if ( rmenu_enable )
{
g_extern . lifecycle_mode_state | = ( 1ULL < < MODE_GAME ) ;
process_input_ret = - 1 ;
}
2013-01-06 00:28:23 +00:00
}
2012-12-15 16:56:18 +00:00
2013-05-09 16:12:54 +00:00
if ( rgui - > trigger_state = = RGUI_ACTION_CANCEL )
2012-12-15 15:39:30 +00:00
{
2013-05-10 15:14:22 +00:00
XuiSceneNavigateBack ( current_menu , root_menu , XUSER_INDEX_ANY ) ;
current_menu = root_menu ;
XuiElementGetChildById ( current_menu , L " XuiMenuList " , & m_menulist ) ;
2013-05-09 16:12:54 +00:00
init_menulist ( INGAME_MENU_MAIN_MODE ) ;
2012-12-15 15:39:30 +00:00
}
2012-05-22 00:19:40 +00:00
2013-05-09 16:12:54 +00:00
#if 0
if ( input_loop = = INPUT_LOOP_RESIZE_MODE )
2013-05-09 16:44:35 +00:00
ingame_menu_resize ( ) ;
2013-05-09 16:12:54 +00:00
# endif
2013-04-11 14:38:12 +00:00
if ( driver . video_poke & & driver . video_poke - > set_texture_enable )
2013-04-13 15:07:47 +00:00
driver . video_poke - > set_texture_enable ( driver . video_data , true , true ) ;
2013-04-11 14:38:12 +00:00
rarch_render_cached_frame ( ) ;
if ( driver . video_poke & & driver . video_poke - > set_texture_enable )
2013-04-13 15:07:47 +00:00
driver . video_poke - > set_texture_enable ( driver . video_data , false , true ) ;
2012-04-10 19:23:42 +00:00
2013-04-27 20:49:43 +00:00
/* FIXME - hack for now */
rgui - > delay_count + + ;
2013-01-11 05:10:21 +00:00
if ( process_input_ret ! = 0 )
2013-01-10 07:46:46 +00:00
goto deinit ;
2012-12-15 15:39:30 +00:00
return true ;
2012-02-13 21:45:28 +00:00
2012-12-15 15:39:30 +00:00
deinit :
2013-01-11 05:10:21 +00:00
process_input_ret = 0 ;
2012-12-15 15:39:30 +00:00
return false ;
2012-01-23 23:02:02 +00:00
}
2013-03-09 21:30:35 +00:00
bool menu_iterate_xui ( void )
{
2013-04-19 21:22:58 +00:00
xdk_d3d_video_t * d3d = ( xdk_d3d_video_t * ) driver . video_data ;
LPDIRECT3DDEVICE d3dr = ( LPDIRECT3DDEVICE ) d3d - > d3d_render_device ;
2013-04-19 19:04:08 +00:00
app . RunFrame ( ) ; /* Update XUI */
2013-05-09 16:44:35 +00:00
XuiRenderBegin ( app . GetDC ( ) , D3DCOLOR_ARGB ( 255 , 0 , 0 , 0 ) ) ;
2013-04-19 19:04:08 +00:00
2013-05-09 16:44:35 +00:00
D3DXMATRIX matOrigView ;
XuiRenderGetViewTransform ( app . GetDC ( ) , & matOrigView ) ;
2013-04-19 19:04:08 +00:00
2013-05-09 16:44:35 +00:00
XUIMessage msg ;
XUIMessageRender msgRender ;
XuiMessageRender ( & msg , & msgRender , app . GetDC ( ) , 0xffffffff , XUI_BLEND_NORMAL ) ;
XuiSendMessage ( app . GetRootObj ( ) , & msg ) ;
2013-04-19 19:04:08 +00:00
2013-05-09 16:44:35 +00:00
XuiRenderSetViewTransform ( app . GetDC ( ) , & matOrigView ) ;
2013-04-19 19:04:08 +00:00
2013-05-09 16:44:35 +00:00
XuiRenderEnd ( app . GetDC ( ) ) ;
2013-03-09 21:30:35 +00:00
XuiTimersRun ( ) ;
return true ;
2013-03-10 02:34:37 +00:00
}
2013-09-19 13:01:17 +00:00
const menu_ctx_driver_t menu_ctx_rmenu_xui = {
NULL ,
rgui_init ,
rgui_free ,
" rmenu_xui " ,
} ;