ddraw: Add a test for IDirectDrawSurface_SetColorKey.

This commit is contained in:
Günther Brammer 2006-12-21 00:06:03 +01:00 committed by Alexandre Julliard
parent 42d372eb4a
commit 8485eb02dc
1 changed files with 22 additions and 0 deletions

View File

@ -167,6 +167,7 @@ static void SrcColorKey32BlitTest(void)
LPDIRECTDRAWSURFACE lpDst;
DDSURFACEDESC ddsd;
DDSURFACEDESC ddsd2;
DDCOLORKEY DDColorKey;
LPDWORD lpData;
HRESULT rc;
@ -223,6 +224,27 @@ static void SrcColorKey32BlitTest(void)
rc = IDirectDrawSurface_Unlock(lpDst, NULL);
ok(rc==DD_OK,"Unlock returned: %x\n",rc);
/* Also test SetColorKey */
IDirectDrawSurface_GetColorKey(lpSrc, DDCKEY_SRCBLT, &DDColorKey);
ok(DDColorKey.dwColorSpaceLowValue == 0xFF00FF && DDColorKey.dwColorSpaceHighValue == 0xFF00FF,
"GetColorKey does not return the colorkey used at surface creation\n");
DDColorKey.dwColorSpaceLowValue = 0x00FF00;
DDColorKey.dwColorSpaceHighValue = 0x00FF00;
IDirectDrawSurface_SetColorKey(lpSrc, DDCKEY_SRCBLT, &DDColorKey);
DDColorKey.dwColorSpaceLowValue = 0;
DDColorKey.dwColorSpaceHighValue = 0;
IDirectDrawSurface_GetColorKey(lpSrc, DDCKEY_SRCBLT, &DDColorKey);
ok(DDColorKey.dwColorSpaceLowValue == 0x00FF00 && DDColorKey.dwColorSpaceHighValue == 0x00FF00,
"GetColorKey does not return the colorkey set with SetColorKey\n");
ddsd.ddckCKSrcBlt.dwColorSpaceLowValue = 0;
ddsd.ddckCKSrcBlt.dwColorSpaceHighValue = 0;
IDirectDrawSurface_GetSurfaceDesc(lpSrc, &ddsd);
ok(ddsd.ddckCKSrcBlt.dwColorSpaceLowValue == 0x00FF00 && ddsd.ddckCKSrcBlt.dwColorSpaceHighValue == 0x00FF00,
"GetSurfaceDesc does not return the colorkey set with SetColorKey\n");
IDirectDrawSurface_Release(lpSrc);
IDirectDrawSurface_Release(lpDst);
}