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
8e272741
Commit
8e272741
authored
Jun 15, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use unsafe_impl_from_IDirect3DVertexBuffer() for app provided ifaces.
parent
ca1ee4a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
16 deletions
+30
-16
ddraw_private.h
dlls/ddraw/ddraw_private.h
+2
-0
device.c
dlls/ddraw/device.c
+5
-5
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+23
-11
No files found.
dlls/ddraw/ddraw_private.h
View file @
8e272741
...
...
@@ -536,6 +536,8 @@ struct IDirect3DVertexBufferImpl
HRESULT
d3d_vertex_buffer_create
(
IDirect3DVertexBufferImpl
**
vertex_buf
,
IDirectDrawImpl
*
ddraw
,
D3DVERTEXBUFFERDESC
*
desc
)
DECLSPEC_HIDDEN
;
IDirect3DVertexBufferImpl
*
unsafe_impl_from_IDirect3DVertexBuffer
(
IDirect3DVertexBuffer
*
iface
)
DECLSPEC_HIDDEN
;
IDirect3DVertexBufferImpl
*
unsafe_impl_from_IDirect3DVertexBuffer7
(
IDirect3DVertexBuffer7
*
iface
)
DECLSPEC_HIDDEN
;
static
inline
IDirect3DVertexBufferImpl
*
vb_from_vb1
(
IDirect3DVertexBuffer
*
iface
)
{
...
...
dlls/ddraw/device.c
View file @
8e272741
...
...
@@ -4053,7 +4053,7 @@ IDirect3DDeviceImpl_7_DrawPrimitiveVB(IDirect3DDevice7 *iface,
DWORD
Flags
)
{
IDirect3DDeviceImpl
*
This
=
(
IDirect3DDeviceImpl
*
)
iface
;
IDirect3DVertexBufferImpl
*
vb
=
(
IDirect3DVertexBufferImpl
*
)
D3DVertexBuf
;
IDirect3DVertexBufferImpl
*
vb
=
unsafe_impl_from_IDirect3DVertexBuffer7
(
D3DVertexBuf
)
;
HRESULT
hr
;
DWORD
stride
;
...
...
@@ -4126,7 +4126,7 @@ static HRESULT WINAPI IDirect3DDeviceImpl_3_DrawPrimitiveVB(IDirect3DDevice3 *if
D3DPRIMITIVETYPE
PrimitiveType
,
IDirect3DVertexBuffer
*
D3DVertexBuf
,
DWORD
StartVertex
,
DWORD
NumVertices
,
DWORD
Flags
)
{
IDirect3DVertexBufferImpl
*
vb
=
D3DVertexBuf
?
vb_from_vb1
(
D3DVertexBuf
)
:
NULL
;
IDirect3DVertexBufferImpl
*
vb
=
unsafe_impl_from_IDirect3DVertexBuffer
(
D3DVertexBuf
)
;
TRACE
(
"iface %p, primitive_type %#x, vb %p, start_vertex %u, vertex_count %u, flags %#x.
\n
"
,
iface
,
PrimitiveType
,
D3DVertexBuf
,
StartVertex
,
NumVertices
,
Flags
);
...
...
@@ -4164,7 +4164,7 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
DWORD
Flags
)
{
IDirect3DDeviceImpl
*
This
=
(
IDirect3DDeviceImpl
*
)
iface
;
IDirect3DVertexBufferImpl
*
vb
=
(
IDirect3DVertexBufferImpl
*
)
D3DVertexBuf
;
IDirect3DVertexBufferImpl
*
vb
=
unsafe_impl_from_IDirect3DVertexBuffer7
(
D3DVertexBuf
)
;
DWORD
stride
=
get_flexible_vertex_size
(
vb
->
fvf
);
struct
wined3d_resource
*
wined3d_resource
;
struct
wined3d_resource_desc
desc
;
...
...
@@ -4288,13 +4288,13 @@ static HRESULT WINAPI IDirect3DDeviceImpl_3_DrawIndexedPrimitiveVB(IDirect3DDevi
D3DPRIMITIVETYPE
PrimitiveType
,
IDirect3DVertexBuffer
*
D3DVertexBuf
,
WORD
*
Indices
,
DWORD
IndexCount
,
DWORD
Flags
)
{
IDirect3DVertexBufferImpl
*
VB
=
vb_from_vb1
(
D3DVertexBuf
);
IDirect3DVertexBufferImpl
*
vb
=
unsafe_impl_from_IDirect3DVertexBuffer
(
D3DVertexBuf
);
TRACE
(
"iface %p, primitive_type %#x, vb %p, indices %p, index_count %u, flags %#x.
\n
"
,
iface
,
PrimitiveType
,
D3DVertexBuf
,
Indices
,
IndexCount
,
Flags
);
return
IDirect3DDevice7_DrawIndexedPrimitiveVB
((
IDirect3DDevice7
*
)
device_from_device3
(
iface
),
PrimitiveType
,
(
IDirect3DVertexBuffer7
*
)
VB
,
0
,
IndexCount
,
Indices
,
IndexCount
,
Flags
);
PrimitiveType
,
(
IDirect3DVertexBuffer7
*
)
vb
,
0
,
IndexCount
,
Indices
,
IndexCount
,
Flags
);
}
/*****************************************************************************
...
...
dlls/ddraw/vertexbuffer.c
View file @
8e272741
...
...
@@ -289,18 +289,12 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_1_Unlock(IDirect3DVertexBuffer *
* DDERR_INVALIDPARAMS If D3DVOP_TRANSFORM wasn't passed
*
*****************************************************************************/
static
HRESULT
WINAPI
IDirect3DVertexBufferImpl_ProcessVertices
(
IDirect3DVertexBuffer7
*
iface
,
DWORD
VertexOp
,
DWORD
DestIndex
,
DWORD
Count
,
IDirect3DVertexBuffer7
*
SrcBuffer
,
DWORD
SrcIndex
,
IDirect3DDevice7
*
D3DDevice
,
DWORD
Flags
)
static
HRESULT
WINAPI
IDirect3DVertexBufferImpl_ProcessVertices
(
IDirect3DVertexBuffer7
*
iface
,
DWORD
VertexOp
,
DWORD
DestIndex
,
DWORD
Count
,
IDirect3DVertexBuffer7
*
SrcBuffer
,
DWORD
SrcIndex
,
IDirect3DDevice7
*
D3DDevice
,
DWORD
Flags
)
{
IDirect3DVertexBufferImpl
*
This
=
(
IDirect3DVertexBufferImpl
*
)
iface
;
IDirect3DVertexBufferImpl
*
Src
=
(
IDirect3DVertexBufferImpl
*
)
SrcBuffer
;
IDirect3DVertexBufferImpl
*
Src
=
unsafe_impl_from_IDirect3DVertexBuffer7
(
SrcBuffer
)
;
IDirect3DDeviceImpl
*
D3D
=
(
IDirect3DDeviceImpl
*
)
D3DDevice
;
BOOL
oldClip
,
doClip
;
HRESULT
hr
;
...
...
@@ -347,7 +341,7 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_1_ProcessVertices(IDirect3DVerte
DWORD
VertexOp
,
DWORD
DestIndex
,
DWORD
Count
,
IDirect3DVertexBuffer
*
SrcBuffer
,
DWORD
SrcIndex
,
IDirect3DDevice3
*
D3DDevice
,
DWORD
Flags
)
{
IDirect3DVertexBufferImpl
*
Src
=
SrcBuffer
?
vb_from_vb1
(
SrcBuffer
)
:
NULL
;
IDirect3DVertexBufferImpl
*
Src
=
unsafe_impl_from_IDirect3DVertexBuffer
(
SrcBuffer
)
;
IDirect3DDeviceImpl
*
D3D
=
D3DDevice
?
device_from_device3
(
D3DDevice
)
:
NULL
;
TRACE
(
"iface %p, vertex_op %#x, dst_idx %u, count %u, src_buffer %p, src_idx %u, device %p, flags %#x.
\n
"
,
...
...
@@ -587,3 +581,21 @@ end:
return
hr
;
}
IDirect3DVertexBufferImpl
*
unsafe_impl_from_IDirect3DVertexBuffer
(
IDirect3DVertexBuffer
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
d3d_vertex_buffer1_vtbl
);
return
vb_from_vb1
(
iface
);
}
IDirect3DVertexBufferImpl
*
unsafe_impl_from_IDirect3DVertexBuffer7
(
IDirect3DVertexBuffer7
*
iface
)
{
if
(
!
iface
)
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
d3d_vertex_buffer7_vtbl
);
return
(
IDirect3DVertexBufferImpl
*
)
iface
;
}
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