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
0586dd8b
Commit
0586dd8b
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 IDirect3DMaterial2 iface.
parent
734a4c3a
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 @
0586dd8b
...
@@ -4627,7 +4627,7 @@ static HRESULT WINAPI d3d2_CreateMaterial(IDirect3D2 *iface, IDirect3DMaterial2
...
@@ -4627,7 +4627,7 @@ static HRESULT WINAPI d3d2_CreateMaterial(IDirect3D2 *iface, IDirect3DMaterial2
TRACE
(
"iface %p, material %p, outer_unknown %p.
\n
"
,
iface
,
material
,
outer_unknown
);
TRACE
(
"iface %p, material %p, outer_unknown %p.
\n
"
,
iface
,
material
,
outer_unknown
);
hr
=
d3d3_CreateMaterial
(
&
This
->
IDirect3D3_iface
,
&
material3
,
outer_unknown
);
hr
=
d3d3_CreateMaterial
(
&
This
->
IDirect3D3_iface
,
&
material3
,
outer_unknown
);
*
material
=
material3
?
(
IDirect3DMaterial2
*
)
&
((
IDirect3DMaterialImpl
*
)
material3
)
->
IDirect3DMaterial2_vtbl
:
NULL
;
*
material
=
material3
?
&
((
IDirect3DMaterialImpl
*
)
material3
)
->
IDirect3DMaterial2_iface
:
NULL
;
TRACE
(
"Returning material %p.
\n
"
,
*
material
);
TRACE
(
"Returning material %p.
\n
"
,
*
material
);
...
...
dlls/ddraw/ddraw_private.h
View file @
0586dd8b
...
@@ -415,7 +415,7 @@ void d3d_light_init(IDirect3DLightImpl *light, IDirectDrawImpl *ddraw) DECLSPEC_
...
@@ -415,7 +415,7 @@ void d3d_light_init(IDirect3DLightImpl *light, IDirectDrawImpl *ddraw) DECLSPEC_
struct
IDirect3DMaterialImpl
struct
IDirect3DMaterialImpl
{
{
const
IDirect3DMaterial3Vtbl
*
lpVtbl
;
const
IDirect3DMaterial3Vtbl
*
lpVtbl
;
const
IDirect3DMaterial2Vtbl
*
IDirect3DMaterial2_vtbl
;
IDirect3DMaterial2
IDirect3DMaterial2_iface
;
const
IDirect3DMaterialVtbl
*
IDirect3DMaterial_vtbl
;
const
IDirect3DMaterialVtbl
*
IDirect3DMaterial_vtbl
;
LONG
ref
;
LONG
ref
;
...
...
dlls/ddraw/material.c
View file @
0586dd8b
...
@@ -36,9 +36,9 @@ static inline IDirect3DMaterialImpl *material_from_material1(IDirect3DMaterial *
...
@@ -36,9 +36,9 @@ static inline IDirect3DMaterialImpl *material_from_material1(IDirect3DMaterial *
return
(
IDirect3DMaterialImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
IDirect3DMaterialImpl
,
IDirect3DMaterial_vtbl
));
return
(
IDirect3DMaterialImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
IDirect3DMaterialImpl
,
IDirect3DMaterial_vtbl
));
}
}
static
inline
IDirect3DMaterialImpl
*
material_from_m
aterial2
(
IDirect3DMaterial2
*
iface
)
static
inline
IDirect3DMaterialImpl
*
impl_from_IDirect3DM
aterial2
(
IDirect3DMaterial2
*
iface
)
{
{
return
(
IDirect3DMaterialImpl
*
)((
char
*
)
iface
-
FIELD_OFFSET
(
IDirect3DMaterialImpl
,
IDirect3DMaterial2_vtbl
)
);
return
CONTAINING_RECORD
(
iface
,
IDirect3DMaterialImpl
,
IDirect3DMaterial2_iface
);
}
}
/*****************************************************************************
/*****************************************************************************
...
@@ -84,8 +84,8 @@ IDirect3DMaterialImpl_QueryInterface(IDirect3DMaterial3 *iface,
...
@@ -84,8 +84,8 @@ IDirect3DMaterialImpl_QueryInterface(IDirect3DMaterial3 *iface,
return
S_OK
;
return
S_OK
;
}
}
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial2
,
riid
)
)
{
if
(
IsEqualGUID
(
&
IID_IDirect3DMaterial2
,
riid
)
)
{
IDirect3DMaterial_AddRef
(
(
IDirect3DMaterial2
*
)
&
This
->
IDirect3DMaterial2_vtbl
);
IDirect3DMaterial_AddRef
(
&
This
->
IDirect3DMaterial2_iface
);
*
obp
=
&
This
->
IDirect3DMaterial2_
vtbl
;
*
obp
=
&
This
->
IDirect3DMaterial2_
iface
;
TRACE
(
" Creating IDirect3DMaterial2 interface %p
\n
"
,
*
obp
);
TRACE
(
" Creating IDirect3DMaterial2 interface %p
\n
"
,
*
obp
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -329,9 +329,11 @@ IDirect3DMaterialImpl_GetHandle(IDirect3DMaterial3 *iface,
...
@@ -329,9 +329,11 @@ IDirect3DMaterialImpl_GetHandle(IDirect3DMaterial3 *iface,
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_GetHandle
(
IDirect3DMaterial2
*
iface
,
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_GetHandle
(
IDirect3DMaterial2
*
iface
,
IDirect3DDevice2
*
lpDirect3DDevice2
,
D3DMATERIALHANDLE
*
lpHandle
)
IDirect3DDevice2
*
lpDirect3DDevice2
,
D3DMATERIALHANDLE
*
lpHandle
)
{
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial2
(
iface
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
lpDirect3DDevice2
,
lpHandle
);
TRACE
(
"iface %p, device %p, handle %p.
\n
"
,
iface
,
lpDirect3DDevice2
,
lpHandle
);
return
IDirect3DMaterial3_GetHandle
((
IDirect3DMaterial3
*
)
material_from_material2
(
iface
)
,
lpDirect3DDevice2
?
return
IDirect3DMaterial3_GetHandle
((
IDirect3DMaterial3
*
)
This
,
lpDirect3DDevice2
?
(
IDirect3DDevice3
*
)
&
device_from_device2
(
lpDirect3DDevice2
)
->
IDirect3DDevice3_vtbl
:
NULL
,
lpHandle
);
(
IDirect3DDevice3
*
)
&
device_from_device2
(
lpDirect3DDevice2
)
->
IDirect3DDevice3_vtbl
:
NULL
,
lpHandle
);
}
}
...
@@ -344,12 +346,14 @@ static HRESULT WINAPI IDirect3DMaterialImpl_1_GetHandle(IDirect3DMaterial *iface
...
@@ -344,12 +346,14 @@ static HRESULT WINAPI IDirect3DMaterialImpl_1_GetHandle(IDirect3DMaterial *iface
(
IDirect3DDevice3
*
)
&
device_from_device1
(
lpDirect3DDevice
)
->
IDirect3DDevice3_vtbl
:
NULL
,
lpHandle
);
(
IDirect3DDevice3
*
)
&
device_from_device1
(
lpDirect3DDevice
)
->
IDirect3DDevice3_vtbl
:
NULL
,
lpHandle
);
}
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_QueryInterface
(
LPDIRECT3DMATERIAL2
iface
,
REFIID
riid
,
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_QueryInterface
(
IDirect3DMaterial2
*
iface
,
REFIID
riid
,
LPVOID
*
obp
)
void
**
obp
)
{
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial2
(
iface
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obp
);
TRACE
(
"iface %p, riid %s, object %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obp
);
return
IDirect3DMaterial3_QueryInterface
((
IDirect3DMaterial3
*
)
material_from_material2
(
iface
)
,
riid
,
obp
);
return
IDirect3DMaterial3_QueryInterface
((
IDirect3DMaterial3
*
)
This
,
riid
,
obp
);
}
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_QueryInterface
(
LPDIRECT3DMATERIAL
iface
,
REFIID
riid
,
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_QueryInterface
(
LPDIRECT3DMATERIAL
iface
,
REFIID
riid
,
...
@@ -360,11 +364,13 @@ static HRESULT WINAPI IDirect3DMaterialImpl_1_QueryInterface(LPDIRECT3DMATERIAL
...
@@ -360,11 +364,13 @@ static HRESULT WINAPI IDirect3DMaterialImpl_1_QueryInterface(LPDIRECT3DMATERIAL
return
IDirect3DMaterial3_QueryInterface
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
),
riid
,
obp
);
return
IDirect3DMaterial3_QueryInterface
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
),
riid
,
obp
);
}
}
static
ULONG
WINAPI
IDirect3DMaterialImpl_2_AddRef
(
LPDIRECT3DMATERIAL2
iface
)
static
ULONG
WINAPI
IDirect3DMaterialImpl_2_AddRef
(
IDirect3DMaterial2
*
iface
)
{
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial2
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
IDirect3DMaterial3_AddRef
((
IDirect3DMaterial3
*
)
material_from_material2
(
iface
)
);
return
IDirect3DMaterial3_AddRef
((
IDirect3DMaterial3
*
)
This
);
}
}
static
ULONG
WINAPI
IDirect3DMaterialImpl_1_AddRef
(
LPDIRECT3DMATERIAL
iface
)
static
ULONG
WINAPI
IDirect3DMaterialImpl_1_AddRef
(
LPDIRECT3DMATERIAL
iface
)
...
@@ -374,11 +380,13 @@ static ULONG WINAPI IDirect3DMaterialImpl_1_AddRef(LPDIRECT3DMATERIAL iface)
...
@@ -374,11 +380,13 @@ static ULONG WINAPI IDirect3DMaterialImpl_1_AddRef(LPDIRECT3DMATERIAL iface)
return
IDirect3DMaterial3_AddRef
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
));
return
IDirect3DMaterial3_AddRef
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
));
}
}
static
ULONG
WINAPI
IDirect3DMaterialImpl_2_Release
(
LPDIRECT3DMATERIAL2
iface
)
static
ULONG
WINAPI
IDirect3DMaterialImpl_2_Release
(
IDirect3DMaterial2
*
iface
)
{
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial2
(
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
TRACE
(
"iface %p.
\n
"
,
iface
);
return
IDirect3DMaterial3_Release
((
IDirect3DMaterial3
*
)
material_from_material2
(
iface
)
);
return
IDirect3DMaterial3_Release
((
IDirect3DMaterial3
*
)
This
);
}
}
static
ULONG
WINAPI
IDirect3DMaterialImpl_1_Release
(
LPDIRECT3DMATERIAL
iface
)
static
ULONG
WINAPI
IDirect3DMaterialImpl_1_Release
(
LPDIRECT3DMATERIAL
iface
)
...
@@ -388,12 +396,14 @@ static ULONG WINAPI IDirect3DMaterialImpl_1_Release(LPDIRECT3DMATERIAL iface)
...
@@ -388,12 +396,14 @@ static ULONG WINAPI IDirect3DMaterialImpl_1_Release(LPDIRECT3DMATERIAL iface)
return
IDirect3DMaterial3_Release
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
));
return
IDirect3DMaterial3_Release
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
));
}
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_SetMaterial
(
LPDIRECT3DMATERIAL2
iface
,
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_SetMaterial
(
IDirect3DMaterial2
*
iface
,
LPD3DMATERIAL
lpMat
)
LPD3DMATERIAL
lpMat
)
{
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial2
(
iface
);
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
lpMat
);
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
lpMat
);
return
IDirect3DMaterial3_SetMaterial
((
IDirect3DMaterial3
*
)
material_from_material2
(
iface
)
,
lpMat
);
return
IDirect3DMaterial3_SetMaterial
((
IDirect3DMaterial3
*
)
This
,
lpMat
);
}
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_SetMaterial
(
LPDIRECT3DMATERIAL
iface
,
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_SetMaterial
(
LPDIRECT3DMATERIAL
iface
,
...
@@ -404,12 +414,14 @@ static HRESULT WINAPI IDirect3DMaterialImpl_1_SetMaterial(LPDIRECT3DMATERIAL ifa
...
@@ -404,12 +414,14 @@ static HRESULT WINAPI IDirect3DMaterialImpl_1_SetMaterial(LPDIRECT3DMATERIAL ifa
return
IDirect3DMaterial3_SetMaterial
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
),
lpMat
);
return
IDirect3DMaterial3_SetMaterial
((
IDirect3DMaterial3
*
)
material_from_material1
(
iface
),
lpMat
);
}
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_GetMaterial
(
LPDIRECT3DMATERIAL2
iface
,
static
HRESULT
WINAPI
IDirect3DMaterialImpl_2_GetMaterial
(
IDirect3DMaterial2
*
iface
,
LPD3DMATERIAL
lpMat
)
LPD3DMATERIAL
lpMat
)
{
{
IDirect3DMaterialImpl
*
This
=
impl_from_IDirect3DMaterial2
(
iface
);
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
lpMat
);
TRACE
(
"iface %p, material %p.
\n
"
,
iface
,
lpMat
);
return
IDirect3DMaterial3_GetMaterial
((
IDirect3DMaterial3
*
)
material_from_material2
(
iface
)
,
lpMat
);
return
IDirect3DMaterial3_GetMaterial
((
IDirect3DMaterial3
*
)
This
,
lpMat
);
}
}
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_GetMaterial
(
LPDIRECT3DMATERIAL
iface
,
static
HRESULT
WINAPI
IDirect3DMaterialImpl_1_GetMaterial
(
LPDIRECT3DMATERIAL
iface
,
...
@@ -486,7 +498,7 @@ static const struct IDirect3DMaterialVtbl d3d_material1_vtbl =
...
@@ -486,7 +498,7 @@ static const struct IDirect3DMaterialVtbl d3d_material1_vtbl =
void
d3d_material_init
(
IDirect3DMaterialImpl
*
material
,
IDirectDrawImpl
*
ddraw
)
void
d3d_material_init
(
IDirect3DMaterialImpl
*
material
,
IDirectDrawImpl
*
ddraw
)
{
{
material
->
lpVtbl
=
&
d3d_material3_vtbl
;
material
->
lpVtbl
=
&
d3d_material3_vtbl
;
material
->
IDirect3DMaterial2_
v
tbl
=
&
d3d_material2_vtbl
;
material
->
IDirect3DMaterial2_
iface
.
lpV
tbl
=
&
d3d_material2_vtbl
;
material
->
IDirect3DMaterial_vtbl
=
&
d3d_material1_vtbl
;
material
->
IDirect3DMaterial_vtbl
=
&
d3d_material1_vtbl
;
material
->
ref
=
1
;
material
->
ref
=
1
;
material
->
ddraw
=
ddraw
;
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