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
60223057
Commit
60223057
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: COM cleanup for the IDirect3DVertexBuffer iface.
parent
8e272741
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
20 deletions
+33
-20
ddraw.c
dlls/ddraw/ddraw.c
+1
-1
ddraw_private.h
dlls/ddraw/ddraw_private.h
+2
-8
vertexbuffer.c
dlls/ddraw/vertexbuffer.c
+30
-11
No files found.
dlls/ddraw/ddraw.c
View file @
60223057
...
...
@@ -4983,7 +4983,7 @@ static HRESULT WINAPI d3d3_CreateVertexBuffer(IDirect3D3 *iface, D3DVERTEXBUFFER
if
(
hr
==
D3D_OK
)
{
TRACE
(
"Created vertex buffer %p.
\n
"
,
object
);
*
vertex_buffer
=
(
IDirect3DVertexBuffer
*
)
object
;
*
vertex_buffer
=
&
object
->
IDirect3DVertexBuffer_iface
;
}
else
WARN
(
"Failed to create vertex buffer, hr %#x.
\n
"
,
hr
);
...
...
dlls/ddraw/ddraw_private.h
View file @
60223057
...
...
@@ -521,8 +521,8 @@ struct IDirect3DVertexBufferImpl
{
/*** IUnknown Methods ***/
const
IDirect3DVertexBuffer7Vtbl
*
lpVtbl
;
const
IDirect3DVertexBufferVtbl
*
IDirect3DVertexBuffer_vtbl
;
LONG
ref
;
IDirect3DVertexBuffer
IDirect3DVertexBuffer_iface
;
LONG
ref
;
/*** WineD3D and ddraw links ***/
struct
wined3d_buffer
*
wineD3DVertexBuffer
;
...
...
@@ -539,12 +539,6 @@ HRESULT d3d_vertex_buffer_create(IDirect3DVertexBufferImpl **vertex_buf, IDirect
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
)
{
return
(
IDirect3DVertexBufferImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer_vtbl
));
}
/*****************************************************************************
* Helper functions from utils.c
*****************************************************************************/
...
...
dlls/ddraw/vertexbuffer.c
View file @
60223057
...
...
@@ -26,6 +26,11 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
ddraw
);
static
inline
IDirect3DVertexBufferImpl
*
impl_from_IDirect3DVertexBuffer
(
IDirect3DVertexBuffer
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DVertexBufferImpl
,
IDirect3DVertexBuffer_iface
);
}
/*****************************************************************************
* IUnknown Methods
*****************************************************************************/
...
...
@@ -67,7 +72,7 @@ IDirect3DVertexBufferImpl_QueryInterface(IDirect3DVertexBuffer7 *iface,
if
(
IsEqualGUID
(
&
IID_IDirect3DVertexBuffer
,
riid
)
)
{
IUnknown_AddRef
(
iface
);
*
obj
=
&
This
->
IDirect3DVertexBuffer_
vtbl
;
*
obj
=
&
This
->
IDirect3DVertexBuffer_
iface
;
TRACE
(
" Creating IDirect3DVertexBuffer interface %p
\n
"
,
*
obj
);
return
S_OK
;
}
...
...
@@ -85,9 +90,11 @@ IDirect3DVertexBufferImpl_QueryInterface(IDirect3DVertexBuffer7 *iface,
static
HRESULT
WINAPI
IDirect3DVertexBufferImpl_1_QueryInterface
(
IDirect3DVertexBuffer
*
iface
,
REFIID
riid
,
void
**
obj
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer
(
iface
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
return
IDirect3DVertexBuffer7_QueryInterface
((
IDirect3DVertexBuffer7
*
)
vb_from_vb1
(
iface
)
,
riid
,
obj
);
return
IDirect3DVertexBuffer7_QueryInterface
((
IDirect3DVertexBuffer7
*
)
This
,
riid
,
obj
);
}
/*****************************************************************************
...
...
@@ -112,9 +119,11 @@ IDirect3DVertexBufferImpl_AddRef(IDirect3DVertexBuffer7 *iface)
static
ULONG
WINAPI
IDirect3DVertexBufferImpl_1_AddRef
(
IDirect3DVertexBuffer
*
iface
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
IDirect3DVertexBuffer7_AddRef
((
IDirect3DVertexBuffer7
*
)
vb_from_vb1
(
iface
)
);
return
IDirect3DVertexBuffer7_AddRef
((
IDirect3DVertexBuffer7
*
)
This
);
}
...
...
@@ -164,9 +173,11 @@ IDirect3DVertexBufferImpl_Release(IDirect3DVertexBuffer7 *iface)
static
ULONG
WINAPI
IDirect3DVertexBufferImpl_1_Release
(
IDirect3DVertexBuffer
*
iface
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
IDirect3DVertexBuffer7_Release
((
IDirect3DVertexBuffer7
*
)
vb_from_vb1
(
iface
)
);
return
IDirect3DVertexBuffer7_Release
((
IDirect3DVertexBuffer7
*
)
This
);
}
/*****************************************************************************
...
...
@@ -231,9 +242,11 @@ IDirect3DVertexBufferImpl_Lock(IDirect3DVertexBuffer7 *iface,
static
HRESULT
WINAPI
IDirect3DVertexBufferImpl_1_Lock
(
IDirect3DVertexBuffer
*
iface
,
DWORD
Flags
,
void
**
Data
,
DWORD
*
Size
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer
(
iface
);
TRACE
(
"iface %p, flags %#x, data %p, data_size %p.
\n
"
,
iface
,
Flags
,
Data
,
Size
);
return
IDirect3DVertexBuffer7_Lock
((
IDirect3DVertexBuffer7
*
)
vb_from_vb1
(
iface
)
,
Flags
,
Data
,
Size
);
return
IDirect3DVertexBuffer7_Lock
((
IDirect3DVertexBuffer7
*
)
This
,
Flags
,
Data
,
Size
);
}
/*****************************************************************************
...
...
@@ -261,9 +274,11 @@ IDirect3DVertexBufferImpl_Unlock(IDirect3DVertexBuffer7 *iface)
static
HRESULT
WINAPI
IDirect3DVertexBufferImpl_1_Unlock
(
IDirect3DVertexBuffer
*
iface
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
IDirect3DVertexBuffer7_Unlock
((
IDirect3DVertexBuffer7
*
)
vb_from_vb1
(
iface
)
);
return
IDirect3DVertexBuffer7_Unlock
((
IDirect3DVertexBuffer7
*
)
This
);
}
...
...
@@ -341,13 +356,14 @@ static HRESULT WINAPI IDirect3DVertexBufferImpl_1_ProcessVertices(IDirect3DVerte
DWORD
VertexOp
,
DWORD
DestIndex
,
DWORD
Count
,
IDirect3DVertexBuffer
*
SrcBuffer
,
DWORD
SrcIndex
,
IDirect3DDevice3
*
D3DDevice
,
DWORD
Flags
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer
(
iface
);
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
"
,
iface
,
VertexOp
,
DestIndex
,
Count
,
SrcBuffer
,
SrcIndex
,
D3DDevice
,
Flags
);
return
IDirect3DVertexBuffer7_ProcessVertices
((
IDirect3DVertexBuffer7
*
)
vb_from_vb1
(
iface
)
,
VertexOp
,
return
IDirect3DVertexBuffer7_ProcessVertices
((
IDirect3DVertexBuffer7
*
)
This
,
VertexOp
,
DestIndex
,
Count
,
(
IDirect3DVertexBuffer7
*
)
Src
,
SrcIndex
,
(
IDirect3DDevice7
*
)
D3D
,
Flags
);
}
...
...
@@ -392,9 +408,11 @@ IDirect3DVertexBufferImpl_GetVertexBufferDesc(IDirect3DVertexBuffer7 *iface,
static
HRESULT
WINAPI
IDirect3DVertexBufferImpl_1_GetVertexBufferDesc
(
IDirect3DVertexBuffer
*
iface
,
D3DVERTEXBUFFERDESC
*
Desc
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer
(
iface
);
TRACE
(
"iface %p, desc %p.
\n
"
,
iface
,
Desc
);
return
IDirect3DVertexBuffer7_GetVertexBufferDesc
((
IDirect3DVertexBuffer7
*
)
vb_from_vb1
(
iface
)
,
Desc
);
return
IDirect3DVertexBuffer7_GetVertexBufferDesc
((
IDirect3DVertexBuffer7
*
)
This
,
Desc
);
}
...
...
@@ -440,11 +458,12 @@ IDirect3DVertexBufferImpl_Optimize(IDirect3DVertexBuffer7 *iface,
static
HRESULT
WINAPI
IDirect3DVertexBufferImpl_1_Optimize
(
IDirect3DVertexBuffer
*
iface
,
IDirect3DDevice3
*
D3DDevice
,
DWORD
Flags
)
{
IDirect3DVertexBufferImpl
*
This
=
impl_from_IDirect3DVertexBuffer
(
iface
);
IDirect3DDeviceImpl
*
D3D
=
D3DDevice
?
device_from_device3
(
D3DDevice
)
:
NULL
;
TRACE
(
"iface %p, device %p, flags %#x.
\n
"
,
iface
,
D3DDevice
,
Flags
);
return
IDirect3DVertexBuffer7_Optimize
((
IDirect3DVertexBuffer7
*
)
vb_from_vb1
(
iface
)
,
return
IDirect3DVertexBuffer7_Optimize
((
IDirect3DVertexBuffer7
*
)
This
,
(
IDirect3DDevice7
*
)
D3D
,
Flags
);
}
...
...
@@ -538,7 +557,7 @@ HRESULT d3d_vertex_buffer_create(IDirect3DVertexBufferImpl **vertex_buf, IDirect
return
DDERR_OUTOFMEMORY
;
buffer
->
lpVtbl
=
&
d3d_vertex_buffer7_vtbl
;
buffer
->
IDirect3DVertexBuffer_
v
tbl
=
&
d3d_vertex_buffer1_vtbl
;
buffer
->
IDirect3DVertexBuffer_
iface
.
lpV
tbl
=
&
d3d_vertex_buffer1_vtbl
;
buffer
->
ref
=
1
;
buffer
->
ddraw
=
ddraw
;
...
...
@@ -588,7 +607,7 @@ IDirect3DVertexBufferImpl *unsafe_impl_from_IDirect3DVertexBuffer(IDirect3DVerte
return
NULL
;
assert
(
iface
->
lpVtbl
==
&
d3d_vertex_buffer1_vtbl
);
return
vb_from_vb1
(
iface
);
return
impl_from_IDirect3DVertexBuffer
(
iface
);
}
IDirect3DVertexBufferImpl
*
unsafe_impl_from_IDirect3DVertexBuffer7
(
IDirect3DVertexBuffer7
*
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