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
06a44abc
Commit
06a44abc
authored
Aug 17, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Aug 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Remove useless light callbacks.
parent
8394f006
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
90 deletions
+77
-90
ddraw.c
dlls/ddraw/ddraw.c
+0
-5
ddraw_private.h
dlls/ddraw/ddraw_private.h
+2
-8
light.c
dlls/ddraw/light.c
+67
-70
viewport.c
dlls/ddraw/viewport.c
+8
-7
No files found.
dlls/ddraw/ddraw.c
View file @
06a44abc
...
...
@@ -4397,11 +4397,6 @@ static HRESULT WINAPI d3d3_CreateLight(IDirect3D3 *iface, IDirect3DLight **light
object
->
ref
=
1
;
object
->
ddraw
=
ddraw_from_d3d3
(
iface
);
/* Update functions */
object
->
activate
=
light_update
;
object
->
desactivate
=
light_activate
;
object
->
update
=
light_desactivate
;
TRACE
(
"Created light %p.
\n
"
,
object
);
*
light
=
(
IDirect3DLight
*
)
object
;
...
...
dlls/ddraw/ddraw_private.h
View file @
06a44abc
...
...
@@ -525,20 +525,14 @@ struct IDirect3DLightImpl
/* Chained list used for adding / removing from viewports */
IDirect3DLightImpl
*
next
;
/* Activation function */
void
(
*
activate
)(
IDirect3DLightImpl
*
);
void
(
*
desactivate
)(
IDirect3DLightImpl
*
);
void
(
*
update
)(
IDirect3DLightImpl
*
);
};
/* Vtable */
extern
const
IDirect3DLightVtbl
IDirect3DLight_Vtbl
DECLSPEC_HIDDEN
;
/* Helper functions */
void
light_update
(
IDirect3DLightImpl
*
This
)
DECLSPEC_HIDDEN
;
void
light_activate
(
IDirect3DLightImpl
*
This
)
DECLSPEC_HIDDEN
;
void
light_desactivate
(
IDirect3DLightImpl
*
This
)
DECLSPEC_HIDDEN
;
void
light_activate
(
IDirect3DLightImpl
*
light
)
DECLSPEC_HIDDEN
;
void
light_deactivate
(
IDirect3DLightImpl
*
light
)
DECLSPEC_HIDDEN
;
/******************************************************************************
* IDirect3DMaterial implementation structure - Wraps to D3D7
...
...
dlls/ddraw/light.c
View file @
06a44abc
...
...
@@ -44,6 +44,71 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d7
);
/*****************************************************************************
* light_update
*
* Updates the Direct3DDevice7 lighting parameters
*
*****************************************************************************/
static
void
light_update
(
IDirect3DLightImpl
*
light
)
{
IDirect3DDeviceImpl
*
device
;
TRACE
(
"light %p.
\n
"
,
light
);
if
(
!
light
->
active_viewport
||
!
light
->
active_viewport
->
active_device
)
return
;
device
=
light
->
active_viewport
->
active_device
;
IDirect3DDevice7_SetLight
((
IDirect3DDevice7
*
)
device
,
light
->
dwLightIndex
,
&
light
->
light7
);
}
/*****************************************************************************
* light_activate
*
* Uses the Direct3DDevice7::LightEnable method to active the light
*
*****************************************************************************/
void
light_activate
(
IDirect3DLightImpl
*
light
)
{
IDirect3DDeviceImpl
*
device
;
TRACE
(
"light %p.
\n
"
,
light
);
if
(
!
light
->
active_viewport
||
!
light
->
active_viewport
->
active_device
)
return
;
device
=
light
->
active_viewport
->
active_device
;
light_update
(
light
);
if
(
!
(
light
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
))
{
IDirect3DDevice7_LightEnable
((
IDirect3DDevice7
*
)
device
,
light
->
dwLightIndex
,
TRUE
);
light
->
light
.
dwFlags
|=
D3DLIGHT_ACTIVE
;
}
}
/*****************************************************************************
*
* light_deactivate
*
* Uses the Direct3DDevice7::LightEnable method to deactivate the light
*
*****************************************************************************/
void
light_deactivate
(
IDirect3DLightImpl
*
light
)
{
IDirect3DDeviceImpl
*
device
;
TRACE
(
"light %p.
\n
"
,
light
);
if
(
!
light
->
active_viewport
||
!
light
->
active_viewport
->
active_device
)
return
;
device
=
light
->
active_viewport
->
active_device
;
/* If was not active, activate it */
if
(
light
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
)
{
IDirect3DDevice7_LightEnable
((
IDirect3DDevice7
*
)
device
,
light
->
dwLightIndex
,
FALSE
);
light
->
light
.
dwFlags
&=
~
D3DLIGHT_ACTIVE
;
}
}
/*****************************************************************************
* IUnknown Methods.
*****************************************************************************/
...
...
@@ -203,9 +268,8 @@ IDirect3DLightImpl_SetLight(IDirect3DLight *iface,
EnterCriticalSection
(
&
ddraw_cs
);
memcpy
(
&
This
->
light
,
lpLight
,
lpLight
->
dwSize
);
if
((
This
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
)
!=
0
)
{
This
->
update
(
This
);
}
if
(
This
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
)
light_update
(
This
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
D3D_OK
;
}
...
...
@@ -240,73 +304,6 @@ IDirect3DLightImpl_GetLight(IDirect3DLight *iface,
return
DD_OK
;
}
/*****************************************************************************
* light_update
*
* Updates the Direct3DDevice7 lighting parameters
*
*****************************************************************************/
void
light_update
(
IDirect3DLightImpl
*
This
)
{
IDirect3DDeviceImpl
*
device
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
This
->
active_viewport
||
!
This
->
active_viewport
->
active_device
)
return
;
device
=
This
->
active_viewport
->
active_device
;
IDirect3DDevice7_SetLight
((
IDirect3DDevice7
*
)
device
,
This
->
dwLightIndex
,
&
(
This
->
light7
));
}
/*****************************************************************************
* light_activate
*
* Uses the Direct3DDevice7::LightEnable method to active the light
*
*****************************************************************************/
void
light_activate
(
IDirect3DLightImpl
*
This
)
{
IDirect3DDeviceImpl
*
device
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
This
->
active_viewport
||
!
This
->
active_viewport
->
active_device
)
return
;
device
=
This
->
active_viewport
->
active_device
;
light_update
(
This
);
/* If was not active, activate it */
if
((
This
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
)
==
0
)
{
IDirect3DDevice7_LightEnable
((
IDirect3DDevice7
*
)
device
,
This
->
dwLightIndex
,
TRUE
);
This
->
light
.
dwFlags
|=
D3DLIGHT_ACTIVE
;
}
}
/*****************************************************************************
*
* light_desactivate
*
* Uses the Direct3DDevice7::LightEnable method to deactivate the light
*
*****************************************************************************/
void
light_desactivate
(
IDirect3DLightImpl
*
This
)
{
IDirect3DDeviceImpl
*
device
;
TRACE
(
"(%p)
\n
"
,
This
);
if
(
!
This
->
active_viewport
||
!
This
->
active_viewport
->
active_device
)
return
;
device
=
This
->
active_viewport
->
active_device
;
/* If was not active, activate it */
if
((
This
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
)
!=
0
)
{
IDirect3DDevice7_LightEnable
((
IDirect3DDevice7
*
)
device
,
This
->
dwLightIndex
,
FALSE
);
This
->
light
.
dwFlags
&=
~
D3DLIGHT_ACTIVE
;
}
}
const
IDirect3DLightVtbl
IDirect3DLight_Vtbl
=
{
/*** IUnknown Methods ***/
...
...
dlls/ddraw/viewport.c
View file @
06a44abc
...
...
@@ -62,8 +62,9 @@ void viewport_activate(IDirect3DViewportImpl* This, BOOL ignore_lights) {
/* Activate all the lights associated with this context */
light
=
This
->
lights
;
while
(
light
!=
NULL
)
{
light
->
activate
(
light
);
while
(
light
)
{
light_activate
(
light
);
light
=
light
->
next
;
}
}
...
...
@@ -762,9 +763,8 @@ IDirect3DViewportImpl_AddLight(IDirect3DViewport3 *iface,
lpDirect3DLightImpl
->
active_viewport
=
This
;
/* If active, activate the light */
if
(
This
->
active_device
!=
NULL
)
{
lpDirect3DLightImpl
->
activate
(
lpDirect3DLightImpl
);
}
if
(
This
->
active_device
)
light_activate
(
lpDirect3DLightImpl
);
LeaveCriticalSection
(
&
ddraw_cs
);
return
D3D_OK
;
...
...
@@ -796,8 +796,9 @@ IDirect3DViewportImpl_DeleteLight(IDirect3DViewport3 *iface,
EnterCriticalSection
(
&
ddraw_cs
);
cur_light
=
This
->
lights
;
while
(
cur_light
!=
NULL
)
{
if
(
cur_light
==
lpDirect3DLightImpl
)
{
lpDirect3DLightImpl
->
desactivate
(
lpDirect3DLightImpl
);
if
(
cur_light
==
lpDirect3DLightImpl
)
{
light_deactivate
(
lpDirect3DLightImpl
);
if
(
prev_light
==
NULL
)
This
->
lights
=
cur_light
->
next
;
else
prev_light
->
next
=
cur_light
->
next
;
/* Detach the light to the viewport */
...
...
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