Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7f184144
Commit
7f184144
authored
Jan 28, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: COM cleanup for the IWineD3DDeviceParent_iface.
parent
54a61ae7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
23 deletions
+21
-23
d3d8_private.h
dlls/d3d8/d3d8_private.h
+5
-5
device.c
dlls/d3d8/device.c
+16
-18
No files found.
dlls/d3d8/d3d8_private.h
View file @
7f184144
...
...
@@ -178,18 +178,18 @@ struct IDirect3DDevice8Impl
{
/* IUnknown fields */
IDirect3DDevice8
IDirect3DDevice8_iface
;
const
IWineD3DDeviceParentVtbl
*
device_parent_vtbl
;
LONG
ref
;
IWineD3DDeviceParent
IWineD3DDeviceParent_iface
;
LONG
ref
;
/* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */
IWineD3DDevice
*
WineD3DDevice
;
struct
d3d8_handle_table
handle_table
;
IWineD3DDevice
*
WineD3DDevice
;
struct
d3d8_handle_table
handle_table
;
/* FVF management */
struct
FvfToDecl
*
decls
;
UINT
numConvertedDecls
,
declArraySize
;
/* Avoids recursion with nested ReleaseRef to 0 */
BOOL
inDestruction
;
BOOL
inDestruction
;
};
HRESULT
device_init
(
IDirect3DDevice8Impl
*
device
,
IWineD3D
*
wined3d
,
UINT
adapter
,
...
...
dlls/d3d8/device.c
View file @
7f184144
...
...
@@ -286,8 +286,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_QueryInterface(IDirect3DDevice8 *ifac
if
(
IsEqualGUID
(
riid
,
&
IID_IWineD3DDeviceParent
))
{
I
Unknown_AddRef
((
IUnknown
*
)
&
This
->
device_parent_vtbl
);
*
ppobj
=
&
This
->
device_parent_vtbl
;
I
WineD3DDeviceParent_AddRef
(
&
This
->
IWineD3DDeviceParent_iface
);
*
ppobj
=
&
This
->
IWineD3DDeviceParent_iface
;
return
S_OK
;
}
...
...
@@ -2713,29 +2713,27 @@ static const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl =
IDirect3DDevice8Impl_DeletePatch
};
/* IWineD3DDeviceParent IUnknown methods */
static
inline
struct
IDirect3DDevice8Impl
*
device_from_device_parent
(
IWineD3DDeviceParent
*
iface
)
static
inline
IDirect3DDevice8Impl
*
impl_from_IWineD3DDeviceParent
(
IWineD3DDeviceParent
*
iface
)
{
return
(
struct
IDirect3DDevice8Impl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
struct
IDirect3DDevice8Impl
,
device_parent_vtbl
));
return
CONTAINING_RECORD
(
iface
,
IDirect3DDevice8Impl
,
IWineD3DDeviceParent_iface
);
}
static
HRESULT
STDMETHODCALLTYPE
device_parent_QueryInterface
(
IWineD3DDeviceParent
*
iface
,
REFIID
riid
,
void
**
object
)
static
HRESULT
STDMETHODCALLTYPE
device_parent_QueryInterface
(
IWineD3DDeviceParent
*
iface
,
REFIID
riid
,
void
**
object
)
{
struct
IDirect3DDevice8Impl
*
This
=
device_from_device_p
arent
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IWineD3DDeviceP
arent
(
iface
);
return
IDirect3DDevice8Impl_QueryInterface
(
&
This
->
IDirect3DDevice8_iface
,
riid
,
object
);
}
static
ULONG
STDMETHODCALLTYPE
device_parent_AddRef
(
IWineD3DDeviceParent
*
iface
)
{
struct
IDirect3DDevice8Impl
*
This
=
device_from_device_p
arent
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IWineD3DDeviceP
arent
(
iface
);
return
IDirect3DDevice8Impl_AddRef
(
&
This
->
IDirect3DDevice8_iface
);
}
static
ULONG
STDMETHODCALLTYPE
device_parent_Release
(
IWineD3DDeviceParent
*
iface
)
{
struct
IDirect3DDevice8Impl
*
This
=
device_from_device_p
arent
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IWineD3DDeviceP
arent
(
iface
);
return
IDirect3DDevice8Impl_Release
(
&
This
->
IDirect3DDevice8_iface
);
}
...
...
@@ -2750,7 +2748,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateSurface(IWineD3DDeviceParen
IUnknown
*
superior
,
UINT
width
,
UINT
height
,
enum
wined3d_format_id
format
,
DWORD
usage
,
WINED3DPOOL
pool
,
UINT
level
,
WINED3DCUBEMAP_FACES
face
,
IWineD3DSurface
**
surface
)
{
struct
IDirect3DDevice8Impl
*
This
=
device_from_device_p
arent
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IWineD3DDeviceP
arent
(
iface
);
IDirect3DSurface8Impl
*
d3d_surface
;
BOOL
lockable
=
TRUE
;
HRESULT
hr
;
...
...
@@ -2789,7 +2787,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateRenderTarget(IWineD3DDevice
WINED3DMULTISAMPLE_TYPE
multisample_type
,
DWORD
multisample_quality
,
BOOL
lockable
,
IWineD3DSurface
**
surface
)
{
struct
IDirect3DDevice8Impl
*
This
=
device_from_device_p
arent
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IWineD3DDeviceP
arent
(
iface
);
IDirect3DSurface8Impl
*
d3d_surface
;
HRESULT
hr
;
...
...
@@ -2819,7 +2817,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateDepthStencilSurface(IWineD3
UINT
width
,
UINT
height
,
enum
wined3d_format_id
format
,
WINED3DMULTISAMPLE_TYPE
multisample_type
,
DWORD
multisample_quality
,
BOOL
discard
,
IWineD3DSurface
**
surface
)
{
struct
IDirect3DDevice8Impl
*
This
=
device_from_device_p
arent
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IWineD3DDeviceP
arent
(
iface
);
IDirect3DSurface8Impl
*
d3d_surface
;
HRESULT
hr
;
...
...
@@ -2849,7 +2847,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent
IUnknown
*
superior
,
UINT
width
,
UINT
height
,
UINT
depth
,
enum
wined3d_format_id
format
,
WINED3DPOOL
pool
,
DWORD
usage
,
IWineD3DVolume
**
volume
)
{
struct
IDirect3DDevice8Impl
*
This
=
device_from_device_p
arent
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IWineD3DDeviceP
arent
(
iface
);
IDirect3DVolume8Impl
*
object
;
HRESULT
hr
;
...
...
@@ -2888,7 +2886,7 @@ static HRESULT STDMETHODCALLTYPE device_parent_CreateVolume(IWineD3DDeviceParent
static
HRESULT
STDMETHODCALLTYPE
device_parent_CreateSwapChain
(
IWineD3DDeviceParent
*
iface
,
WINED3DPRESENT_PARAMETERS
*
present_parameters
,
IWineD3DSwapChain
**
swapchain
)
{
struct
IDirect3DDevice8Impl
*
This
=
device_from_device_p
arent
(
iface
);
IDirect3DDevice8Impl
*
This
=
impl_from_IWineD3DDeviceP
arent
(
iface
);
IDirect3DSwapChain8Impl
*
d3d_swapchain
;
D3DPRESENT_PARAMETERS
local_parameters
;
HRESULT
hr
;
...
...
@@ -2975,7 +2973,7 @@ HRESULT device_init(IDirect3DDevice8Impl *device, IWineD3D *wined3d, UINT adapte
HRESULT
hr
;
device
->
IDirect3DDevice8_iface
.
lpVtbl
=
&
Direct3DDevice8_Vtbl
;
device
->
device_parent_v
tbl
=
&
d3d8_wined3d_device_parent_vtbl
;
device
->
IWineD3DDeviceParent_iface
.
lpV
tbl
=
&
d3d8_wined3d_device_parent_vtbl
;
device
->
ref
=
1
;
device
->
handle_table
.
entries
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
D3D8_INITIAL_HANDLE_TABLE_SIZE
*
sizeof
(
*
device
->
handle_table
.
entries
));
...
...
@@ -2990,7 +2988,7 @@ HRESULT device_init(IDirect3DDevice8Impl *device, IWineD3D *wined3d, UINT adapte
wined3d_mutex_lock
();
hr
=
IWineD3D_CreateDevice
(
wined3d
,
adapter
,
device_type
,
focus_window
,
flags
,
(
IWineD3DDeviceParent
*
)
&
device
->
device_parent_vtbl
,
&
device
->
WineD3DDevice
);
&
device
->
IWineD3DDeviceParent_iface
,
&
device
->
WineD3DDevice
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d device, hr %#x.
\n
"
,
hr
);
...
...
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