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
3ffd998c
Commit
3ffd998c
authored
Oct 09, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Get rid of the IDirect3DRMVisualArrayImpl typedef.
parent
cb49cff0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
68 deletions
+58
-68
frame.c
dlls/d3drm/frame.c
+58
-68
No files found.
dlls/d3drm/frame.c
View file @
3ffd998c
...
...
@@ -65,12 +65,13 @@ typedef struct {
IDirect3DRMFrame
**
frames
;
}
IDirect3DRMFrameArrayImpl
;
typedef
struct
{
struct
d3drm_visual_array
{
IDirect3DRMVisualArray
IDirect3DRMVisualArray_iface
;
LONG
ref
;
ULONG
size
;
IDirect3DRMVisual
**
visuals
;
}
IDirect3DRMVisualArrayImpl
;
};
struct
d3drm_light_array
{
...
...
@@ -97,9 +98,9 @@ static inline IDirect3DRMFrameArrayImpl *impl_from_IDirect3DRMFrameArray(IDirect
return
CONTAINING_RECORD
(
iface
,
IDirect3DRMFrameArrayImpl
,
IDirect3DRMFrameArray_iface
);
}
static
inline
IDirect3DRMVisualArrayImpl
*
impl_from_IDirect3DRMVisualArray
(
IDirect3DRMVisualArray
*
iface
)
static
inline
struct
d3drm_visual_array
*
impl_from_IDirect3DRMVisualArray
(
IDirect3DRMVisualArray
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DRMVisualArrayImpl
,
IDirect3DRMVisualArray_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3drm_visual_array
,
IDirect3DRMVisualArray_iface
);
}
static
inline
struct
d3drm_light_array
*
impl_from_IDirect3DRMLightArray
(
IDirect3DRMLightArray
*
iface
)
...
...
@@ -218,7 +219,7 @@ static HRESULT Direct3DRMFrameArray_create(IDirect3DRMFrameArray** obj)
return
S_OK
;
}
static
HRESULT
WINAPI
IDirect3DRMVisualArrayImpl
_QueryInterface
(
IDirect3DRMVisualArray
*
iface
,
REFIID
riid
,
void
**
out
)
static
HRESULT
WINAPI
d3drm_visual_array
_QueryInterface
(
IDirect3DRMVisualArray
*
iface
,
REFIID
riid
,
void
**
out
)
{
TRACE
(
"iface %p, riid %s, out %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
out
);
...
...
@@ -236,97 +237,88 @@ static HRESULT WINAPI IDirect3DRMVisualArrayImpl_QueryInterface(IDirect3DRMVisua
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IDirect3DRMVisualArrayImpl_AddRef
(
IDirect3DRMVisualArray
*
iface
)
static
ULONG
WINAPI
d3drm_visual_array_AddRef
(
IDirect3DRMVisualArray
*
iface
)
{
IDirect3DRMVisualArrayImpl
*
This
=
impl_from_IDirect3DRMVisualArray
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
struct
d3drm_visual_array
*
array
=
impl_from_IDirect3DRMVisualArray
(
iface
);
ULONG
ref
count
=
InterlockedIncrement
(
&
array
->
ref
);
TRACE
(
"
(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
TRACE
(
"
%p increasing refcount to %u.
\n
"
,
iface
,
refcount
);
return
ref
;
return
ref
count
;
}
static
ULONG
WINAPI
IDirect3DRMVisualArrayImpl_Release
(
IDirect3DRMVisualArray
*
iface
)
static
ULONG
WINAPI
d3drm_visual_array_Release
(
IDirect3DRMVisualArray
*
iface
)
{
IDirect3DRMVisualArrayImpl
*
This
=
impl_from_IDirect3DRMVisualArray
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
d3drm_visual_array
*
array
=
impl_from_IDirect3DRMVisualArray
(
iface
);
ULONG
ref
count
=
InterlockedDecrement
(
&
array
->
ref
);
ULONG
i
;
TRACE
(
"
(%p)->(): new ref = %u
\n
"
,
iface
,
ref
);
TRACE
(
"
%p decreasing refcount to %u.
\n
"
,
iface
,
refcount
);
if
(
!
ref
)
if
(
!
ref
count
)
{
for
(
i
=
0
;
i
<
This
->
size
;
i
++
)
IDirect3DRMVisual_Release
(
This
->
visuals
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
visuals
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
for
(
i
=
0
;
i
<
array
->
size
;
++
i
)
{
IDirect3DRMVisual_Release
(
array
->
visuals
[
i
]);
}
HeapFree
(
GetProcessHeap
(),
0
,
array
->
visuals
);
HeapFree
(
GetProcessHeap
(),
0
,
array
);
}
return
ref
;
return
ref
count
;
}
/*** IDirect3DRMArray methods ***/
static
DWORD
WINAPI
IDirect3DRMVisualArrayImpl_GetSize
(
IDirect3DRMVisualArray
*
iface
)
static
DWORD
WINAPI
d3drm_visual_array_GetSize
(
IDirect3DRMVisualArray
*
iface
)
{
IDirect3DRMVisualArrayImpl
*
This
=
impl_from_IDirect3DRMVisualArray
(
iface
);
struct
d3drm_visual_array
*
array
=
impl_from_IDirect3DRMVisualArray
(
iface
);
TRACE
(
"
(%p)->() = %d
\n
"
,
iface
,
This
->
siz
e
);
TRACE
(
"
iface %p.
\n
"
,
ifac
e
);
return
This
->
size
;
return
array
->
size
;
}
/*** IDirect3DRMVisualArray methods ***/
static
HRESULT
WINAPI
IDirect3DRMVisualArrayImpl_GetElement
(
IDirect3DRMVisualArray
*
iface
,
static
HRESULT
WINAPI
d3drm_visual_array_GetElement
(
IDirect3DRMVisualArray
*
iface
,
DWORD
index
,
IDirect3DRMVisual
**
visual
)
{
IDirect3DRMVisualArrayImpl
*
This
=
impl_from_IDirect3DRMVisualArray
(
iface
);
struct
d3drm_visual_array
*
array
=
impl_from_IDirect3DRMVisualArray
(
iface
);
TRACE
(
"
(%p)->(%u, %p)
\n
"
,
iface
,
index
,
visual
);
TRACE
(
"
iface %p, index %u, visual %p.
\n
"
,
iface
,
index
,
visual
);
if
(
!
visual
)
return
D3DRMERR_BADVALUE
;
if
(
index
>=
array
->
size
)
{
*
visual
=
NULL
;
if
(
index
>=
This
->
size
)
return
D3DRMERR_BADVALUE
;
}
IDirect3DRMVisual_AddRef
(
This
->
visuals
[
index
]);
*
visual
=
This
->
visuals
[
index
];
IDirect3DRMVisual_AddRef
(
array
->
visuals
[
index
]);
*
visual
=
array
->
visuals
[
index
];
return
D3DRM_OK
;
}
static
const
struct
IDirect3DRMVisualArrayVtbl
Direct3DRMVisualArray_V
tbl
=
static
const
struct
IDirect3DRMVisualArrayVtbl
d3drm_visual_array_v
tbl
=
{
/*** IUnknown methods ***/
IDirect3DRMVisualArrayImpl_QueryInterface
,
IDirect3DRMVisualArrayImpl_AddRef
,
IDirect3DRMVisualArrayImpl_Release
,
/*** IDirect3DRMArray methods ***/
IDirect3DRMVisualArrayImpl_GetSize
,
/*** IDirect3DRMVisualArray methods ***/
IDirect3DRMVisualArrayImpl_GetElement
d3drm_visual_array_QueryInterface
,
d3drm_visual_array_AddRef
,
d3drm_visual_array_Release
,
d3drm_visual_array_GetSize
,
d3drm_visual_array_GetElement
,
};
static
HRESULT
Direct3DRMVisualArray_create
(
IDirect3DRMVisualArray
**
ret_iface
)
static
struct
d3drm_visual_array
*
d3drm_visual_array_create
(
void
)
{
IDirect3DRMVisualArrayImpl
*
object
;
struct
d3drm_visual_array
*
array
;
TRACE
(
"(%p)
\n
"
,
ret_iface
);
*
ret_iface
=
NULL
;
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3DRMVisualArrayImpl
));
if
(
!
object
)
return
E_OUTOFMEMORY
;
object
->
IDirect3DRMVisualArray_iface
.
lpVtbl
=
&
Direct3DRMVisualArray_Vtbl
;
object
->
ref
=
1
;
if
(
!
(
array
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
array
))))
return
NULL
;
*
ret_iface
=
&
object
->
IDirect3DRMVisualArray_iface
;
array
->
IDirect3DRMVisualArray_iface
.
lpVtbl
=
&
d3drm_visual_array_vtbl
;
array
->
ref
=
1
;
return
S_OK
;
return
array
;
}
static
HRESULT
WINAPI
d3drm_light_array_QueryInterface
(
IDirect3DRMLightArray
*
iface
,
REFIID
riid
,
void
**
out
)
...
...
@@ -789,34 +781,32 @@ static HRESULT WINAPI IDirect3DRMFrame2Impl_GetOrientation(IDirect3DRMFrame2 *if
static
HRESULT
WINAPI
IDirect3DRMFrame2Impl_GetVisuals
(
IDirect3DRMFrame2
*
iface
,
IDirect3DRMVisualArray
**
visuals
)
{
IDirect3DRMFrameImpl
*
This
=
impl_from_IDirect3DRMFrame2
(
iface
);
IDirect3DRMVisualArrayImpl
*
obj
;
HRESULT
hr
;
struct
d3drm_visual_array
*
array
;
TRACE
(
"
(%p/%p)->(%p)
\n
"
,
iface
,
This
,
visuals
);
TRACE
(
"
iface %p, visuals %p.
\n
"
,
iface
,
visuals
);
if
(
!
visuals
)
return
D3DRMERR_BADVALUE
;
hr
=
Direct3DRMVisualArray_create
(
visuals
);
if
(
hr
!=
D3DRM_OK
)
return
hr
;
obj
=
(
IDirect3DRMVisualArrayImpl
*
)
*
visuals
;
if
(
!
(
array
=
d3drm_visual_array_create
()))
return
E_OUTOFMEMORY
;
obj
->
size
=
This
->
nb_visuals
;
array
->
size
=
This
->
nb_visuals
;
if
(
This
->
nb_visuals
)
{
ULONG
i
;
if
(
!
(
obj
->
visuals
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
nb_visuals
*
sizeof
(
*
obj
->
visuals
))))
if
(
!
(
array
->
visuals
=
HeapAlloc
(
GetProcessHeap
(),
0
,
This
->
nb_visuals
*
sizeof
(
*
array
->
visuals
))))
return
E_OUTOFMEMORY
;
for
(
i
=
0
;
i
<
This
->
nb_visuals
;
i
++
)
{
obj
->
visuals
[
i
]
=
This
->
visuals
[
i
];
array
->
visuals
[
i
]
=
This
->
visuals
[
i
];
IDirect3DRMVisual_AddRef
(
This
->
visuals
[
i
]);
}
}
*
visuals
=
&
array
->
IDirect3DRMVisualArray_iface
;
return
D3DRM_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