Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
6ad10335
Commit
6ad10335
authored
14 years ago
by
Michael Stefaniuc
Committed by
Alexandre Julliard
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3d8: COM cleanup for the IDirect3D8 iface.
parent
3a95fe84
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/d3d8/d3d8_main.c
+3
-3
3 additions, 3 deletions
dlls/d3d8/d3d8_main.c
dlls/d3d8/d3d8_private.h
+3
-4
3 additions, 4 deletions
dlls/d3d8/d3d8_private.h
dlls/d3d8/directx.c
+60
-40
60 additions, 40 deletions
dlls/d3d8/directx.c
with
66 additions
and
47 deletions
dlls/d3d8/d3d8_main.c
+
3
−
3
View file @
6ad10335
...
...
@@ -43,9 +43,9 @@ IDirect3D8* WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT SDKVersion) {
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3D8Impl
));
object
->
lpVtbl
=
&
Direct3D8_Vtbl
;
object
->
IDirect3D8_iface
.
lpVtbl
=
&
Direct3D8_Vtbl
;
object
->
ref
=
1
;
object
->
WineD3D
=
WineDirect3DCreate
(
8
,
(
IUnknown
*
)
object
);
object
->
WineD3D
=
WineDirect3DCreate
(
8
,
(
IUnknown
*
)
&
object
->
IDirect3D8_iface
);
TRACE
(
"Created Direct3D object @ %p, WineObj @ %p
\n
"
,
object
,
object
->
WineD3D
);
...
...
@@ -56,7 +56,7 @@ IDirect3D8* WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT SDKVersion) {
HeapFree
(
GetProcessHeap
(),
0
,
object
);
object
=
NULL
;
}
return
(
IDirect3D8
*
)
object
;
return
&
object
->
IDirect3D8
_iface
;
}
/* At process attach */
...
...
This diff is collapsed.
Click to expand it.
dlls/d3d8/d3d8_private.h
+
3
−
4
View file @
6ad10335
...
...
@@ -132,12 +132,11 @@ extern const IDirect3D8Vtbl Direct3D8_Vtbl DECLSPEC_HIDDEN;
*/
struct
IDirect3D8Impl
{
/* IUnknown fields */
const
IDirect3D8Vtbl
*
lpVtbl
;
LONG
ref
;
IDirect3D8
IDirect3D8_iface
;
LONG
ref
;
/* The WineD3D device */
IWineD3D
*
WineD3D
;
IWineD3D
*
WineD3D
;
};
/*****************************************************************************
...
...
This diff is collapsed.
Click to expand it.
dlls/d3d8/directx.c
+
60
−
40
View file @
6ad10335
...
...
@@ -37,10 +37,14 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d8
);
/* IDirect3D IUnknown parts follow: */
static
inline
IDirect3D8Impl
*
impl_from_IDirect3D8
(
IDirect3D8
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3D8Impl
,
IDirect3D8_iface
);
}
static
HRESULT
WINAPI
IDirect3D8Impl_QueryInterface
(
LPDIRECT3D8
iface
,
REFIID
riid
,
LPVOID
*
ppobj
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8
Impl
*
)
iface
;
IDirect3D8Impl
*
This
=
impl_from_
IDirect3D8
(
iface
)
;
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
ppobj
);
...
...
@@ -56,8 +60,9 @@ static HRESULT WINAPI IDirect3D8Impl_QueryInterface(LPDIRECT3D8 iface, REFIID ri
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IDirect3D8Impl_AddRef
(
LPDIRECT3D8
iface
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
static
ULONG
WINAPI
IDirect3D8Impl_AddRef
(
LPDIRECT3D8
iface
)
{
IDirect3D8Impl
*
This
=
impl_from_IDirect3D8
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
iface
,
ref
);
...
...
@@ -65,8 +70,9 @@ static ULONG WINAPI IDirect3D8Impl_AddRef(LPDIRECT3D8 iface) {
return
ref
;
}
static
ULONG
WINAPI
IDirect3D8Impl_Release
(
LPDIRECT3D8
iface
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
static
ULONG
WINAPI
IDirect3D8Impl_Release
(
LPDIRECT3D8
iface
)
{
IDirect3D8Impl
*
This
=
impl_from_IDirect3D8
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
iface
,
ref
);
...
...
@@ -84,9 +90,10 @@ static ULONG WINAPI IDirect3D8Impl_Release(LPDIRECT3D8 iface) {
return
ref
;
}
/* IDirect3D8 Interface follow: */
static
HRESULT
WINAPI
IDirect3D8Impl_RegisterSoftwareDevice
(
LPDIRECT3D8
iface
,
void
*
pInitializeFunction
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
static
HRESULT
WINAPI
IDirect3D8Impl_RegisterSoftwareDevice
(
LPDIRECT3D8
iface
,
void
*
pInitializeFunction
)
{
IDirect3D8Impl
*
This
=
impl_from_IDirect3D8
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, init_function %p.
\n
"
,
iface
,
pInitializeFunction
);
...
...
@@ -98,8 +105,9 @@ static HRESULT WINAPI IDirect3D8Impl_RegisterSoftwareDevice (LPDIRECT3D8 iface,
return
hr
;
}
static
UINT
WINAPI
IDirect3D8Impl_GetAdapterCount
(
LPDIRECT3D8
iface
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
static
UINT
WINAPI
IDirect3D8Impl_GetAdapterCount
(
LPDIRECT3D8
iface
)
{
IDirect3D8Impl
*
This
=
impl_from_IDirect3D8
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p.
\n
"
,
iface
);
...
...
@@ -111,10 +119,10 @@ static UINT WINAPI IDirect3D8Impl_GetAdapterCount (LPDIRECT3D8 iface) {
return
hr
;
}
static
HRESULT
WINAPI
IDirect3D8Impl_GetAdapterIdentifier
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
DWORD
Flags
,
D3DADAPTER_IDENTIFIER8
*
pIdentifier
)
static
HRESULT
WINAPI
IDirect3D8Impl_GetAdapterIdentifier
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
DWORD
Flags
,
D3DADAPTER_IDENTIFIER8
*
pIdentifier
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8
Impl
*
)
iface
;
IDirect3D8Impl
*
This
=
impl_from_
IDirect3D8
(
iface
)
;
WINED3DADAPTER_IDENTIFIER
adapter_id
;
HRESULT
hr
;
...
...
@@ -143,8 +151,9 @@ static HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier(LPDIRECT3D8 iface,
return
hr
;
}
static
UINT
WINAPI
IDirect3D8Impl_GetAdapterModeCount
(
LPDIRECT3D8
iface
,
UINT
Adapter
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
static
UINT
WINAPI
IDirect3D8Impl_GetAdapterModeCount
(
LPDIRECT3D8
iface
,
UINT
Adapter
)
{
IDirect3D8Impl
*
This
=
impl_from_IDirect3D8
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, adapter %u.
\n
"
,
iface
,
Adapter
);
...
...
@@ -156,8 +165,10 @@ static UINT WINAPI IDirect3D8Impl_GetAdapterModeCount (LPDIRECT3D8 iface,UINT Ad
return
hr
;
}
static
HRESULT
WINAPI
IDirect3D8Impl_EnumAdapterModes
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
UINT
Mode
,
D3DDISPLAYMODE
*
pMode
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
static
HRESULT
WINAPI
IDirect3D8Impl_EnumAdapterModes
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
UINT
Mode
,
D3DDISPLAYMODE
*
pMode
)
{
IDirect3D8Impl
*
This
=
impl_from_IDirect3D8
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, adapter %u, mode_idx %u, mode %p.
\n
"
,
...
...
@@ -172,8 +183,10 @@ static HRESULT WINAPI IDirect3D8Impl_EnumAdapterModes (LPDIRECT3D8 iface, UINT A
return
hr
;
}
static
HRESULT
WINAPI
IDirect3D8Impl_GetAdapterDisplayMode
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
D3DDISPLAYMODE
*
pMode
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
static
HRESULT
WINAPI
IDirect3D8Impl_GetAdapterDisplayMode
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
D3DDISPLAYMODE
*
pMode
)
{
IDirect3D8Impl
*
This
=
impl_from_IDirect3D8
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, adapter %u, mode %p.
\n
"
,
...
...
@@ -188,10 +201,10 @@ static HRESULT WINAPI IDirect3D8Impl_GetAdapterDisplayMode (LPDIRECT3D8 iface, U
return
hr
;
}
static
HRESULT
WINAPI
IDirect3D8Impl_CheckDeviceType
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
D3DDEVTYPE
CheckType
,
D3DFORMAT
DisplayFormat
,
D3DFORMAT
BackBufferFormat
,
BOOL
Windowed
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8
Impl
*
)
iface
;
static
HRESULT
WINAPI
IDirect3D8Impl_CheckDeviceType
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
D3DDEVTYPE
CheckType
,
D3DFORMAT
DisplayFormat
,
D3DFORMAT
BackBufferFormat
,
BOOL
Windowed
)
{
IDirect3D8Impl
*
This
=
impl_from_
IDirect3D8
(
iface
)
;
HRESULT
hr
;
TRACE
(
"iface %p, adapter %u, device_type %#x, display_format %#x, backbuffer_format %#x, windowed %#x.
\n
"
,
...
...
@@ -205,10 +218,11 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDeviceType (LPDIRECT3D8 i
return
hr
;
}
static
HRESULT
WINAPI
IDirect3D8Impl_CheckDeviceFormat
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
D3DDEVTYPE
DeviceType
,
D3DFORMAT
AdapterFormat
,
DWORD
Usage
,
D3DRESOURCETYPE
RType
,
D3DFORMAT
CheckFormat
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
static
HRESULT
WINAPI
IDirect3D8Impl_CheckDeviceFormat
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
D3DDEVTYPE
DeviceType
,
D3DFORMAT
AdapterFormat
,
DWORD
Usage
,
D3DRESOURCETYPE
RType
,
D3DFORMAT
CheckFormat
)
{
IDirect3D8Impl
*
This
=
impl_from_IDirect3D8
(
iface
);
HRESULT
hr
;
WINED3DRESOURCETYPE
WineD3DRType
;
...
...
@@ -243,9 +257,10 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat (LPDIRECT3D8 i
}
static
HRESULT
WINAPI
IDirect3D8Impl_CheckDeviceMultiSampleType
(
IDirect3D8
*
iface
,
UINT
Adapter
,
D3DDEVTYPE
DeviceType
,
D3DFORMAT
SurfaceFormat
,
BOOL
Windowed
,
D3DMULTISAMPLE_TYPE
MultiSampleType
)
D3DDEVTYPE
DeviceType
,
D3DFORMAT
SurfaceFormat
,
BOOL
Windowed
,
D3DMULTISAMPLE_TYPE
MultiSampleType
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8
Impl
*
)
iface
;
IDirect3D8Impl
*
This
=
impl_from_
IDirect3D8
(
iface
)
;
HRESULT
hr
;
TRACE
(
"iface %p, adapter %u, device_type %#x, format %#x, windowed %#x, multisample_type %#x.
\n
"
,
...
...
@@ -259,10 +274,11 @@ static HRESULT WINAPI IDirect3D8Impl_CheckDeviceMultiSampleType(IDirect3D8 *ifac
return
hr
;
}
static
HRESULT
WINAPI
IDirect3D8Impl_CheckDepthStencilMatch
(
IDirect3D8
*
iface
,
UINT
Adapter
,
D3DDEVTYPE
DeviceType
,
D3DFORMAT
AdapterFormat
,
D3DFORMAT
RenderTargetFormat
,
D3DFORMAT
DepthStencilFormat
)
static
HRESULT
WINAPI
IDirect3D8Impl_CheckDepthStencilMatch
(
IDirect3D8
*
iface
,
UINT
Adapter
,
D3DDEVTYPE
DeviceType
,
D3DFORMAT
AdapterFormat
,
D3DFORMAT
RenderTargetFormat
,
D3DFORMAT
DepthStencilFormat
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8
Impl
*
)
iface
;
IDirect3D8Impl
*
This
=
impl_from_
IDirect3D8
(
iface
)
;
HRESULT
hr
;
TRACE
(
"iface %p, adapter %u, device_type %#x, adapter_format %#x, rt_format %#x, ds_format %#x.
\n
"
,
...
...
@@ -291,8 +307,10 @@ void fixup_caps(WINED3DCAPS *caps)
caps
->
StencilCaps
&=
~
WINED3DSTENCILCAPS_TWOSIDED
;
}
static
HRESULT
WINAPI
IDirect3D8Impl_GetDeviceCaps
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
D3DDEVTYPE
DeviceType
,
D3DCAPS8
*
pCaps
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
static
HRESULT
WINAPI
IDirect3D8Impl_GetDeviceCaps
(
LPDIRECT3D8
iface
,
UINT
Adapter
,
D3DDEVTYPE
DeviceType
,
D3DCAPS8
*
pCaps
)
{
IDirect3D8Impl
*
This
=
impl_from_IDirect3D8
(
iface
);
HRESULT
hrc
=
D3D_OK
;
WINED3DCAPS
*
pWineCaps
;
...
...
@@ -318,8 +336,9 @@ static HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface, UINT Ada
return
hrc
;
}
static
HMONITOR
WINAPI
IDirect3D8Impl_GetAdapterMonitor
(
LPDIRECT3D8
iface
,
UINT
Adapter
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8Impl
*
)
iface
;
static
HMONITOR
WINAPI
IDirect3D8Impl_GetAdapterMonitor
(
LPDIRECT3D8
iface
,
UINT
Adapter
)
{
IDirect3D8Impl
*
This
=
impl_from_IDirect3D8
(
iface
);
HMONITOR
ret
;
TRACE
(
"iface %p, adapter %u.
\n
"
,
iface
,
Adapter
);
...
...
@@ -331,10 +350,11 @@ static HMONITOR WINAPI IDirect3D8Impl_GetAdapterMonitor(LPDIRECT3D8 iface, UINT
return
ret
;
}
static
HRESULT
WINAPI
IDirect3D8Impl_CreateDevice
(
IDirect3D8
*
iface
,
UINT
adapter
,
D3DDEVTYPE
device_type
,
HWND
focus_window
,
DWORD
flags
,
D3DPRESENT_PARAMETERS
*
parameters
,
IDirect3DDevice8
**
device
)
static
HRESULT
WINAPI
IDirect3D8Impl_CreateDevice
(
IDirect3D8
*
iface
,
UINT
adapter
,
D3DDEVTYPE
device_type
,
HWND
focus_window
,
DWORD
flags
,
D3DPRESENT_PARAMETERS
*
parameters
,
IDirect3DDevice8
**
device
)
{
IDirect3D8Impl
*
This
=
(
IDirect3D8
Impl
*
)
iface
;
IDirect3D8Impl
*
This
=
impl_from_
IDirect3D8
(
iface
)
;
IDirect3DDevice8Impl
*
object
;
HRESULT
hr
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment