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
638cf80c
Commit
638cf80c
authored
Jul 05, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: COM cleanup for the IDirect3DIndexBuffer8 iface.
parent
c1eeeec2
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 @
638cf80c
...
@@ -300,7 +300,7 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Im
...
@@ -300,7 +300,7 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Im
static
inline
IDirect3DIndexBuffer8Impl
*
impl_from_IDirect3DIndexBuffer8
(
IDirect3DIndexBuffer8
*
iface
)
static
inline
IDirect3DIndexBuffer8Impl
*
impl_from_IDirect3DIndexBuffer8
(
IDirect3DIndexBuffer8
*
iface
)
{
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DIndexBuffer8Impl
,
lpVtbl
);
return
CONTAINING_RECORD
(
iface
,
IDirect3DIndexBuffer8Impl
,
IDirect3DIndexBuffer8_iface
);
}
}
static
HRESULT
WINAPI
d3d8_indexbuffer_QueryInterface
(
IDirect3DIndexBuffer8
*
iface
,
REFIID
riid
,
void
**
object
)
static
HRESULT
WINAPI
d3d8_indexbuffer_QueryInterface
(
IDirect3DIndexBuffer8
*
iface
,
REFIID
riid
,
void
**
object
)
...
@@ -324,7 +324,7 @@ static HRESULT WINAPI d3d8_indexbuffer_QueryInterface(IDirect3DIndexBuffer8 *ifa
...
@@ -324,7 +324,7 @@ static HRESULT WINAPI d3d8_indexbuffer_QueryInterface(IDirect3DIndexBuffer8 *ifa
static
ULONG
WINAPI
d3d8_indexbuffer_AddRef
(
IDirect3DIndexBuffer8
*
iface
)
static
ULONG
WINAPI
d3d8_indexbuffer_AddRef
(
IDirect3DIndexBuffer8
*
iface
)
{
{
IDirect3DIndexBuffer8Impl
*
buffer
=
(
IDirect3DIndexBuffer8Impl
*
)
iface
;
IDirect3DIndexBuffer8Impl
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
iface
)
;
ULONG
refcount
=
InterlockedIncrement
(
&
buffer
->
ref
);
ULONG
refcount
=
InterlockedIncrement
(
&
buffer
->
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
...
@@ -342,7 +342,7 @@ static ULONG WINAPI d3d8_indexbuffer_AddRef(IDirect3DIndexBuffer8 *iface)
...
@@ -342,7 +342,7 @@ static ULONG WINAPI d3d8_indexbuffer_AddRef(IDirect3DIndexBuffer8 *iface)
static
ULONG
WINAPI
d3d8_indexbuffer_Release
(
IDirect3DIndexBuffer8
*
iface
)
static
ULONG
WINAPI
d3d8_indexbuffer_Release
(
IDirect3DIndexBuffer8
*
iface
)
{
{
IDirect3DIndexBuffer8Impl
*
buffer
=
(
IDirect3DIndexBuffer8Impl
*
)
iface
;
IDirect3DIndexBuffer8Impl
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
iface
)
;
ULONG
refcount
=
InterlockedDecrement
(
&
buffer
->
ref
);
ULONG
refcount
=
InterlockedDecrement
(
&
buffer
->
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
...
@@ -362,11 +362,14 @@ static ULONG WINAPI d3d8_indexbuffer_Release(IDirect3DIndexBuffer8 *iface)
...
@@ -362,11 +362,14 @@ static ULONG WINAPI d3d8_indexbuffer_Release(IDirect3DIndexBuffer8 *iface)
return
refcount
;
return
refcount
;
}
}
static
HRESULT
WINAPI
d3d8_indexbuffer_GetDevice
(
IDirect3DIndexBuffer8
*
iface
,
IDirect3DDevice8
**
device
)
static
HRESULT
WINAPI
d3d8_indexbuffer_GetDevice
(
IDirect3DIndexBuffer8
*
iface
,
IDirect3DDevice8
**
device
)
{
{
IDirect3DIndexBuffer8Impl
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
IDirect3DDevice8
*
)((
IDirect3DIndexBuffer8Impl
*
)
iface
)
->
parentDevice
;
*
device
=
buffer
->
parentDevice
;
IDirect3DDevice8_AddRef
(
*
device
);
IDirect3DDevice8_AddRef
(
*
device
);
TRACE
(
"Returning device %p.
\n
"
,
*
device
);
TRACE
(
"Returning device %p.
\n
"
,
*
device
);
...
@@ -428,12 +431,13 @@ static HRESULT WINAPI d3d8_indexbuffer_FreePrivateData(IDirect3DIndexBuffer8 *if
...
@@ -428,12 +431,13 @@ static HRESULT WINAPI d3d8_indexbuffer_FreePrivateData(IDirect3DIndexBuffer8 *if
static
DWORD
WINAPI
d3d8_indexbuffer_SetPriority
(
IDirect3DIndexBuffer8
*
iface
,
DWORD
priority
)
static
DWORD
WINAPI
d3d8_indexbuffer_SetPriority
(
IDirect3DIndexBuffer8
*
iface
,
DWORD
priority
)
{
{
IDirect3DIndexBuffer8Impl
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
iface
);
DWORD
previous
;
DWORD
previous
;
TRACE
(
"iface %p, priority %u.
\n
"
,
iface
,
priority
);
TRACE
(
"iface %p, priority %u.
\n
"
,
iface
,
priority
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
previous
=
wined3d_buffer_set_priority
(
((
IDirect3DIndexBuffer8Impl
*
)
iface
)
->
wineD3DIndexBuffer
,
priority
);
previous
=
wined3d_buffer_set_priority
(
buffer
->
wineD3DIndexBuffer
,
priority
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
previous
;
return
previous
;
...
@@ -441,12 +445,13 @@ static DWORD WINAPI d3d8_indexbuffer_SetPriority(IDirect3DIndexBuffer8 *iface, D
...
@@ -441,12 +445,13 @@ static DWORD WINAPI d3d8_indexbuffer_SetPriority(IDirect3DIndexBuffer8 *iface, D
static
DWORD
WINAPI
d3d8_indexbuffer_GetPriority
(
IDirect3DIndexBuffer8
*
iface
)
static
DWORD
WINAPI
d3d8_indexbuffer_GetPriority
(
IDirect3DIndexBuffer8
*
iface
)
{
{
IDirect3DIndexBuffer8Impl
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
iface
);
DWORD
priority
;
DWORD
priority
;
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
priority
=
wined3d_buffer_get_priority
(
((
IDirect3DIndexBuffer8Impl
*
)
iface
)
->
wineD3DIndexBuffer
);
priority
=
wined3d_buffer_get_priority
(
buffer
->
wineD3DIndexBuffer
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
priority
;
return
priority
;
...
@@ -454,10 +459,12 @@ static DWORD WINAPI d3d8_indexbuffer_GetPriority(IDirect3DIndexBuffer8 *iface)
...
@@ -454,10 +459,12 @@ static DWORD WINAPI d3d8_indexbuffer_GetPriority(IDirect3DIndexBuffer8 *iface)
static
void
WINAPI
d3d8_indexbuffer_PreLoad
(
IDirect3DIndexBuffer8
*
iface
)
static
void
WINAPI
d3d8_indexbuffer_PreLoad
(
IDirect3DIndexBuffer8
*
iface
)
{
{
IDirect3DIndexBuffer8Impl
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
wined3d_buffer_preload
(
((
IDirect3DIndexBuffer8Impl
*
)
iface
)
->
wineD3DIndexBuffer
);
wined3d_buffer_preload
(
buffer
->
wineD3DIndexBuffer
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
}
}
...
@@ -468,17 +475,17 @@ static D3DRESOURCETYPE WINAPI d3d8_indexbuffer_GetType(IDirect3DIndexBuffer8 *if
...
@@ -468,17 +475,17 @@ static D3DRESOURCETYPE WINAPI d3d8_indexbuffer_GetType(IDirect3DIndexBuffer8 *if
return
D3DRTYPE_INDEXBUFFER
;
return
D3DRTYPE_INDEXBUFFER
;
}
}
static
HRESULT
WINAPI
d3d8_indexbuffer_Lock
(
IDirect3DIndexBuffer8
*
iface
,
static
HRESULT
WINAPI
d3d8_indexbuffer_Lock
(
IDirect3DIndexBuffer8
*
iface
,
UINT
offset
,
UINT
size
,
UINT
offset
,
UINT
size
,
BYTE
**
data
,
DWORD
flags
)
BYTE
**
data
,
DWORD
flags
)
{
{
IDirect3DIndexBuffer8Impl
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
iface
);
HRESULT
hr
;
HRESULT
hr
;
TRACE
(
"iface %p, offset %u, size %u, data %p, flags %#x.
\n
"
,
TRACE
(
"iface %p, offset %u, size %u, data %p, flags %#x.
\n
"
,
iface
,
offset
,
size
,
data
,
flags
);
iface
,
offset
,
size
,
data
,
flags
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
hr
=
wined3d_buffer_map
(((
IDirect3DIndexBuffer8Impl
*
)
iface
)
->
wineD3DIndexBuffer
,
hr
=
wined3d_buffer_map
(
buffer
->
wineD3DIndexBuffer
,
offset
,
size
,
data
,
flags
);
offset
,
size
,
data
,
flags
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
hr
;
return
hr
;
...
@@ -486,18 +493,21 @@ static HRESULT WINAPI d3d8_indexbuffer_Lock(IDirect3DIndexBuffer8 *iface,
...
@@ -486,18 +493,21 @@ static HRESULT WINAPI d3d8_indexbuffer_Lock(IDirect3DIndexBuffer8 *iface,
static
HRESULT
WINAPI
d3d8_indexbuffer_Unlock
(
IDirect3DIndexBuffer8
*
iface
)
static
HRESULT
WINAPI
d3d8_indexbuffer_Unlock
(
IDirect3DIndexBuffer8
*
iface
)
{
{
IDirect3DIndexBuffer8Impl
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
wined3d_mutex_lock
();
wined3d_buffer_unmap
(
((
IDirect3DIndexBuffer8Impl
*
)
iface
)
->
wineD3DIndexBuffer
);
wined3d_buffer_unmap
(
buffer
->
wineD3DIndexBuffer
);
wined3d_mutex_unlock
();
wined3d_mutex_unlock
();
return
D3D_OK
;
return
D3D_OK
;
}
}
static
HRESULT
WINAPI
d3d8_indexbuffer_GetDesc
(
IDirect3DIndexBuffer8
*
iface
,
D3DINDEXBUFFER_DESC
*
desc
)
static
HRESULT
WINAPI
d3d8_indexbuffer_GetDesc
(
IDirect3DIndexBuffer8
*
iface
,
D3DINDEXBUFFER_DESC
*
desc
)
{
{
IDirect3DIndexBuffer8Impl
*
buffer
=
(
IDirect3DIndexBuffer8Impl
*
)
iface
;
IDirect3DIndexBuffer8Impl
*
buffer
=
impl_from_IDirect3DIndexBuffer8
(
iface
)
;
struct
wined3d_resource_desc
wined3d_desc
;
struct
wined3d_resource_desc
wined3d_desc
;
struct
wined3d_resource
*
wined3d_resource
;
struct
wined3d_resource
*
wined3d_resource
;
...
@@ -553,7 +563,7 @@ HRESULT indexbuffer_init(IDirect3DIndexBuffer8Impl *buffer, IDirect3DDevice8Impl
...
@@ -553,7 +563,7 @@ HRESULT indexbuffer_init(IDirect3DIndexBuffer8Impl *buffer, IDirect3DDevice8Impl
{
{
HRESULT
hr
;
HRESULT
hr
;
buffer
->
lpVtbl
=
&
d3d8_indexbuffer_vtbl
;
buffer
->
IDirect3DIndexBuffer8_iface
.
lpVtbl
=
&
d3d8_indexbuffer_vtbl
;
buffer
->
ref
=
1
;
buffer
->
ref
=
1
;
buffer
->
format
=
wined3dformat_from_d3dformat
(
format
);
buffer
->
format
=
wined3dformat_from_d3dformat
(
format
);
...
...
dlls/d3d8/d3d8_private.h
View file @
638cf80c
...
@@ -287,10 +287,8 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Im
...
@@ -287,10 +287,8 @@ HRESULT vertexbuffer_init(IDirect3DVertexBuffer8Impl *buffer, IDirect3DDevice8Im
*/
*/
struct
IDirect3DIndexBuffer8Impl
struct
IDirect3DIndexBuffer8Impl
{
{
/* IUnknown fields */
IDirect3DIndexBuffer8
IDirect3DIndexBuffer8_iface
;
const
IDirect3DIndexBuffer8Vtbl
*
lpVtbl
;
LONG
ref
;
LONG
ref
;
struct
wined3d_buffer
*
wineD3DIndexBuffer
;
struct
wined3d_buffer
*
wineD3DIndexBuffer
;
IDirect3DDevice8
*
parentDevice
;
IDirect3DDevice8
*
parentDevice
;
enum
wined3d_format_id
format
;
enum
wined3d_format_id
format
;
...
...
dlls/d3d8/device.c
View file @
638cf80c
...
@@ -870,7 +870,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(IDirect3DDevice8 *i
...
@@ -870,7 +870,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(IDirect3DDevice8 *i
}
}
TRACE
(
"Created index buffer %p.
\n
"
,
object
);
TRACE
(
"Created index buffer %p.
\n
"
,
object
);
*
buffer
=
(
IDirect3DIndexBuffer8
*
)
object
;
*
buffer
=
&
object
->
IDirect3DIndexBuffer8_iface
;
return
D3D_OK
;
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