mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
d3d9: Use color_match() in alpha_test().
Also fixes some of the messages.
This commit is contained in:
parent
3546b8bbfc
commit
60b5581e1c
1 changed files with 8 additions and 20 deletions
|
@ -6656,7 +6656,7 @@ static void alpha_test(IDirect3DDevice9 *device)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
IDirect3DTexture9 *offscreenTexture;
|
IDirect3DTexture9 *offscreenTexture;
|
||||||
IDirect3DSurface9 *backbuffer = NULL, *offscreen = NULL;
|
IDirect3DSurface9 *backbuffer = NULL, *offscreen = NULL;
|
||||||
DWORD color, red, green, blue;
|
DWORD color;
|
||||||
|
|
||||||
struct vertex quad1[] =
|
struct vertex quad1[] =
|
||||||
{
|
{
|
||||||
|
@ -6778,32 +6778,20 @@ static void alpha_test(IDirect3DDevice9 *device)
|
||||||
IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
color = getPixelColor(device, 160, 360);
|
color = getPixelColor(device, 160, 360);
|
||||||
red = (color & 0x00ff0000) >> 16;
|
ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xbf, 0x40, 0x00), 1),
|
||||||
green = (color & 0x0000ff00) >> 8;
|
|
||||||
blue = (color & 0x000000ff);
|
|
||||||
ok(red >= 0xbe && red <= 0xc0 && green >= 0x39 && green <= 0x41 && blue == 0x00,
|
|
||||||
"SRCALPHA on frame buffer returned color %08x, expected 0x00bf4000\n", color);
|
"SRCALPHA on frame buffer returned color %08x, expected 0x00bf4000\n", color);
|
||||||
|
|
||||||
color = getPixelColor(device, 160, 120);
|
color = getPixelColor(device, 160, 120);
|
||||||
red = (color & 0x00ff0000) >> 16;
|
ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x7f, 0x00, 0x80), 2),
|
||||||
green = (color & 0x0000ff00) >> 8;
|
"DSTALPHA on frame buffer returned color %08x, expected 0x007f0080\n", color);
|
||||||
blue = (color & 0x000000ff);
|
|
||||||
ok(red >= 0x7e && red <= 0x81 && green == 0x00 && blue >= 0x7e && blue <= 0x81,
|
|
||||||
"DSTALPHA on frame buffer returned color %08x, expected 0x00ff0000\n", color);
|
|
||||||
|
|
||||||
color = getPixelColor(device, 480, 360);
|
color = getPixelColor(device, 480, 360);
|
||||||
red = (color & 0x00ff0000) >> 16;
|
ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xbf, 0x40, 0x00), 1),
|
||||||
green = (color & 0x0000ff00) >> 8;
|
"SRCALPHA on texture returned color %08x, expected 0x00bf4000\n", color);
|
||||||
blue = (color & 0x000000ff);
|
|
||||||
ok(red >= 0xbe && red <= 0xc0 && green >= 0x39 && green <= 0x41 && blue == 0x00,
|
|
||||||
"SRCALPHA on texture returned color %08x, expected bar\n", color);
|
|
||||||
|
|
||||||
color = getPixelColor(device, 480, 120);
|
color = getPixelColor(device, 480, 120);
|
||||||
red = (color & 0x00ff0000) >> 16;
|
ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0xff), 1),
|
||||||
green = (color & 0x0000ff00) >> 8;
|
"DSTALPHA on texture returned color %08x, expected 0x000000ff\n", color);
|
||||||
blue = (color & 0x000000ff);
|
|
||||||
ok(red == 0x00 && green == 0x00 && blue >= 0xfe && blue <= 0xff ,
|
|
||||||
"DSTALPHA on texture returned color %08x, expected 0x00800080\n", color);
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
/* restore things */
|
/* restore things */
|
||||||
|
|
Loading…
Reference in a new issue