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
7dc07389
Commit
7dc07389
authored
Oct 28, 2013
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 28, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Initialize the actual array in d3drm_light_array_create() as well.
parent
c0d05d9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
frame.c
dlls/d3drm/frame.c
+19
-18
No files found.
dlls/d3drm/frame.c
View file @
7dc07389
...
@@ -434,15 +434,32 @@ static const struct IDirect3DRMLightArrayVtbl d3drm_light_array_vtbl =
...
@@ -434,15 +434,32 @@ static const struct IDirect3DRMLightArrayVtbl d3drm_light_array_vtbl =
d3drm_light_array_GetElement
,
d3drm_light_array_GetElement
,
};
};
static
struct
d3drm_light_array
*
d3drm_light_array_create
(
void
)
static
struct
d3drm_light_array
*
d3drm_light_array_create
(
unsigned
int
light_count
,
IDirect3DRMLight
**
lights
)
{
{
struct
d3drm_light_array
*
array
;
struct
d3drm_light_array
*
array
;
unsigned
int
i
;
if
(
!
(
array
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
array
))))
if
(
!
(
array
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
array
))))
return
NULL
;
return
NULL
;
array
->
IDirect3DRMLightArray_iface
.
lpVtbl
=
&
d3drm_light_array_vtbl
;
array
->
IDirect3DRMLightArray_iface
.
lpVtbl
=
&
d3drm_light_array_vtbl
;
array
->
ref
=
1
;
array
->
ref
=
1
;
array
->
size
=
light_count
;
if
(
light_count
)
{
if
(
!
(
array
->
lights
=
HeapAlloc
(
GetProcessHeap
(),
0
,
light_count
*
sizeof
(
*
array
->
lights
))))
{
HeapFree
(
GetProcessHeap
(),
0
,
array
);
return
NULL
;
}
for
(
i
=
0
;
i
<
light_count
;
++
i
)
{
array
->
lights
[
i
]
=
lights
[
i
];
IDirect3DRMLight_AddRef
(
array
->
lights
[
i
]);
}
}
return
array
;
return
array
;
}
}
...
@@ -1541,25 +1558,9 @@ static HRESULT WINAPI d3drm_frame3_GetLights(IDirect3DRMFrame3 *iface, IDirect3D
...
@@ -1541,25 +1558,9 @@ static HRESULT WINAPI d3drm_frame3_GetLights(IDirect3DRMFrame3 *iface, IDirect3D
if
(
!
lights
)
if
(
!
lights
)
return
D3DRMERR_BADVALUE
;
return
D3DRMERR_BADVALUE
;
if
(
!
(
array
=
d3drm_light_array_create
()))
if
(
!
(
array
=
d3drm_light_array_create
(
frame
->
nb_lights
,
frame
->
lights
)))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
array
->
size
=
frame
->
nb_lights
;
if
(
frame
->
nb_lights
)
{
ULONG
i
;
if
(
!
(
array
->
lights
=
HeapAlloc
(
GetProcessHeap
(),
0
,
frame
->
nb_lights
*
sizeof
(
*
array
->
lights
))))
{
HeapFree
(
GetProcessHeap
(),
0
,
array
);
return
E_OUTOFMEMORY
;
}
for
(
i
=
0
;
i
<
frame
->
nb_lights
;
++
i
)
{
IDirect3DRMLight_QueryInterface
(
frame
->
lights
[
i
],
&
IID_IDirect3DRMLight
,
(
void
**
)
&
array
->
lights
[
i
]);
}
}
*
lights
=
&
array
->
IDirect3DRMLightArray_iface
;
*
lights
=
&
array
->
IDirect3DRMLightArray_iface
;
return
D3DRM_OK
;
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