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
6b7e3e77
Commit
6b7e3e77
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: COM cleanup for IDirect3DDevice3 interface.
parent
bd530d3a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
35 deletions
+40
-35
ddraw.c
dlls/ddraw/ddraw.c
+8
-3
ddraw_private.h
dlls/ddraw/ddraw_private.h
+2
-2
device.c
dlls/ddraw/device.c
+24
-24
material.c
dlls/ddraw/material.c
+2
-2
viewport.c
dlls/ddraw/viewport.c
+4
-4
No files found.
dlls/ddraw/ddraw.c
View file @
6b7e3e77
...
...
@@ -4339,6 +4339,8 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
{
IDirectDrawImpl
*
This
=
impl_from_IDirect3D3
(
iface
);
IDirectDrawSurfaceImpl
*
surface_impl
=
unsafe_impl_from_IDirectDrawSurface4
(
surface
);
IDirect3DDevice7
*
device7
;
IDirect3DDeviceImpl
*
device_impl
;
HRESULT
hr
;
TRACE
(
"iface %p, riid %s, surface %p, device %p, outer_unknown %p.
\n
"
,
...
...
@@ -4347,9 +4349,12 @@ static HRESULT WINAPI d3d3_CreateDevice(IDirect3D3 *iface, REFCLSID riid,
if
(
outer_unknown
)
return
CLASS_E_NOAGGREGATION
;
hr
=
d3d7_CreateDevice
(
&
This
->
IDirect3D7_iface
,
riid
,
surface_impl
?
&
surface_impl
->
IDirectDrawSurface7_iface
:
NULL
,
(
IDirect3DDevice7
**
)
device
);
if
(
*
device
)
*
device
=
(
IDirect3DDevice3
*
)
&
((
IDirect3DDeviceImpl
*
)
*
device
)
->
IDirect3DDevice3_vtbl
;
surface_impl
?
&
surface_impl
->
IDirectDrawSurface7_iface
:
NULL
,
device
?
&
device7
:
NULL
);
if
(
SUCCEEDED
(
hr
))
{
device_impl
=
(
IDirect3DDeviceImpl
*
)
device7
;
*
device
=
&
device_impl
->
IDirect3DDevice3_iface
;
}
return
hr
;
}
...
...
dlls/ddraw/ddraw_private.h
View file @
6b7e3e77
...
...
@@ -278,7 +278,7 @@ struct IDirect3DDeviceImpl
{
/* IUnknown */
const
IDirect3DDevice7Vtbl
*
lpVtbl
;
const
IDirect3DDevice3Vtbl
*
IDirect3DDevice3_vtbl
;
IDirect3DDevice3
IDirect3DDevice3_iface
;
IDirect3DDevice2
IDirect3DDevice2_iface
;
IDirect3DDevice
IDirect3DDevice_iface
;
LONG
ref
;
...
...
@@ -337,7 +337,7 @@ static inline IDirect3DDeviceImpl *impl_from_IDirect3DDevice2(IDirect3DDevice2 *
static
inline
IDirect3DDeviceImpl
*
impl_from_IDirect3DDevice3
(
IDirect3DDevice3
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DDeviceImpl
,
IDirect3DDevice3_
vtbl
);
return
CONTAINING_RECORD
(
iface
,
IDirect3DDeviceImpl
,
IDirect3DDevice3_
iface
);
}
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice
(
IDirect3DDevice
*
iface
)
DECLSPEC_HIDDEN
;
...
...
dlls/ddraw/device.c
View file @
6b7e3e77
This diff is collapsed.
Click to expand it.
dlls/ddraw/material.c
View file @
6b7e3e77
...
...
@@ -332,7 +332,7 @@ static HRESULT WINAPI IDirect3DMaterialImpl_2_GetHandle(IDirect3DMaterial2 *ifac
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
device
,
handle
);
return
IDirect3DMaterial3_GetHandle
(
&
This
->
IDirect3DMaterial3_iface
,
device_impl
?
(
IDirect3DDevice3
*
)
&
device_impl
->
IDirect3DDevice3_vtbl
:
NULL
,
handle
);
&
device_impl
->
IDirect3DDevice3_iface
:
NULL
,
handle
);
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_GetHandle
(
IDirect3DMaterial
*
iface
,
...
...
@@ -344,7 +344,7 @@ static HRESULT WINAPI IDirect3DMaterialImpl_1_GetHandle(IDirect3DMaterial *iface
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
device
,
handle
);
return
IDirect3DMaterial3_GetHandle
(
&
This
->
IDirect3DMaterial3_iface
,
device_impl
?
(
IDirect3DDevice3
*
)
&
device_impl
->
IDirect3DDevice3_vtbl
:
NULL
,
handle
);
&
device_impl
->
IDirect3DDevice3_iface
:
NULL
,
handle
);
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_QueryInterface
(
IDirect3DMaterial2
*
iface
,
REFIID
riid
,
...
...
dlls/ddraw/viewport.c
View file @
6b7e3e77
...
...
@@ -316,7 +316,7 @@ IDirect3DViewportImpl_SetViewport(IDirect3DViewport3 *iface,
This
->
viewports
.
vp1
.
dvMaxZ
=
1
.
0
;
if
(
This
->
active_device
)
{
IDirect3DDevice3
*
d3d_device3
=
(
IDirect3DDevice3
*
)
&
This
->
active_device
->
IDirect3DDevice3_vtbl
;
IDirect3DDevice3
*
d3d_device3
=
&
This
->
active_device
->
IDirect3DDevice3_iface
;
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
);
if
(
current_viewport
)
{
...
...
@@ -672,7 +672,7 @@ static HRESULT WINAPI IDirect3DViewportImpl_Clear(IDirect3DViewport3 *iface,
ERR
(
" Trying to clear a viewport not attached to a device !
\n
"
);
return
D3DERR_VIEWPORTHASNODEVICE
;
}
d3d_device3
=
(
IDirect3DDevice3
*
)
&
This
->
active_device
->
IDirect3DDevice3_vtbl
;
d3d_device3
=
&
This
->
active_device
->
IDirect3DDevice3_iface
;
EnterCriticalSection
(
&
ddraw_cs
);
if
(
dwFlags
&
D3DCLEAR_TARGET
)
{
...
...
@@ -970,7 +970,7 @@ IDirect3DViewportImpl_SetViewport2(IDirect3DViewport3 *iface,
memcpy
(
&
(
This
->
viewports
.
vp2
),
lpData
,
lpData
->
dwSize
);
if
(
This
->
active_device
)
{
IDirect3DDevice3
*
d3d_device3
=
(
IDirect3DDevice3
*
)
&
This
->
active_device
->
IDirect3DDevice3_vtbl
;
IDirect3DDevice3
*
d3d_device3
=
&
This
->
active_device
->
IDirect3DDevice3_iface
;
IDirect3DDevice3_GetCurrentViewport
(
d3d_device3
,
&
current_viewport
);
if
(
current_viewport
)
{
...
...
@@ -1070,7 +1070,7 @@ IDirect3DViewportImpl_Clear2(IDirect3DViewport3 *iface,
LeaveCriticalSection
(
&
ddraw_cs
);
return
D3DERR_VIEWPORTHASNODEVICE
;
}
d3d_device3
=
(
IDirect3DDevice3
*
)
&
This
->
active_device
->
IDirect3DDevice3_vtbl
;
d3d_device3
=
&
This
->
active_device
->
IDirect3DDevice3_iface
;
/* Need to temporarily activate viewport to clear it. Previously active
* one will be restored afterwards. */
viewport_activate
(
This
,
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