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
93dfe5af
Commit
93dfe5af
authored
Jun 06, 2011
by
Ričardas Barkauskas
Committed by
Alexandre Julliard
Jun 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use impl_from_IDirectDrawSurface7() instead of casts.
parent
11bf99c5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
13 deletions
+18
-13
ddraw.c
dlls/ddraw/ddraw.c
+11
-11
ddraw_private.h
dlls/ddraw/ddraw_private.h
+5
-0
device.c
dlls/ddraw/device.c
+1
-1
main.c
dlls/ddraw/main.c
+1
-1
surface.c
dlls/ddraw/surface.c
+0
-0
No files found.
dlls/ddraw/ddraw.c
View file @
93dfe5af
...
...
@@ -2058,7 +2058,7 @@ static HRESULT WINAPI ddraw3_GetGDISurface(IDirectDraw3 *iface, IDirectDrawSurfa
*
surface
=
NULL
;
return
hr
;
}
surface_impl
=
(
IDirectDrawSurfaceImpl
*
)
surface7
;
surface_impl
=
impl_from_IDirectDrawSurface7
(
surface7
)
;
*
surface
=
(
IDirectDrawSurface
*
)
&
surface_impl
->
IDirectDrawSurface3_iface
;
return
hr
;
...
...
@@ -2079,7 +2079,7 @@ static HRESULT WINAPI ddraw2_GetGDISurface(IDirectDraw2 *iface, IDirectDrawSurfa
*
surface
=
NULL
;
return
hr
;
}
surface_impl
=
(
IDirectDrawSurfaceImpl
*
)
surface7
;
surface_impl
=
impl_from_IDirectDrawSurface7
(
surface7
)
;
*
surface
=
(
IDirectDrawSurface
*
)
&
surface_impl
->
IDirectDrawSurface3_iface
;
return
hr
;
...
...
@@ -2100,7 +2100,7 @@ static HRESULT WINAPI ddraw1_GetGDISurface(IDirectDraw *iface, IDirectDrawSurfac
*
surface
=
NULL
;
return
hr
;
}
surface_impl
=
(
IDirectDrawSurfaceImpl
*
)
surface7
;
surface_impl
=
impl_from_IDirectDrawSurface7
(
surface7
)
;
*
surface
=
(
IDirectDrawSurface
*
)
&
surface_impl
->
IDirectDrawSurface3_iface
;
return
hr
;
...
...
@@ -2472,7 +2472,7 @@ static HRESULT WINAPI ddraw4_GetSurfaceFromDC(IDirectDraw4 *iface, HDC dc,
*
surface
=
NULL
;
return
hr
;
}
surface_impl
=
(
IDirectDrawSurfaceImpl
*
)
surface7
;
surface_impl
=
impl_from_IDirectDrawSurface7
(
surface7
)
;
/* Tests say this is true */
*
surface
=
(
IDirectDrawSurface4
*
)
&
surface_impl
->
IDirectDrawSurface3_iface
;
...
...
@@ -2571,7 +2571,7 @@ static HRESULT WINAPI ddraw7_StartModeTest(IDirectDraw7 *iface, SIZE *Modes, DWO
*****************************************************************************/
HRESULT
WINAPI
ddraw_recreate_surfaces_cb
(
IDirectDrawSurface7
*
surf
,
DDSURFACEDESC2
*
desc
,
void
*
Context
)
{
IDirectDrawSurfaceImpl
*
surfImpl
=
(
IDirectDrawSurfaceImpl
*
)
surf
;
IDirectDrawSurfaceImpl
*
surfImpl
=
impl_from_IDirectDrawSurface7
(
surf
)
;
struct
wined3d_resource_desc
wined3d_desc
;
struct
wined3d_resource
*
wined3d_resource
;
IDirectDrawImpl
*
This
=
surfImpl
->
ddraw
;
...
...
@@ -3785,7 +3785,7 @@ struct surfacescallback_context
static
HRESULT
CALLBACK
EnumSurfacesCallbackThunk
(
IDirectDrawSurface7
*
surface
,
DDSURFACEDESC2
*
surface_desc
,
void
*
context
)
{
IDirectDrawSurfaceImpl
*
surface_impl
=
(
IDirectDrawSurfaceImpl
*
)
surface
;
IDirectDrawSurfaceImpl
*
surface_impl
=
impl_from_IDirectDrawSurface7
(
surface
)
;
struct
surfacescallback_context
*
cbcontext
=
context
;
return
cbcontext
->
func
((
IDirectDrawSurface
*
)
&
surface_impl
->
IDirectDrawSurface3_iface
,
...
...
@@ -4236,7 +4236,7 @@ static HRESULT WINAPI ddraw3_DuplicateSurface(IDirectDraw3 *iface, IDirectDrawSu
hr
=
ddraw7_DuplicateSurface
(
&
This
->
IDirectDraw7_iface
,
(
IDirectDrawSurface7
*
)
src_impl
,
&
dst7
);
if
(
FAILED
(
hr
))
return
hr
;
dst_impl
=
(
IDirectDrawSurfaceImpl
*
)
dst7
;
dst_impl
=
impl_from_IDirectDrawSurface7
(
dst7
)
;
*
dst
=
(
IDirectDrawSurface
*
)
&
dst_impl
->
IDirectDrawSurface3_iface
;
return
hr
;
}
...
...
@@ -4254,7 +4254,7 @@ static HRESULT WINAPI ddraw2_DuplicateSurface(IDirectDraw2 *iface,
hr
=
ddraw7_DuplicateSurface
(
&
This
->
IDirectDraw7_iface
,
(
IDirectDrawSurface7
*
)
src_impl
,
&
dst7
);
if
(
FAILED
(
hr
))
return
hr
;
dst_impl
=
(
IDirectDrawSurfaceImpl
*
)
dst7
;
dst_impl
=
impl_from_IDirectDrawSurface7
(
dst7
)
;
*
dst
=
(
IDirectDrawSurface
*
)
&
dst_impl
->
IDirectDrawSurface3_iface
;
return
hr
;
}
...
...
@@ -4272,7 +4272,7 @@ static HRESULT WINAPI ddraw1_DuplicateSurface(IDirectDraw *iface, IDirectDrawSur
hr
=
ddraw7_DuplicateSurface
(
&
This
->
IDirectDraw7_iface
,
(
IDirectDrawSurface7
*
)
src_impl
,
&
dst7
);
if
(
FAILED
(
hr
))
return
hr
;
dst_impl
=
(
IDirectDrawSurfaceImpl
*
)
dst7
;
dst_impl
=
impl_from_IDirectDrawSurface7
(
dst7
)
;
*
dst
=
(
IDirectDrawSurface
*
)
&
dst_impl
->
IDirectDrawSurface3_iface
;
return
hr
;
}
...
...
@@ -5769,7 +5769,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent *
IDirectDrawSurface7
*
attached
;
IDirectDrawSurface7_GetAttachedSurface
((
IDirectDrawSurface7
*
)
surf
,
&
searchcaps
,
&
attached
);
if
(
!
attached
)
ERR
(
"Surface not found
\n
"
);
surf
=
(
IDirectDrawSurfaceImpl
*
)
attached
;
surf
=
impl_from_IDirectDrawSurface7
(
attached
)
;
IDirectDrawSurface7_Release
(
attached
);
++
i
;
}
...
...
@@ -5785,7 +5785,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent *
static
HRESULT
WINAPI
findRenderTarget
(
IDirectDrawSurface7
*
surface
,
DDSURFACEDESC2
*
surface_desc
,
void
*
ctx
)
{
IDirectDrawSurfaceImpl
*
s
=
(
IDirectDrawSurfaceImpl
*
)
surface
;
IDirectDrawSurfaceImpl
*
s
=
impl_from_IDirectDrawSurface7
(
surface
)
;
IDirectDrawSurfaceImpl
**
target
=
ctx
;
if
(
!
s
->
isRenderTarget
)
...
...
dlls/ddraw/ddraw_private.h
View file @
93dfe5af
...
...
@@ -225,6 +225,11 @@ static inline IDirectDrawSurfaceImpl *impl_from_IDirectDrawSurface3(IDirectDrawS
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
IDirectDrawSurface3_iface
);
}
static
inline
IDirectDrawSurfaceImpl
*
impl_from_IDirectDrawSurface7
(
IDirectDrawSurface7
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
lpVtbl
);
}
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface3
(
IDirectDrawSurface3
*
iface
)
DECLSPEC_HIDDEN
;
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface7
(
IDirectDrawSurface7
*
iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/ddraw/device.c
View file @
93dfe5af
...
...
@@ -6751,7 +6751,7 @@ IDirect3DDeviceImpl_UpdateDepthStencil(IDirect3DDeviceImpl *This)
return
WINED3DZB_FALSE
;
}
dsi
=
(
IDirectDrawSurfaceImpl
*
)
depthStencil
;
dsi
=
impl_from_IDirectDrawSurface7
(
depthStencil
)
;
TRACE
(
"Setting wined3d depth stencil to %p (wined3d %p)
\n
"
,
dsi
,
dsi
->
wined3d_surface
);
wined3d_device_set_depth_stencil
(
This
->
wined3d_device
,
dsi
->
wined3d_surface
);
...
...
dlls/ddraw/main.c
View file @
93dfe5af
...
...
@@ -751,7 +751,7 @@ DestroyCallback(IDirectDrawSurface7 *surf,
DDSURFACEDESC2
*
desc
,
void
*
context
)
{
IDirectDrawSurfaceImpl
*
Impl
=
(
IDirectDrawSurfaceImpl
*
)
surf
;
IDirectDrawSurfaceImpl
*
Impl
=
impl_from_IDirectDrawSurface7
(
surf
)
;
ULONG
ref
;
ref
=
IDirectDrawSurface7_Release
(
surf
);
/* For the EnumSurfaces */
...
...
dlls/ddraw/surface.c
View file @
93dfe5af
This diff is collapsed.
Click to expand it.
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