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
a870753d
Commit
a870753d
authored
Oct 17, 2011
by
Ričardas Barkauskas
Committed by
Alexandre Julliard
Oct 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use unsafe_impl_from_IDirect3DDevice2 for application provided interfaces.
parent
d5912c53
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
5 deletions
+15
-5
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
device.c
dlls/ddraw/device.c
+7
-0
material.c
dlls/ddraw/material.c
+5
-4
surface.c
dlls/ddraw/surface.c
+2
-1
No files found.
dlls/ddraw/ddraw_private.h
View file @
a870753d
...
...
@@ -341,6 +341,7 @@ static inline IDirect3DDeviceImpl *device_from_device3(IDirect3DDevice3 *iface)
}
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice
(
IDirect3DDevice
*
iface
)
DECLSPEC_HIDDEN
;
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice2
(
IDirect3DDevice2
*
iface
)
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirectDrawClipper implementation structure
...
...
dlls/ddraw/device.c
View file @
a870753d
...
...
@@ -6737,6 +6737,13 @@ static const struct IDirect3DDeviceVtbl d3d_device1_vtbl =
IDirect3DDeviceImpl_1_GetDirect3D
};
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice2
(
IDirect3DDevice2
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
d3d_device2_vtbl
);
return
CONTAINING_RECORD
(
iface
,
IDirect3DDeviceImpl
,
IDirect3DDevice2_vtbl
);
}
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice
(
IDirect3DDevice
*
iface
)
{
if
(
!
iface
)
return
NULL
;
...
...
dlls/ddraw/material.c
View file @
a870753d
...
...
@@ -324,14 +324,15 @@ static HRESULT WINAPI IDirect3DMaterialImpl_GetHandle(IDirect3DMaterial3 *iface,
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_GetHandle
(
IDirect3DMaterial2
*
iface
,
IDirect3DDevice2
*
lpDirect3DDevice2
,
D3DMATERIALHANDLE
*
lpH
andle
)
IDirect3DDevice2
*
device
,
D3DMATERIALHANDLE
*
h
andle
)
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial2
(
iface
);
IDirect3DDeviceImpl
*
device_impl
=
unsafe_impl_from_IDirect3DDevice2
(
device
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
lpDirect3DDevice2
,
lpH
andle
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
device
,
h
andle
);
return
IDirect3DMaterial3_GetHandle
(
&
This
->
IDirect3DMaterial3_iface
,
lpDirect3DDevice2
?
(
IDirect3DDevice3
*
)
&
device_
from_device2
(
lpDirect3DDevice2
)
->
IDirect3DDevice3_vtbl
:
NULL
,
lpH
andle
);
return
IDirect3DMaterial3_GetHandle
(
&
This
->
IDirect3DMaterial3_iface
,
device_impl
?
(
IDirect3DDevice3
*
)
&
device_
impl
->
IDirect3DDevice3_vtbl
:
NULL
,
h
andle
);
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_GetHandle
(
IDirect3DMaterial
*
iface
,
...
...
dlls/ddraw/surface.c
View file @
a870753d
...
...
@@ -4521,6 +4521,7 @@ static HRESULT WINAPI d3d_texture2_GetHandle(IDirect3DTexture2 *iface,
IDirect3DDevice2
*
device
,
D3DTEXTUREHANDLE
*
handle
)
{
IDirectDrawSurfaceImpl
*
surface
=
impl_from_IDirect3DTexture2
(
iface
);
IDirect3DDeviceImpl
*
device_impl
=
unsafe_impl_from_IDirect3DDevice2
(
device
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
device
,
handle
);
...
...
@@ -4528,7 +4529,7 @@ static HRESULT WINAPI d3d_texture2_GetHandle(IDirect3DTexture2 *iface,
if
(
!
surface
->
Handle
)
{
DWORD
h
=
ddraw_allocate_handle
(
&
device_
from_device2
(
device
)
->
handle_table
,
surface
,
DDRAW_HANDLE_SURFACE
);
DWORD
h
=
ddraw_allocate_handle
(
&
device_
impl
->
handle_table
,
surface
,
DDRAW_HANDLE_SURFACE
);
if
(
h
==
DDRAW_INVALID_HANDLE
)
{
ERR
(
"Failed to allocate a texture handle.
\n
"
);
...
...
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