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
e95ffacd
Commit
e95ffacd
authored
Oct 15, 2009
by
Christian Costa
Committed by
Alexandre Julliard
Oct 15, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Make SetColorKey handle case where dwColorSpaceHighValue < dwColorSpaceLowValue + tests.
parent
6a5bd0c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
5 deletions
+42
-5
surface.c
dlls/ddraw/surface.c
+11
-5
dsurface.c
dlls/ddraw/tests/dsurface.c
+31
-0
No files found.
dlls/ddraw/surface.c
View file @
e95ffacd
...
...
@@ -2429,31 +2429,37 @@ IDirectDrawSurfaceImpl_SetColorKey(IDirectDrawSurface7 *iface,
DDCOLORKEY
*
CKey
)
{
IDirectDrawSurfaceImpl
*
This
=
(
IDirectDrawSurfaceImpl
*
)
iface
;
struct
SCKContext
ctx
=
{
DD_OK
,
(
WINEDDCOLORKEY
*
)
CKey
,
Flags
};
DDCOLORKEY
FixedCKey
;
struct
SCKContext
ctx
=
{
DD_OK
,
(
WINEDDCOLORKEY
*
)
(
CKey
?
&
FixedCKey
:
NULL
),
Flags
};
TRACE
(
"(%p)->(%x,%p)
\n
"
,
This
,
Flags
,
CKey
);
EnterCriticalSection
(
&
ddraw_cs
);
if
(
CKey
)
{
FixedCKey
=
*
CKey
;
/* Handle case where dwColorSpaceHighValue < dwColorSpaceLowValue */
if
(
FixedCKey
.
dwColorSpaceHighValue
<
FixedCKey
.
dwColorSpaceLowValue
)
FixedCKey
.
dwColorSpaceHighValue
=
FixedCKey
.
dwColorSpaceLowValue
;
switch
(
Flags
&
~
DDCKEY_COLORSPACE
)
{
case
DDCKEY_DESTBLT
:
This
->
surface_desc
.
ddckCKDestBlt
=
*
CKey
;
This
->
surface_desc
.
ddckCKDestBlt
=
Fixed
CKey
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKDESTBLT
;
break
;
case
DDCKEY_DESTOVERLAY
:
This
->
surface_desc
.
u3
.
ddckCKDestOverlay
=
*
CKey
;
This
->
surface_desc
.
u3
.
ddckCKDestOverlay
=
Fixed
CKey
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKDESTOVERLAY
;
break
;
case
DDCKEY_SRCOVERLAY
:
This
->
surface_desc
.
ddckCKSrcOverlay
=
*
CKey
;
This
->
surface_desc
.
ddckCKSrcOverlay
=
Fixed
CKey
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKSRCOVERLAY
;
break
;
case
DDCKEY_SRCBLT
:
This
->
surface_desc
.
ddckCKSrcBlt
=
*
CKey
;
This
->
surface_desc
.
ddckCKSrcBlt
=
Fixed
CKey
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKSRCBLT
;
break
;
...
...
dlls/ddraw/tests/dsurface.c
View file @
e95ffacd
...
...
@@ -325,6 +325,37 @@ static void SrcColorKey32BlitTest(void)
ok
(
ddsd
.
ddckCKSrcBlt
.
dwColorSpaceLowValue
==
0x00FF00
&&
ddsd
.
ddckCKSrcBlt
.
dwColorSpaceHighValue
==
0x00FF00
,
"GetSurfaceDesc does not return the colorkey set with SetColorKey
\n
"
);
/* Test SetColorKey with dwColorSpaceHighValue < dwColorSpaceLowValue */
DDColorKey
.
dwColorSpaceLowValue
=
0x0000FF
;
DDColorKey
.
dwColorSpaceHighValue
=
0x000000
;
IDirectDrawSurface_SetColorKey
(
lpSrc
,
DDCKEY_SRCBLT
,
&
DDColorKey
);
DDColorKey
.
dwColorSpaceLowValue
=
0
;
DDColorKey
.
dwColorSpaceHighValue
=
0
;
IDirectDrawSurface_GetColorKey
(
lpSrc
,
DDCKEY_SRCBLT
,
&
DDColorKey
);
ok
(
DDColorKey
.
dwColorSpaceLowValue
==
0x0000FF
&&
DDColorKey
.
dwColorSpaceHighValue
==
0x0000FF
,
"GetColorKey does not return the colorkey set with SetColorKey (%x %x)
\n
"
,
DDColorKey
.
dwColorSpaceLowValue
,
DDColorKey
.
dwColorSpaceHighValue
);
DDColorKey
.
dwColorSpaceLowValue
=
0x0000FF
;
DDColorKey
.
dwColorSpaceHighValue
=
0x000001
;
IDirectDrawSurface_SetColorKey
(
lpSrc
,
DDCKEY_SRCBLT
,
&
DDColorKey
);
DDColorKey
.
dwColorSpaceLowValue
=
0
;
DDColorKey
.
dwColorSpaceHighValue
=
0
;
IDirectDrawSurface_GetColorKey
(
lpSrc
,
DDCKEY_SRCBLT
,
&
DDColorKey
);
ok
(
DDColorKey
.
dwColorSpaceLowValue
==
0x0000FF
&&
DDColorKey
.
dwColorSpaceHighValue
==
0x0000FF
,
"GetColorKey does not return the colorkey set with SetColorKey (%x %x)
\n
"
,
DDColorKey
.
dwColorSpaceLowValue
,
DDColorKey
.
dwColorSpaceHighValue
);
DDColorKey
.
dwColorSpaceLowValue
=
0x0000FF
;
DDColorKey
.
dwColorSpaceHighValue
=
0x0000FE
;
IDirectDrawSurface_SetColorKey
(
lpSrc
,
DDCKEY_SRCBLT
,
&
DDColorKey
);
DDColorKey
.
dwColorSpaceLowValue
=
0
;
DDColorKey
.
dwColorSpaceHighValue
=
0
;
IDirectDrawSurface_GetColorKey
(
lpSrc
,
DDCKEY_SRCBLT
,
&
DDColorKey
);
ok
(
DDColorKey
.
dwColorSpaceLowValue
==
0x0000FF
&&
DDColorKey
.
dwColorSpaceHighValue
==
0x0000FF
,
"GetColorKey does not return the colorkey set with SetColorKey (%x %x)
\n
"
,
DDColorKey
.
dwColorSpaceLowValue
,
DDColorKey
.
dwColorSpaceHighValue
);
IDirectDrawSurface_Release
(
lpSrc
);
IDirectDrawSurface_Release
(
lpDst
);
...
...
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