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
79d62ca1
Commit
79d62ca1
authored
Jun 01, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Get rid of IDirect3DStateBlock9Impl.
parent
176d27e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
63 deletions
+52
-63
d3d9_private.h
dlls/d3d9/d3d9_private.h
+7
-17
device.c
dlls/d3d9/device.c
+2
-2
stateblock.c
dlls/d3d9/stateblock.c
+43
-44
No files found.
dlls/d3d9/d3d9_private.h
View file @
79d62ca1
...
...
@@ -245,25 +245,15 @@ HRESULT volumetexture_init(struct d3d9_texture *texture, struct d3d9_device *dev
UINT
width
,
UINT
height
,
UINT
depth
,
UINT
levels
,
DWORD
usage
,
D3DFORMAT
format
,
D3DPOOL
pool
)
DECLSPEC_HIDDEN
;
struct
d3d9_texture
*
unsafe_impl_from_IDirect3DBaseTexture9
(
IDirect3DBaseTexture9
*
iface
)
DECLSPEC_HIDDEN
;
/* ----------------------- */
/* IDirect3DStateBlock9 */
/* ----------------------- */
/*****************************************************************************
* IDirect3DStateBlock9 implementation structure
*/
typedef
struct
IDirect3DStateBlock9Impl
{
IDirect3DStateBlock9
IDirect3DStateBlock9_iface
;
LONG
ref
;
/* IDirect3DStateBlock9 fields */
struct
d3d9_stateblock
{
IDirect3DStateBlock9
IDirect3DStateBlock9_iface
;
LONG
refcount
;
struct
wined3d_stateblock
*
wined3d_stateblock
;
IDirect3DDevice9Ex
*
parent_device
;
};
/* Parent reference */
IDirect3DDevice9Ex
*
parentDevice
;
}
IDirect3DStateBlock9Impl
;
HRESULT
stateblock_init
(
IDirect3DStateBlock9Impl
*
stateblock
,
struct
d3d9_device
*
device
,
HRESULT
stateblock_init
(
struct
d3d9_stateblock
*
stateblock
,
struct
d3d9_device
*
device
,
D3DSTATEBLOCKTYPE
type
,
struct
wined3d_stateblock
*
wined3d_stateblock
)
DECLSPEC_HIDDEN
;
/* --------------------------- */
...
...
dlls/d3d9/device.c
View file @
79d62ca1
...
...
@@ -1525,7 +1525,7 @@ static HRESULT WINAPI d3d9_device_CreateStateBlock(IDirect3DDevice9Ex *iface,
D3DSTATEBLOCKTYPE
type
,
IDirect3DStateBlock9
**
stateblock
)
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
IDirect3DStateBlock9Impl
*
object
;
struct
d3d9_stateblock
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, type %#x, stateblock %p.
\n
"
,
iface
,
type
,
stateblock
);
...
...
@@ -1575,7 +1575,7 @@ static HRESULT WINAPI d3d9_device_EndStateBlock(IDirect3DDevice9Ex *iface, IDire
{
struct
d3d9_device
*
device
=
impl_from_IDirect3DDevice9Ex
(
iface
);
struct
wined3d_stateblock
*
wined3d_stateblock
;
IDirect3DStateBlock9Impl
*
object
;
struct
d3d9_stateblock
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, stateblock %p.
\n
"
,
iface
,
stateblock
);
...
...
dlls/d3d9/stateblock.c
View file @
79d62ca1
...
...
@@ -25,67 +25,66 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d9
);
static
inline
IDirect3DStateBlock9Impl
*
impl_from_IDirect3DStateBlock9
(
IDirect3DStateBlock9
*
iface
)
static
inline
struct
d3d9_stateblock
*
impl_from_IDirect3DStateBlock9
(
IDirect3DStateBlock9
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DStateBlock9Impl
,
IDirect3DStateBlock9_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d9_stateblock
,
IDirect3DStateBlock9_iface
);
}
static
HRESULT
WINAPI
IDirect3DStateBlock9Impl_QueryInterface
(
IDirect3DStateBlock9
*
iface
,
REFIID
riid
,
void
**
ppobj
)
static
HRESULT
WINAPI
d3d9_stateblock_QueryInterface
(
IDirect3DStateBlock9
*
iface
,
REFIID
riid
,
void
**
out
)
{
TRACE
(
"iface %p, riid %s, o
bject %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppobj
);
TRACE
(
"iface %p, riid %s, o
ut %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
if
(
IsEqualGUID
(
riid
,
&
IID_IDirect3DStateBlock9
)
||
IsEqualGUID
(
riid
,
&
IID_IUnknown
))
{
IDirect3DStateBlock9_AddRef
(
iface
);
*
ppobj
=
iface
;
*
out
=
iface
;
return
S_OK
;
}
WARN
(
"%s not implemented, returning E_NOINTERFACE.
\n
"
,
debugstr_guid
(
riid
));
*
ppobj
=
NULL
;
*
out
=
NULL
;
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IDirect3DStateBlock9Impl
_AddRef
(
IDirect3DStateBlock9
*
iface
)
static
ULONG
WINAPI
d3d9_stateblock
_AddRef
(
IDirect3DStateBlock9
*
iface
)
{
IDirect3DStateBlock9Impl
*
This
=
impl_from_IDirect3DStateBlock9
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
struct
d3d9_stateblock
*
stateblock
=
impl_from_IDirect3DStateBlock9
(
iface
);
ULONG
ref
count
=
InterlockedIncrement
(
&
stateblock
->
refcount
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
ref
count
);
return
ref
;
return
ref
count
;
}
static
ULONG
WINAPI
IDirect3DStateBlock9Impl
_Release
(
IDirect3DStateBlock9
*
iface
)
static
ULONG
WINAPI
d3d9_stateblock
_Release
(
IDirect3DStateBlock9
*
iface
)
{
IDirect3DStateBlock9Impl
*
This
=
impl_from_IDirect3DStateBlock9
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
d3d9_stateblock
*
stateblock
=
impl_from_IDirect3DStateBlock9
(
iface
);
ULONG
ref
count
=
InterlockedDecrement
(
&
stateblock
->
refcount
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
ref
count
);
if
(
ref
==
0
)
{
if
(
!
refcount
)
{
wined3d_mutex_lock
();
wined3d_stateblock_decref
(
This
->
wined3d_stateblock
);
wined3d_stateblock_decref
(
stateblock
->
wined3d_stateblock
);
wined3d_mutex_unlock
();
IDirect3DDevice9Ex_Release
(
This
->
parentD
evice
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
IDirect3DDevice9Ex_Release
(
stateblock
->
parent_d
evice
);
HeapFree
(
GetProcessHeap
(),
0
,
stateblock
);
}
return
ref
;
return
refcount
;
}
/* IDirect3DStateBlock9 Interface follow: */
static
HRESULT
WINAPI
IDirect3DStateBlock9Impl_GetDevice
(
IDirect3DStateBlock9
*
iface
,
IDirect3DDevice9
**
device
)
static
HRESULT
WINAPI
d3d9_stateblock_GetDevice
(
IDirect3DStateBlock9
*
iface
,
IDirect3DDevice9
**
device
)
{
IDirect3DStateBlock9Impl
*
This
=
impl_from_IDirect3DStateBlock9
(
iface
);
struct
d3d9_stateblock
*
stateblock
=
impl_from_IDirect3DStateBlock9
(
iface
);
TRACE
(
"iface %p, device %p.
\n
"
,
iface
,
device
);
*
device
=
(
IDirect3DDevice9
*
)
This
->
parentD
evice
;
*
device
=
(
IDirect3DDevice9
*
)
stateblock
->
parent_d
evice
;
IDirect3DDevice9_AddRef
(
*
device
);
TRACE
(
"Returning device %p.
\n
"
,
*
device
);
...
...
@@ -93,54 +92,54 @@ static HRESULT WINAPI IDirect3DStateBlock9Impl_GetDevice(IDirect3DStateBlock9 *i
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DStateBlock9Impl
_Capture
(
IDirect3DStateBlock9
*
iface
)
static
HRESULT
WINAPI
d3d9_stateblock
_Capture
(
IDirect3DStateBlock9
*
iface
)
{
IDirect3DStateBlock9Impl
*
This
=
impl_from_IDirect3DStateBlock9
(
iface
);
struct
d3d9_stateblock
*
stateblock
=
impl_from_IDirect3DStateBlock9
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
hr
=
wined3d_stateblock_capture
(
This
->
wined3d_stateblock
);
hr
=
wined3d_stateblock_capture
(
stateblock
->
wined3d_stateblock
);
wined3d_mutex_unlock
();
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DStateBlock9Impl
_Apply
(
IDirect3DStateBlock9
*
iface
)
static
HRESULT
WINAPI
d3d9_stateblock
_Apply
(
IDirect3DStateBlock9
*
iface
)
{
IDirect3DStateBlock9Impl
*
This
=
impl_from_IDirect3DStateBlock9
(
iface
);
struct
d3d9_stateblock
*
stateblock
=
impl_from_IDirect3DStateBlock9
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p.
\n
"
,
iface
);
wined3d_mutex_lock
();
hr
=
wined3d_stateblock_apply
(
This
->
wined3d_stateblock
);
hr
=
wined3d_stateblock_apply
(
stateblock
->
wined3d_stateblock
);
wined3d_mutex_unlock
();
return
hr
;
}
static
const
IDirect3DStateBlock9Vtbl
Direct3DStateBlock9_V
tbl
=
static
const
struct
IDirect3DStateBlock9Vtbl
d3d9_stateblock_v
tbl
=
{
/* IUnknown */
IDirect3DStateBlock9Impl
_QueryInterface
,
IDirect3DStateBlock9Impl
_AddRef
,
IDirect3DStateBlock9Impl
_Release
,
d3d9_stateblock
_QueryInterface
,
d3d9_stateblock
_AddRef
,
d3d9_stateblock
_Release
,
/* IDirect3DStateBlock9 */
IDirect3DStateBlock9Impl
_GetDevice
,
IDirect3DStateBlock9Impl
_Capture
,
IDirect3DStateBlock9Impl_Apply
d3d9_stateblock
_GetDevice
,
d3d9_stateblock
_Capture
,
d3d9_stateblock_Apply
,
};
HRESULT
stateblock_init
(
IDirect3DStateBlock9Impl
*
stateblock
,
struct
d3d9_device
*
device
,
HRESULT
stateblock_init
(
struct
d3d9_stateblock
*
stateblock
,
struct
d3d9_device
*
device
,
D3DSTATEBLOCKTYPE
type
,
struct
wined3d_stateblock
*
wined3d_stateblock
)
{
HRESULT
hr
;
stateblock
->
IDirect3DStateBlock9_iface
.
lpVtbl
=
&
Direct3DStateBlock9_V
tbl
;
stateblock
->
ref
=
1
;
stateblock
->
IDirect3DStateBlock9_iface
.
lpVtbl
=
&
d3d9_stateblock_v
tbl
;
stateblock
->
ref
count
=
1
;
if
(
wined3d_stateblock
)
{
...
...
@@ -159,8 +158,8 @@ HRESULT stateblock_init(IDirect3DStateBlock9Impl *stateblock, struct d3d9_device
}
}
stateblock
->
parent
D
evice
=
&
device
->
IDirect3DDevice9Ex_iface
;
IDirect3DDevice9Ex_AddRef
(
stateblock
->
parent
D
evice
);
stateblock
->
parent
_d
evice
=
&
device
->
IDirect3DDevice9Ex_iface
;
IDirect3DDevice9Ex_AddRef
(
stateblock
->
parent
_d
evice
);
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