(360) BUild fixes + 360 uses RMenu context file now

This commit is contained in:
twinaphex 2012-09-30 18:29:32 +02:00
parent 4d80a71f7e
commit 7ab348dc40
5 changed files with 43 additions and 12 deletions

View File

@ -24,6 +24,9 @@
#include "../../console/rarch_console_settings.h"
#include "../../console/rarch_console_video.h"
#include "../../console/rmenu/rmenu.h"
#include "../../gfx/gfx_context.h"
#include "../xdk_d3d9.h"
#include "menu.h"
#include "../../message.h"
@ -35,6 +38,7 @@ HXUIOBJ hCur;
filebrowser_t *browser;
filebrowser_t *tmp_browser;
uint32_t set_shader = 0;
static const rmenu_context_t *context;
wchar_t strw_buffer[PATH_MAX];
char str_buffer[PATH_MAX];
@ -470,7 +474,7 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
case SETTING_SCALE_ENABLED:
g_console.fbo_enabled = !g_console.fbo_enabled;
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_console.fbo_enabled ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
gfx_ctx_set_fbo(g_console.fbo_enabled);
context->set_fbo_enable(g_console.fbo_enabled);
break;
case SETTING_ZIP_EXTRACT:
if(g_console.zip_extract_mode < ZIP_EXTRACT_TO_CACHE_DIR)
@ -555,7 +559,7 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
case SETTING_SCALE_ENABLED:
g_console.fbo_enabled = !g_console.fbo_enabled;
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_console.fbo_enabled ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
gfx_ctx_set_fbo(g_console.fbo_enabled);
context->set_fbo_enable(g_console.fbo_enabled);
break;
default:
break;
@ -620,7 +624,7 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
case SETTING_SCALE_ENABLED:
g_console.fbo_enabled = !g_console.fbo_enabled;
m_settingslist.SetText(SETTING_SCALE_ENABLED, g_console.fbo_enabled ? L"Custom Scaling/Dual Shaders: ON" : L"Custom Scaling/Dual Shaders: OFF");
gfx_ctx_set_fbo(g_console.fbo_enabled);
context->set_fbo_enable(g_console.fbo_enabled);
break;
default:
break;
@ -735,7 +739,7 @@ HRESULT CRetroArchQuickMenu::OnControlNavigate(XUIMessageControlNavigate *pContr
if(aspectratio_changed)
{
gfx_ctx_set_aspect_ratio(d3d, g_console.aspect_ratio_index);
context->set_aspect_ratio(g_console.aspect_ratio_index);
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_ITEM_KEEP_ASPECT_RATIO, strw_buffer);
}
@ -784,7 +788,7 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
break;
case MENU_ITEM_KEEP_ASPECT_RATIO:
rarch_settings_default(S_DEF_ASPECT_RATIO);
gfx_ctx_set_aspect_ratio(d3d, g_console.aspect_ratio_index);
context->set_aspect_ratio(g_console.aspect_ratio_index);
rarch_settings_create_menu_item_label_w(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
m_quickmenulist.SetText(MENU_ITEM_KEEP_ASPECT_RATIO, strw_buffer);
break;
@ -1038,6 +1042,8 @@ void menu_init (void)
{
HRESULT hr;
context = (rmenu_context_t*)&rmenu_ctx_xdk;
xdk_d3d_video_t *vid = (xdk_d3d_video_t*)driver.video_data;
bool hdmenus_allowed = g_console.menus_hd_enable;
@ -1195,7 +1201,7 @@ void menu_loop(void)
xdk360_console_draw();
}
gfx_ctx_swap_buffers();
context->swap_buffers();
}while(g_console.menu_enable);
d3d->block_swap = false;

View File

@ -114,7 +114,7 @@ static void check_window(xdk_d3d_video_t *d3d)
{
bool quit, resize;
gfx_ctx_check_window(&quit,
gfx_ctx_xdk_check_window(&quit,
&resize, NULL, NULL,
d3d->frame_count);
@ -748,7 +748,7 @@ static bool xdk_d3d_frame(void *data, const void *frame,
}
if(!d3d->block_swap)
gfx_ctx_swap_buffers();
gfx_ctx_xdk_swap_buffers();
return true;
}
@ -760,7 +760,7 @@ static void xdk_d3d_set_nonblock_state(void *data, bool state)
if(d3d->vsync)
{
RARCH_LOG("D3D Vsync => %s\n", state ? "off" : "on");
gfx_ctx_set_swap_interval(state ? 0 : 1, TRUE);
gfx_ctx_xdk_set_swap_interval(state ? 0 : 1);
}
}
@ -791,7 +791,7 @@ static void xdk_d3d_start(void)
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
gfx_ctx_set_swap_interval(d3d->vsync ? 1 : 0, false);
gfx_ctx_xdk_set_swap_interval(d3d->vsync ? 1 : 0);
HRESULT hr = d3d9_init_font("game:\\media\\Arial_12.xpr");

View File

@ -324,11 +324,13 @@ SCREENSHOTS
/*============================================================
MENU
============================================================ */
#ifdef _XBOX
#include "../rmenu/context/rmenu_ctx_xdk.c"
#endif
#ifdef HAVE_RMENU
#if defined(__CELLOS_LV2__)
#include "../rmenu/context/rmenu_ctx_ps3.c"
#elif defined(_XBOX1)
#include "../rmenu/context/rmenu_ctx_xdk.c"
#endif
#include "../rmenu/rmenu_stack.c"
#include "../rmenu/rmenu.c"

View File

@ -66,12 +66,14 @@ const char drive_mappings[DRIVE_MAPPING_SIZE][32] = {
unsigned char drive_mapping_idx = 2;
int xpos, ypos;
#ifdef _XBOX1
texture_image m_menuMainRomSelectPanel;
texture_image m_menuMainBG;
// Rom list coords
int m_menuMainRomListPos_x;
int m_menuMainRomListPos_y;
#endif
static void rmenu_ctx_xdk_clear(void)
{
@ -85,12 +87,15 @@ static void rmenu_ctx_xdk_blend(bool enable)
static void rmenu_ctx_xdk_free_textures(void)
{
#ifdef _XBOX1
texture_image_free(&m_menuMainBG);
texture_image_free(&m_menuMainRomSelectPanel);
#endif
}
static void rmenu_ctx_xdk_init_textures(void)
{
#ifdef _XBOX1
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
int width = d3d->d3dpp.BackBufferWidth;
@ -116,22 +121,27 @@ static void rmenu_ctx_xdk_init_textures(void)
//Center the text (hardcoded)
xpos = width == 640 ? 65 : 400;
ypos = width == 640 ? 430 : 670;
#endif
}
static void rmenu_ctx_xdk_render_selection_panel(rmenu_position_t *position)
{
#ifdef _XBOX1
m_menuMainRomSelectPanel.x = position->x;
m_menuMainRomSelectPanel.y = position->y;
m_menuMainRomSelectPanel.width = ROM_PANEL_WIDTH;
m_menuMainRomSelectPanel.height = ROM_PANEL_HEIGHT;
texture_image_render(&m_menuMainRomSelectPanel);
#endif
}
static void rmenu_ctx_xdk_render_bg(rmenu_position_t *position)
{
#ifdef _XBOX1
m_menuMainBG.x = 0;
m_menuMainBG.y = 0;
texture_image_render(&m_menuMainBG);
#endif
}
static void rmenu_ctx_xdk_swap_buffers(void)
@ -146,6 +156,7 @@ void rmenu_ctx_xdk_set_swap_interval(unsigned interval)
static void rmenu_ctx_xdk_set_default_pos(rmenu_default_positions_t *position)
{
#ifdef _XBOX1
position->x_position = POSITION_X;
position->x_position_center = POSITION_X_CENTER;
position->y_position = POSITION_Y_BEGIN;
@ -165,12 +176,15 @@ static void rmenu_ctx_xdk_set_default_pos(rmenu_default_positions_t *position)
position->core_msg_x_position = position->x_position;
position->core_msg_y_position = position->msg_prev_next_y_position + 0.01f;
position->core_msg_font_size = position->font_size;
#endif
}
static void rmenu_ctx_xdk_render_msg(float xpos, float ypos, float scale, unsigned color, const char *msg, ...)
{
#ifdef _XBOX1
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
xfonts_render_msg_place(d3d, xpos, ypos, scale, msg);
#endif
}
static void rmenu_ctx_xdk_render_menu_enable(bool enable)
@ -210,11 +224,17 @@ static void rmenu_ctx_xdk_set_aspect_ratio(unsigned aspectratio_index)
driver.video->set_aspect_ratio(NULL, aspectratio_index);
}
static void rmenu_ctx_xdk_set_fbo_enable(bool enable)
{
gfx_ctx_xdk_set_fbo(enable);
}
const rmenu_context_t rmenu_ctx_xdk = {
rmenu_ctx_xdk_clear,
rmenu_ctx_xdk_set_filtering,
rmenu_ctx_xdk_set_aspect_ratio,
rmenu_ctx_xdk_blend,
rmenu_ctx_xdk_set_fbo_enable,
rmenu_ctx_xdk_free_textures,
rmenu_ctx_xdk_init_textures,
rmenu_ctx_xdk_render_selection_panel,

View File

@ -75,6 +75,7 @@ typedef struct rmenu_context
void (*set_filtering)(unsigned index, bool set_smooth);
void (*set_aspect_ratio)(unsigned aspectratio_index);
void (*blend)(bool enable);
void (*set_fbo_enable)(bool enable);
void (*free_textures)(void);
void (*init_textures)(void);
void (*render_selection_panel)(rmenu_position_t *position);
@ -124,6 +125,7 @@ enum
INGAME_MENU_SCREENSHOT
};
#ifndef _XBOX360
enum
{
#ifdef __CELLOS_LV2__
@ -207,6 +209,7 @@ enum
SETTING_CONTROLS_SAVE_CUSTOM_CONTROLS,
SETTING_CONTROLS_DEFAULT_ALL
};
#endif
#define FIRST_VIDEO_SETTING 0
#define FIRST_AUDIO_SETTING SETTING_DEFAULT_VIDEO_ALL+1