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
4d66615b
Commit
4d66615b
authored
Jun 06, 2006
by
Ivan Gyurdiev
Committed by
Alexandre Julliard
Jun 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Fix missing light recording.
Write a light with the default parameters in disabled state if capturing a missing light.
parent
5bb0eebc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
46 deletions
+36
-46
device.c
dlls/wined3d/device.c
+18
-30
stateblock.c
dlls/wined3d/stateblock.c
+15
-16
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-0
No files found.
dlls/wined3d/device.c
View file @
4d66615b
...
...
@@ -32,6 +32,22 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d
);
#define GLINFO_LOCATION ((IWineD3DImpl *)(This->wineD3D))->gl_info
/* Define the default light parameters as specified by MSDN */
const
WINED3DLIGHT
WINED3D_default_light
=
{
D3DLIGHT_DIRECTIONAL
,
/* Type */
{
1
.
0
,
1
.
0
,
1
.
0
,
0
.
0
},
/* Diffuse r,g,b,a */
{
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
},
/* Specular r,g,b,a */
{
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
},
/* Ambient r,g,b,a, */
{
0
.
0
,
0
.
0
,
0
.
0
},
/* Position x,y,z */
{
0
.
0
,
0
.
0
,
1
.
0
},
/* Direction x,y,z */
0
.
0
,
/* Range */
0
.
0
,
/* Falloff */
0
.
0
,
0
.
0
,
0
.
0
,
/* Attenuation 0,1,2 */
0
.
0
,
/* Theta */
0
.
0
/* Phi */
};
/* x11drv GDI escapes */
#define X11DRV_ESCAPE 6789
enum
x11drv_escape_codes
...
...
@@ -2515,37 +2531,9 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetLightEnable(IWineD3DDevice *iface, DWORD In
/* Special case - enabling an undefined light creates one with a strict set of parms! */
if
(
lightInfo
==
NULL
)
{
D3DLIGHT9
lightParms
;
/* Warning - untested code :-) Prob safe to change fixme to a trace but
wait until someone confirms it seems to work! */
TRACE
(
"Light enabled requested but light not defined, so defining one!
\n
"
);
lightParms
.
Type
=
D3DLIGHT_DIRECTIONAL
;
lightParms
.
Diffuse
.
r
=
1
.
0
;
lightParms
.
Diffuse
.
g
=
1
.
0
;
lightParms
.
Diffuse
.
b
=
1
.
0
;
lightParms
.
Diffuse
.
a
=
0
.
0
;
lightParms
.
Specular
.
r
=
0
.
0
;
lightParms
.
Specular
.
g
=
0
.
0
;
lightParms
.
Specular
.
b
=
0
.
0
;
lightParms
.
Specular
.
a
=
0
.
0
;
lightParms
.
Ambient
.
r
=
0
.
0
;
lightParms
.
Ambient
.
g
=
0
.
0
;
lightParms
.
Ambient
.
b
=
0
.
0
;
lightParms
.
Ambient
.
a
=
0
.
0
;
lightParms
.
Position
.
x
=
0
.
0
;
lightParms
.
Position
.
y
=
0
.
0
;
lightParms
.
Position
.
z
=
0
.
0
;
lightParms
.
Direction
.
x
=
0
.
0
;
lightParms
.
Direction
.
y
=
0
.
0
;
lightParms
.
Direction
.
z
=
1
.
0
;
lightParms
.
Range
=
0
.
0
;
lightParms
.
Falloff
=
0
.
0
;
lightParms
.
Attenuation0
=
0
.
0
;
lightParms
.
Attenuation1
=
0
.
0
;
lightParms
.
Attenuation2
=
0
.
0
;
lightParms
.
Theta
=
0
.
0
;
lightParms
.
Phi
=
0
.
0
;
IWineD3DDeviceImpl_SetLight
(
iface
,
Index
,
&
lightParms
);
IWineD3DDeviceImpl_SetLight
(
iface
,
Index
,
&
WINED3D_default_light
);
/* Search for it again! Should be fairly quick as near head of list */
lightInfo
=
This
->
stateBlock
->
lights
;
...
...
dlls/wined3d/stateblock.c
View file @
4d66615b
...
...
@@ -213,24 +213,23 @@ HRESULT WINAPI IWineD3DStateBlockImpl_Capture(IWineD3DStateBlock *iface){
realLight
=
targetStateBlock
->
lights
;
while
(
realLight
!=
NULL
&&
realLight
->
OriginalIndex
!=
src
->
OriginalIndex
)
realLight
=
realLight
->
next
;
if
(
realLight
==
NULL
)
{
FIXME
(
"A captured light no longer exists...?
\n
"
);
}
else
{
/* If 'changed' then its a SetLight command. Rather than comparing to see
if the OriginalParms have changed and then copy them (twice through
memory) just do the copy */
if
(
src
->
changed
)
{
TRACE
(
"Updating lights for light %ld
\n
"
,
src
->
OriginalIndex
);
memcpy
(
&
src
->
OriginalParms
,
&
realLight
->
OriginalParms
,
sizeof
(
src
->
OriginalParms
));
}
/* If 'changed' then its a SetLight command. Rather than comparing to see
if the OriginalParms have changed and then copy them (twice through
memory) just do the copy */
if
(
src
->
changed
)
{
/* If 'enabledchanged' then its a LightEnable command */
if
(
src
->
enabledChanged
)
{
TRACE
(
"Updating lightEnabled for light %ld
\n
"
,
src
->
OriginalIndex
);
src
->
lightEnabled
=
realLight
->
lightEnabled
;
}
/* If the light exists, copy its parameters, otherwise copy the default parameters */
const
WINED3DLIGHT
*
params
=
realLight
?
&
realLight
->
OriginalParms
:
&
WINED3D_default_light
;
TRACE
(
"Updating lights for light %ld
\n
"
,
src
->
OriginalIndex
);
memcpy
(
&
src
->
OriginalParms
,
params
,
sizeof
(
*
params
));
}
/* If 'enabledchanged' then its a LightEnable command */
if
(
src
->
enabledChanged
)
{
/* If the light exists, check if it's enabled, otherwise default is disabled state */
TRACE
(
"Updating lightEnabled for light %ld
\n
"
,
src
->
OriginalIndex
);
src
->
lightEnabled
=
realLight
?
realLight
->
lightEnabled
:
FALSE
;
}
src
=
src
->
next
;
...
...
dlls/wined3d/wined3d_private.h
View file @
4d66615b
...
...
@@ -393,6 +393,9 @@ struct PLIGHTINFOEL {
PLIGHTINFOEL
*
prev
;
};
/* The default light parameters */
extern
const
WINED3DLIGHT
WINED3D_default_light
;
/*****************************************************************************
* IWineD3D implementation structure
*/
...
...
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