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
f5973597
Commit
f5973597
authored
Nov 20, 2011
by
Henri Verbeet
Committed by
Alexandre Julliard
Nov 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Get rid of the WINED3DLIGHT typedef.
parent
e2d099a1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
93 additions
and
87 deletions
+93
-87
device.c
dlls/d3d8/device.c
+4
-4
device.c
dlls/d3d9/device.c
+4
-4
device.c
dlls/ddraw/device.c
+4
-4
device.c
dlls/wined3d/device.c
+33
-31
state.c
dlls/wined3d/state.c
+26
-24
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-2
wined3d.h
include/wine/wined3d.h
+20
-18
No files found.
dlls/d3d8/device.c
View file @
f5973597
...
...
@@ -1343,9 +1343,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_SetLight(IDirect3DDevice8 *iface, DWO
TRACE
(
"iface %p, index %u, light %p.
\n
"
,
iface
,
Index
,
pLight
);
/* Note: D3DLIGHT8 is compatible with
WINED3DLIGHT
*/
/* Note: D3DLIGHT8 is compatible with
struct wined3d_light.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_set_light
(
This
->
wined3d_device
,
Index
,
(
const
WINED3DLIGHT
*
)
pLight
);
hr
=
wined3d_device_set_light
(
This
->
wined3d_device
,
Index
,
(
const
struct
wined3d_light
*
)
pLight
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -1359,9 +1359,9 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetLight(IDirect3DDevice8 *iface, DWO
TRACE
(
"iface %p, index %u, light %p.
\n
"
,
iface
,
Index
,
pLight
);
/* Note: D3DLIGHT8 is compatible with
WINED3DLIGHT
*/
/* Note: D3DLIGHT8 is compatible with
struct wined3d_light.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_get_light
(
This
->
wined3d_device
,
Index
,
(
WINED3DLIGHT
*
)
pLight
);
hr
=
wined3d_device_get_light
(
This
->
wined3d_device
,
Index
,
(
struct
wined3d_light
*
)
pLight
);
wined3d_mutex_unlock
();
return
hr
;
...
...
dlls/d3d9/device.c
View file @
f5973597
...
...
@@ -1361,9 +1361,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_SetLight(IDirect3DDevice9Ex *iface, D
TRACE
(
"iface %p, index %u, light %p.
\n
"
,
iface
,
Index
,
pLight
);
/* Note: D3DLIGHT9 is compatible with
WINED3DLIGHT
*/
/* Note: D3DLIGHT9 is compatible with
struct wined3d_light.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_set_light
(
This
->
wined3d_device
,
Index
,
(
const
WINED3DLIGHT
*
)
pLight
);
hr
=
wined3d_device_set_light
(
This
->
wined3d_device
,
Index
,
(
const
struct
wined3d_light
*
)
pLight
);
wined3d_mutex_unlock
();
return
hr
;
...
...
@@ -1377,9 +1377,9 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetLight(IDirect3DDevice9Ex *iface, D
TRACE
(
"iface %p, index %u, light %p.
\n
"
,
iface
,
Index
,
pLight
);
/* Note: D3DLIGHT9 is compatible with
WINED3DLIGHT
*/
/* Note: D3DLIGHT9 is compatible with
struct wined3d_light.
*/
wined3d_mutex_lock
();
hr
=
wined3d_device_get_light
(
This
->
wined3d_device
,
Index
,
(
WINED3DLIGHT
*
)
pLight
);
hr
=
wined3d_device_get_light
(
This
->
wined3d_device
,
Index
,
(
struct
wined3d_light
*
)
pLight
);
wined3d_mutex_unlock
();
return
hr
;
...
...
dlls/ddraw/device.c
View file @
f5973597
...
...
@@ -5374,8 +5374,8 @@ IDirect3DDeviceImpl_7_SetLight(IDirect3DDevice7 *iface,
TRACE
(
"iface %p, light_idx %u, light %p.
\n
"
,
iface
,
LightIndex
,
Light
);
wined3d_mutex_lock
();
/* Note: D3DLIGHT7 is compatible with
WINED3DLIGHT
*/
hr
=
wined3d_device_set_light
(
This
->
wined3d_device
,
LightIndex
,
(
WINED3DLIGHT
*
)
Light
);
/* Note: D3DLIGHT7 is compatible with
struct wined3d_light.
*/
hr
=
wined3d_device_set_light
(
This
->
wined3d_device
,
LightIndex
,
(
struct
wined3d_light
*
)
Light
);
wined3d_mutex_unlock
();
return
hr_ddraw_from_wined3d
(
hr
);
...
...
@@ -5429,8 +5429,8 @@ IDirect3DDeviceImpl_7_GetLight(IDirect3DDevice7 *iface,
TRACE
(
"iface %p, light_idx %u, light %p.
\n
"
,
iface
,
LightIndex
,
Light
);
wined3d_mutex_lock
();
/* Note: D3DLIGHT7 is compatible with
WINED3DLIGHT
*/
rc
=
wined3d_device_get_light
(
This
->
wined3d_device
,
LightIndex
,
(
WINED3DLIGHT
*
)
Light
);
/* Note: D3DLIGHT7 is compatible with
struct wined3d_light.
*/
rc
=
wined3d_device_get_light
(
This
->
wined3d_device
,
LightIndex
,
(
struct
wined3d_light
*
)
Light
);
wined3d_mutex_unlock
();
/* Translate the result. WineD3D returns other values than D3D7 */
...
...
dlls/wined3d/device.c
View file @
f5973597
...
...
@@ -33,9 +33,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
/* Define the default light parameters as specified by MSDN */
const
WINED3DLIGHT
WINED3D_default_light
=
{
/* Define the default light parameters as specified by MSDN
.
*/
const
struct
wined3d_light
WINED3D_default_light
=
{
WINED3DLIGHT_DIRECTIONAL
,
/* Type */
{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
,
0
.
0
f
},
/* Diffuse r,g,b,a */
{
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
},
/* Specular r,g,b,a */
...
...
@@ -1902,7 +1902,8 @@ HRESULT CDECL wined3d_device_multiply_transform(struct wined3d_device *device,
* stateblock problems. When capturing the state block, I duplicate the
* hashmap, but when recording, just build a chain pretty much of commands to
* be replayed. */
HRESULT
CDECL
wined3d_device_set_light
(
struct
wined3d_device
*
device
,
UINT
light_idx
,
const
WINED3DLIGHT
*
light
)
HRESULT
CDECL
wined3d_device_set_light
(
struct
wined3d_device
*
device
,
UINT
light_idx
,
const
struct
wined3d_light
*
light
)
{
UINT
hash_idx
=
LIGHTMAP_HASHFUNC
(
light_idx
);
struct
wined3d_light_info
*
object
=
NULL
;
...
...
@@ -1916,7 +1917,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light
if
(
!
light
)
return
WINED3DERR_INVALIDCALL
;
switch
(
light
->
T
ype
)
switch
(
light
->
t
ype
)
{
case
WINED3DLIGHT_POINT
:
case
WINED3DLIGHT_SPOT
:
...
...
@@ -1924,7 +1925,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light
case
WINED3DLIGHT_GLSPOT
:
/* Incorrect attenuation values can cause the gl driver to crash.
* Happens with Need for speed most wanted. */
if
(
light
->
Attenuation0
<
0
.
0
f
||
light
->
Attenuation1
<
0
.
0
f
||
light
->
A
ttenuation2
<
0
.
0
f
)
if
(
light
->
attenuation0
<
0
.
0
f
||
light
->
attenuation1
<
0
.
0
f
||
light
->
a
ttenuation2
<
0
.
0
f
)
{
WARN
(
"Attenuation is negative, returning WINED3DERR_INVALIDCALL.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
...
...
@@ -1964,25 +1965,25 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light
/* Initialize the object. */
TRACE
(
"Light %d setting to type %d, Diffuse(%f,%f,%f,%f), Specular(%f,%f,%f,%f), Ambient(%f,%f,%f,%f)
\n
"
,
light_idx
,
light
->
T
ype
,
light
->
Diffuse
.
r
,
light
->
Diffuse
.
g
,
light
->
Diffuse
.
b
,
light
->
D
iffuse
.
a
,
light
->
Specular
.
r
,
light
->
Specular
.
g
,
light
->
Specular
.
b
,
light
->
S
pecular
.
a
,
light
->
Ambient
.
r
,
light
->
Ambient
.
g
,
light
->
Ambient
.
b
,
light
->
A
mbient
.
a
);
TRACE
(
"... Pos(%f,%f,%f), Dir(%f,%f,%f)
\n
"
,
light
->
Position
.
x
,
light
->
Position
.
y
,
light
->
P
osition
.
z
,
light
->
Direction
.
x
,
light
->
Direction
.
y
,
light
->
D
irection
.
z
);
light_idx
,
light
->
t
ype
,
light
->
diffuse
.
r
,
light
->
diffuse
.
g
,
light
->
diffuse
.
b
,
light
->
d
iffuse
.
a
,
light
->
specular
.
r
,
light
->
specular
.
g
,
light
->
specular
.
b
,
light
->
s
pecular
.
a
,
light
->
ambient
.
r
,
light
->
ambient
.
g
,
light
->
ambient
.
b
,
light
->
a
mbient
.
a
);
TRACE
(
"... Pos(%f,%f,%f), Dir(%f,%f,%f)
\n
"
,
light
->
position
.
x
,
light
->
position
.
y
,
light
->
p
osition
.
z
,
light
->
direction
.
x
,
light
->
direction
.
y
,
light
->
d
irection
.
z
);
TRACE
(
"... Range(%f), Falloff(%f), Theta(%f), Phi(%f)
\n
"
,
light
->
Range
,
light
->
Falloff
,
light
->
Theta
,
light
->
P
hi
);
light
->
range
,
light
->
falloff
,
light
->
theta
,
light
->
p
hi
);
/* Save away the information. */
object
->
OriginalParms
=
*
light
;
switch
(
light
->
T
ype
)
switch
(
light
->
t
ype
)
{
case
WINED3DLIGHT_POINT
:
/* Position */
object
->
lightPosn
[
0
]
=
light
->
P
osition
.
x
;
object
->
lightPosn
[
1
]
=
light
->
P
osition
.
y
;
object
->
lightPosn
[
2
]
=
light
->
P
osition
.
z
;
object
->
lightPosn
[
0
]
=
light
->
p
osition
.
x
;
object
->
lightPosn
[
1
]
=
light
->
p
osition
.
y
;
object
->
lightPosn
[
2
]
=
light
->
p
osition
.
z
;
object
->
lightPosn
[
3
]
=
1
.
0
f
;
object
->
cutoff
=
180
.
0
f
;
/* FIXME: Range */
...
...
@@ -1990,9 +1991,9 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light
case
WINED3DLIGHT_DIRECTIONAL
:
/* Direction */
object
->
lightPosn
[
0
]
=
-
light
->
D
irection
.
x
;
object
->
lightPosn
[
1
]
=
-
light
->
D
irection
.
y
;
object
->
lightPosn
[
2
]
=
-
light
->
D
irection
.
z
;
object
->
lightPosn
[
0
]
=
-
light
->
d
irection
.
x
;
object
->
lightPosn
[
1
]
=
-
light
->
d
irection
.
y
;
object
->
lightPosn
[
2
]
=
-
light
->
d
irection
.
z
;
object
->
lightPosn
[
3
]
=
0
.
0
f
;
object
->
exponent
=
0
.
0
f
;
object
->
cutoff
=
180
.
0
f
;
...
...
@@ -2000,15 +2001,15 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light
case
WINED3DLIGHT_SPOT
:
/* Position */
object
->
lightPosn
[
0
]
=
light
->
P
osition
.
x
;
object
->
lightPosn
[
1
]
=
light
->
P
osition
.
y
;
object
->
lightPosn
[
2
]
=
light
->
P
osition
.
z
;
object
->
lightPosn
[
0
]
=
light
->
p
osition
.
x
;
object
->
lightPosn
[
1
]
=
light
->
p
osition
.
y
;
object
->
lightPosn
[
2
]
=
light
->
p
osition
.
z
;
object
->
lightPosn
[
3
]
=
1
.
0
f
;
/* Direction */
object
->
lightDirn
[
0
]
=
light
->
D
irection
.
x
;
object
->
lightDirn
[
1
]
=
light
->
D
irection
.
y
;
object
->
lightDirn
[
2
]
=
light
->
D
irection
.
z
;
object
->
lightDirn
[
0
]
=
light
->
d
irection
.
x
;
object
->
lightDirn
[
1
]
=
light
->
d
irection
.
y
;
object
->
lightDirn
[
2
]
=
light
->
d
irection
.
z
;
object
->
lightDirn
[
3
]
=
1
.
0
f
;
/* opengl-ish and d3d-ish spot lights use too different models
...
...
@@ -2017,7 +2018,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light
* roughly. However, spot lights are rather rarely used in games
* (if ever used at all). Furthermore if still used, probably
* nobody pays attention to such details. */
if
(
!
light
->
F
alloff
)
if
(
!
light
->
f
alloff
)
{
/* Falloff = 0 is easy, because d3d's and opengl's spot light
* equations have the falloff resp. exponent parameter as an
...
...
@@ -2028,7 +2029,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light
}
else
{
rho
=
light
->
Theta
+
(
light
->
Phi
-
light
->
Theta
)
/
(
2
*
light
->
F
alloff
);
rho
=
light
->
theta
+
(
light
->
phi
-
light
->
theta
)
/
(
2
*
light
->
f
alloff
);
if
(
rho
<
0
.
0001
f
)
rho
=
0
.
0001
f
;
object
->
exponent
=
-
0
.
3
f
/
logf
(
cosf
(
rho
/
2
));
...
...
@@ -2037,12 +2038,12 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light
if
(
object
->
exponent
>
128
.
0
f
)
object
->
exponent
=
128
.
0
f
;
object
->
cutoff
=
(
float
)(
light
->
P
hi
*
90
/
M_PI
);
object
->
cutoff
=
(
float
)(
light
->
p
hi
*
90
/
M_PI
);
/* FIXME: Range */
break
;
default:
FIXME
(
"Unrecognized light type %#x.
\n
"
,
light
->
T
ype
);
FIXME
(
"Unrecognized light type %#x.
\n
"
,
light
->
t
ype
);
}
/* Update the live definitions if the light is currently assigned a glIndex. */
...
...
@@ -2052,7 +2053,8 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device, UINT light
return
WINED3D_OK
;
}
HRESULT
CDECL
wined3d_device_get_light
(
const
struct
wined3d_device
*
device
,
UINT
light_idx
,
WINED3DLIGHT
*
light
)
HRESULT
CDECL
wined3d_device_get_light
(
const
struct
wined3d_device
*
device
,
UINT
light_idx
,
struct
wined3d_light
*
light
)
{
UINT
hash_idx
=
LIGHTMAP_HASHFUNC
(
light_idx
);
struct
wined3d_light_info
*
light_info
=
NULL
;
...
...
dlls/wined3d/state.c
View file @
f5973597
...
...
@@ -4647,41 +4647,41 @@ static void light(struct wined3d_context *context, const struct wined3d_state *s
glLoadMatrixf
(
&
state
->
transforms
[
WINED3DTS_VIEW
].
u
.
m
[
0
][
0
]);
/* Diffuse: */
colRGBA
[
0
]
=
lightInfo
->
OriginalParms
.
D
iffuse
.
r
;
colRGBA
[
1
]
=
lightInfo
->
OriginalParms
.
D
iffuse
.
g
;
colRGBA
[
2
]
=
lightInfo
->
OriginalParms
.
D
iffuse
.
b
;
colRGBA
[
3
]
=
lightInfo
->
OriginalParms
.
D
iffuse
.
a
;
colRGBA
[
0
]
=
lightInfo
->
OriginalParms
.
d
iffuse
.
r
;
colRGBA
[
1
]
=
lightInfo
->
OriginalParms
.
d
iffuse
.
g
;
colRGBA
[
2
]
=
lightInfo
->
OriginalParms
.
d
iffuse
.
b
;
colRGBA
[
3
]
=
lightInfo
->
OriginalParms
.
d
iffuse
.
a
;
glLightfv
(
GL_LIGHT0
+
Index
,
GL_DIFFUSE
,
colRGBA
);
checkGLcall
(
"glLightfv"
);
/* Specular */
colRGBA
[
0
]
=
lightInfo
->
OriginalParms
.
S
pecular
.
r
;
colRGBA
[
1
]
=
lightInfo
->
OriginalParms
.
S
pecular
.
g
;
colRGBA
[
2
]
=
lightInfo
->
OriginalParms
.
S
pecular
.
b
;
colRGBA
[
3
]
=
lightInfo
->
OriginalParms
.
S
pecular
.
a
;
colRGBA
[
0
]
=
lightInfo
->
OriginalParms
.
s
pecular
.
r
;
colRGBA
[
1
]
=
lightInfo
->
OriginalParms
.
s
pecular
.
g
;
colRGBA
[
2
]
=
lightInfo
->
OriginalParms
.
s
pecular
.
b
;
colRGBA
[
3
]
=
lightInfo
->
OriginalParms
.
s
pecular
.
a
;
glLightfv
(
GL_LIGHT0
+
Index
,
GL_SPECULAR
,
colRGBA
);
checkGLcall
(
"glLightfv"
);
/* Ambient */
colRGBA
[
0
]
=
lightInfo
->
OriginalParms
.
A
mbient
.
r
;
colRGBA
[
1
]
=
lightInfo
->
OriginalParms
.
A
mbient
.
g
;
colRGBA
[
2
]
=
lightInfo
->
OriginalParms
.
A
mbient
.
b
;
colRGBA
[
3
]
=
lightInfo
->
OriginalParms
.
A
mbient
.
a
;
colRGBA
[
0
]
=
lightInfo
->
OriginalParms
.
a
mbient
.
r
;
colRGBA
[
1
]
=
lightInfo
->
OriginalParms
.
a
mbient
.
g
;
colRGBA
[
2
]
=
lightInfo
->
OriginalParms
.
a
mbient
.
b
;
colRGBA
[
3
]
=
lightInfo
->
OriginalParms
.
a
mbient
.
a
;
glLightfv
(
GL_LIGHT0
+
Index
,
GL_AMBIENT
,
colRGBA
);
checkGLcall
(
"glLightfv"
);
if
((
lightInfo
->
OriginalParms
.
Range
*
lightInfo
->
OriginalParms
.
Range
)
>=
FLT_MIN
)
{
quad_att
=
1
.
4
f
/
(
lightInfo
->
OriginalParms
.
Range
*
lightInfo
->
OriginalParms
.
R
ange
);
}
else
{
if
((
lightInfo
->
OriginalParms
.
range
*
lightInfo
->
OriginalParms
.
range
)
>=
FLT_MIN
)
quad_att
=
1
.
4
f
/
(
lightInfo
->
OriginalParms
.
range
*
lightInfo
->
OriginalParms
.
r
ange
);
else
quad_att
=
0
.
0
f
;
/* 0 or MAX? (0 seems to be ok) */
}
/* Do not assign attenuation values for lights that do not use them. D3D apps are free to pass any junk,
* but gl drivers use them and may crash due to bad Attenuation values. Need for Speed most wanted sets
* Attenuation0 to NaN and crashes in the gl lib
*/
switch
(
lightInfo
->
OriginalParms
.
Type
)
{
switch
(
lightInfo
->
OriginalParms
.
type
)
{
case
WINED3DLIGHT_POINT
:
/* Position */
glLightfv
(
GL_LIGHT0
+
Index
,
GL_POSITION
,
&
lightInfo
->
lightPosn
[
0
]);
...
...
@@ -4689,11 +4689,12 @@ static void light(struct wined3d_context *context, const struct wined3d_state *s
glLightf
(
GL_LIGHT0
+
Index
,
GL_SPOT_CUTOFF
,
lightInfo
->
cutoff
);
checkGLcall
(
"glLightf"
);
/* Attenuation - Are these right? guessing... */
glLightf
(
GL_LIGHT0
+
Index
,
GL_CONSTANT_ATTENUATION
,
lightInfo
->
OriginalParms
.
A
ttenuation0
);
glLightf
(
GL_LIGHT0
+
Index
,
GL_CONSTANT_ATTENUATION
,
lightInfo
->
OriginalParms
.
a
ttenuation0
);
checkGLcall
(
"glLightf"
);
glLightf
(
GL_LIGHT0
+
Index
,
GL_LINEAR_ATTENUATION
,
lightInfo
->
OriginalParms
.
A
ttenuation1
);
glLightf
(
GL_LIGHT0
+
Index
,
GL_LINEAR_ATTENUATION
,
lightInfo
->
OriginalParms
.
a
ttenuation1
);
checkGLcall
(
"glLightf"
);
if
(
quad_att
<
lightInfo
->
OriginalParms
.
Attenuation2
)
quad_att
=
lightInfo
->
OriginalParms
.
Attenuation2
;
if
(
quad_att
<
lightInfo
->
OriginalParms
.
attenuation2
)
quad_att
=
lightInfo
->
OriginalParms
.
attenuation2
;
glLightf
(
GL_LIGHT0
+
Index
,
GL_QUADRATIC_ATTENUATION
,
quad_att
);
checkGLcall
(
"glLightf"
);
/* FIXME: Range */
...
...
@@ -4711,11 +4712,12 @@ static void light(struct wined3d_context *context, const struct wined3d_state *s
glLightf
(
GL_LIGHT0
+
Index
,
GL_SPOT_CUTOFF
,
lightInfo
->
cutoff
);
checkGLcall
(
"glLightf"
);
/* Attenuation - Are these right? guessing... */
glLightf
(
GL_LIGHT0
+
Index
,
GL_CONSTANT_ATTENUATION
,
lightInfo
->
OriginalParms
.
A
ttenuation0
);
glLightf
(
GL_LIGHT0
+
Index
,
GL_CONSTANT_ATTENUATION
,
lightInfo
->
OriginalParms
.
a
ttenuation0
);
checkGLcall
(
"glLightf"
);
glLightf
(
GL_LIGHT0
+
Index
,
GL_LINEAR_ATTENUATION
,
lightInfo
->
OriginalParms
.
A
ttenuation1
);
glLightf
(
GL_LIGHT0
+
Index
,
GL_LINEAR_ATTENUATION
,
lightInfo
->
OriginalParms
.
a
ttenuation1
);
checkGLcall
(
"glLightf"
);
if
(
quad_att
<
lightInfo
->
OriginalParms
.
Attenuation2
)
quad_att
=
lightInfo
->
OriginalParms
.
Attenuation2
;
if
(
quad_att
<
lightInfo
->
OriginalParms
.
attenuation2
)
quad_att
=
lightInfo
->
OriginalParms
.
attenuation2
;
glLightf
(
GL_LIGHT0
+
Index
,
GL_QUADRATIC_ATTENUATION
,
quad_att
);
checkGLcall
(
"glLightf"
);
/* FIXME: Range */
...
...
@@ -4732,7 +4734,7 @@ static void light(struct wined3d_context *context, const struct wined3d_state *s
break
;
default:
FIXME
(
"Unrecognized light type %
d
\n
"
,
lightInfo
->
OriginalParms
.
T
ype
);
FIXME
(
"Unrecognized light type %
#x.
\n
"
,
lightInfo
->
OriginalParms
.
t
ype
);
}
/* Restore the modelview matrix */
...
...
dlls/wined3d/wined3d_private.h
View file @
f5973597
...
...
@@ -1271,7 +1271,7 @@ void context_surface_update(struct wined3d_context *context, const struct wined3
*/
struct
wined3d_light_info
{
WINED3DLIGHT
OriginalParms
;
/* Note D3D8LIGHT == D3D9LIGHT */
struct
wined3d_light
OriginalParms
;
/* Note D3D8LIGHT == D3D9LIGHT */
DWORD
OriginalIndex
;
LONG
glIndex
;
BOOL
enabled
;
...
...
@@ -1286,7 +1286,7 @@ struct wined3d_light_info
};
/* The default light parameters */
extern
const
WINED3DLIGHT
WINED3D_default_light
DECLSPEC_HIDDEN
;
extern
const
struct
wined3d_light
WINED3D_default_light
DECLSPEC_HIDDEN
;
struct
wined3d_pixel_format
{
...
...
include/wine/wined3d.h
View file @
f5973597
...
...
@@ -1547,22 +1547,22 @@ struct wined3d_matrix
}
DUMMYUNIONNAME
;
};
typedef
struct
_WINED3DLIGHT
{
WINED3DLIGHTTYPE
T
ype
;
struct
wined3d_color
D
iffuse
;
struct
wined3d_color
S
pecular
;
struct
wined3d_color
A
mbient
;
struct
wined3d_vec3
P
osition
;
struct
wined3d_vec3
D
irection
;
float
R
ange
;
float
F
alloff
;
float
A
ttenuation0
;
float
A
ttenuation1
;
float
A
ttenuation2
;
float
T
heta
;
float
P
hi
;
}
WINED3DLIGHT
;
struct
wined3d_light
{
WINED3DLIGHTTYPE
t
ype
;
struct
wined3d_color
d
iffuse
;
struct
wined3d_color
s
pecular
;
struct
wined3d_color
a
mbient
;
struct
wined3d_vec3
p
osition
;
struct
wined3d_vec3
d
irection
;
float
r
ange
;
float
f
alloff
;
float
a
ttenuation0
;
float
a
ttenuation1
;
float
a
ttenuation2
;
float
t
heta
;
float
p
hi
;
};
typedef
struct
_WINED3DMATERIAL
{
...
...
@@ -2214,7 +2214,8 @@ void __cdecl wined3d_device_get_gamma_ramp(const struct wined3d_device *device,
UINT
swapchain_idx
,
WINED3DGAMMARAMP
*
ramp
);
HRESULT
__cdecl
wined3d_device_get_index_buffer
(
const
struct
wined3d_device
*
device
,
struct
wined3d_buffer
**
index_buffer
);
HRESULT
__cdecl
wined3d_device_get_light
(
const
struct
wined3d_device
*
device
,
UINT
light_idx
,
WINED3DLIGHT
*
light
);
HRESULT
__cdecl
wined3d_device_get_light
(
const
struct
wined3d_device
*
device
,
UINT
light_idx
,
struct
wined3d_light
*
light
);
HRESULT
__cdecl
wined3d_device_get_light_enable
(
const
struct
wined3d_device
*
device
,
UINT
light_idx
,
BOOL
*
enable
);
HRESULT
__cdecl
wined3d_device_get_material
(
const
struct
wined3d_device
*
device
,
WINED3DMATERIAL
*
material
);
float
__cdecl
wined3d_device_get_npatch_mode
(
const
struct
wined3d_device
*
device
);
...
...
@@ -2292,7 +2293,8 @@ void __cdecl wined3d_device_set_gamma_ramp(const struct wined3d_device *device,
UINT
swapchain_idx
,
DWORD
flags
,
const
WINED3DGAMMARAMP
*
ramp
);
HRESULT
__cdecl
wined3d_device_set_index_buffer
(
struct
wined3d_device
*
device
,
struct
wined3d_buffer
*
index_buffer
,
enum
wined3d_format_id
format_id
);
HRESULT
__cdecl
wined3d_device_set_light
(
struct
wined3d_device
*
device
,
UINT
light_idx
,
const
WINED3DLIGHT
*
light
);
HRESULT
__cdecl
wined3d_device_set_light
(
struct
wined3d_device
*
device
,
UINT
light_idx
,
const
struct
wined3d_light
*
light
);
HRESULT
__cdecl
wined3d_device_set_light_enable
(
struct
wined3d_device
*
device
,
UINT
light_idx
,
BOOL
enable
);
HRESULT
__cdecl
wined3d_device_set_material
(
struct
wined3d_device
*
device
,
const
WINED3DMATERIAL
*
material
);
void
__cdecl
wined3d_device_set_multithreaded
(
struct
wined3d_device
*
device
);
...
...
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