Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4775c762
Commit
4775c762
authored
Jan 31, 2012
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jan 31, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add an IDirect3DDevice7::Load color key test.
parent
cfc9e120
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
0 deletions
+88
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+88
-0
No files found.
dlls/ddraw/tests/ddraw7.c
View file @
4775c762
...
...
@@ -1128,6 +1128,93 @@ static void test_depth_blit(void)
DestroyWindow
(
window
);
}
static
void
test_texture_load_ckey
(
void
)
{
HWND
window
;
IDirect3DDevice7
*
device
;
IDirectDraw7
*
ddraw
;
IDirectDrawSurface7
*
src
;
IDirectDrawSurface7
*
dst
;
DDSURFACEDESC2
ddsd
;
HRESULT
hr
;
DDCOLORKEY
ckey
;
IDirect3D7
*
d3d
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
device
=
create_device
(
window
,
DDSCL_NORMAL
)))
{
skip
(
"Failed to create D3D device, skipping test.
\n
"
);
DestroyWindow
(
window
);
return
;
}
hr
=
IDirect3DDevice7_GetDirect3D
(
device
,
&
d3d
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get Direct3D7 interface, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3D7_QueryInterface
(
d3d
,
&
IID_IDirectDraw7
,
(
void
**
)
&
ddraw
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get DirectDraw7 interface, hr %#x.
\n
"
,
hr
);
IDirect3D7_Release
(
d3d
);
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_HEIGHT
|
DDSD_WIDTH
;
ddsd
.
dwHeight
=
128
;
ddsd
.
dwWidth
=
128
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_TEXTURE
|
DDSCAPS_SYSTEMMEMORY
;
hr
=
IDirectDraw7_CreateSurface
(
ddraw
,
&
ddsd
,
&
src
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create source texture, hr %#x.
\n
"
,
hr
);
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_TEXTURE
;
hr
=
IDirectDraw7_CreateSurface
(
ddraw
,
&
ddsd
,
&
dst
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create destination texture, hr %#x.
\n
"
,
hr
);
/* No surface has a color key */
hr
=
IDirect3DDevice7_Load
(
device
,
dst
,
NULL
,
src
,
NULL
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#x.
\n
"
,
hr
);
ckey
.
dwColorSpaceLowValue
=
ckey
.
dwColorSpaceHighValue
=
0xdeadbeef
;
hr
=
IDirectDrawSurface7_GetColorKey
(
dst
,
DDCKEY_SRCBLT
,
&
ckey
);
ok
(
hr
==
DDERR_NOCOLORKEY
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
ckey
.
dwColorSpaceLowValue
==
0xdeadbeef
,
"dwColorSpaceLowValue is %#x.
\n
"
,
ckey
.
dwColorSpaceLowValue
);
ok
(
ckey
.
dwColorSpaceHighValue
==
0xdeadbeef
,
"dwColorSpaceHighValue is %#x.
\n
"
,
ckey
.
dwColorSpaceHighValue
);
/* Source surface has a color key */
ckey
.
dwColorSpaceLowValue
=
ckey
.
dwColorSpaceHighValue
=
0x0000ff00
;
hr
=
IDirectDrawSurface7_SetColorKey
(
src
,
DDCKEY_SRCBLT
,
&
ckey
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set color key, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_Load
(
device
,
dst
,
NULL
,
src
,
NULL
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_GetColorKey
(
dst
,
DDCKEY_SRCBLT
,
&
ckey
);
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
ckey
.
dwColorSpaceLowValue
==
0x0000ff00
,
"dwColorSpaceLowValue is %#x.
\n
"
,
ckey
.
dwColorSpaceLowValue
);
ok
(
ckey
.
dwColorSpaceHighValue
==
0x0000ff00
,
"dwColorSpaceHighValue is %#x.
\n
"
,
ckey
.
dwColorSpaceHighValue
);
/* Both surfaces have a color key: Dest ckey is overwritten */
ckey
.
dwColorSpaceLowValue
=
ckey
.
dwColorSpaceHighValue
=
0x000000ff
;
hr
=
IDirectDrawSurface7_SetColorKey
(
dst
,
DDCKEY_SRCBLT
,
&
ckey
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set color key, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_Load
(
device
,
dst
,
NULL
,
src
,
NULL
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_GetColorKey
(
dst
,
DDCKEY_SRCBLT
,
&
ckey
);
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
ckey
.
dwColorSpaceLowValue
==
0x0000ff00
,
"dwColorSpaceLowValue is %#x.
\n
"
,
ckey
.
dwColorSpaceLowValue
);
ok
(
ckey
.
dwColorSpaceHighValue
==
0x0000ff00
,
"dwColorSpaceHighValue is %#x.
\n
"
,
ckey
.
dwColorSpaceHighValue
);
/* Only the destination has a color key: It is deleted. This behavior differs from
* IDirect3DTexture(2)::Load */
hr
=
IDirectDrawSurface7_SetColorKey
(
src
,
DDCKEY_SRCBLT
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set color key, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_GetColorKey
(
src
,
DDCKEY_SRCBLT
,
&
ckey
);
ok
(
hr
==
DDERR_NOCOLORKEY
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_Load
(
device
,
dst
,
NULL
,
src
,
NULL
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_GetColorKey
(
dst
,
DDCKEY_SRCBLT
,
&
ckey
);
todo_wine
ok
(
hr
==
DDERR_NOCOLORKEY
,
"Got unexpected hr %#x.
\n
"
,
hr
);
IDirectDrawSurface7_Release
(
dst
);
IDirectDrawSurface7_Release
(
src
);
IDirectDraw7_Release
(
ddraw
);
IDirect3DDevice7_Release
(
device
);
}
START_TEST
(
ddraw7
)
{
HMODULE
module
=
GetModuleHandleA
(
"ddraw.dll"
);
...
...
@@ -1145,4 +1232,5 @@ START_TEST(ddraw7)
test_surface_interface_mismatch
();
test_coop_level_threaded
();
test_depth_blit
();
test_texture_load_ckey
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment