(360) Add color format setting for changing backbuffer color format -

32bit ARGB and 16bit RGBA
This commit is contained in:
TwinAphex51224 2012-05-22 16:04:39 +02:00
parent 56a9d359ba
commit 6d0c569f0a
7 changed files with 49 additions and 2 deletions

View File

@ -175,6 +175,7 @@ static void set_default_settings (void)
g_console.viewports.custom_vp.height = 0;
g_console.viewports.custom_vp.x = 0;
g_console.viewports.custom_vp.y = 0;
g_console.color_format = 0;
//g_extern
g_extern.state_slot = 0;
@ -268,6 +269,7 @@ static void init_settings (bool load_libretro_path)
CONFIG_GET_INT_CONSOLE(viewports.custom_vp.width, "custom_viewport_width");
CONFIG_GET_INT_CONSOLE(viewports.custom_vp.height, "custom_viewport_height");
CONFIG_GET_INT_CONSOLE(screen_orientation, "screen_orientation");
CONFIG_GET_INT_CONSOLE(color_format, "color_format");
// g_extern
CONFIG_GET_INT_EXTERN(state_slot, "state_slot");
@ -312,6 +314,7 @@ static void save_settings (void)
config_set_int(conf, "custom_viewport_x", g_console.viewports.custom_vp.x);
config_set_int(conf, "custom_viewport_y", g_console.viewports.custom_vp.y);
config_set_int(conf, "screen_orientation", g_console.screen_orientation);
config_set_int(conf, "color_format", g_console.color_format);
// g_extern
config_set_int(conf, "state_slot", g_extern.state_slot);

View File

@ -32,6 +32,7 @@
<Position>44.880005,64.959991,0.000000</Position>
<ItemsText>Rewind:
Gamma Correction:
Color Format:
Shader #1:
Shader #2:
Hardware filtering shader #1:
@ -171,6 +172,18 @@ Custom Scaling/Dual Shaders
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
</XuiCommonList>
<XuiBackButton>
<Properties>

View File

@ -31,6 +31,7 @@
<Height>232.720001</Height>
<Position>44.880005,64.959991,0.000000</Position>
<ItemsText>Rewind:
Color Format:
Gamma Correction:
Shader #1:
Shader #2:
@ -147,6 +148,18 @@ Cutom Scaling/Dual Shaders:
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
<XuiListItem>
<Properties>
<Id>control_ListItem</Id>
<Width>226.000000</Width>
<Height>45.000000</Height>
<Position>7.000000,22.000000,0.000000</Position>
<Anchor>5</Anchor>
<Show>false</Show>
<Visual>XuiButton</Visual>
<InterItemSpacing>0.000000,10.000000,0.000000</InterItemSpacing>
</Properties>
</XuiListItem>
</XuiCommonList>
<XuiBackButton>
<Properties>

View File

@ -144,6 +144,7 @@ HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
snprintf(shader1str, sizeof(shader1str), "Shader #1: %s", g_settings.video.cg_shader_path);
snprintf(shader2str, sizeof(shader2str), "Shader #2: %s", g_settings.video.second_pass_shader);
m_settingslist.SetText(SETTING_SHADER, rarch_convert_char_to_wchar(shader1str));
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_console.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
m_settingslist.SetText(SETTING_SHADER_2, rarch_convert_char_to_wchar(shader2str));
return S_OK;
@ -456,6 +457,12 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
msg_queue_clear(g_extern.msg_queue);
msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch for this change to take effect.", 1, 180);
break;
case SETTING_COLOR_FORMAT:
g_console.color_format = !g_console.color_format;
m_settingslist.SetText(SETTING_COLOR_FORMAT, g_console.color_format ? L"Color format: 32bit ARGB" : L"Color format: 16bit RGBA");
msg_queue_clear(g_extern.msg_queue);
msg_queue_push(g_extern.msg_queue, "INFO - You need to restart RetroArch for this change to take effect.", 1, 180);
break;
case SETTING_SHADER:
set_shader = 1;
hr = XuiSceneCreate(hdmenus_allowed ? L"file://game:/media/hd/" : L"file://game:/media/sd/", L"rarch_shader_browser.xur", NULL, &app.hShaderBrowser);

View File

@ -24,6 +24,7 @@ enum
{
SETTING_EMU_REWIND_ENABLED = 0,
SETTING_GAMMA_CORRECTION_ENABLED,
SETTING_COLOR_FORMAT,
SETTING_SHADER,
SETTING_SHADER_2,
SETTING_HW_TEXTURE_FILTER,

View File

@ -423,8 +423,17 @@ static void *xdk360_gfx_init(const video_info_t *video, const input_driver_t **i
vid->d3dpp.BackBufferWidth = vid->video_mode.fIsHiDef ? 1280 : 640;
vid->d3dpp.BackBufferHeight = vid->video_mode.fIsHiDef ? 720 : 480;
vid->d3dpp.BackBufferFormat = g_console.gamma_correction_enable ? (D3DFORMAT)MAKESRGBFMT(D3DFMT_A8R8G8B8) : D3DFMT_A8R8G8B8;
vid->d3dpp.FrontBufferFormat = g_console.gamma_correction_enable ? (D3DFORMAT)MAKESRGBFMT(D3DFMT_LE_X8R8G8B8) : D3DFMT_LE_X8R8G8B8;
if(g_console.gamma_correction_enable)
{
vid->d3dpp.BackBufferFormat = g_console.color_format ? (D3DFORMAT)MAKESRGBFMT(D3DFMT_A8R8G8B8) : (D3DFORMAT)MAKESRGBFMT(D3DFMT_LIN_A1R5G5B5);
vid->d3dpp.FrontBufferFormat = (D3DFORMAT)MAKESRGBFMT(D3DFMT_LE_X8R8G8B8);
}
else
{
vid->d3dpp.BackBufferFormat = g_console.color_format ? D3DFMT_A8R8G8B8 : D3DFMT_LIN_A1R5G5B5;
vid->d3dpp.FrontBufferFormat = D3DFMT_LE_X8R8G8B8;
}
vid->d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
vid->d3dpp.MultiSampleQuality = 0;
vid->d3dpp.BackBufferCount = 2;

View File

@ -232,6 +232,7 @@ struct console_settings
uint32_t input_loop;
#endif
#ifdef _XBOX
uint32_t color_format;
DWORD volume_device_type;
#endif
char cgp_path[PATH_MAX];