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
e3a32e8d
Commit
e3a32e8d
authored
Jun 07, 2011
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jun 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: COM cleanup for the IDirect3DMaterial iface.
parent
0586dd8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
19 deletions
+31
-19
ddraw.c
dlls/ddraw/ddraw.c
+1
-1
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-1
material.c
dlls/ddraw/material.c
+29
-17
No files found.
dlls/ddraw/ddraw.c
View file @
e3a32e8d
...
...
@@ -4644,7 +4644,7 @@ static HRESULT WINAPI d3d1_CreateMaterial(IDirect3D *iface, IDirect3DMaterial **
TRACE
(
"iface %p, material %p, outer_unknown %p.
\n
"
,
iface
,
material
,
outer_unknown
);
hr
=
d3d3_CreateMaterial
(
&
This
->
IDirect3D3_iface
,
&
material3
,
outer_unknown
);
*
material
=
material3
?
(
IDirect3DMaterial
*
)
&
((
IDirect3DMaterialImpl
*
)
material3
)
->
IDirect3DMaterial_vtbl
:
NULL
;
*
material
=
material3
?
&
((
IDirect3DMaterialImpl
*
)
material3
)
->
IDirect3DMaterial_iface
:
NULL
;
TRACE
(
"Returning material %p.
\n
"
,
*
material
);
...
...
dlls/ddraw/ddraw_private.h
View file @
e3a32e8d
...
...
@@ -416,7 +416,7 @@ struct IDirect3DMaterialImpl
{
const
IDirect3DMaterial3Vtbl
*
lpVtbl
;
IDirect3DMaterial2
IDirect3DMaterial2_iface
;
const
IDirect3DMaterialVtbl
*
IDirect3DMaterial_vtbl
;
IDirect3DMaterial
IDirect3DMaterial_iface
;
LONG
ref
;
/* IDirect3DMaterial2 fields */
...
...
dlls/ddraw/material.c
View file @
e3a32e8d
...
...
@@ -31,9 +31,9 @@ static void dump_material(const D3DMATERIAL *mat)
TRACE
(
" dwSize : %d
\n
"
,
mat
->
dwSize
);
}
static
inline
IDirect3DMaterialImpl
*
material_from_material1
(
IDirect3DMaterial
*
iface
)
static
inline
IDirect3DMaterialImpl
*
impl_from_IDirect3DMaterial
(
IDirect3DMaterial
*
iface
)
{
return
(
IDirect3DMaterialImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
IDirect3DMaterialImpl
,
IDirect3DMaterial_vtbl
)
);
return
CONTAINING_RECORD
(
iface
,
IDirect3DMaterialImpl
,
IDirect3DMaterial_iface
);
}
static
inline
IDirect3DMaterialImpl
*
impl_from_IDirect3DMaterial2
(
IDirect3DMaterial2
*
iface
)
...
...
@@ -78,8 +78,8 @@ IDirect3DMaterialImpl_QueryInterface(IDirect3DMaterial3 *iface,
return
S_OK
;
}
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial
,
riid
)
)
{
IDirect3DMaterial_AddRef
(
(
IDirect3DMaterial
*
)
&
This
->
IDirect3DMaterial_vtbl
);
*
obp
=
&
This
->
IDirect3DMaterial_
vtbl
;
IDirect3DMaterial_AddRef
(
&
This
->
IDirect3DMaterial_iface
);
*
obp
=
&
This
->
IDirect3DMaterial_
iface
;
TRACE
(
" Creating IDirect3DMaterial interface %p
\n
"
,
*
obp
);
return
S_OK
;
}
...
...
@@ -340,9 +340,11 @@ static HRESULT WINAPI IDirect3DMaterialImpl_2_GetHandle(IDirect3DMaterial2 *ifac
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_GetHandle
(
IDirect3DMaterial
*
iface
,
IDirect3DDevice
*
lpDirect3DDevice
,
D3DMATERIALHANDLE
*
lpHandle
)
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial
(
iface
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
lpDirect3DDevice
,
lpHandle
);
return
IDirect3DMaterial3_GetHandle
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
)
,
lpDirect3DDevice
?
return
IDirect3DMaterial3_GetHandle
((
IDirect3DMaterial3
*
)
This
,
lpDirect3DDevice
?
(
IDirect3DDevice3
*
)
&
device_from_device1
(
lpDirect3DDevice
)
->
IDirect3DDevice3_vtbl
:
NULL
,
lpHandle
);
}
...
...
@@ -356,12 +358,14 @@ static HRESULT WINAPI IDirect3DMaterialImpl_2_QueryInterface(IDirect3DMaterial2
return
IDirect3DMaterial3_QueryInterface
((
IDirect3DMaterial3
*
)
This
,
riid
,
obp
);
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_QueryInterface
(
LPDIRECT3DMATERIAL
iface
,
REFIID
riid
,
LPVOID
*
obp
)
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_QueryInterface
(
IDirect3DMaterial
*
iface
,
REFIID
riid
,
void
**
obp
)
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial
(
iface
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obp
);
return
IDirect3DMaterial3_QueryInterface
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
)
,
riid
,
obp
);
return
IDirect3DMaterial3_QueryInterface
((
IDirect3DMaterial3
*
)
This
,
riid
,
obp
);
}
static
ULONG
WINAPI
IDirect3DMaterialImpl_2_AddRef
(
IDirect3DMaterial2
*
iface
)
...
...
@@ -373,11 +377,13 @@ static ULONG WINAPI IDirect3DMaterialImpl_2_AddRef(IDirect3DMaterial2 *iface)
return
IDirect3DMaterial3_AddRef
((
IDirect3DMaterial3
*
)
This
);
}
static
ULONG
WINAPI
IDirect3DMaterialImpl_1_AddRef
(
LPDIRECT3DMATERIAL
iface
)
static
ULONG
WINAPI
IDirect3DMaterialImpl_1_AddRef
(
IDirect3DMaterial
*
iface
)
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
IDirect3DMaterial3_AddRef
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
)
);
return
IDirect3DMaterial3_AddRef
((
IDirect3DMaterial3
*
)
This
);
}
static
ULONG
WINAPI
IDirect3DMaterialImpl_2_Release
(
IDirect3DMaterial2
*
iface
)
...
...
@@ -389,11 +395,13 @@ static ULONG WINAPI IDirect3DMaterialImpl_2_Release(IDirect3DMaterial2 *iface)
return
IDirect3DMaterial3_Release
((
IDirect3DMaterial3
*
)
This
);
}
static
ULONG
WINAPI
IDirect3DMaterialImpl_1_Release
(
LPDIRECT3DMATERIAL
iface
)
static
ULONG
WINAPI
IDirect3DMaterialImpl_1_Release
(
IDirect3DMaterial
*
iface
)
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
IDirect3DMaterial3_Release
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
)
);
return
IDirect3DMaterial3_Release
((
IDirect3DMaterial3
*
)
This
);
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_SetMaterial
(
IDirect3DMaterial2
*
iface
,
...
...
@@ -406,12 +414,14 @@ static HRESULT WINAPI IDirect3DMaterialImpl_2_SetMaterial(IDirect3DMaterial2 *if
return
IDirect3DMaterial3_SetMaterial
((
IDirect3DMaterial3
*
)
This
,
lpMat
);
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_SetMaterial
(
LPDIRECT3DMATERIAL
iface
,
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_SetMaterial
(
IDirect3DMaterial
*
iface
,
LPD3DMATERIAL
lpMat
)
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial
(
iface
);
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
lpMat
);
return
IDirect3DMaterial3_SetMaterial
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
)
,
lpMat
);
return
IDirect3DMaterial3_SetMaterial
((
IDirect3DMaterial3
*
)
This
,
lpMat
);
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_GetMaterial
(
IDirect3DMaterial2
*
iface
,
...
...
@@ -424,12 +434,14 @@ static HRESULT WINAPI IDirect3DMaterialImpl_2_GetMaterial(IDirect3DMaterial2 *if
return
IDirect3DMaterial3_GetMaterial
((
IDirect3DMaterial3
*
)
This
,
lpMat
);
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_GetMaterial
(
LPDIRECT3DMATERIAL
iface
,
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_GetMaterial
(
IDirect3DMaterial
*
iface
,
LPD3DMATERIAL
lpMat
)
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial
(
iface
);
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
lpMat
);
return
IDirect3DMaterial3_GetMaterial
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
)
,
lpMat
);
return
IDirect3DMaterial3_GetMaterial
((
IDirect3DMaterial3
*
)
This
,
lpMat
);
}
...
...
@@ -499,7 +511,7 @@ void d3d_material_init(IDirect3DMaterialImpl *material, IDirectDrawImpl *ddraw)
{
material
->
lpVtbl
=
&
d3d_material3_vtbl
;
material
->
IDirect3DMaterial2_iface
.
lpVtbl
=
&
d3d_material2_vtbl
;
material
->
IDirect3DMaterial_
v
tbl
=
&
d3d_material1_vtbl
;
material
->
IDirect3DMaterial_
iface
.
lpV
tbl
=
&
d3d_material1_vtbl
;
material
->
ref
=
1
;
material
->
ddraw
=
ddraw
;
}
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