Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
1c29c78c
Commit
1c29c78c
authored
May 30, 2015
by
Michael Müller
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add more tests for IDirect3DTexture2::Load.
parent
c9582456
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
d3d.c
dlls/ddraw/tests/d3d.c
+0
-0
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+27
-1
No files found.
dlls/ddraw/tests/d3d.c
View file @
1c29c78c
This diff is collapsed.
Click to expand it.
dlls/ddraw/tests/ddraw2.c
View file @
1c29c78c
...
...
@@ -1495,8 +1495,10 @@ static void test_texture_load_ckey(void)
IDirectDraw2
*
ddraw
=
NULL
;
IDirectDrawSurface
*
src
=
NULL
;
IDirectDrawSurface
*
dst
=
NULL
;
IDirectDrawSurface
*
dst2
=
NULL
;
IDirect3DTexture
*
src_tex
=
NULL
;
IDirect3DTexture
*
dst_tex
=
NULL
;
IDirect3DTexture
*
dst2_tex
=
NULL
;
DDSURFACEDESC
ddsd
;
HRESULT
hr
;
DDCOLORKEY
ckey
;
...
...
@@ -1508,16 +1510,31 @@ static void test_texture_load_ckey(void)
memset
(
&
ddsd
,
0
,
sizeof
(
ddsd
));
ddsd
.
dwSize
=
sizeof
(
ddsd
);
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_HEIGHT
|
DDSD_WIDTH
;
ddsd
.
dwFlags
=
DDSD_CAPS
|
DDSD_HEIGHT
|
DDSD_WIDTH
|
DDSD_PIXELFORMAT
;
ddsd
.
dwHeight
=
128
;
ddsd
.
dwWidth
=
128
;
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_TEXTURE
|
DDSCAPS_SYSTEMMEMORY
;
ddsd
.
ddpfPixelFormat
.
dwSize
=
sizeof
(
ddsd
.
ddpfPixelFormat
);
ddsd
.
ddpfPixelFormat
.
dwFlags
=
DDPF_RGB
;
U1
(
ddsd
.
ddpfPixelFormat
).
dwRGBBitCount
=
32
;
U2
(
ddsd
.
ddpfPixelFormat
).
dwRBitMask
=
0x00FF0000
;
U3
(
ddsd
.
ddpfPixelFormat
).
dwGBitMask
=
0x0000FF00
;
U4
(
ddsd
.
ddpfPixelFormat
).
dwBBitMask
=
0x000000FF
;
hr
=
IDirectDraw2_CreateSurface
(
ddraw
,
&
ddsd
,
&
src
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create source texture, hr %#lx.
\n
"
,
hr
);
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_TEXTURE
;
hr
=
IDirectDraw2_CreateSurface
(
ddraw
,
&
ddsd
,
&
dst
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create destination texture, hr %#lx.
\n
"
,
hr
);
U1
(
ddsd
.
ddpfPixelFormat
).
dwRGBBitCount
=
16
;
U2
(
ddsd
.
ddpfPixelFormat
).
dwRBitMask
=
0xf800
;
U3
(
ddsd
.
ddpfPixelFormat
).
dwGBitMask
=
0x07e0
;
U4
(
ddsd
.
ddpfPixelFormat
).
dwBBitMask
=
0x001f
;
hr
=
IDirectDraw2_CreateSurface
(
ddraw
,
&
ddsd
,
&
dst2
,
NULL
);
ok
(
SUCCEEDED
(
hr
),
"Failed to create destination texture, hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface_QueryInterface
(
src
,
&
IID_IDirect3DTexture
,
(
void
**
)
&
src_tex
);
ok
(
SUCCEEDED
(
hr
)
||
hr
==
E_NOINTERFACE
,
"Failed to get Direct3DTexture interface, hr %#lx.
\n
"
,
hr
);
if
(
FAILED
(
hr
))
...
...
@@ -1528,6 +1545,8 @@ static void test_texture_load_ckey(void)
}
hr
=
IDirectDrawSurface_QueryInterface
(
dst
,
&
IID_IDirect3DTexture
,
(
void
**
)
&
dst_tex
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get Direct3DTexture interface, hr %#lx.
\n
"
,
hr
);
hr
=
IDirectDrawSurface_QueryInterface
(
dst2
,
&
IID_IDirect3DTexture
,
(
void
**
)
&
dst2_tex
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get Direct3DTexture interface, hr %#lx.
\n
"
,
hr
);
/* No surface has a color key */
hr
=
IDirect3DTexture_Load
(
dst_tex
,
src_tex
);
...
...
@@ -1556,6 +1575,11 @@ static void test_texture_load_ckey(void)
ok
(
ckey
.
dwColorSpaceLowValue
==
0x0000ff00
,
"Got unexpected value 0x%08lx.
\n
"
,
ckey
.
dwColorSpaceLowValue
);
ok
(
ckey
.
dwColorSpaceHighValue
==
0x0000ff00
,
"Got unexpected value 0x%08lx.
\n
"
,
ckey
.
dwColorSpaceHighValue
);
/* Source surface has a color key but destination differs in format */
ckey
.
dwColorSpaceLowValue
=
ckey
.
dwColorSpaceHighValue
=
0x0
;
hr
=
IDirect3DTexture_Load
(
dst2_tex
,
src_tex
);
ok
(
hr
==
E_FAIL
,
"Got unexpected hr %#x, expected E_FAIL.
\n
"
,
hr
);
/* Both surfaces have a color key: Dest ckey is overwritten */
ckey
.
dwColorSpaceLowValue
=
ckey
.
dwColorSpaceHighValue
=
0x000000ff
;
hr
=
IDirectDrawSurface_SetColorKey
(
dst
,
DDCKEY_SRCBLT
,
&
ckey
);
...
...
@@ -1580,8 +1604,10 @@ static void test_texture_load_ckey(void)
ok
(
ckey
.
dwColorSpaceHighValue
==
0x0000ff00
,
"Got unexpected value 0x%08lx.
\n
"
,
ckey
.
dwColorSpaceHighValue
);
done:
if
(
dst2_tex
)
IDirect3DTexture_Release
(
dst2_tex
);
if
(
dst_tex
)
IDirect3DTexture_Release
(
dst_tex
);
if
(
src_tex
)
IDirect3DTexture_Release
(
src_tex
);
if
(
dst2
)
IDirectDrawSurface_Release
(
dst2
);
if
(
dst
)
IDirectDrawSurface_Release
(
dst
);
if
(
src
)
IDirectDrawSurface_Release
(
src
);
if
(
ddraw
)
IDirectDraw2_Release
(
ddraw
);
...
...
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