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
bddb0433
Commit
bddb0433
authored
Jan 09, 2014
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Return DDERR_NOTONMIPMAPSUBLEVEL for ddraw_surface7_SetColorKey() on mipmap sub levels.
parent
f7ee96c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
53 deletions
+70
-53
surface.c
dlls/ddraw/surface.c
+69
-52
d3d.c
dlls/ddraw/tests/d3d.c
+1
-1
No files found.
dlls/ddraw/surface.c
View file @
bddb0433
...
...
@@ -4494,89 +4494,106 @@ static HRESULT WINAPI ddraw_surface1_GetPalette(IDirectDrawSurface *iface, IDire
return
ddraw_surface7_GetPalette
(
&
surface
->
IDirectDrawSurface7_iface
,
palette
);
}
static
HRESULT
WINAPI
ddraw_surface7_SetColorKey
(
IDirectDrawSurface7
*
iface
,
DWORD
Flags
,
DDCOLORKEY
*
CK
ey
)
static
HRESULT
ddraw_surface_set_color_key
(
struct
ddraw_surface
*
surface
,
DWORD
flags
,
DDCOLORKEY
*
color_k
ey
)
{
struct
ddraw_surface
*
This
=
impl_from_IDirectDrawSurface7
(
iface
)
;
DDCOLORKEY
fixed_color_key
;
HRESULT
hr
=
WINED3D_OK
;
DDCOLORKEY
FixedCKey
;
TRACE
(
"iface %p, flags %#x, color_key %p.
\n
"
,
iface
,
Flags
,
CKey
);
wined3d_mutex_lock
();
if
(
CKey
)
if
(
color_key
)
{
FixedCKey
=
*
CK
ey
;
fixed_color_key
=
*
color_k
ey
;
/* Handle case where dwColorSpaceHighValue < dwColorSpaceLowValue */
if
(
FixedCKey
.
dwColorSpaceHighValue
<
FixedCK
ey
.
dwColorSpaceLowValue
)
FixedCKey
.
dwColorSpaceHighValue
=
FixedCK
ey
.
dwColorSpaceLowValue
;
if
(
fixed_color_key
.
dwColorSpaceHighValue
<
fixed_color_k
ey
.
dwColorSpaceLowValue
)
fixed_color_key
.
dwColorSpaceHighValue
=
fixed_color_k
ey
.
dwColorSpaceLowValue
;
switch
(
F
lags
&
~
DDCKEY_COLORSPACE
)
switch
(
f
lags
&
~
DDCKEY_COLORSPACE
)
{
case
DDCKEY_DESTBLT
:
This
->
surface_desc
.
ddckCKDestBlt
=
FixedCK
ey
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKDESTBLT
;
break
;
case
DDCKEY_DESTBLT
:
surface
->
surface_desc
.
ddckCKDestBlt
=
fixed_color_k
ey
;
surface
->
surface_desc
.
dwFlags
|=
DDSD_CKDESTBLT
;
break
;
case
DDCKEY_DESTOVERLAY
:
This
->
surface_desc
.
u3
.
ddckCKDestOverlay
=
FixedCK
ey
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKDESTOVERLAY
;
break
;
case
DDCKEY_DESTOVERLAY
:
surface
->
surface_desc
.
u3
.
ddckCKDestOverlay
=
fixed_color_k
ey
;
surface
->
surface_desc
.
dwFlags
|=
DDSD_CKDESTOVERLAY
;
break
;
case
DDCKEY_SRCOVERLAY
:
This
->
surface_desc
.
ddckCKSrcOverlay
=
FixedCK
ey
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKSRCOVERLAY
;
break
;
case
DDCKEY_SRCOVERLAY
:
surface
->
surface_desc
.
ddckCKSrcOverlay
=
fixed_color_k
ey
;
surface
->
surface_desc
.
dwFlags
|=
DDSD_CKSRCOVERLAY
;
break
;
case
DDCKEY_SRCBLT
:
This
->
surface_desc
.
ddckCKSrcBlt
=
FixedCK
ey
;
This
->
surface_desc
.
dwFlags
|=
DDSD_CKSRCBLT
;
break
;
case
DDCKEY_SRCBLT
:
surface
->
surface_desc
.
ddckCKSrcBlt
=
fixed_color_k
ey
;
surface
->
surface_desc
.
dwFlags
|=
DDSD_CKSRCBLT
;
break
;
default:
wined3d_mutex_unlock
();
return
DDERR_INVALIDPARAMS
;
default:
wined3d_mutex_unlock
();
return
DDERR_INVALIDPARAMS
;
}
}
else
{
switch
(
F
lags
&
~
DDCKEY_COLORSPACE
)
switch
(
f
lags
&
~
DDCKEY_COLORSPACE
)
{
case
DDCKEY_DESTBLT
:
This
->
surface_desc
.
dwFlags
&=
~
DDSD_CKDESTBLT
;
break
;
case
DDCKEY_DESTBLT
:
surface
->
surface_desc
.
dwFlags
&=
~
DDSD_CKDESTBLT
;
break
;
case
DDCKEY_DESTOVERLAY
:
This
->
surface_desc
.
dwFlags
&=
~
DDSD_CKDESTOVERLAY
;
break
;
case
DDCKEY_DESTOVERLAY
:
surface
->
surface_desc
.
dwFlags
&=
~
DDSD_CKDESTOVERLAY
;
break
;
case
DDCKEY_SRCOVERLAY
:
This
->
surface_desc
.
dwFlags
&=
~
DDSD_CKSRCOVERLAY
;
break
;
case
DDCKEY_SRCOVERLAY
:
surface
->
surface_desc
.
dwFlags
&=
~
DDSD_CKSRCOVERLAY
;
break
;
case
DDCKEY_SRCBLT
:
This
->
surface_desc
.
dwFlags
&=
~
DDSD_CKSRCBLT
;
break
;
case
DDCKEY_SRCBLT
:
surface
->
surface_desc
.
dwFlags
&=
~
DDSD_CKSRCBLT
;
break
;
default:
wined3d_mutex_unlock
();
return
DDERR_INVALIDPARAMS
;
default:
wined3d_mutex_unlock
();
return
DDERR_INVALIDPARAMS
;
}
}
if
(
This
->
wined3d_texture
)
hr
=
wined3d_texture_set_color_key
(
This
->
wined3d_texture
,
Flags
,
CKey
?
(
struct
wined3d_color_key
*
)
&
FixedCKey
:
NULL
);
if
(
surface
->
wined3d_texture
)
hr
=
wined3d_texture_set_color_key
(
surface
->
wined3d_texture
,
flags
,
color_key
?
(
struct
wined3d_color_key
*
)
&
fixed_color_key
:
NULL
);
wined3d_mutex_unlock
();
return
hr_ddraw_from_wined3d
(
hr
);
}
static
HRESULT
WINAPI
ddraw_surface7_SetColorKey
(
IDirectDrawSurface7
*
iface
,
DWORD
flags
,
DDCOLORKEY
*
color_key
)
{
struct
ddraw_surface
*
surface
=
impl_from_IDirectDrawSurface7
(
iface
);
TRACE
(
"iface %p, flags %#x, color_key %p.
\n
"
,
iface
,
flags
,
color_key
);
wined3d_mutex_lock
();
if
(
!
surface
->
wined3d_texture
)
{
wined3d_mutex_unlock
();
return
DDERR_NOTONMIPMAPSUBLEVEL
;
}
wined3d_mutex_unlock
();
return
ddraw_surface_set_color_key
(
surface
,
flags
,
color_key
);
}
static
HRESULT
WINAPI
ddraw_surface4_SetColorKey
(
IDirectDrawSurface4
*
iface
,
DWORD
flags
,
DDCOLORKEY
*
color_key
)
{
struct
ddraw_surface
*
surface
=
impl_from_IDirectDrawSurface4
(
iface
);
TRACE
(
"iface %p, flags %#x, color_key %p.
\n
"
,
iface
,
flags
,
color_key
);
return
ddraw_surface
7_SetColorKey
(
&
surface
->
IDirectDrawSurface7_i
face
,
flags
,
color_key
);
return
ddraw_surface
_set_color_key
(
sur
face
,
flags
,
color_key
);
}
static
HRESULT
WINAPI
ddraw_surface3_SetColorKey
(
IDirectDrawSurface3
*
iface
,
DWORD
flags
,
DDCOLORKEY
*
color_key
)
...
...
@@ -4585,7 +4602,7 @@ static HRESULT WINAPI ddraw_surface3_SetColorKey(IDirectDrawSurface3 *iface, DWO
TRACE
(
"iface %p, flags %#x, color_key %p.
\n
"
,
iface
,
flags
,
color_key
);
return
ddraw_surface
7_SetColorKey
(
&
surface
->
IDirectDrawSurface7_i
face
,
flags
,
color_key
);
return
ddraw_surface
_set_color_key
(
sur
face
,
flags
,
color_key
);
}
static
HRESULT
WINAPI
ddraw_surface2_SetColorKey
(
IDirectDrawSurface2
*
iface
,
DWORD
flags
,
DDCOLORKEY
*
color_key
)
...
...
@@ -4594,7 +4611,7 @@ static HRESULT WINAPI ddraw_surface2_SetColorKey(IDirectDrawSurface2 *iface, DWO
TRACE
(
"iface %p, flags %#x, color_key %p.
\n
"
,
iface
,
flags
,
color_key
);
return
ddraw_surface
7_SetColorKey
(
&
surface
->
IDirectDrawSurface7_i
face
,
flags
,
color_key
);
return
ddraw_surface
_set_color_key
(
sur
face
,
flags
,
color_key
);
}
static
HRESULT
WINAPI
ddraw_surface1_SetColorKey
(
IDirectDrawSurface
*
iface
,
DWORD
flags
,
DDCOLORKEY
*
color_key
)
...
...
@@ -4603,7 +4620,7 @@ static HRESULT WINAPI ddraw_surface1_SetColorKey(IDirectDrawSurface *iface, DWOR
TRACE
(
"iface %p, flags %#x, color_key %p.
\n
"
,
iface
,
flags
,
color_key
);
return
ddraw_surface
7_SetColorKey
(
&
surface
->
IDirectDrawSurface7_i
face
,
flags
,
color_key
);
return
ddraw_surface
_set_color_key
(
sur
face
,
flags
,
color_key
);
}
static
HRESULT
WINAPI
ddraw_surface7_SetPalette
(
IDirectDrawSurface7
*
iface
,
IDirectDrawPalette
*
palette
)
...
...
dlls/ddraw/tests/d3d.c
View file @
bddb0433
...
...
@@ -2761,7 +2761,7 @@ static void DeviceLoadTest(void)
hr
=
IDirectDrawSurface7_SetColorKey
(
texture_levels
[
0
][
0
],
DDCKEY_SRCBLT
,
&
ddckey
);
ok
(
hr
==
DD_OK
,
"IDirectDrawSurface7_SetColorKey returned: %x
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_SetColorKey
(
texture_levels
[
0
][
1
],
DDCKEY_SRCBLT
,
&
ddckey
);
todo_wine
ok
(
hr
==
DDERR_NOTONMIPMAPSUBLEVEL
,
"IDirectDrawSurface7_SetColorKey returned: %x
\n
"
,
hr
);
ok
(
hr
==
DDERR_NOTONMIPMAPSUBLEVEL
,
"Got unexpected hr %#x.
\n
"
,
hr
);
hr
=
IDirectDrawSurface7_GetColorKey
(
texture_levels
[
1
][
0
],
DDCKEY_SRCBLT
,
&
ddckey
);
ok
(
hr
==
DDERR_NOCOLORKEY
,
"IDirectDrawSurface7_GetColorKey returned: %x
\n
"
,
hr
);
...
...
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