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
9ab233ea
Commit
9ab233ea
authored
Jul 08, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 08, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: COM cleanup for the IDirect3DVertexBuffer8 iface.
parent
aa8e4dd8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
21 deletions
+29
-21
buffer.c
dlls/d3d8/buffer.c
+26
-16
d3d8_private.h
dlls/d3d8/d3d8_private.h
+2
-4
device.c
dlls/d3d8/device.c
+1
-1
No files found.
dlls/d3d8/buffer.c
View file @
9ab233ea
...
...
@@ -24,7 +24,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d8);
static
inline
IDirect3DVertexBuffer8Impl
*
impl_from_IDirect3DVertexBuffer8
(
IDirect3DVertexBuffer8
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DVertexBuffer8Impl
,
lpVtbl
);
return
CONTAINING_RECORD
(
iface
,
IDirect3DVertexBuffer8Impl
,
IDirect3DVertexBuffer8_iface
);
}
static
HRESULT
WINAPI
d3d8_vertexbuffer_QueryInterface
(
IDirect3DVertexBuffer8
*
iface
,
REFIID
riid
,
void
**
object
)
...
...
@@ -48,7 +48,7 @@ static HRESULT WINAPI d3d8_vertexbuffer_QueryInterface(IDirect3DVertexBuffer8 *i
static
ULONG
WINAPI
d3d8_vertexbuffer_AddRef
(
IDirect3DVertexBuffer8
*
iface
)
{
IDirect3DVertexBuffer8Impl
*
buffer
=
(
IDirect3DVertexBuffer8Impl
*
)
iface
;
IDirect3DVertexBuffer8Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
iface
)
;
ULONG
refcount
=
InterlockedIncrement
(
&
buffer
->
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
...
...
@@ -66,7 +66,7 @@ static ULONG WINAPI d3d8_vertexbuffer_AddRef(IDirect3DVertexBuffer8 *iface)
static
ULONG
WINAPI
d3d8_vertexbuffer_Release
(
IDirect3DVertexBuffer8
*
iface
)
{
IDirect3DVertexBuffer8Impl
*
buffer
=
(
IDirect3DVertexBuffer8Impl
*
)
iface
;
IDirect3DVertexBuffer8Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
iface
)
;
ULONG
refcount
=
InterlockedDecrement
(
&
buffer
->
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
...
...
@@ -86,11 +86,14 @@ static ULONG WINAPI d3d8_vertexbuffer_Release(IDirect3DVertexBuffer8 *iface)
return
refcount
;
}
static
HRESULT
WINAPI
d3d8_vertexbuffer_GetDevice
(
IDirect3DVertexBuffer8
*
iface
,
IDirect3DDevice8
**
device
)
static
HRESULT
WINAPI
d3d8_vertexbuffer_GetDevice
(
IDirect3DVertexBuffer8
*
iface
,
IDirect3DDevice8
**
device
)
{
IDirect3DVertexBuffer8Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
IDirect3DDevice8
*
)((
IDirect3DVertexBuffer8Impl
*
)
iface
)
->
parentDevice
;
*
device
=
buffer
->
parentDevice
;
IDirect3DDevice8_AddRef
(
*
device
);
TRACE
(
"Returning device %p.
\n
"
,
*
device
);
...
...
@@ -152,12 +155,13 @@ static HRESULT WINAPI d3d8_vertexbuffer_FreePrivateData(IDirect3DVertexBuffer8 *
static
DWORD
WINAPI
d3d8_vertexbuffer_SetPriority
(
IDirect3DVertexBuffer8
*
iface
,
DWORD
priority
)
{
IDirect3DVertexBuffer8Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
iface
);
DWORD
previous
;
TRACE
(
"iface %p, priority %u.
\n
"
,
iface
,
priority
);
wined3d_mutex_lock
();
previous
=
wined3d_buffer_set_priority
(
((
IDirect3DVertexBuffer8Impl
*
)
iface
)
->
wineD3DVertexBuffer
,
priority
);
previous
=
wined3d_buffer_set_priority
(
buffer
->
wineD3DVertexBuffer
,
priority
);
wined3d_mutex_unlock
();
return
previous
;
...
...
@@ -165,12 +169,13 @@ static DWORD WINAPI d3d8_vertexbuffer_SetPriority(IDirect3DVertexBuffer8 *iface,
static
DWORD
WINAPI
d3d8_vertexbuffer_GetPriority
(
IDirect3DVertexBuffer8
*
iface
)
{
IDirect3DVertexBuffer8Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
iface
);
DWORD
priority
;
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
priority
=
wined3d_buffer_get_priority
(
((
IDirect3DVertexBuffer8Impl
*
)
iface
)
->
wineD3DVertexBuffer
);
priority
=
wined3d_buffer_get_priority
(
buffer
->
wineD3DVertexBuffer
);
wined3d_mutex_unlock
();
return
priority
;
...
...
@@ -178,10 +183,12 @@ static DWORD WINAPI d3d8_vertexbuffer_GetPriority(IDirect3DVertexBuffer8 *iface)
static
void
WINAPI
d3d8_vertexbuffer_PreLoad
(
IDirect3DVertexBuffer8
*
iface
)
{
IDirect3DVertexBuffer8Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_buffer_preload
(
((
IDirect3DVertexBuffer8Impl
*
)
iface
)
->
wineD3DVertexBuffer
);
wined3d_buffer_preload
(
buffer
->
wineD3DVertexBuffer
);
wined3d_mutex_unlock
();
}
...
...
@@ -192,17 +199,17 @@ static D3DRESOURCETYPE WINAPI d3d8_vertexbuffer_GetType(IDirect3DVertexBuffer8 *
return
D3DRTYPE_VERTEXBUFFER
;
}
static
HRESULT
WINAPI
d3d8_vertexbuffer_Lock
(
IDirect3DVertexBuffer8
*
iface
,
UINT
offset
,
UINT
size
,
BYTE
**
data
,
DWORD
flags
)
static
HRESULT
WINAPI
d3d8_vertexbuffer_Lock
(
IDirect3DVertexBuffer8
*
iface
,
UINT
offset
,
UINT
size
,
BYTE
**
data
,
DWORD
flags
)
{
IDirect3DVertexBuffer8Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, offset %u, size %u, data %p, flags %#x.
\n
"
,
iface
,
offset
,
size
,
data
,
flags
);
wined3d_mutex_lock
();
hr
=
wined3d_buffer_map
(((
IDirect3DVertexBuffer8Impl
*
)
iface
)
->
wineD3DVertexBuffer
,
offset
,
size
,
data
,
flags
);
hr
=
wined3d_buffer_map
(
buffer
->
wineD3DVertexBuffer
,
offset
,
size
,
data
,
flags
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -210,18 +217,21 @@ static HRESULT WINAPI d3d8_vertexbuffer_Lock(IDirect3DVertexBuffer8 *iface,
static
HRESULT
WINAPI
d3d8_vertexbuffer_Unlock
(
IDirect3DVertexBuffer8
*
iface
)
{
IDirect3DVertexBuffer8Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_buffer_unmap
(
((
IDirect3DVertexBuffer8Impl
*
)
iface
)
->
wineD3DVertexBuffer
);
wined3d_buffer_unmap
(
buffer
->
wineD3DVertexBuffer
);
wined3d_mutex_unlock
();
return
D3D_OK
;
}
static
HRESULT
WINAPI
d3d8_vertexbuffer_GetDesc
(
IDirect3DVertexBuffer8
*
iface
,
D3DVERTEXBUFFER_DESC
*
desc
)
static
HRESULT
WINAPI
d3d8_vertexbuffer_GetDesc
(
IDirect3DVertexBuffer8
*
iface
,
D3DVERTEXBUFFER_DESC
*
desc
)
{
IDirect3DVertexBuffer8Impl
*
buffer
=
(
IDirect3DVertexBuffer8Impl
*
)
iface
;
IDirect3DVertexBuffer8Impl
*
buffer
=
impl_from_IDirect3DVertexBuffer8
(
iface
)
;
struct
wined3d_resource_desc
wined3d_desc
;
struct
wined3d_resource
*
wined3d_resource
;
...
...
@@ -278,7 +288,7 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Im
{
HRESULT
hr
;
buffer
->
lpVtbl
=
&
Direct3DVertexBuffer8_Vtbl
;
buffer
->
IDirect3DVertexBuffer8_iface
.
lpVtbl
=
&
Direct3DVertexBuffer8_Vtbl
;
buffer
->
ref
=
1
;
buffer
->
fvf
=
fvf
;
...
...
dlls/d3d8/d3d8_private.h
View file @
9ab233ea
...
...
@@ -266,10 +266,8 @@ IDirect3DSurface8Impl *unsafe_impl_from_IDirect3DSurface8(IDirect3DSurface8 *ifa
*/
struct
IDirect3DVertexBuffer8Impl
{
/* IUnknown fields */
const
IDirect3DVertexBuffer8Vtbl
*
lpVtbl
;
LONG
ref
;
IDirect3DVertexBuffer8
IDirect3DVertexBuffer8_iface
;
LONG
ref
;
struct
wined3d_buffer
*
wineD3DVertexBuffer
;
IDirect3DDevice8
*
parentDevice
;
DWORD
fvf
;
...
...
dlls/d3d8/device.c
View file @
9ab233ea
...
...
@@ -839,7 +839,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(IDirect3DDevice8 *
}
TRACE
(
"Created vertex buffer %p.
\n
"
,
object
);
*
buffer
=
(
IDirect3DVertexBuffer8
*
)
object
;
*
buffer
=
&
object
->
IDirect3DVertexBuffer8_iface
;
return
D3D_OK
;
}
...
...
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