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
c1663c55
Commit
c1663c55
authored
Jun 20, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Device2 and Device3 do not have a lighting render state.
parent
669611b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
14 deletions
+39
-14
device.c
dlls/ddraw/device.c
+37
-1
ddraw2.c
dlls/ddraw/tests/ddraw2.c
+2
-13
No files found.
dlls/ddraw/device.c
View file @
c1663c55
/*
/*
* Copyright (c) 1998-2004 Lionel Ulmer
* Copyright (c) 1998-2004 Lionel Ulmer
* Copyright (c) 2002-2005 Christian Costa
* Copyright (c) 2002-2005 Christian Costa
* Copyright (c) 2006-2009, 2011-201
2
Stefan Dösinger
* Copyright (c) 2006-2009, 2011-201
3
Stefan Dösinger
* Copyright (c) 2008 Alexander Dorofeyev
* Copyright (c) 2008 Alexander Dorofeyev
*
*
* This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or
...
@@ -2445,6 +2445,10 @@ static HRESULT WINAPI d3d_device3_GetRenderState(IDirect3DDevice3 *iface,
...
@@ -2445,6 +2445,10 @@ static HRESULT WINAPI d3d_device3_GetRenderState(IDirect3DDevice3 *iface,
return
D3D_OK
;
return
D3D_OK
;
}
}
case
D3DRENDERSTATE_LIGHTING
:
*
value
=
0xffffffff
;
return
D3D_OK
;
default:
default:
return
IDirect3DDevice7_GetRenderState
(
&
device
->
IDirect3DDevice7_iface
,
state
,
value
);
return
IDirect3DDevice7_GetRenderState
(
&
device
->
IDirect3DDevice7_iface
,
state
,
value
);
}
}
...
@@ -2800,6 +2804,10 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface,
...
@@ -2800,6 +2804,10 @@ static HRESULT WINAPI d3d_device3_SetRenderState(IDirect3DDevice3 *iface,
break
;
break
;
}
}
case
D3DRENDERSTATE_LIGHTING
:
hr
=
D3D_OK
;
break
;
default:
default:
hr
=
IDirect3DDevice7_SetRenderState
(
&
device
->
IDirect3DDevice7_iface
,
state
,
value
);
hr
=
IDirect3DDevice7_SetRenderState
(
&
device
->
IDirect3DDevice7_iface
,
state
,
value
);
break
;
break
;
...
@@ -3475,6 +3483,22 @@ static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUPreserve(IDirect3DDevice7 *if
...
@@ -3475,6 +3483,22 @@ static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUPreserve(IDirect3DDevice7 *if
return
hr
;
return
hr
;
}
}
static
void
setup_lighting
(
const
struct
d3d_device
*
device
,
DWORD
fvf
,
DWORD
flags
)
{
BOOL
enable
;
/* Ignore the D3DFVF_XYZRHW case here, wined3d takes care of that */
if
(
flags
&
D3DDP_DONOTLIGHT
)
enable
=
FALSE
;
else
if
(
!
(
fvf
&
D3DFVF_NORMAL
))
enable
=
FALSE
;
else
enable
=
TRUE
;
wined3d_device_set_render_state
(
device
->
wined3d_device
,
WINED3D_RS_LIGHTING
,
enable
);
}
static
HRESULT
WINAPI
d3d_device3_DrawPrimitive
(
IDirect3DDevice3
*
iface
,
static
HRESULT
WINAPI
d3d_device3_DrawPrimitive
(
IDirect3DDevice3
*
iface
,
D3DPRIMITIVETYPE
primitive_type
,
DWORD
fvf
,
void
*
vertices
,
DWORD
vertex_count
,
D3DPRIMITIVETYPE
primitive_type
,
DWORD
fvf
,
void
*
vertices
,
DWORD
vertex_count
,
DWORD
flags
)
DWORD
flags
)
...
@@ -3484,6 +3508,8 @@ static HRESULT WINAPI d3d_device3_DrawPrimitive(IDirect3DDevice3 *iface,
...
@@ -3484,6 +3508,8 @@ static HRESULT WINAPI d3d_device3_DrawPrimitive(IDirect3DDevice3 *iface,
TRACE
(
"iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, flags %#x.
\n
"
,
TRACE
(
"iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, flags %#x.
\n
"
,
iface
,
primitive_type
,
fvf
,
vertices
,
vertex_count
,
flags
);
iface
,
primitive_type
,
fvf
,
vertices
,
vertex_count
,
flags
);
setup_lighting
(
device
,
fvf
,
flags
);
return
IDirect3DDevice7_DrawPrimitive
(
&
device
->
IDirect3DDevice7_iface
,
return
IDirect3DDevice7_DrawPrimitive
(
&
device
->
IDirect3DDevice7_iface
,
primitive_type
,
fvf
,
vertices
,
vertex_count
,
flags
);
primitive_type
,
fvf
,
vertices
,
vertex_count
,
flags
);
}
}
...
@@ -3666,6 +3692,8 @@ static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive(IDirect3DDevice3 *iface,
...
@@ -3666,6 +3692,8 @@ static HRESULT WINAPI d3d_device3_DrawIndexedPrimitive(IDirect3DDevice3 *iface,
"indices %p, index_count %u, flags %#x.
\n
"
,
"indices %p, index_count %u, flags %#x.
\n
"
,
iface
,
primitive_type
,
fvf
,
vertices
,
vertex_count
,
indices
,
index_count
,
flags
);
iface
,
primitive_type
,
fvf
,
vertices
,
vertex_count
,
indices
,
index_count
,
flags
);
setup_lighting
(
device
,
fvf
,
flags
);
return
IDirect3DDevice7_DrawIndexedPrimitive
(
&
device
->
IDirect3DDevice7_iface
,
return
IDirect3DDevice7_DrawIndexedPrimitive
(
&
device
->
IDirect3DDevice7_iface
,
primitive_type
,
fvf
,
vertices
,
vertex_count
,
indices
,
index_count
,
flags
);
primitive_type
,
fvf
,
vertices
,
vertex_count
,
indices
,
index_count
,
flags
);
}
}
...
@@ -3972,6 +4000,8 @@ static HRESULT WINAPI d3d_device3_DrawPrimitiveStrided(IDirect3DDevice3 *iface,
...
@@ -3972,6 +4000,8 @@ static HRESULT WINAPI d3d_device3_DrawPrimitiveStrided(IDirect3DDevice3 *iface,
TRACE
(
"iface %p, primitive_type %#x, FVF %#x, strided_data %p, vertex_count %u, flags %#x.
\n
"
,
TRACE
(
"iface %p, primitive_type %#x, FVF %#x, strided_data %p, vertex_count %u, flags %#x.
\n
"
,
iface
,
PrimitiveType
,
VertexType
,
D3DDrawPrimStrideData
,
VertexCount
,
Flags
);
iface
,
PrimitiveType
,
VertexType
,
D3DDrawPrimStrideData
,
VertexCount
,
Flags
);
setup_lighting
(
device
,
VertexType
,
Flags
);
return
IDirect3DDevice7_DrawPrimitiveStrided
(
&
device
->
IDirect3DDevice7_iface
,
return
IDirect3DDevice7_DrawPrimitiveStrided
(
&
device
->
IDirect3DDevice7_iface
,
PrimitiveType
,
VertexType
,
D3DDrawPrimStrideData
,
VertexCount
,
Flags
);
PrimitiveType
,
VertexType
,
D3DDrawPrimStrideData
,
VertexCount
,
Flags
);
}
}
...
@@ -4097,6 +4127,8 @@ static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveStrided(IDirect3DDevice3 *
...
@@ -4097,6 +4127,8 @@ static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveStrided(IDirect3DDevice3 *
TRACE
(
"iface %p, primitive_type %#x, FVF %#x, strided_data %p, vertex_count %u, indices %p, index_count %u, flags %#x.
\n
"
,
TRACE
(
"iface %p, primitive_type %#x, FVF %#x, strided_data %p, vertex_count %u, indices %p, index_count %u, flags %#x.
\n
"
,
iface
,
PrimitiveType
,
VertexType
,
D3DDrawPrimStrideData
,
VertexCount
,
Indices
,
IndexCount
,
Flags
);
iface
,
PrimitiveType
,
VertexType
,
D3DDrawPrimStrideData
,
VertexCount
,
Indices
,
IndexCount
,
Flags
);
setup_lighting
(
device
,
VertexType
,
Flags
);
return
IDirect3DDevice7_DrawIndexedPrimitiveStrided
(
&
device
->
IDirect3DDevice7_iface
,
return
IDirect3DDevice7_DrawIndexedPrimitiveStrided
(
&
device
->
IDirect3DDevice7_iface
,
PrimitiveType
,
VertexType
,
D3DDrawPrimStrideData
,
VertexCount
,
Indices
,
IndexCount
,
Flags
);
PrimitiveType
,
VertexType
,
D3DDrawPrimStrideData
,
VertexCount
,
Indices
,
IndexCount
,
Flags
);
}
}
...
@@ -4189,6 +4221,8 @@ static HRESULT WINAPI d3d_device3_DrawPrimitiveVB(IDirect3DDevice3 *iface, D3DPR
...
@@ -4189,6 +4221,8 @@ static HRESULT WINAPI d3d_device3_DrawPrimitiveVB(IDirect3DDevice3 *iface, D3DPR
TRACE
(
"iface %p, primitive_type %#x, vb %p, start_vertex %u, vertex_count %u, flags %#x.
\n
"
,
TRACE
(
"iface %p, primitive_type %#x, vb %p, start_vertex %u, vertex_count %u, flags %#x.
\n
"
,
iface
,
PrimitiveType
,
D3DVertexBuf
,
StartVertex
,
NumVertices
,
Flags
);
iface
,
PrimitiveType
,
D3DVertexBuf
,
StartVertex
,
NumVertices
,
Flags
);
setup_lighting
(
device
,
vb
->
fvf
,
Flags
);
return
IDirect3DDevice7_DrawPrimitiveVB
(
&
device
->
IDirect3DDevice7_iface
,
return
IDirect3DDevice7_DrawPrimitiveVB
(
&
device
->
IDirect3DDevice7_iface
,
PrimitiveType
,
&
vb
->
IDirect3DVertexBuffer7_iface
,
StartVertex
,
NumVertices
,
Flags
);
PrimitiveType
,
&
vb
->
IDirect3DVertexBuffer7_iface
,
StartVertex
,
NumVertices
,
Flags
);
}
}
...
@@ -4320,6 +4354,8 @@ static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveVB(IDirect3DDevice3 *iface
...
@@ -4320,6 +4354,8 @@ static HRESULT WINAPI d3d_device3_DrawIndexedPrimitiveVB(IDirect3DDevice3 *iface
TRACE
(
"iface %p, primitive_type %#x, vb %p, indices %p, index_count %u, flags %#x.
\n
"
,
TRACE
(
"iface %p, primitive_type %#x, vb %p, indices %p, index_count %u, flags %#x.
\n
"
,
iface
,
PrimitiveType
,
D3DVertexBuf
,
Indices
,
IndexCount
,
Flags
);
iface
,
PrimitiveType
,
D3DVertexBuf
,
Indices
,
IndexCount
,
Flags
);
setup_lighting
(
device
,
vb
->
fvf
,
Flags
);
return
IDirect3DDevice7_DrawIndexedPrimitiveVB
(
&
device
->
IDirect3DDevice7_iface
,
PrimitiveType
,
return
IDirect3DDevice7_DrawIndexedPrimitiveVB
(
&
device
->
IDirect3DDevice7_iface
,
PrimitiveType
,
&
vb
->
IDirect3DVertexBuffer7_iface
,
0
,
IndexCount
,
Indices
,
IndexCount
,
Flags
);
&
vb
->
IDirect3DVertexBuffer7_iface
,
0
,
IndexCount
,
Indices
,
IndexCount
,
Flags
);
}
}
...
...
dlls/ddraw/tests/ddraw2.c
View file @
c1663c55
...
@@ -902,13 +902,6 @@ static void test_depth_blit(void)
...
@@ -902,13 +902,6 @@ static void test_depth_blit(void)
{
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
},
{
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
},
{
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
},
{
0x0000ff00
,
0x0000ff00
,
0x0000ff00
,
0x0000ff00
},
};
};
static
const
BOOL
todo
[
4
][
4
]
=
{
{
FALSE
,
FALSE
,
TRUE
,
TRUE
},
{
FALSE
,
FALSE
,
TRUE
,
TRUE
},
{
TRUE
,
TRUE
,
TRUE
,
TRUE
},
{
TRUE
,
TRUE
,
TRUE
,
TRUE
},
};
DDSURFACEDESC
ddsd_new
,
ddsd_existing
;
DDSURFACEDESC
ddsd_new
,
ddsd_existing
;
IDirect3DDevice2
*
device
;
IDirect3DDevice2
*
device
;
...
@@ -1056,12 +1049,8 @@ static void test_depth_blit(void)
...
@@ -1056,12 +1049,8 @@ static void test_depth_blit(void)
unsigned
int
x
=
80
*
((
2
*
j
)
+
1
);
unsigned
int
x
=
80
*
((
2
*
j
)
+
1
);
unsigned
int
y
=
60
*
((
2
*
i
)
+
1
);
unsigned
int
y
=
60
*
((
2
*
i
)
+
1
);
color
=
get_surface_color
(
rt
,
x
,
y
);
color
=
get_surface_color
(
rt
,
x
,
y
);
if
(
todo
[
i
][
j
])
ok
(
compare_color
(
color
,
expected_colors
[
i
][
j
],
1
),
todo_wine
ok
(
compare_color
(
color
,
expected_colors
[
i
][
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected_colors
[
i
][
j
],
x
,
y
,
color
);
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected_colors
[
i
][
j
],
x
,
y
,
color
);
else
ok
(
compare_color
(
color
,
expected_colors
[
i
][
j
],
1
),
"Expected color 0x%08x at %u,%u, got 0x%08x.
\n
"
,
expected_colors
[
i
][
j
],
x
,
y
,
color
);
}
}
}
}
IDirectDrawSurface_Release
(
rt
);
IDirectDrawSurface_Release
(
rt
);
...
...
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