Create d3d_get_color_format_front_buffer

This commit is contained in:
twinaphex 2018-01-06 15:25:11 +01:00
parent 7cc8040347
commit 67220c358c

View File

@ -500,7 +500,7 @@ static void d3d_deinitialize(d3d_video_t *d3d)
#define FS_PRESENTINTERVAL(pp) ((pp)->PresentationInterval)
#endif
static D3DFORMAT d3d_get_color_format(bool rgb32, bool windowed)
static D3DFORMAT d3d_get_color_format_backbuffer(bool rgb32, bool windowed)
{
D3DFORMAT fmt = D3DFMT_UNKNOWN;
#ifdef _XBOX
@ -515,6 +515,13 @@ static D3DFORMAT d3d_get_color_format(bool rgb32, bool windowed)
return fmt;
}
#ifdef _XBOX360
static D3DFORMAT d3d_get_color_format_front_buffer(void)
{
return D3DFMT_LE_X8R8G8B8;
}
#endif
void d3d_make_d3dpp(void *data,
const video_info_t *info, D3DPRESENT_PARAMETERS *d3dpp)
{
@ -523,6 +530,7 @@ void d3d_make_d3dpp(void *data,
#ifdef _XBOX360
/* TODO/FIXME - get rid of global state dependencies. */
global_t *global = global_get_ptr();
bool gamma_enable = global->console.screen.gamma_correction;
#endif
memset(d3dpp, 0, sizeof(*d3dpp));
@ -557,13 +565,13 @@ void d3d_make_d3dpp(void *data,
d3dpp->SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp->BackBufferCount = 2;
d3dpp->BackBufferFormat = d3d_get_color_format(info->rgb32, d3dpp->Windowed);
d3dpp->BackBufferFormat = d3d_get_color_format_backbuffer(info->rgb32, d3dpp->Windowed);
#ifndef _XBOX
d3dpp->hDeviceWindow = win32_get_window();
#endif
#ifdef _XBOX360
if (global->console.screen.gamma_correction)
if (gamma_enable)
d3dpp->BackBufferFormat = (D3DFORMAT)MAKESRGBFMT(d3dpp->BackBufferFormat);
#endif
@ -630,11 +638,11 @@ void d3d_make_d3dpp(void *data,
d3dpp->Flags |= D3DPRESENTFLAG_NO_LETTERBOX;
#endif
if (global->console.screen.gamma_correction)
d3dpp->FrontBufferFormat = (D3DFORMAT)
MAKESRGBFMT(D3DFMT_LE_X8R8G8B8);
else
d3dpp->FrontBufferFormat = D3DFMT_LE_X8R8G8B8;
d3dpp->FrontBufferFormat = d3d_get_color_format_front_buffer();
if (gamma_enable)
d3dpp->FrontBufferFormat = (D3DFORMAT)MAKESRGBFMT(d3dpp->FrontBufferFormat);
d3dpp->MultiSampleQuality = 0;
#endif
#endif