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
31cf68dd
Commit
31cf68dd
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_IDirect3DDevice7 for application provided interfaces.
parent
6b7e3e77
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
9 deletions
+17
-9
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
device.c
dlls/ddraw/device.c
+7
-0
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+9
-9
No files found.
dlls/ddraw/ddraw_private.h
View file @
31cf68dd
...
...
@@ -343,6 +343,7 @@ static inline IDirect3DDeviceImpl *impl_from_IDirect3DDevice3(IDirect3DDevice3 *
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
;
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice7
(
IDirect3DDevice7
*
iface
)
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirectDrawClipper implementation structure
...
...
dlls/ddraw/device.c
View file @
31cf68dd
...
...
@@ -6770,6 +6770,13 @@ static const struct IDirect3DDeviceVtbl d3d_device1_vtbl =
IDirect3DDeviceImpl_1_GetDirect3D
};
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice7
(
IDirect3DDevice7
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
((
iface
->
lpVtbl
==
&
d3d_device7_fpu_preserve_vtbl
)
||
(
iface
->
lpVtbl
==
&
d3d_device7_fpu_setup_vtbl
));
return
CONTAINING_RECORD
(
iface
,
IDirect3DDeviceImpl
,
lpVtbl
);
}
IDirect3DDeviceImpl
*
unsafe_impl_from_IDirect3DDevice3
(
IDirect3DDevice3
*
iface
)
{
if
(
!
iface
)
return
NULL
;
...
...
dlls/ddraw/vertexbuffer.c
View file @
31cf68dd
...
...
@@ -303,16 +303,16 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_1_Unlock(IDirect3DVertexBuffer *
*****************************************************************************/
static
HRESULT
WINAPI
IDirect3DVertexBufferImpl_ProcessVertices
(
IDirect3DVertexBuffer7
*
iface
,
DWORD
VertexOp
,
DWORD
DestIndex
,
DWORD
Count
,
IDirect3DVertexBuffer7
*
SrcBuffer
,
DWORD
SrcIndex
,
IDirect3DDevice7
*
D3DD
evice
,
DWORD
Flags
)
DWORD
SrcIndex
,
IDirect3DDevice7
*
d
evice
,
DWORD
Flags
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer7
(
iface
);
IDirect3DVertexBufferImpl
*
Src
=
unsafe_impl_from_IDirect3DVertexBuffer7
(
SrcBuffer
);
IDirect3DDeviceImpl
*
D3D
=
(
IDirect3DDeviceImpl
*
)
D3DDevice
;
IDirect3DDeviceImpl
*
device_impl
=
unsafe_impl_from_IDirect3DDevice7
(
device
)
;
BOOL
oldClip
,
doClip
;
HRESULT
hr
;
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
);
/* Vertex operations:
* D3DVOP_CLIP: Clips vertices outside the viewing frustrum. Needs clipping information
...
...
@@ -332,19 +332,19 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexB
* the vertex ops
*/
doClip
=
VertexOp
&
D3DVOP_CLIP
?
TRUE
:
FALSE
;
wined3d_device_get_render_state
(
D3D
->
wined3d_device
,
WINED3DRS_CLIPPING
,
(
DWORD
*
)
&
oldClip
);
wined3d_device_get_render_state
(
device_impl
->
wined3d_device
,
WINED3DRS_CLIPPING
,
(
DWORD
*
)
&
oldClip
);
if
(
doClip
!=
oldClip
)
wined3d_device_set_render_state
(
D3D
->
wined3d_device
,
WINED3DRS_CLIPPING
,
doClip
);
wined3d_device_set_render_state
(
device_impl
->
wined3d_device
,
WINED3DRS_CLIPPING
,
doClip
);
wined3d_device_set_stream_source
(
D3D
->
wined3d_device
,
wined3d_device_set_stream_source
(
device_impl
->
wined3d_device
,
0
,
Src
->
wineD3DVertexBuffer
,
0
,
get_flexible_vertex_size
(
Src
->
fvf
));
wined3d_device_set_vertex_declaration
(
D3D
->
wined3d_device
,
Src
->
wineD3DVertexDeclaration
);
hr
=
wined3d_device_process_vertices
(
D3D
->
wined3d_device
,
SrcIndex
,
DestIndex
,
wined3d_device_set_vertex_declaration
(
device_impl
->
wined3d_device
,
Src
->
wineD3DVertexDeclaration
);
hr
=
wined3d_device_process_vertices
(
device_impl
->
wined3d_device
,
SrcIndex
,
DestIndex
,
Count
,
This
->
wineD3DVertexBuffer
,
NULL
,
Flags
,
This
->
fvf
);
/* Restore the states if needed */
if
(
doClip
!=
oldClip
)
wined3d_device_set_render_state
(
D3D
->
wined3d_device
,
WINED3DRS_CLIPPING
,
oldClip
);
wined3d_device_set_render_state
(
device_impl
->
wined3d_device
,
WINED3DRS_CLIPPING
,
oldClip
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
hr
;
}
...
...
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