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
e226e759
Commit
e226e759
authored
Apr 27, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
Apr 28, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Use struct wined3d_vec4 to store the light position and direction.
parent
540130bf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
30 deletions
+30
-30
device.c
dlls/wined3d/device.c
+16
-16
glsl_shader.c
dlls/wined3d/glsl_shader.c
+3
-3
state.c
dlls/wined3d/state.c
+7
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+4
-4
No files found.
dlls/wined3d/device.c
View file @
e226e759
...
...
@@ -1521,36 +1521,36 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
{
case
WINED3D_LIGHT_POINT
:
/* Position */
object
->
lightPosn
[
0
]
=
light
->
position
.
x
;
object
->
lightPosn
[
1
]
=
light
->
position
.
y
;
object
->
lightPosn
[
2
]
=
light
->
position
.
z
;
object
->
lightPosn
[
3
]
=
1
.
0
f
;
object
->
position
.
x
=
light
->
position
.
x
;
object
->
position
.
y
=
light
->
position
.
y
;
object
->
position
.
z
=
light
->
position
.
z
;
object
->
position
.
w
=
1
.
0
f
;
object
->
cutoff
=
180
.
0
f
;
/* FIXME: Range */
break
;
case
WINED3D_LIGHT_DIRECTIONAL
:
/* Direction */
object
->
lightDirn
[
0
]
=
-
light
->
direction
.
x
;
object
->
lightDirn
[
1
]
=
-
light
->
direction
.
y
;
object
->
lightDirn
[
2
]
=
-
light
->
direction
.
z
;
object
->
lightDirn
[
3
]
=
0
.
0
f
;
object
->
direction
.
x
=
-
light
->
direction
.
x
;
object
->
direction
.
y
=
-
light
->
direction
.
y
;
object
->
direction
.
z
=
-
light
->
direction
.
z
;
object
->
direction
.
w
=
0
.
0
f
;
object
->
exponent
=
0
.
0
f
;
object
->
cutoff
=
180
.
0
f
;
break
;
case
WINED3D_LIGHT_SPOT
:
/* Position */
object
->
lightPosn
[
0
]
=
light
->
position
.
x
;
object
->
lightPosn
[
1
]
=
light
->
position
.
y
;
object
->
lightPosn
[
2
]
=
light
->
position
.
z
;
object
->
lightPosn
[
3
]
=
1
.
0
f
;
object
->
position
.
x
=
light
->
position
.
x
;
object
->
position
.
y
=
light
->
position
.
y
;
object
->
position
.
z
=
light
->
position
.
z
;
object
->
position
.
w
=
1
.
0
f
;
/* Direction */
object
->
lightDirn
[
0
]
=
light
->
direction
.
x
;
object
->
lightDirn
[
1
]
=
light
->
direction
.
y
;
object
->
lightDirn
[
2
]
=
light
->
direction
.
z
;
object
->
lightDirn
[
3
]
=
0
.
0
f
;
object
->
direction
.
x
=
light
->
direction
.
x
;
object
->
direction
.
y
=
light
->
direction
.
y
;
object
->
direction
.
z
=
light
->
direction
.
z
;
object
->
direction
.
w
=
0
.
0
f
;
/* opengl-ish and d3d-ish spot lights use too different models
* for the light "intensity" as a function of the angle towards
...
...
dlls/wined3d/glsl_shader.c
View file @
e226e759
...
...
@@ -7530,11 +7530,11 @@ static void glsl_vertex_pipe_view(struct wined3d_context *context, const struct
if
(
!
(
light
=
state
->
lights
[
k
]))
continue
;
if
(
light
->
OriginalParms
.
type
==
WINED3D_LIGHT_DIRECTIONAL
)
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_POSITION
,
light
->
lightDirn
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_POSITION
,
&
light
->
direction
.
x
);
else
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_POSITION
,
light
->
lightPosn
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_POSITION
,
&
light
->
position
.
x
);
checkGLcall
(
"glLightfv posn"
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_SPOT_DIRECTION
,
light
->
lightDirn
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_SPOT_DIRECTION
,
&
light
->
direction
.
x
);
checkGLcall
(
"glLightfv dirn"
);
}
...
...
dlls/wined3d/state.c
View file @
e226e759
...
...
@@ -3974,11 +3974,11 @@ static void transform_view(struct wined3d_context *context, const struct wined3d
if
(
!
(
light
=
state
->
lights
[
k
]))
continue
;
if
(
light
->
OriginalParms
.
type
==
WINED3D_LIGHT_DIRECTIONAL
)
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_POSITION
,
light
->
lightDirn
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_POSITION
,
&
light
->
direction
.
x
);
else
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_POSITION
,
light
->
lightPosn
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_POSITION
,
&
light
->
position
.
x
);
checkGLcall
(
"glLightfv posn"
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_SPOT_DIRECTION
,
light
->
lightDirn
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
light
->
glIndex
,
GL_SPOT_DIRECTION
,
&
light
->
direction
.
x
);
checkGLcall
(
"glLightfv dirn"
);
}
...
...
@@ -4759,7 +4759,7 @@ void light(struct wined3d_context *context, const struct wined3d_state *state, D
{
case
WINED3D_LIGHT_POINT
:
/* Position */
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
Index
,
GL_POSITION
,
lightInfo
->
lightPosn
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
Index
,
GL_POSITION
,
&
lightInfo
->
position
.
x
);
checkGLcall
(
"glLightfv"
);
gl_info
->
gl_ops
.
gl
.
p_glLightf
(
GL_LIGHT0
+
Index
,
GL_SPOT_CUTOFF
,
lightInfo
->
cutoff
);
checkGLcall
(
"glLightf"
);
...
...
@@ -4778,10 +4778,10 @@ void light(struct wined3d_context *context, const struct wined3d_state *state, D
case
WINED3D_LIGHT_SPOT
:
/* Position */
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
Index
,
GL_POSITION
,
lightInfo
->
lightPosn
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
Index
,
GL_POSITION
,
&
lightInfo
->
position
.
x
);
checkGLcall
(
"glLightfv"
);
/* Direction */
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
Index
,
GL_SPOT_DIRECTION
,
lightInfo
->
lightDirn
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
Index
,
GL_SPOT_DIRECTION
,
&
lightInfo
->
direction
.
x
);
checkGLcall
(
"glLightfv"
);
gl_info
->
gl_ops
.
gl
.
p_glLightf
(
GL_LIGHT0
+
Index
,
GL_SPOT_EXPONENT
,
lightInfo
->
exponent
);
checkGLcall
(
"glLightf"
);
...
...
@@ -4803,7 +4803,7 @@ void light(struct wined3d_context *context, const struct wined3d_state *state, D
case
WINED3D_LIGHT_DIRECTIONAL
:
/* Direction */
/* Note GL uses w position of 0 for direction! */
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
Index
,
GL_POSITION
,
lightInfo
->
lightDirn
);
gl_info
->
gl_ops
.
gl
.
p_glLightfv
(
GL_LIGHT0
+
Index
,
GL_POSITION
,
&
lightInfo
->
direction
.
x
);
checkGLcall
(
"glLightfv"
);
gl_info
->
gl_ops
.
gl
.
p_glLightf
(
GL_LIGHT0
+
Index
,
GL_SPOT_CUTOFF
,
lightInfo
->
cutoff
);
checkGLcall
(
"glLightf"
);
...
...
dlls/wined3d/wined3d_private.h
View file @
e226e759
...
...
@@ -1421,10 +1421,10 @@ struct wined3d_light_info
BOOL
enabled
;
/* Converted parms to speed up swapping lights */
float
lightPosn
[
4
]
;
float
lightDirn
[
4
]
;
float
exponent
;
float
cutoff
;
struct
wined3d_vec4
position
;
struct
wined3d_vec4
direction
;
float
exponent
;
float
cutoff
;
struct
list
entry
;
};
...
...
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