Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e7548fc4
Commit
e7548fc4
authored
Apr 22, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
Apr 23, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Cleanup d3d_light_SetLight() a bit.
parent
969e7239
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
light.c
dlls/ddraw/light.c
+5
-8
No files found.
dlls/ddraw/light.c
View file @
e7548fc4
...
...
@@ -163,12 +163,9 @@ static HRESULT WINAPI d3d_light_Initialize(IDirect3DLight *iface, IDirect3D *d3d
return
D3D_OK
;
}
static
const
float
zero_value
[]
=
{
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
};
static
HRESULT
WINAPI
d3d_light_SetLight
(
IDirect3DLight
*
iface
,
D3DLIGHT
*
data
)
{
static
const
D3DCOLORVALUE
zero_value
=
{{
0
.
0
f
},
{
0
.
0
f
},
{
0
.
0
f
},
{
0
.
0
f
}};
struct
d3d_light
*
light
=
impl_from_IDirect3DLight
(
iface
);
DWORD
flags
=
data
->
dwSize
>=
sizeof
(
D3DLIGHT2
)
?
((
D3DLIGHT2
*
)
data
)
->
dwFlags
:
D3DLIGHT_ACTIVE
;
D3DLIGHT7
*
light7
=
&
light
->
light7
;
...
...
@@ -184,10 +181,10 @@ static HRESULT WINAPI d3d_light_SetLight(IDirect3DLight *iface, D3DLIGHT *data)
/* Translate D3DLIGHT2 structure to D3DLIGHT7. */
light7
->
dltType
=
data
->
dltType
;
light7
->
dcvDiffuse
=
data
->
dcvColor
;
if
(
!
(
flags
&
D3DLIGHT_NO_SPECULAR
)
)
light7
->
dcvSpecular
=
data
->
dcvColor
;
if
(
flags
&
D3DLIGHT_NO_SPECULAR
)
light7
->
dcvSpecular
=
zero_value
;
else
light7
->
dcvSpecular
=
*
(
const
D3DCOLORVALUE
*
)
zero_value
;
light7
->
dcvSpecular
=
data
->
dcvColor
;
light7
->
dcvAmbient
=
data
->
dcvColor
;
light7
->
dvPosition
=
data
->
dvPosition
;
light7
->
dvDirection
=
data
->
dvDirection
;
...
...
@@ -200,7 +197,7 @@ static HRESULT WINAPI d3d_light_SetLight(IDirect3DLight *iface, D3DLIGHT *data)
light7
->
dvPhi
=
data
->
dvPhi
;
wined3d_mutex_lock
();
memcpy
(
&
light
->
light
,
data
,
sizeof
(
D3DLIGHT
));
memcpy
(
&
light
->
light
,
data
,
sizeof
(
*
data
));
if
(
!
(
light
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
)
&&
flags
&
D3DLIGHT_ACTIVE
)
light_activate
(
light
);
else
if
(
light
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
&&
!
(
flags
&
D3DLIGHT_ACTIVE
))
...
...
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