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
cb1248da
Commit
cb1248da
authored
Aug 17, 2012
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Aug 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddrawex: Use unsafe_impl_from_IDirectDrawSurface4() for application provided ifaces.
parent
5a5de655
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
11 deletions
+19
-11
ddrawex_private.h
dlls/ddrawex/ddrawex_private.h
+1
-0
surface.c
dlls/ddrawex/surface.c
+18
-11
No files found.
dlls/ddrawex/ddrawex_private.h
View file @
cb1248da
...
...
@@ -89,6 +89,7 @@ typedef struct
}
IDirectDrawSurfaceImpl
;
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface4
(
IDirectDrawSurface4
*
iface
)
DECLSPEC_HIDDEN
;
IDirectDrawSurface4
*
dds_get_outer
(
IDirectDrawSurface4
*
inner
)
DECLSPEC_HIDDEN
;
IDirectDrawSurface4
*
dds_get_inner
(
IDirectDrawSurface4
*
outer
)
DECLSPEC_HIDDEN
;
HRESULT
prepare_permanent_dc
(
IDirectDrawSurface4
*
iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/ddrawex/surface.c
View file @
cb1248da
...
...
@@ -161,7 +161,7 @@ IDirectDrawSurface4Impl_AddAttachedSurface(IDirectDrawSurface4 *iface,
IDirectDrawSurface4
*
Attach_iface
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds4
(
iface
);
IDirectDrawSurfaceImpl
*
attach
=
impl_from_dds
4
(
Attach_iface
);
IDirectDrawSurfaceImpl
*
attach
=
unsafe_impl_from_IDirectDrawSurface
4
(
Attach_iface
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
attach
);
return
IDirectDrawSurface4_AddAttachedSurface
(
This
->
parent
,
attach
->
parent
);
}
...
...
@@ -201,7 +201,7 @@ IDirectDrawSurface4Impl_Blt(IDirectDrawSurface4 *iface,
DDBLTFX
*
DDBltFx
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds4
(
iface
);
IDirectDrawSurfaceImpl
*
Src
=
impl_from_dds
4
(
SrcSurface
);
IDirectDrawSurfaceImpl
*
Src
=
unsafe_impl_from_IDirectDrawSurface
4
(
SrcSurface
);
TRACE
(
"(%p)->(%p,%p,%p,0x%08x,%p)
\n
"
,
This
,
DestRect
,
Src
,
SrcRect
,
Flags
,
DDBltFx
);
return
IDirectDrawSurface4_Blt
(
This
->
parent
,
DestRect
,
Src
?
Src
->
parent
:
NULL
,
SrcRect
,
Flags
,
DDBltFx
);
...
...
@@ -245,7 +245,7 @@ IDirectDrawSurface4Impl_BltFast(IDirectDrawSurface4 *iface,
DWORD
trans
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds4
(
iface
);
IDirectDrawSurfaceImpl
*
Src
=
impl_from_dds
4
(
Source
);
IDirectDrawSurfaceImpl
*
Src
=
unsafe_impl_from_IDirectDrawSurface
4
(
Source
);
TRACE
(
"(%p)->(%u,%u,%p,%p,0x%08x)
\n
"
,
This
,
dstx
,
dsty
,
Src
,
rsrc
,
trans
);
return
IDirectDrawSurface4_BltFast
(
This
->
parent
,
dstx
,
dsty
,
Src
?
Src
->
parent
:
NULL
,
rsrc
,
trans
);
...
...
@@ -267,7 +267,7 @@ IDirectDrawSurface4Impl_DeleteAttachedSurface(IDirectDrawSurface4 *iface,
IDirectDrawSurface4
*
Attach
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds4
(
iface
);
IDirectDrawSurfaceImpl
*
Att
=
impl_from_dds
4
(
Attach
);
IDirectDrawSurfaceImpl
*
Att
=
unsafe_impl_from_IDirectDrawSurface
4
(
Attach
);
TRACE
(
"(%p)->(0x%08x,%p)
\n
"
,
This
,
Flags
,
Att
);
return
IDirectDrawSurface4_DeleteAttachedSurface
(
This
->
parent
,
Flags
,
Att
?
Att
->
parent
:
NULL
);
...
...
@@ -321,10 +321,10 @@ struct enumsurfaces_thunk
void
*
orig_ctx
;
};
static
HRESULT
WINAPI
enumsurfaces_thunk_cb
(
IDirectDrawSurface4
*
surf
,
DDSURFACEDESC2
*
desc2
,
void
*
vctx
)
static
HRESULT
WINAPI
enumsurfaces_thunk_cb
(
IDirectDrawSurface4
*
surf
,
DDSURFACEDESC2
*
desc2
,
void
*
vctx
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds
4
(
surf
);
IDirectDrawSurfaceImpl
*
This
=
unsafe_impl_from_IDirectDrawSurface
4
(
surf
);
struct
enumsurfaces_thunk
*
ctx
=
vctx
;
DDSURFACEDESC
desc
;
...
...
@@ -381,7 +381,7 @@ IDirectDrawSurface4Impl_Flip(IDirectDrawSurface4 *iface,
DWORD
Flags
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds4
(
iface
);
IDirectDrawSurfaceImpl
*
Dest
=
impl_from_dds
4
(
DestOverride
);
IDirectDrawSurfaceImpl
*
Dest
=
unsafe_impl_from_IDirectDrawSurface
4
(
DestOverride
);
TRACE
(
"(%p)->(%p,0x%08x)
\n
"
,
This
,
Dest
,
Flags
);
return
IDirectDrawSurface4_Flip
(
This
->
parent
,
Dest
?
Dest
->
parent
:
NULL
,
Flags
);
}
...
...
@@ -858,7 +858,7 @@ IDirectDrawSurface4Impl_UpdateOverlay(IDirectDrawSurface4 *iface,
LPDDOVERLAYFX
FX
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds4
(
iface
);
IDirectDrawSurfaceImpl
*
Dst
=
impl_from_dds
4
(
DstSurface
);
IDirectDrawSurfaceImpl
*
Dst
=
unsafe_impl_from_IDirectDrawSurface
4
(
DstSurface
);
TRACE
(
"(%p)->(%p,%p,%p,0x%08x,%p)
\n
"
,
This
,
SrcRect
,
Dst
,
DstRect
,
Flags
,
FX
);
return
IDirectDrawSurface4_UpdateOverlay
(
This
->
parent
,
SrcRect
,
Dst
?
Dst
->
parent
:
NULL
,
DstRect
,
Flags
,
FX
);
...
...
@@ -898,7 +898,7 @@ IDirectDrawSurface4Impl_UpdateOverlayZOrder(IDirectDrawSurface4 *iface,
IDirectDrawSurface4
*
DDSRef
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds4
(
iface
);
IDirectDrawSurfaceImpl
*
Ref
=
impl_from_dds
4
(
DDSRef
);
IDirectDrawSurfaceImpl
*
Ref
=
unsafe_impl_from_IDirectDrawSurface
4
(
DDSRef
);
TRACE
(
"(%p)->(0x%08x,%p)
\n
"
,
This
,
Flags
,
Ref
);
return
IDirectDrawSurface4_UpdateOverlayZOrder
(
This
->
parent
,
Flags
,
Ref
?
Ref
->
parent
:
NULL
);
}
...
...
@@ -1164,6 +1164,13 @@ static IDirectDrawSurfaceImpl *unsafe_impl_from_IDirectDrawSurface3(IDirectDrawS
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
IDirectDrawSurface3_iface
);
}
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface4
(
IDirectDrawSurface4
*
iface
)
{
if
(
!
iface
)
return
NULL
;
if
(
iface
->
lpVtbl
!=
&
IDirectDrawSurface4_Vtbl
)
return
NULL
;
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
IDirectDrawSurface4_Vtbl
);
}
/* dds_get_outer
*
* Given a surface from ddraw.dll it retrieves the pointer to the ddrawex.dll wrapper around it
...
...
@@ -1222,7 +1229,7 @@ IDirectDrawSurface4 *dds_get_inner(IDirectDrawSurface4 *outer)
HRESULT
prepare_permanent_dc
(
IDirectDrawSurface4
*
iface
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds
4
(
iface
);
IDirectDrawSurfaceImpl
*
This
=
unsafe_impl_from_IDirectDrawSurface
4
(
iface
);
HRESULT
hr
;
This
->
permanent_dc
=
TRUE
;
...
...
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