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
a90b2ad0
Commit
a90b2ad0
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_IDirect3DDevice3 for application provided interfaces.
parent
d32df839
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
15 deletions
+23
-15
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
device.c
dlls/ddraw/device.c
+7
-0
material.c
dlls/ddraw/material.c
+7
-7
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+8
-8
No files found.
dlls/ddraw/ddraw_private.h
View file @
a90b2ad0
...
...
@@ -342,6 +342,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
;
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice3
(
IDirect3DDevice3
*
iface
)
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirectDrawClipper implementation structure
...
...
dlls/ddraw/device.c
View file @
a90b2ad0
...
...
@@ -6746,6 +6746,13 @@ static const struct IDirect3DDeviceVtbl d3d_device1_vtbl =
IDirect3DDeviceImpl_1_GetDirect3D
};
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice3
(
IDirect3DDevice3
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
d3d_device3_vtbl
);
return
CONTAINING_RECORD
(
iface
,
IDirect3DDeviceImpl
,
IDirect3DDevice3_vtbl
);
}
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice2
(
IDirect3DDevice2
*
iface
)
{
if
(
!
iface
)
return
NULL
;
...
...
dlls/ddraw/material.c
View file @
a90b2ad0
...
...
@@ -295,18 +295,18 @@ static HRESULT WINAPI IDirect3DMaterialImpl_GetMaterial(IDirect3DMaterial3 *ifac
*
*****************************************************************************/
static
HRESULT
WINAPI
IDirect3DMaterialImpl_GetHandle
(
IDirect3DMaterial3
*
iface
,
IDirect3DDevice3
*
lpDirect3DDevice3
,
D3DMATERIALHANDLE
*
lpH
andle
)
IDirect3DDevice3
*
device
,
D3DMATERIALHANDLE
*
h
andle
)
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial3
(
iface
);
IDirect3DDeviceImpl
*
device
=
device_from_device3
(
lpDirect3DDevice3
);
IDirect3DDeviceImpl
*
device
_impl
=
unsafe_impl_from_IDirect3DDevice3
(
device
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
lpDirect3DDevice3
,
lpH
andle
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
device
,
h
andle
);
EnterCriticalSection
(
&
ddraw_cs
);
This
->
active_device
=
device
;
This
->
active_device
=
device
_impl
;
if
(
!
This
->
Handle
)
{
DWORD
h
=
ddraw_allocate_handle
(
&
device
->
handle_table
,
This
,
DDRAW_HANDLE_MATERIAL
);
DWORD
h
=
ddraw_allocate_handle
(
&
device
_impl
->
handle_table
,
This
,
DDRAW_HANDLE_MATERIAL
);
if
(
h
==
DDRAW_INVALID_HANDLE
)
{
ERR
(
"Failed to allocate a material handle.
\n
"
);
...
...
@@ -316,8 +316,8 @@ static HRESULT WINAPI IDirect3DMaterialImpl_GetHandle(IDirect3DMaterial3 *iface,
This
->
Handle
=
h
+
1
;
}
*
lpH
andle
=
This
->
Handle
;
TRACE
(
" returning handle %08x.
\n
"
,
*
lpH
andle
);
*
h
andle
=
This
->
Handle
;
TRACE
(
" returning handle %08x.
\n
"
,
*
h
andle
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
D3D_OK
;
...
...
dlls/ddraw/vertexbuffer.c
View file @
a90b2ad0
...
...
@@ -351,17 +351,17 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexB
static
HRESULT
WINAPI
IDirect3DVertexBufferImpl_1_ProcessVertices
(
IDirect3DVertexBuffer
*
iface
,
DWORD
VertexOp
,
DWORD
DestIndex
,
DWORD
Count
,
IDirect3DVertexBuffer
*
SrcBuffer
,
DWORD
SrcIndex
,
IDirect3DDevice3
*
D3DD
evice
,
DWORD
Flags
)
DWORD
SrcIndex
,
IDirect3DDevice3
*
d
evice
,
DWORD
Flags
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer
(
iface
);
IDirect3DVertexBufferImpl
*
Src
=
unsafe_impl_from_IDirect3DVertexBuffer
(
SrcBuffer
);
IDirect3DDeviceImpl
*
D3D
=
D3DDevice
?
device_from_device3
(
D3DDevice
)
:
NULL
;
IDirect3DDeviceImpl
*
device_impl
=
unsafe_impl_from_IDirect3DDevice3
(
device
)
;
TRACE
(
"iface %p, vertex_op %#x, dst_idx %u, count %u, src_buffer %p, src_idx %u, device %p, flags %#x.
\n
"
,
iface
,
VertexOp
,
DestIndex
,
Count
,
SrcBuffer
,
SrcIndex
,
D3DD
evice
,
Flags
);
iface
,
VertexOp
,
DestIndex
,
Count
,
SrcBuffer
,
SrcIndex
,
d
evice
,
Flags
);
return
IDirect3DVertexBuffer7_ProcessVertices
(
&
This
->
IDirect3DVertexBuffer7_iface
,
VertexOp
,
DestIndex
,
Count
,
&
Src
->
IDirect3DVertexBuffer7_iface
,
SrcIndex
,
(
IDirect3DDevice7
*
)
D3D
,
DestIndex
,
Count
,
&
Src
->
IDirect3DVertexBuffer7_iface
,
SrcIndex
,
(
IDirect3DDevice7
*
)
device_impl
,
Flags
);
}
...
...
@@ -451,15 +451,15 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_Optimize(IDirect3DVertexBuffer7
}
static
HRESULT
WINAPI
IDirect3DVertexBufferImpl_1_Optimize
(
IDirect3DVertexBuffer
*
iface
,
IDirect3DDevice3
*
D3DD
evice
,
DWORD
Flags
)
IDirect3DDevice3
*
d
evice
,
DWORD
Flags
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer
(
iface
);
IDirect3DDeviceImpl
*
D3D
=
D3DDevice
?
device_from_device3
(
D3DDevice
)
:
NULL
;
IDirect3DDeviceImpl
*
device_impl
=
unsafe_impl_from_IDirect3DDevice3
(
device
)
;
TRACE
(
"iface %p, device %p, flags %#x.
\n
"
,
iface
,
D3DD
evice
,
Flags
);
TRACE
(
"iface %p, device %p, flags %#x.
\n
"
,
iface
,
d
evice
,
Flags
);
return
IDirect3DVertexBuffer7_Optimize
(
&
This
->
IDirect3DVertexBuffer7_iface
,
(
IDirect3DDevice7
*
)
D3D
,
Flags
);
(
IDirect3DDevice7
*
)
device_impl
,
Flags
);
}
/*****************************************************************************
...
...
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