Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7b918934
Commit
7b918934
authored
Mar 13, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Mar 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Get rid of IDirect3DLightImpl.
parent
2071026a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
52 deletions
+52
-52
ddraw.c
dlls/ddraw/ddraw.c
+1
-1
ddraw_private.h
dlls/ddraw/ddraw_private.h
+5
-6
light.c
dlls/ddraw/light.c
+36
-35
viewport.c
dlls/ddraw/viewport.c
+10
-10
No files found.
dlls/ddraw/ddraw.c
View file @
7b918934
...
...
@@ -4123,7 +4123,7 @@ static HRESULT WINAPI d3d3_CreateLight(IDirect3D3 *iface, IDirect3DLight **light
IUnknown
*
outer_unknown
)
{
struct
ddraw
*
ddraw
=
impl_from_IDirect3D3
(
iface
);
IDirect3DLightImpl
*
object
;
struct
d3d_light
*
object
;
TRACE
(
"iface %p, light %p, outer_unknown %p.
\n
"
,
iface
,
light
,
outer_unknown
);
...
...
dlls/ddraw/ddraw_private.h
View file @
7b918934
...
...
@@ -42,7 +42,6 @@ extern const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops DECLSPEC_HI
/* Typdef the interfaces */
typedef
struct
IDirect3DDeviceImpl
IDirect3DDeviceImpl
;
typedef
struct
IDirect3DLightImpl
IDirect3DLightImpl
;
typedef
struct
IDirect3DViewportImpl
IDirect3DViewportImpl
;
typedef
struct
IDirect3DMaterialImpl
IDirect3DMaterialImpl
;
typedef
struct
IDirect3DExecuteBufferImpl
IDirect3DExecuteBufferImpl
;
...
...
@@ -402,7 +401,7 @@ struct object_creation_info
/******************************************************************************
* IDirect3DLight implementation structure - Wraps to D3D7
******************************************************************************/
struct
IDirect3DLightImpl
struct
d3d_light
{
IDirect3DLight
IDirect3DLight_iface
;
LONG
ref
;
...
...
@@ -422,10 +421,10 @@ struct IDirect3DLightImpl
};
/* Helper functions */
void
light_activate
(
IDirect3DLightImpl
*
light
)
DECLSPEC_HIDDEN
;
void
light_deactivate
(
IDirect3DLightImpl
*
light
)
DECLSPEC_HIDDEN
;
void
d3d_light_init
(
IDirect3DLightImpl
*
light
,
struct
ddraw
*
ddraw
)
DECLSPEC_HIDDEN
;
IDirect3DLightImpl
*
unsafe_impl_from_IDirect3DLight
(
IDirect3DLight
*
iface
)
DECLSPEC_HIDDEN
;
void
light_activate
(
struct
d3d_light
*
light
)
DECLSPEC_HIDDEN
;
void
light_deactivate
(
struct
d3d_light
*
light
)
DECLSPEC_HIDDEN
;
void
d3d_light_init
(
struct
d3d_light
*
light
,
struct
ddraw
*
ddraw
)
DECLSPEC_HIDDEN
;
struct
d3d_light
*
unsafe_impl_from_IDirect3DLight
(
IDirect3DLight
*
iface
)
DECLSPEC_HIDDEN
;
/******************************************************************************
* IDirect3DMaterial implementation structure - Wraps to D3D7
...
...
dlls/ddraw/light.c
View file @
7b918934
...
...
@@ -32,7 +32,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
* Updates the Direct3DDevice7 lighting parameters
*
*****************************************************************************/
static
void
light_update
(
IDirect3DLightImpl
*
light
)
static
void
light_update
(
struct
d3d_light
*
light
)
{
IDirect3DDeviceImpl
*
device
;
...
...
@@ -50,7 +50,7 @@ static void light_update(IDirect3DLightImpl *light)
* Uses the Direct3DDevice7::LightEnable method to active the light
*
*****************************************************************************/
void
light_activate
(
IDirect3DLightImpl
*
light
)
void
light_activate
(
struct
d3d_light
*
light
)
{
IDirect3DDeviceImpl
*
device
;
...
...
@@ -74,7 +74,7 @@ void light_activate(IDirect3DLightImpl *light)
* Uses the Direct3DDevice7::LightEnable method to deactivate the light
*
*****************************************************************************/
void
light_deactivate
(
IDirect3DLightImpl
*
light
)
void
light_deactivate
(
struct
d3d_light
*
light
)
{
IDirect3DDeviceImpl
*
device
;
...
...
@@ -91,9 +91,9 @@ void light_deactivate(IDirect3DLightImpl *light)
}
}
static
inline
IDirect3DLightImpl
*
impl_from_IDirect3DLight
(
IDirect3DLight
*
iface
)
static
inline
struct
d3d_light
*
impl_from_IDirect3DLight
(
IDirect3DLight
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
IDirect3DLightImpl
,
IDirect3DLight_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
d3d_light
,
IDirect3DLight_iface
);
}
/*****************************************************************************
...
...
@@ -109,7 +109,7 @@ static inline IDirect3DLightImpl *impl_from_IDirect3DLight(IDirect3DLight *iface
* Returns:
* E_NOINTERFACE, because it's a stub
*****************************************************************************/
static
HRESULT
WINAPI
IDirect3DLightImpl
_QueryInterface
(
IDirect3DLight
*
iface
,
REFIID
riid
,
void
**
object
)
static
HRESULT
WINAPI
d3d_light
_QueryInterface
(
IDirect3DLight
*
iface
,
REFIID
riid
,
void
**
object
)
{
FIXME
(
"iface %p, riid %s, object %p stub!
\n
"
,
iface
,
debugstr_guid
(
riid
),
object
);
...
...
@@ -117,25 +117,26 @@ static HRESULT WINAPI IDirect3DLightImpl_QueryInterface(IDirect3DLight *iface, R
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
IDirect3DLightImpl
_AddRef
(
IDirect3DLight
*
iface
)
static
ULONG
WINAPI
d3d_light
_AddRef
(
IDirect3DLight
*
iface
)
{
IDirect3DLightImpl
*
This
=
impl_from_IDirect3DLight
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
struct
d3d_light
*
light
=
impl_from_IDirect3DLight
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
light
->
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
This
,
ref
);
TRACE
(
"%p increasing refcount to %u.
\n
"
,
light
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
IDirect3DLightImpl
_Release
(
IDirect3DLight
*
iface
)
static
ULONG
WINAPI
d3d_light
_Release
(
IDirect3DLight
*
iface
)
{
IDirect3DLightImpl
*
This
=
impl_from_IDirect3DLight
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
d3d_light
*
light
=
impl_from_IDirect3DLight
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
light
->
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
This
,
ref
);
TRACE
(
"%p decreasing refcount to %u.
\n
"
,
light
,
ref
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
This
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
light
);
return
0
;
}
return
ref
;
...
...
@@ -158,7 +159,7 @@ static ULONG WINAPI IDirect3DLightImpl_Release(IDirect3DLight *iface)
* D3D_OK
*
*****************************************************************************/
static
HRESULT
WINAPI
IDirect3DLightImpl
_Initialize
(
IDirect3DLight
*
iface
,
IDirect3D
*
d3d
)
static
HRESULT
WINAPI
d3d_light
_Initialize
(
IDirect3DLight
*
iface
,
IDirect3D
*
d3d
)
{
TRACE
(
"iface %p, d3d %p.
\n
"
,
iface
,
d3d
);
...
...
@@ -187,10 +188,10 @@ static const float zero_value[] = {
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
};
static
HRESULT
WINAPI
IDirect3DLightImpl
_SetLight
(
IDirect3DLight
*
iface
,
D3DLIGHT
*
lpLight
)
static
HRESULT
WINAPI
d3d_light
_SetLight
(
IDirect3DLight
*
iface
,
D3DLIGHT
*
lpLight
)
{
IDirect3DLightImpl
*
This
=
impl_from_IDirect3DLight
(
iface
);
LPD3DLIGHT7
light7
=
&
This
->
light7
;
struct
d3d_light
*
light
=
impl_from_IDirect3DLight
(
iface
);
D3DLIGHT7
*
light7
=
&
light
->
light7
;
TRACE
(
"iface %p, light %p.
\n
"
,
iface
,
lpLight
);
...
...
@@ -225,9 +226,9 @@ static HRESULT WINAPI IDirect3DLightImpl_SetLight(IDirect3DLight *iface, D3DLIGH
light7
->
dvPhi
=
lpLight
->
dvPhi
;
wined3d_mutex_lock
();
memcpy
(
&
This
->
light
,
lpLight
,
lpLight
->
dwSize
);
if
(
This
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
)
light_update
(
This
);
memcpy
(
&
light
->
light
,
lpLight
,
lpLight
->
dwSize
);
if
(
light
->
light
.
dwFlags
&
D3DLIGHT_ACTIVE
)
light_update
(
light
);
wined3d_mutex_unlock
();
return
D3D_OK
;
...
...
@@ -245,20 +246,20 @@ static HRESULT WINAPI IDirect3DLightImpl_SetLight(IDirect3DLight *iface, D3DLIGH
* D3D_OK on success
* DDERR_INVALIDPARAMS if Light is NULL
*****************************************************************************/
static
HRESULT
WINAPI
IDirect3DLightImpl
_GetLight
(
IDirect3DLight
*
iface
,
D3DLIGHT
*
lpLight
)
static
HRESULT
WINAPI
d3d_light
_GetLight
(
IDirect3DLight
*
iface
,
D3DLIGHT
*
lpLight
)
{
IDirect3DLightImpl
*
This
=
impl_from_IDirect3DLight
(
iface
);
struct
d3d_light
*
light
=
impl_from_IDirect3DLight
(
iface
);
TRACE
(
"iface %p, light %p.
\n
"
,
iface
,
lpLight
);
if
(
TRACE_ON
(
ddraw
))
{
TRACE
(
" Returning light definition :
\n
"
);
dump_light
(
&
This
->
light
);
dump_light
(
&
light
->
light
);
}
wined3d_mutex_lock
();
memcpy
(
lpLight
,
&
This
->
light
,
lpLight
->
dwSize
);
memcpy
(
lpLight
,
&
light
->
light
,
lpLight
->
dwSize
);
wined3d_mutex_unlock
();
return
DD_OK
;
...
...
@@ -267,23 +268,23 @@ static HRESULT WINAPI IDirect3DLightImpl_GetLight(IDirect3DLight *iface, D3DLIGH
static
const
struct
IDirect3DLightVtbl
d3d_light_vtbl
=
{
/*** IUnknown Methods ***/
IDirect3DLightImpl
_QueryInterface
,
IDirect3DLightImpl
_AddRef
,
IDirect3DLightImpl
_Release
,
d3d_light
_QueryInterface
,
d3d_light
_AddRef
,
d3d_light
_Release
,
/*** IDirect3DLight Methods ***/
IDirect3DLightImpl
_Initialize
,
IDirect3DLightImpl
_SetLight
,
IDirect3DLightImpl
_GetLight
d3d_light
_Initialize
,
d3d_light
_SetLight
,
d3d_light
_GetLight
};
void
d3d_light_init
(
IDirect3DLightImpl
*
light
,
struct
ddraw
*
ddraw
)
void
d3d_light_init
(
struct
d3d_light
*
light
,
struct
ddraw
*
ddraw
)
{
light
->
IDirect3DLight_iface
.
lpVtbl
=
&
d3d_light_vtbl
;
light
->
ref
=
1
;
light
->
ddraw
=
ddraw
;
}
IDirect3DLightImpl
*
unsafe_impl_from_IDirect3DLight
(
IDirect3DLight
*
iface
)
struct
d3d_light
*
unsafe_impl_from_IDirect3DLight
(
IDirect3DLight
*
iface
)
{
if
(
!
iface
)
return
NULL
;
...
...
dlls/ddraw/viewport.c
View file @
7b918934
...
...
@@ -63,10 +63,10 @@ void viewport_activate(IDirect3DViewportImpl *This, BOOL ignore_lights)
if
(
!
ignore_lights
)
{
IDirect3DLightImpl
*
light
;
struct
d3d_light
*
light
;
/* Activate all the lights associated with this context */
LIST_FOR_EACH_ENTRY
(
light
,
&
This
->
light_list
,
IDirect3DLightImpl
,
entry
)
LIST_FOR_EACH_ENTRY
(
light
,
&
This
->
light_list
,
struct
d3d_light
,
entry
)
{
light_activate
(
light
);
}
...
...
@@ -764,7 +764,7 @@ static HRESULT WINAPI IDirect3DViewportImpl_AddLight(IDirect3DViewport3 *iface,
IDirect3DLight
*
lpDirect3DLight
)
{
IDirect3DViewportImpl
*
This
=
impl_from_IDirect3DViewport3
(
iface
);
IDirect3DLightImpl
*
lpDirect3DLightI
mpl
=
unsafe_impl_from_IDirect3DLight
(
lpDirect3DLight
);
struct
d3d_light
*
light_i
mpl
=
unsafe_impl_from_IDirect3DLight
(
lpDirect3DLight
);
DWORD
i
=
0
;
DWORD
map
=
This
->
map_lights
;
...
...
@@ -784,20 +784,20 @@ static HRESULT WINAPI IDirect3DViewportImpl_AddLight(IDirect3DViewport3 *iface,
map
>>=
1
;
++
i
;
}
l
pDirect3DLightI
mpl
->
dwLightIndex
=
i
;
l
ight_i
mpl
->
dwLightIndex
=
i
;
This
->
num_lights
++
;
This
->
map_lights
|=
1
<<
i
;
/* Add the light in the 'linked' chain */
list_add_head
(
&
This
->
light_list
,
&
l
pDirect3DLightI
mpl
->
entry
);
list_add_head
(
&
This
->
light_list
,
&
l
ight_i
mpl
->
entry
);
IDirect3DLight_AddRef
(
lpDirect3DLight
);
/* Attach the light to the viewport */
l
pDirect3DLightI
mpl
->
active_viewport
=
This
;
l
ight_i
mpl
->
active_viewport
=
This
;
/* If active, activate the light */
if
(
This
->
active_device
)
light_activate
(
l
pDirect3DLightI
mpl
);
light_activate
(
l
ight_i
mpl
);
wined3d_mutex_unlock
();
...
...
@@ -821,7 +821,7 @@ static HRESULT WINAPI IDirect3DViewportImpl_DeleteLight(IDirect3DViewport3 *ifac
IDirect3DLight
*
lpDirect3DLight
)
{
IDirect3DViewportImpl
*
This
=
impl_from_IDirect3DViewport3
(
iface
);
IDirect3DLightImpl
*
l
=
unsafe_impl_from_IDirect3DLight
(
lpDirect3DLight
);
struct
d3d_light
*
l
=
unsafe_impl_from_IDirect3DLight
(
lpDirect3DLight
);
TRACE
(
"iface %p, light %p.
\n
"
,
iface
,
lpDirect3DLight
);
...
...
@@ -863,7 +863,7 @@ static HRESULT WINAPI IDirect3DViewportImpl_NextLight(IDirect3DViewport3 *iface,
IDirect3DLight
*
lpDirect3DLight
,
IDirect3DLight
**
lplpDirect3DLight
,
DWORD
dwFlags
)
{
IDirect3DViewportImpl
*
This
=
impl_from_IDirect3DViewport3
(
iface
);
IDirect3DLightImpl
*
l
=
unsafe_impl_from_IDirect3DLight
(
lpDirect3DLight
);
struct
d3d_light
*
l
=
unsafe_impl_from_IDirect3DLight
(
lpDirect3DLight
);
struct
list
*
entry
;
HRESULT
hr
;
...
...
@@ -904,7 +904,7 @@ static HRESULT WINAPI IDirect3DViewportImpl_NextLight(IDirect3DViewport3 *iface,
if
(
entry
)
{
*
lplpDirect3DLight
=
(
IDirect3DLight
*
)
LIST_ENTRY
(
entry
,
IDirect3DLightImpl
,
entry
);
*
lplpDirect3DLight
=
(
IDirect3DLight
*
)
LIST_ENTRY
(
entry
,
struct
d3d_light
,
entry
);
IDirect3DLight_AddRef
(
*
lplpDirect3DLight
);
hr
=
D3D_OK
;
}
...
...
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