Commit 632d3465 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

wined3d: Implement CONVERT_CK_RGB24 in d3dfmt_convert_surface.

parent 40fff317
......@@ -1845,6 +1845,29 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN
}
break;
case CONVERT_CK_RGB24:
{
/* Converting R8G8B8 format to R8G8B8A8 with color-keying. */
unsigned int x, y;
for (y = 0; y < height; y++)
{
source = src + pitch * y;
dest = dst + outpitch * y;
for (x = 0; x < width; x++) {
DWORD color = ((DWORD)source[0] << 16) + ((DWORD)source[1] << 8) + (DWORD)source[2] ;
DWORD dstcolor = color << 8;
if ((color < This->SrcBltCKey.dwColorSpaceLowValue) ||
(color > This->SrcBltCKey.dwColorSpaceHighValue)) {
dstcolor |= 0xff;
}
*(DWORD*)dest = dstcolor;
source += 3;
dest += 4;
}
}
}
break;
case CONVERT_RGB32_888:
{
/* Converting X8R8G8B8 format to R8G8B8A8 with color-keying. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment