wined3d: Convert to WINED3DFMT_B8G8R8A8_UNORM for WINED3D_CT_CK_B8G8R8.
This commit is contained in:
parent
02b031e61a
commit
7579a96ac1
|
@ -1606,7 +1606,7 @@ static void d3dfmt_get_conv(const struct wined3d_texture *texture, BOOL need_alp
|
||||||
{
|
{
|
||||||
{WINED3DFMT_B5G6R5_UNORM, WINED3D_CT_CK_B5G6R5, GL_RGB5_A1, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2},
|
{WINED3DFMT_B5G6R5_UNORM, WINED3D_CT_CK_B5G6R5, GL_RGB5_A1, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2},
|
||||||
{WINED3DFMT_B5G5R5X1_UNORM, WINED3D_CT_CK_B5G5R5X1, GL_RGB5_A1, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2},
|
{WINED3DFMT_B5G5R5X1_UNORM, WINED3D_CT_CK_B5G5R5X1, GL_RGB5_A1, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, 2},
|
||||||
{WINED3DFMT_B8G8R8_UNORM, WINED3D_CT_CK_B8G8R8, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, 4},
|
{WINED3DFMT_B8G8R8_UNORM, WINED3D_CT_CK_B8G8R8, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 4},
|
||||||
{WINED3DFMT_B8G8R8X8_UNORM, WINED3D_CT_CK_B8G8R8X8, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, 4},
|
{WINED3DFMT_B8G8R8X8_UNORM, WINED3D_CT_CK_B8G8R8X8, GL_RGBA8, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, 4},
|
||||||
{WINED3DFMT_B8G8R8A8_UNORM, WINED3D_CT_CK_B8G8R8A8, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 4},
|
{WINED3DFMT_B8G8R8A8_UNORM, WINED3D_CT_CK_B8G8R8A8, GL_RGBA8, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 4},
|
||||||
};
|
};
|
||||||
|
@ -3247,17 +3247,16 @@ static HRESULT d3dfmt_convert_surface(const BYTE *src, BYTE *dst, UINT pitch, UI
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WINED3D_CT_CK_B8G8R8:
|
case WINED3D_CT_CK_B8G8R8:
|
||||||
/* Converting R8G8B8 format to R8G8B8A8 with color-keying. */
|
for (y = 0; y < height; ++y)
|
||||||
for (y = 0; y < height; y++)
|
|
||||||
{
|
{
|
||||||
source = src + pitch * y;
|
source = src + pitch * y;
|
||||||
dest = dst + outpitch * y;
|
dest = dst + outpitch * y;
|
||||||
for (x = 0; x < width; x++) {
|
for (x = 0; x < width; ++x)
|
||||||
DWORD color = ((DWORD)source[0] << 16) + ((DWORD)source[1] << 8) + (DWORD)source[2] ;
|
{
|
||||||
DWORD dstcolor = color << 8;
|
DWORD color = ((DWORD)source[2] << 16) | ((DWORD)source[1] << 8) | (DWORD)source[0];
|
||||||
if (!color_in_range(&surface->container->src_blt_color_key, color))
|
if (!color_in_range(&surface->container->src_blt_color_key, color))
|
||||||
dstcolor |= 0xff;
|
color |= 0xff000000;
|
||||||
*(DWORD*)dest = dstcolor;
|
*(DWORD *)dest = color;
|
||||||
source += 3;
|
source += 3;
|
||||||
dest += 4;
|
dest += 4;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue