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
21491c87
Commit
21491c87
authored
Jun 17, 2013
by
Stefan Dösinger
Committed by
Alexandre Julliard
Jun 19, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw/tests: Add a test for fog_start == fog_end.
parent
5f2f2ae9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
98 additions
and
0 deletions
+98
-0
ddraw7.c
dlls/ddraw/tests/ddraw7.c
+98
-0
No files found.
dlls/ddraw/tests/ddraw7.c
View file @
21491c87
...
...
@@ -3177,6 +3177,103 @@ done:
DestroyWindow
(
window
);
}
static
void
test_fog_special
(
void
)
{
static
struct
{
struct
vec3
position
;
D3DCOLOR
diffuse
;
}
quad
[]
=
{
{{
-
1
.
0
f
,
1
.
0
f
,
0
.
0
f
},
0xff00ff00
},
{{
1
.
0
f
,
1
.
0
f
,
1
.
0
f
},
0xff00ff00
},
{{
-
1
.
0
f
,
-
1
.
0
f
,
0
.
0
f
},
0xff00ff00
},
{{
1
.
0
f
,
-
1
.
0
f
,
1
.
0
f
},
0xff00ff00
},
};
static
const
struct
{
DWORD
vertexmode
,
tablemode
;
D3DCOLOR
color_left
,
color_right
;
}
tests
[]
=
{
{
D3DFOG_LINEAR
,
D3DFOG_NONE
,
0x00ff0000
,
0x00ff0000
},
{
D3DFOG_NONE
,
D3DFOG_LINEAR
,
0x0000ff00
,
0x00ff0000
},
};
union
{
float
f
;
DWORD
d
;
}
conv
;
D3DCOLOR
color
;
HRESULT
hr
;
unsigned
int
i
;
HWND
window
;
IDirect3DDevice7
*
device
;
IDirectDrawSurface7
*
rt
;
window
=
CreateWindowA
(
"static"
,
"ddraw_test"
,
WS_OVERLAPPEDWINDOW
,
0
,
0
,
640
,
480
,
0
,
0
,
0
,
0
);
if
(
!
(
device
=
create_device
(
window
,
DDSCL_NORMAL
)))
{
skip
(
"Failed to create D3D device, skipping test.
\n
"
);
DestroyWindow
(
window
);
return
;
}
hr
=
IDirect3DDevice7_GetRenderTarget
(
device
,
&
rt
);
ok
(
SUCCEEDED
(
hr
),
"Failed to get render target, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_FOGENABLE
,
TRUE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to enable fog, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_FOGCOLOR
,
0xffff0000
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set fog color, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_LIGHTING
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to disable lighting, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_ZENABLE
,
D3DZB_FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to disable lighting, hr %#x.
\n
"
,
hr
);
conv
.
f
=
0
.
5
f
;
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_FOGSTART
,
conv
.
d
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set fog start, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_FOGEND
,
conv
.
d
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set fog end, hr %#x.
\n
"
,
hr
);
for
(
i
=
0
;
i
<
sizeof
(
tests
)
/
sizeof
(
*
tests
);
i
++
)
{
hr
=
IDirect3DDevice7_Clear
(
device
,
0
,
NULL
,
D3DCLEAR_TARGET
,
0x000000ff
,
1
.
0
f
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to clear render target, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_FOGVERTEXMODE
,
tests
[
i
].
vertexmode
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set fogvertexmode, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_FOGTABLEMODE
,
tests
[
i
].
tablemode
);
ok
(
SUCCEEDED
(
hr
),
"Failed to set fogtablemode, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_BeginScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to begin scene, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_DrawPrimitive
(
device
,
D3DPT_TRIANGLESTRIP
,
D3DFVF_XYZ
|
D3DFVF_DIFFUSE
,
quad
,
4
,
0
);
ok
(
SUCCEEDED
(
hr
),
"Failed to draw, hr %#x.
\n
"
,
hr
);
hr
=
IDirect3DDevice7_EndScene
(
device
);
ok
(
SUCCEEDED
(
hr
),
"Failed to end scene, hr %#x.
\n
"
,
hr
);
color
=
get_surface_color
(
rt
,
310
,
240
);
ok
(
compare_color
(
color
,
tests
[
i
].
color_left
,
1
),
"Expected left color 0x%08x, got 0x%08x, case %u.
\n
"
,
tests
[
i
].
color_left
,
color
,
i
);
color
=
get_surface_color
(
rt
,
330
,
240
);
ok
(
compare_color
(
color
,
tests
[
i
].
color_right
,
1
),
"Expected right color 0x%08x, got 0x%08x, case %u.
\n
"
,
tests
[
i
].
color_right
,
color
,
i
);
}
hr
=
IDirect3DDevice7_SetRenderState
(
device
,
D3DRENDERSTATE_FOGENABLE
,
FALSE
);
ok
(
SUCCEEDED
(
hr
),
"Failed to disable fog, hr %#x.
\n
"
,
hr
);
IDirectDrawSurface7_Release
(
rt
);
IDirect3DDevice7_Release
(
device
);
DestroyWindow
(
window
);
}
START_TEST
(
ddraw7
)
{
HMODULE
module
=
GetModuleHandleA
(
"ddraw.dll"
);
...
...
@@ -3212,4 +3309,5 @@ START_TEST(ddraw7)
test_draw_strided
();
test_clear_rect_count
();
test_coop_level_versions
();
test_fog_special
();
}
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