Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
88af9702
Commit
88af9702
authored
Apr 22, 2007
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 27, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use EnumAttachedSurfaces for SetColorKey.
parent
a46012ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
17 deletions
+49
-17
surface.c
dlls/ddraw/surface.c
+49
-17
No files found.
dlls/ddraw/surface.c
View file @
88af9702
...
...
@@ -2073,6 +2073,45 @@ IDirectDrawSurfaceImpl_GetPalette(IDirectDrawSurface7 *iface,
}
/*****************************************************************************
* SetColorKeyEnum
*
* EnumAttachedSurface callback for SetColorKey. Used to set color keys
* recursively in the surface tree
*
*****************************************************************************/
struct
SCKContext
{
HRESULT
ret
;
WINEDDCOLORKEY
*
CKey
;
DWORD
Flags
;
};
static
HRESULT
WINAPI
SetColorKeyEnum
(
IDirectDrawSurface7
*
surface
,
DDSURFACEDESC2
*
desc
,
void
*
context
)
{
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
surface
);
struct
SCKContext
*
ctx
=
context
;
HRESULT
hr
;
hr
=
IWineD3DSurface_SetColorKey
(
This
->
WineD3DSurface
,
ctx
->
Flags
,
ctx
->
CKey
);
if
(
hr
!=
DD_OK
)
{
WARN
(
"IWineD3DSurface_SetColorKey failed, hr = %08x
\n
"
,
hr
);
ctx
->
ret
=
hr
;
}
IDirectDrawSurface7_EnumAttachedSurfaces
(
surface
,
context
,
SetColorKeyEnum
);
IDirectDrawSurface7_Release
(
surface
);
return
DDENUMRET_OK
;
}
/*****************************************************************************
* IDirectDrawSurface7::SetColorKey
*
* Sets the color keying options for the surface. Observations showed that
...
...
@@ -2094,8 +2133,7 @@ IDirectDrawSurfaceImpl_SetColorKey(IDirectDrawSurface7 *iface,
DDCOLORKEY
*
CKey
)
{
ICOM_THIS_FROM
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface7
,
iface
);
IDirectDrawSurfaceImpl
*
surf
;
HRESULT
hr
;
struct
SCKContext
ctx
=
{
DD_OK
,
(
WINEDDCOLORKEY
*
)
CKey
,
Flags
};
TRACE
(
"(%p)->(%x,%p)
\n
"
,
This
,
Flags
,
CKey
);
if
(
CKey
)
...
...
@@ -2150,23 +2188,17 @@ IDirectDrawSurfaceImpl_SetColorKey(IDirectDrawSurface7 *iface,
return
DDERR_INVALIDPARAMS
;
}
}
for
(
surf
=
This
->
first_complex
;
surf
;
surf
=
surf
->
next_complex
)
ctx
.
ret
=
IWineD3DSurface_SetColorKey
(
This
->
WineD3DSurface
,
Flags
,
ctx
.
CKey
);
IDirectDrawSurface7_EnumAttachedSurfaces
(
iface
,
(
void
*
)
&
ctx
,
SetColorKeyEnum
);
switch
(
ctx
.
ret
)
{
hr
=
IWineD3DSurface_SetColorKey
(
surf
->
WineD3DSurface
,
Flags
,
(
WINEDDCOLORKEY
*
)
CKey
);
if
(
FAILED
(
hr
))
{
WARN
(
"IWineD3DSurface::SetColorKey for surface %p failed with hr=%08x
\n
"
,
surf
->
WineD3DSurface
,
hr
);
switch
(
hr
)
{
case
WINED3DERR_INVALIDCALL
:
return
DDERR_INVALIDPARAMS
;
default:
return
hr
;
}
}
case
WINED3DERR_INVALIDCALL
:
return
DDERR_INVALIDPARAMS
;
default:
return
ctx
.
ret
;
}
return
DD_OK
;
}
/*****************************************************************************
...
...
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