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
3bc9d189
Commit
3bc9d189
authored
Oct 14, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Rename PLIGHTINFOEL to something less awful.
parent
580cd8c5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
33 deletions
+41
-33
device.c
dlls/wined3d/device.c
+25
-18
state.c
dlls/wined3d/state.c
+2
-3
stateblock.c
dlls/wined3d/stateblock.c
+11
-9
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-3
No files found.
dlls/wined3d/device.c
View file @
3bc9d189
...
...
@@ -2429,7 +2429,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_MultiplyTransform(IWineD3DDevice *iface
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetLight
(
IWineD3DDevice
*
iface
,
DWORD
Index
,
CONST
WINED3DLIGHT
*
pLight
)
{
float
rho
;
PLIGHTINFOEL
*
object
=
NULL
;
struct
wined3d_light_info
*
object
=
NULL
;
UINT
Hi
=
LIGHTMAP_HASHFUNC
(
Index
);
struct
list
*
e
;
...
...
@@ -2468,8 +2468,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetLight(IWineD3DDevice *iface, DWORD I
return
WINED3DERR_INVALIDCALL
;
}
LIST_FOR_EACH
(
e
,
&
This
->
updateStateBlock
->
lightMap
[
Hi
])
{
object
=
LIST_ENTRY
(
e
,
PLIGHTINFOEL
,
entry
);
LIST_FOR_EACH
(
e
,
&
This
->
updateStateBlock
->
lightMap
[
Hi
])
{
object
=
LIST_ENTRY
(
e
,
struct
wined3d_light_info
,
entry
);
if
(
object
->
OriginalIndex
==
Index
)
break
;
object
=
NULL
;
}
...
...
@@ -2572,15 +2573,17 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetLight(IWineD3DDevice *iface, DWORD I
return
WINED3D_OK
;
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_GetLight
(
IWineD3DDevice
*
iface
,
DWORD
Index
,
WINED3DLIGHT
*
pLight
)
{
PLIGHTINFOEL
*
lightInfo
=
NULL
;
static
HRESULT
WINAPI
IWineD3DDeviceImpl_GetLight
(
IWineD3DDevice
*
iface
,
DWORD
Index
,
WINED3DLIGHT
*
pLight
)
{
struct
wined3d_light_info
*
lightInfo
=
NULL
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
DWORD
Hi
=
LIGHTMAP_HASHFUNC
(
Index
);
struct
list
*
e
;
TRACE
(
"(%p) : Idx(%d), pLight(%p)
\n
"
,
This
,
Index
,
pLight
);
LIST_FOR_EACH
(
e
,
&
This
->
stateBlock
->
lightMap
[
Hi
])
{
lightInfo
=
LIST_ENTRY
(
e
,
PLIGHTINFOEL
,
entry
);
LIST_FOR_EACH
(
e
,
&
This
->
stateBlock
->
lightMap
[
Hi
])
{
lightInfo
=
LIST_ENTRY
(
e
,
struct
wined3d_light_info
,
entry
);
if
(
lightInfo
->
OriginalIndex
==
Index
)
break
;
lightInfo
=
NULL
;
}
...
...
@@ -2598,15 +2601,17 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetLight(IWineD3DDevice *iface, DWORD I
* Get / Set Light Enable
* (Note for consistency, renamed d3dx function by adding the 'set' prefix)
*****/
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetLightEnable
(
IWineD3DDevice
*
iface
,
DWORD
Index
,
BOOL
Enable
)
{
PLIGHTINFOEL
*
lightInfo
=
NULL
;
static
HRESULT
WINAPI
IWineD3DDeviceImpl_SetLightEnable
(
IWineD3DDevice
*
iface
,
DWORD
Index
,
BOOL
Enable
)
{
struct
wined3d_light_info
*
lightInfo
=
NULL
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
UINT
Hi
=
LIGHTMAP_HASHFUNC
(
Index
);
struct
list
*
e
;
TRACE
(
"(%p) : Idx(%d), enable? %d
\n
"
,
This
,
Index
,
Enable
);
LIST_FOR_EACH
(
e
,
&
This
->
updateStateBlock
->
lightMap
[
Hi
])
{
lightInfo
=
LIST_ENTRY
(
e
,
PLIGHTINFOEL
,
entry
);
LIST_FOR_EACH
(
e
,
&
This
->
updateStateBlock
->
lightMap
[
Hi
])
{
lightInfo
=
LIST_ENTRY
(
e
,
struct
wined3d_light_info
,
entry
);
if
(
lightInfo
->
OriginalIndex
==
Index
)
break
;
lightInfo
=
NULL
;
}
...
...
@@ -2619,8 +2624,9 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetLightEnable(IWineD3DDevice *iface, D
IWineD3DDeviceImpl_SetLight
(
iface
,
Index
,
&
WINED3D_default_light
);
/* Search for it again! Should be fairly quick as near head of list */
LIST_FOR_EACH
(
e
,
&
This
->
updateStateBlock
->
lightMap
[
Hi
])
{
lightInfo
=
LIST_ENTRY
(
e
,
PLIGHTINFOEL
,
entry
);
LIST_FOR_EACH
(
e
,
&
This
->
updateStateBlock
->
lightMap
[
Hi
])
{
lightInfo
=
LIST_ENTRY
(
e
,
struct
wined3d_light_info
,
entry
);
if
(
lightInfo
->
OriginalIndex
==
Index
)
break
;
lightInfo
=
NULL
;
}
...
...
@@ -2680,16 +2686,17 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetLightEnable(IWineD3DDevice *iface, D
return
WINED3D_OK
;
}
static
HRESULT
WINAPI
IWineD3DDeviceImpl_GetLightEnable
(
IWineD3DDevice
*
iface
,
DWORD
Index
,
BOOL
*
pEnable
)
{
PLIGHTINFOEL
*
lightInfo
=
NULL
;
static
HRESULT
WINAPI
IWineD3DDeviceImpl_GetLightEnable
(
IWineD3DDevice
*
iface
,
DWORD
Index
,
BOOL
*
pEnable
)
{
struct
wined3d_light_info
*
lightInfo
=
NULL
;
IWineD3DDeviceImpl
*
This
=
(
IWineD3DDeviceImpl
*
)
iface
;
struct
list
*
e
;
UINT
Hi
=
LIGHTMAP_HASHFUNC
(
Index
);
TRACE
(
"(%p) : for idx(%d)
\n
"
,
This
,
Index
);
LIST_FOR_EACH
(
e
,
&
This
->
stateBlock
->
lightMap
[
Hi
])
{
lightInfo
=
LIST_ENTRY
(
e
,
PLIGHTINFOEL
,
entry
);
LIST_FOR_EACH
(
e
,
&
This
->
stateBlock
->
lightMap
[
Hi
])
{
lightInfo
=
LIST_ENTRY
(
e
,
struct
wined3d_light_info
,
entry
);
if
(
lightInfo
->
OriginalIndex
==
Index
)
break
;
lightInfo
=
NULL
;
}
...
...
dlls/wined3d/state.c
View file @
3bc9d189
...
...
@@ -3724,6 +3724,7 @@ static void state_vertexblend(DWORD state, IWineD3DStateBlockImpl *stateblock, s
static
void
transform_view
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
const
struct
wined3d_light_info
*
light
=
NULL
;
unsigned
int
k
;
/* If we are changing the View matrix, reset the light and clipping planes to the new view
...
...
@@ -3732,8 +3733,6 @@ static void transform_view(DWORD state, IWineD3DStateBlockImpl *stateblock, stru
* NOTE2: Apparently texture transforms do NOT need reapplying
*/
const
PLIGHTINFOEL
*
light
=
NULL
;
glMatrixMode
(
GL_MODELVIEW
);
checkGLcall
(
"glMatrixMode(GL_MODELVIEW)"
);
glLoadMatrixf
(
&
stateblock
->
transforms
[
WINED3DTS_VIEW
].
u
.
m
[
0
][
0
]);
...
...
@@ -4684,7 +4683,7 @@ static void viewport_vertexpart(DWORD state, IWineD3DStateBlockImpl *stateblock,
static
void
light
(
DWORD
state
,
IWineD3DStateBlockImpl
*
stateblock
,
struct
wined3d_context
*
context
)
{
UINT
Index
=
state
-
STATE_ACTIVELIGHT
(
0
);
const
PLIGHTINFOEL
*
lightInfo
=
stateblock
->
activeLights
[
Index
];
const
struct
wined3d_light_info
*
lightInfo
=
stateblock
->
activeLights
[
Index
];
if
(
!
lightInfo
)
{
glDisable
(
GL_LIGHT0
+
Index
);
...
...
dlls/wined3d/stateblock.c
View file @
3bc9d189
...
...
@@ -440,11 +440,11 @@ static void stateblock_init_lights(IWineD3DStateBlockImpl *stateblock, struct li
for
(
i
=
0
;
i
<
LIGHTMAP_SIZE
;
++
i
)
{
const
PLIGHTINFOEL
*
src_light
;
const
struct
wined3d_light_info
*
src_light
;
LIST_FOR_EACH_ENTRY
(
src_light
,
&
light_map
[
i
],
PLIGHTINFOEL
,
entry
)
LIST_FOR_EACH_ENTRY
(
src_light
,
&
light_map
[
i
],
struct
wined3d_light_info
,
entry
)
{
PLIGHTINFOEL
*
dst_light
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
dst_light
));
struct
wined3d_light_info
*
dst_light
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
dst_light
));
*
dst_light
=
*
src_light
;
dst_light
->
changed
=
TRUE
;
...
...
@@ -510,8 +510,9 @@ static ULONG WINAPI IWineD3DStateBlockImpl_Release(IWineD3DStateBlock *iface) {
for
(
counter
=
0
;
counter
<
LIGHTMAP_SIZE
;
counter
++
)
{
struct
list
*
e1
,
*
e2
;
LIST_FOR_EACH_SAFE
(
e1
,
e2
,
&
This
->
lightMap
[
counter
])
{
PLIGHTINFOEL
*
light
=
LIST_ENTRY
(
e1
,
PLIGHTINFOEL
,
entry
);
LIST_FOR_EACH_SAFE
(
e1
,
e2
,
&
This
->
lightMap
[
counter
])
{
struct
wined3d_light_info
*
light
=
LIST_ENTRY
(
e1
,
struct
wined3d_light_info
,
entry
);
list_remove
(
&
light
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
light
);
}
...
...
@@ -559,12 +560,12 @@ static void record_lights(IWineD3DStateBlockImpl *This, const IWineD3DStateBlock
struct
list
*
e
,
*
f
;
LIST_FOR_EACH
(
e
,
&
This
->
lightMap
[
i
])
{
BOOL
updated
=
FALSE
;
PLIGHTINFOEL
*
src
=
LIST_ENTRY
(
e
,
PLIGHTINFOEL
,
entry
),
*
realLight
;
struct
wined3d_light_info
*
src
=
LIST_ENTRY
(
e
,
struct
wined3d_light_info
,
entry
),
*
realLight
;
if
(
!
src
->
changed
&&
!
src
->
enabledChanged
)
continue
;
/* Look up the light in the destination */
LIST_FOR_EACH
(
f
,
&
targetStateBlock
->
lightMap
[
i
])
{
realLight
=
LIST_ENTRY
(
f
,
PLIGHTINFOEL
,
entry
);
realLight
=
LIST_ENTRY
(
f
,
struct
wined3d_light_info
,
entry
);
if
(
realLight
->
OriginalIndex
==
src
->
OriginalIndex
)
{
if
(
src
->
changed
)
{
src
->
OriginalParms
=
realLight
->
OriginalParms
;
...
...
@@ -982,8 +983,9 @@ static void apply_lights(IWineD3DDevice *pDevice, const IWineD3DStateBlockImpl *
for
(
i
=
0
;
i
<
LIGHTMAP_SIZE
;
i
++
)
{
struct
list
*
e
;
LIST_FOR_EACH
(
e
,
&
This
->
lightMap
[
i
])
{
const
PLIGHTINFOEL
*
light
=
LIST_ENTRY
(
e
,
PLIGHTINFOEL
,
entry
);
LIST_FOR_EACH
(
e
,
&
This
->
lightMap
[
i
])
{
const
struct
wined3d_light_info
*
light
=
LIST_ENTRY
(
e
,
struct
wined3d_light_info
,
entry
);
if
(
light
->
changed
)
{
IWineD3DDevice_SetLight
(
pDevice
,
light
->
OriginalIndex
,
&
light
->
OriginalParms
);
...
...
dlls/wined3d/wined3d_private.h
View file @
3bc9d189
...
...
@@ -1203,8 +1203,8 @@ HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwapChain *
/*****************************************************************************
* Internal representation of a light
*/
typedef
struct
PLIGHTINFOEL
PLIGHTINFOEL
;
struct
PLIGHTINFOEL
{
struct
wined3d_light_info
{
WINED3DLIGHT
OriginalParms
;
/* Note D3D8LIGHT == D3D9LIGHT */
DWORD
OriginalIndex
;
LONG
glIndex
;
...
...
@@ -2153,7 +2153,7 @@ struct IWineD3DStateBlockImpl
#define LIGHTMAP_SIZE 43
/* Use of a prime number recommended. Set to 1 for a linked list! */
#define LIGHTMAP_HASHFUNC(x) ((x) % LIGHTMAP_SIZE)
/* Primitive and simple function */
struct
list
lightMap
[
LIGHTMAP_SIZE
];
/* Hash map containing the lights */
PLIGHTINFOEL
*
activeLights
[
MAX_ACTIVE_LIGHTS
];
/* Map of opengl lights to d3d lights */
const
struct
wined3d_light_info
*
activeLights
[
MAX_ACTIVE_LIGHTS
];
/* Map of opengl lights to d3d lights */
/* Clipping */
double
clipplane
[
MAX_CLIPPLANES
][
4
];
...
...
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