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
1cce3d68
Commit
1cce3d68
authored
Jan 25, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddrawex: Use unsafe_impl_from_IDirectDrawSurface3() for application provided ifaces.
parent
05ff15a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
surface.c
dlls/ddrawex/surface.c
+17
-8
No files found.
dlls/ddrawex/surface.c
View file @
1cce3d68
...
...
@@ -35,9 +35,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddrawex);
******************************************************************************/
static
IDirectDrawSurfaceImpl
*
impl_from_dds3
(
IDirectDrawSurface3
*
iface
)
{
if
(
!
iface
)
return
NULL
;
return
(
IDirectDrawSurfaceImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
IDirectDrawSurfaceImpl
,
IDirectDrawSurface3_Vtbl
));
}
static
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface3
(
IDirectDrawSurface3
*
iface
);
static
IDirectDrawSurface3
*
dds3_from_impl
(
IDirectDrawSurfaceImpl
*
This
)
{
if
(
!
This
)
return
NULL
;
...
...
@@ -179,7 +181,7 @@ IDirectDrawSurface3Impl_AddAttachedSurface(IDirectDrawSurface3 *iface,
IDirectDrawSurface3
*
Attach_iface
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds3
(
iface
);
IDirectDrawSurfaceImpl
*
attach
=
impl_from_dds
3
(
Attach_iface
);
IDirectDrawSurfaceImpl
*
attach
=
unsafe_impl_from_IDirectDrawSurface
3
(
Attach_iface
);
TRACE
(
"(%p)->(%p): Thunking to IDirectDrawSurface4
\n
"
,
This
,
attach
);
return
IDirectDrawSurface4_AddAttachedSurface
(
dds4_from_impl
(
This
),
dds4_from_impl
(
attach
));
}
...
...
@@ -226,7 +228,7 @@ IDirectDrawSurface3Impl_Blt(IDirectDrawSurface3 *iface,
DDBLTFX
*
DDBltFx
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds3
(
iface
);
IDirectDrawSurfaceImpl
*
Src
=
impl_from_dds
3
(
SrcSurface
);
IDirectDrawSurfaceImpl
*
Src
=
unsafe_impl_from_IDirectDrawSurface
3
(
SrcSurface
);
TRACE
(
"(%p)->(%p,%p,%p,0x%08x,%p): Thunking to IDirectDrawSurface4
\n
"
,
This
,
DestRect
,
Src
,
SrcRect
,
Flags
,
DDBltFx
);
return
IDirectDrawSurface4_Blt
(
dds4_from_impl
(
This
),
DestRect
,
dds4_from_impl
(
Src
),
SrcRect
,
Flags
,
DDBltFx
);
...
...
@@ -278,7 +280,7 @@ IDirectDrawSurface3Impl_BltFast(IDirectDrawSurface3 *iface,
DWORD
trans
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds3
(
iface
);
IDirectDrawSurfaceImpl
*
Src
=
impl_from_dds
3
(
Source
);
IDirectDrawSurfaceImpl
*
Src
=
unsafe_impl_from_IDirectDrawSurface
3
(
Source
);
TRACE
(
"(%p)->(%u,%u,%p,%p,0x%08x): Thunking to IDirectDrawSurface4
\n
"
,
This
,
dstx
,
dsty
,
Src
,
rsrc
,
trans
);
return
IDirectDrawSurface4_BltFast
(
dds4_from_impl
(
This
),
dstx
,
dsty
,
dds4_from_impl
(
Src
),
rsrc
,
trans
);
...
...
@@ -302,7 +304,7 @@ IDirectDrawSurface3Impl_DeleteAttachedSurface(IDirectDrawSurface3 *iface,
IDirectDrawSurface3
*
Attach
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds3
(
iface
);
IDirectDrawSurfaceImpl
*
Att
=
impl_from_dds
3
(
Attach
);
IDirectDrawSurfaceImpl
*
Att
=
unsafe_impl_from_IDirectDrawSurface
3
(
Attach
);
TRACE
(
"(%p)->(0x%08x,%p): Thunking to IDirectDrawSurface4
\n
"
,
This
,
Flags
,
Att
);
return
IDirectDrawSurface4_DeleteAttachedSurface
(
dds4_from_impl
(
This
),
Flags
,
dds4_from_impl
(
Att
));
...
...
@@ -421,7 +423,7 @@ IDirectDrawSurface3Impl_Flip(IDirectDrawSurface3 *iface,
DWORD
Flags
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds3
(
iface
);
IDirectDrawSurfaceImpl
*
Dest
=
impl_from_dds
3
(
DestOverride
);
IDirectDrawSurfaceImpl
*
Dest
=
unsafe_impl_from_IDirectDrawSurface
3
(
DestOverride
);
TRACE
(
"(%p)->(%p,0x%08x): Thunking to IDirectDrawSurface4
\n
"
,
This
,
Dest
,
Flags
);
return
IDirectDrawSurface4_Flip
(
dds4_from_impl
(
This
),
dds4_from_impl
(
Dest
),
Flags
);
}
...
...
@@ -940,7 +942,7 @@ IDirectDrawSurface3Impl_UpdateOverlay(IDirectDrawSurface3 *iface,
LPDDOVERLAYFX
FX
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds3
(
iface
);
IDirectDrawSurfaceImpl
*
Dst
=
impl_from_dds
3
(
DstSurface
);
IDirectDrawSurfaceImpl
*
Dst
=
unsafe_impl_from_IDirectDrawSurface
3
(
DstSurface
);
TRACE
(
"(%p)->(%p,%p,%p,0x%08x,%p): Thunking to IDirectDrawSurface4
\n
"
,
This
,
SrcRect
,
Dst
,
DstRect
,
Flags
,
FX
);
return
IDirectDrawSurface4_UpdateOverlay
(
dds4_from_impl
(
This
),
SrcRect
,
dds4_from_impl
(
Dst
),
DstRect
,
Flags
,
FX
);
...
...
@@ -981,7 +983,7 @@ IDirectDrawSurface3Impl_UpdateOverlayZOrder(IDirectDrawSurface3 *iface,
IDirectDrawSurface3
*
DDSRef
)
{
IDirectDrawSurfaceImpl
*
This
=
impl_from_dds3
(
iface
);
IDirectDrawSurfaceImpl
*
Ref
=
impl_from_dds
3
(
DDSRef
);
IDirectDrawSurfaceImpl
*
Ref
=
unsafe_impl_from_IDirectDrawSurface
3
(
DDSRef
);
TRACE
(
"(%p)->(0x%08x,%p): Thunking to IDirectDrawSurface4
\n
"
,
This
,
Flags
,
Ref
);
return
IDirectDrawSurface4_UpdateOverlayZOrder
(
dds4_from_impl
(
This
),
Flags
,
dds4_from_impl
(
Ref
));
}
...
...
@@ -1239,6 +1241,13 @@ const IDirectDrawSurface4Vtbl IDirectDrawSurface4_Vtbl =
IDirectDrawSurface4Impl_ChangeUniquenessValue
,
};
static
IDirectDrawSurfaceImpl
*
unsafe_impl_from_IDirectDrawSurface3
(
IDirectDrawSurface3
*
iface
)
{
if
(
!
iface
)
return
NULL
;
if
(
iface
->
lpVtbl
!=
&
IDirectDrawSurface3_Vtbl
)
return
NULL
;
return
CONTAINING_RECORD
(
iface
,
IDirectDrawSurfaceImpl
,
IDirectDrawSurface3_Vtbl
);
}
/* dds_get_outer
*
* Given a surface from ddraw.dll it retrieves the pointer to the ddrawex.dll wrapper around 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