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
28ce1c00
Commit
28ce1c00
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 unsafe_impl_from_IDirectDrawSurface7() for application provided interfaces.
parent
39b15066
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
22 deletions
+30
-22
ddraw.c
dlls/ddraw/ddraw.c
+3
-3
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
device.c
dlls/ddraw/device.c
+12
-12
surface.c
dlls/ddraw/surface.c
+14
-7
No files found.
dlls/ddraw/ddraw.c
View file @
28ce1c00
...
...
@@ -4163,7 +4163,7 @@ static HRESULT WINAPI ddraw1_CreatePalette(IDirectDraw *iface, DWORD flags,
static
HRESULT
WINAPI
ddraw7_DuplicateSurface
(
IDirectDraw7
*
iface
,
IDirectDrawSurface7
*
Src
,
IDirectDrawSurface7
**
Dest
)
{
IDirectDrawSurfaceImpl
*
Surf
=
(
IDirectDrawSurfaceImpl
*
)
Src
;
IDirectDrawSurfaceImpl
*
Surf
=
unsafe_impl_from_IDirectDrawSurface7
(
Src
)
;
FIXME
(
"iface %p, src %p, dst %p partial stub!
\n
"
,
iface
,
Src
,
Dest
);
...
...
@@ -4733,7 +4733,7 @@ static HRESULT WINAPI d3d1_FindDevice(IDirect3D *iface, D3DFINDDEVICESEARCH *fds
static
HRESULT
WINAPI
d3d7_CreateDevice
(
IDirect3D7
*
iface
,
REFCLSID
riid
,
IDirectDrawSurface7
*
surface
,
IDirect3DDevice7
**
device
)
{
IDirectDrawSurfaceImpl
*
target
=
(
IDirectDrawSurfaceImpl
*
)
surface
;
IDirectDrawSurfaceImpl
*
target
=
unsafe_impl_from_IDirectDrawSurface7
(
surface
)
;
IDirectDrawImpl
*
This
=
impl_from_IDirect3D7
(
iface
);
IDirect3DDeviceImpl
*
object
;
HRESULT
hr
;
...
...
@@ -5714,7 +5714,7 @@ static HRESULT CDECL device_parent_create_surface(struct wined3d_device_parent *
{
IDirectDrawSurface7
*
attached
;
IDirectDrawSurface7_GetAttachedSurface
((
IDirectDrawSurface7
*
)
ddraw
->
tex_root
,
&
searchcaps
,
&
attached
);
surf
=
(
IDirectDrawSurfaceImpl
*
)
attached
;
surf
=
unsafe_impl_from_IDirectDrawSurface7
(
attached
)
;
IDirectDrawSurface7_Release
(
attached
);
}
if
(
!
surf
)
ERR
(
"root search surface not found
\n
"
);
...
...
dlls/ddraw/ddraw_private.h
View file @
28ce1c00
...
...
@@ -226,6 +226,7 @@ static inline IDirectDrawSurfaceImpl *impl_from_IDirectDrawSurface3(IDirectDrawS
}
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface3
(
IDirectDrawSurface3
*
iface
)
DECLSPEC_HIDDEN
;
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface7
(
IDirectDrawSurface7
*
iface
)
DECLSPEC_HIDDEN
;
/* Get the number of bytes per pixel for a given surface */
#define PFGET_BPP(pf) (pf.dwFlags&DDPF_PALETTEINDEXED8?1:((pf.dwRGBBitCount+7)/8))
...
...
dlls/ddraw/device.c
View file @
28ce1c00
...
...
@@ -1832,7 +1832,7 @@ IDirect3DDeviceImpl_7_SetRenderTarget(IDirect3DDevice7 *iface,
DWORD
Flags
)
{
IDirect3DDeviceImpl
*
This
=
(
IDirect3DDeviceImpl
*
)
iface
;
IDirectDrawSurfaceImpl
*
Target
=
(
IDirectDrawSurfaceImpl
*
)
NewTarget
;
IDirectDrawSurfaceImpl
*
Target
=
unsafe_impl_from_IDirectDrawSurface7
(
NewTarget
)
;
HRESULT
hr
;
TRACE
(
"iface %p, target %p, flags %#x.
\n
"
,
iface
,
NewTarget
,
Flags
);
...
...
@@ -1900,7 +1900,7 @@ static HRESULT WINAPI IDirect3DDeviceImpl_2_SetRenderTarget(IDirect3DDevice2 *if
IDirectDrawSurface
*
NewRenderTarget
,
DWORD
Flags
)
{
IDirect3DDeviceImpl
*
This
=
device_from_device2
(
iface
);
IDirectDrawSurfaceImpl
*
Target
=
(
IDirectDrawSurfaceImpl
*
)
NewRenderTarget
;
IDirectDrawSurfaceImpl
*
Target
=
unsafe_impl_from_IDirectDrawSurface3
((
IDirectDrawSurface3
*
)
NewRenderTarget
)
;
TRACE
(
"iface %p, target %p, flags %#x.
\n
"
,
iface
,
NewRenderTarget
,
Flags
);
...
...
@@ -4517,7 +4517,7 @@ IDirect3DDeviceImpl_7_SetTexture(IDirect3DDevice7 *iface,
IDirectDrawSurface7
*
Texture
)
{
IDirect3DDeviceImpl
*
This
=
(
IDirect3DDeviceImpl
*
)
iface
;
IDirectDrawSurfaceImpl
*
surf
=
(
IDirectDrawSurfaceImpl
*
)
Texture
;
IDirectDrawSurfaceImpl
*
surf
=
unsafe_impl_from_IDirectDrawSurface7
(
Texture
)
;
HRESULT
hr
;
TRACE
(
"iface %p, stage %u, texture %p.
\n
"
,
iface
,
Stage
,
Texture
);
...
...
@@ -5526,7 +5526,7 @@ static HRESULT
IDirect3DDeviceImpl_7_PreLoad
(
IDirect3DDevice7
*
iface
,
IDirectDrawSurface7
*
Texture
)
{
IDirectDrawSurfaceImpl
*
surf
=
(
IDirectDrawSurfaceImpl
*
)
Texture
;
IDirectDrawSurfaceImpl
*
surf
=
unsafe_impl_from_IDirectDrawSurface7
(
Texture
)
;
TRACE
(
"iface %p, texture %p.
\n
"
,
iface
,
Texture
);
...
...
@@ -5866,7 +5866,7 @@ static BOOL is_mip_level_subset(IDirectDrawSurfaceImpl *dest,
if
(
dest_level
!=
dest
)
IDirectDrawSurface7_Release
((
IDirectDrawSurface7
*
)
dest_level
);
dest_level
=
(
IDirectDrawSurfaceImpl
*
)
temp
;
dest_level
=
unsafe_impl_from_IDirectDrawSurface7
(
temp
)
;
}
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_TEXTURE
;
...
...
@@ -5875,7 +5875,7 @@ static BOOL is_mip_level_subset(IDirectDrawSurfaceImpl *dest,
if
(
src_level
!=
src
)
IDirectDrawSurface7_Release
((
IDirectDrawSurface7
*
)
src_level
);
src_level
=
(
IDirectDrawSurfaceImpl
*
)
temp
;
src_level
=
unsafe_impl_from_IDirectDrawSurface7
(
temp
)
;
}
if
(
src_level
&&
src_level
!=
src
)
IDirectDrawSurface7_Release
((
IDirectDrawSurface7
*
)
src_level
);
...
...
@@ -5967,7 +5967,7 @@ static void copy_mipmap_chain(IDirect3DDeviceImpl *device,
if
(
dest_level
!=
dest
)
IDirectDrawSurface7_Release
((
IDirectDrawSurface7
*
)
dest_level
);
dest_level
=
(
IDirectDrawSurfaceImpl
*
)
temp
;
dest_level
=
unsafe_impl_from_IDirectDrawSurface7
(
temp
)
;
}
ddsd
.
ddsCaps
.
dwCaps
=
DDSCAPS_TEXTURE
;
...
...
@@ -5976,7 +5976,7 @@ static void copy_mipmap_chain(IDirect3DDeviceImpl *device,
if
(
src_level
!=
src
)
IDirectDrawSurface7_Release
((
IDirectDrawSurface7
*
)
src_level
);
src_level
=
(
IDirectDrawSurfaceImpl
*
)
temp
;
src_level
=
unsafe_impl_from_IDirectDrawSurface7
(
temp
)
;
point
.
x
/=
2
;
point
.
y
/=
2
;
...
...
@@ -6025,8 +6025,8 @@ IDirect3DDeviceImpl_7_Load(IDirect3DDevice7 *iface,
DWORD
Flags
)
{
IDirect3DDeviceImpl
*
This
=
(
IDirect3DDeviceImpl
*
)
iface
;
IDirectDrawSurfaceImpl
*
dest
=
(
IDirectDrawSurfaceImpl
*
)
DestTex
;
IDirectDrawSurfaceImpl
*
src
=
(
IDirectDrawSurfaceImpl
*
)
SrcTex
;
IDirectDrawSurfaceImpl
*
dest
=
unsafe_impl_from_IDirectDrawSurface7
(
DestTex
)
;
IDirectDrawSurfaceImpl
*
src
=
unsafe_impl_from_IDirectDrawSurface7
(
SrcTex
)
;
POINT
destpoint
;
RECT
srcrect
;
...
...
@@ -6126,7 +6126,7 @@ IDirect3DDeviceImpl_7_Load(IDirect3DDevice7 *iface,
if
(
src_face
!=
src
)
IDirectDrawSurface7_Release
((
IDirectDrawSurface7
*
)
src_face
);
src_face
=
(
IDirectDrawSurfaceImpl
*
)
temp
;
src_face
=
unsafe_impl_from_IDirectDrawSurface7
(
temp
)
;
}
else
{
...
...
@@ -6144,7 +6144,7 @@ IDirect3DDeviceImpl_7_Load(IDirect3DDevice7 *iface,
if
(
dest_face
!=
dest
)
IDirectDrawSurface7_Release
((
IDirectDrawSurface7
*
)
dest_face
);
dest_face
=
(
IDirectDrawSurfaceImpl
*
)
temp
;
dest_face
=
unsafe_impl_from_IDirectDrawSurface7
(
temp
)
;
}
else
{
...
...
dlls/ddraw/surface.c
View file @
28ce1c00
...
...
@@ -740,7 +740,7 @@ static HRESULT WINAPI ddraw_surface3_Unlock(IDirectDrawSurface3 *iface, void *da
static
HRESULT
WINAPI
ddraw_surface7_Flip
(
IDirectDrawSurface7
*
iface
,
IDirectDrawSurface7
*
DestOverride
,
DWORD
Flags
)
{
IDirectDrawSurfaceImpl
*
This
=
(
IDirectDrawSurfaceImpl
*
)
iface
;
IDirectDrawSurfaceImpl
*
Override
=
(
IDirectDrawSurfaceImpl
*
)
DestOverride
;
IDirectDrawSurfaceImpl
*
Override
=
unsafe_impl_from_IDirectDrawSurface7
(
DestOverride
)
;
IDirectDrawSurface7
*
Override7
;
HRESULT
hr
;
...
...
@@ -810,7 +810,7 @@ static HRESULT WINAPI ddraw_surface7_Blt(IDirectDrawSurface7 *iface, RECT *DestR
IDirectDrawSurface7
*
SrcSurface
,
RECT
*
SrcRect
,
DWORD
Flags
,
DDBLTFX
*
DDBltFx
)
{
IDirectDrawSurfaceImpl
*
This
=
(
IDirectDrawSurfaceImpl
*
)
iface
;
IDirectDrawSurfaceImpl
*
Src
=
(
IDirectDrawSurfaceImpl
*
)
SrcSurface
;
IDirectDrawSurfaceImpl
*
Src
=
unsafe_impl_from_IDirectDrawSurface7
(
SrcSurface
)
;
HRESULT
hr
;
TRACE
(
"iface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p.
\n
"
,
...
...
@@ -973,7 +973,7 @@ static HRESULT ddraw_surface_attach_surface(IDirectDrawSurfaceImpl *This, IDirec
static
HRESULT
WINAPI
ddraw_surface7_AddAttachedSurface
(
IDirectDrawSurface7
*
iface
,
IDirectDrawSurface7
*
Attach
)
{
IDirectDrawSurfaceImpl
*
This
=
(
IDirectDrawSurfaceImpl
*
)
iface
;
IDirectDrawSurfaceImpl
*
Surf
=
(
IDirectDrawSurfaceImpl
*
)
Attach
;
IDirectDrawSurfaceImpl
*
Surf
=
unsafe_impl_from_IDirectDrawSurface7
(
Attach
)
;
TRACE
(
"iface %p, attachment %p.
\n
"
,
iface
,
Attach
);
...
...
@@ -1046,7 +1046,7 @@ static HRESULT WINAPI ddraw_surface7_DeleteAttachedSurface(IDirectDrawSurface7 *
DWORD
Flags
,
IDirectDrawSurface7
*
Attach
)
{
IDirectDrawSurfaceImpl
*
This
=
(
IDirectDrawSurfaceImpl
*
)
iface
;
IDirectDrawSurfaceImpl
*
Surf
=
(
IDirectDrawSurfaceImpl
*
)
Attach
;
IDirectDrawSurfaceImpl
*
Surf
=
unsafe_impl_from_IDirectDrawSurface7
(
Attach
)
;
IDirectDrawSurfaceImpl
*
Prev
=
This
;
TRACE
(
"iface %p, flags %#x, attachment %p.
\n
"
,
iface
,
Flags
,
Attach
);
...
...
@@ -2100,7 +2100,7 @@ static HRESULT WINAPI ddraw_surface7_UpdateOverlay(IDirectDrawSurface7 *iface, R
IDirectDrawSurface7
*
DstSurface
,
RECT
*
DstRect
,
DWORD
Flags
,
DDOVERLAYFX
*
FX
)
{
IDirectDrawSurfaceImpl
*
This
=
(
IDirectDrawSurfaceImpl
*
)
iface
;
IDirectDrawSurfaceImpl
*
Dst
=
(
IDirectDrawSurfaceImpl
*
)
DstSurface
;
IDirectDrawSurfaceImpl
*
Dst
=
unsafe_impl_from_IDirectDrawSurface7
(
DstSurface
)
;
HRESULT
hr
;
TRACE
(
"iface %p, src_rect %s, dst_surface %p, dst_rect %s, flags %#x, fx %p.
\n
"
,
...
...
@@ -2174,7 +2174,7 @@ static HRESULT WINAPI ddraw_surface7_UpdateOverlayZOrder(IDirectDrawSurface7 *if
DWORD
Flags
,
IDirectDrawSurface7
*
DDSRef
)
{
IDirectDrawSurfaceImpl
*
This
=
(
IDirectDrawSurfaceImpl
*
)
iface
;
IDirectDrawSurfaceImpl
*
Ref
=
(
IDirectDrawSurfaceImpl
*
)
DDSRef
;
IDirectDrawSurfaceImpl
*
Ref
=
unsafe_impl_from_IDirectDrawSurface7
(
DDSRef
)
;
HRESULT
hr
;
TRACE
(
"iface %p, flags %#x, reference %p.
\n
"
,
iface
,
Flags
,
DDSRef
);
...
...
@@ -2390,7 +2390,7 @@ static HRESULT WINAPI ddraw_surface7_BltFast(IDirectDrawSurface7 *iface, DWORD d
IDirectDrawSurface7
*
Source
,
RECT
*
rsrc
,
DWORD
trans
)
{
IDirectDrawSurfaceImpl
*
This
=
(
IDirectDrawSurfaceImpl
*
)
iface
;
IDirectDrawSurfaceImpl
*
src
=
(
IDirectDrawSurfaceImpl
*
)
Source
;
IDirectDrawSurfaceImpl
*
src
=
unsafe_impl_from_IDirectDrawSurface7
(
Source
)
;
DWORD
src_w
,
src_h
,
dst_w
,
dst_h
;
HRESULT
hr
;
...
...
@@ -3443,6 +3443,13 @@ static const struct IDirect3DTextureVtbl d3d_texture1_vtbl =
d3d_texture1_Unload
,
};
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface7
(
IDirectDrawSurface7
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
ddraw_surface7_vtbl
);
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
lpVtbl
);
}
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface3
(
IDirectDrawSurface3
*
iface
)
{
if
(
!
iface
)
return
NULL
;
...
...
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