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
1e0b1e54
Commit
1e0b1e54
authored
Jun 19, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Use color_match() in the fog test.
parent
68f20f15
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
17 deletions
+11
-17
visual.c
dlls/d3d9/tests/visual.c
+11
-17
No files found.
dlls/d3d9/tests/visual.c
View file @
1e0b1e54
...
...
@@ -774,8 +774,7 @@ struct sVertexT {
static
void
fog_test
(
IDirect3DDevice9
*
device
)
{
HRESULT
hr
;
DWORD
color
;
BYTE
r
,
g
,
b
;
D3DCOLOR
color
;
float
start
=
0
.
0
f
,
end
=
1
.
0
f
;
D3DCAPS9
caps
;
int
i
;
...
...
@@ -909,13 +908,13 @@ static void fog_test(IDirect3DDevice9 *device)
color
=
getPixelColor
(
device
,
160
,
360
);
ok
(
color
==
0x00FF0000
,
"Untransformed vertex with no table or vertex fog has color %08x
\n
"
,
color
);
color
=
getPixelColor
(
device
,
160
,
120
);
ok
(
color
==
0x0000FF00
||
color
==
0x0000FE00
,
"Untransformed vertex with linear vertex fog has color %08x
\n
"
,
color
);
ok
(
color
_match
(
color
,
0x0000ff00
,
1
)
,
"Untransformed vertex with linear vertex fog has color %08x
\n
"
,
color
);
color
=
getPixelColor
(
device
,
480
,
120
);
ok
(
color
==
0x00FFFF00
,
"Transformed vertex with linear vertex fog has color %08x
\n
"
,
color
);
if
(
caps
.
RasterCaps
&
D3DPRASTERCAPS_FOGTABLE
)
{
color
=
getPixelColor
(
device
,
480
,
360
);
ok
(
color
==
0x0000FF00
||
color
==
0x0000FE00
,
"Transformed vertex with linear table fog has color %08x
\n
"
,
color
);
ok
(
color
_match
(
color
,
0x0000ff00
,
1
)
,
"Transformed vertex with linear table fog has color %08x
\n
"
,
color
);
}
else
{
...
...
@@ -979,9 +978,9 @@ static void fog_test(IDirect3DDevice9 *device)
}
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
color
=
getPixelColor
(
device
,
160
,
360
);
ok
(
color
==
0x0000FF00
||
color
==
0x0000FE00
,
"Untransformed vertex with vertex fog and z = 0.1 has color %08x
\n
"
,
color
);
ok
(
color
_match
(
color
,
0x0000ff00
,
1
)
,
"Untransformed vertex with vertex fog and z = 0.1 has color %08x
\n
"
,
color
);
color
=
getPixelColor
(
device
,
160
,
120
);
ok
(
color
==
0x0000FF00
||
color
==
0x0000FE00
,
"Untransformed vertex with vertex fog and z = 1.0 has color %08x
\n
"
,
color
);
ok
(
color
_match
(
color
,
0x0000ff00
,
1
)
,
"Untransformed vertex with vertex fog and z = 1.0 has color %08x
\n
"
,
color
);
color
=
getPixelColor
(
device
,
480
,
120
);
ok
(
color
==
0x00FFFF00
,
"Transformed vertex with linear vertex fog has color %08x
\n
"
,
color
);
...
...
@@ -1026,20 +1025,15 @@ static void fog_test(IDirect3DDevice9 *device)
}
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
color
=
getPixelColor
(
device
,
160
,
360
);
ok
(
color
==
0x0000FF00
||
color
==
0x0000FE00
,
"Reversed %s fog: z=0.1 has color 0x%08x, expected 0x0000ff00 or 0x0000fe00
\n
"
,
mode
,
color
);
ok
(
color_match
(
color
,
0x0000ff00
,
1
),
"Reversed %s fog: z=0.1 has color 0x%08x, expected 0x0000ff00 or 0x0000fe00
\n
"
,
mode
,
color
);
color
=
getPixelColor
(
device
,
160
,
120
);
r
=
(
color
&
0x00ff0000
)
>>
16
;
g
=
(
color
&
0x0000ff00
)
>>
8
;
b
=
(
color
&
0x000000ff
);
ok
(
r
==
0x00
&&
g
>=
0x29
&&
g
<=
0x2d
&&
b
>=
0xd2
&&
b
<=
0xd6
,
ok
(
color_match
(
color
,
D3DCOLOR_ARGB
(
0x00
,
0x00
,
0x2b
,
0xd4
),
2
),
"Reversed %s fog: z=0.7 has color 0x%08x
\n
"
,
mode
,
color
);
color
=
getPixelColor
(
device
,
480
,
120
);
r
=
(
color
&
0x00ff0000
)
>>
16
;
g
=
(
color
&
0x0000ff00
)
>>
8
;
b
=
(
color
&
0x000000ff
);
ok
(
r
==
0x00
&&
g
>=
0xa8
&&
g
<=
0xac
&&
b
>=
0x53
&&
b
<=
0x57
,
ok
(
color_match
(
color
,
D3DCOLOR_ARGB
(
0x00
,
0x00
,
0xaa
,
0x55
),
2
),
"Reversed %s fog: z=0.4 has color 0x%08x
\n
"
,
mode
,
color
);
color
=
getPixelColor
(
device
,
480
,
360
);
...
...
@@ -6679,7 +6673,7 @@ static void fog_srgbwrite_test(IDirect3DDevice9 *device)
1
.
0
,
1
.
0
,
0
.
1
};
HRESULT
hr
;
D
WORD
color
;
D
3DCOLOR
color
;
IDirect3DDevice9_GetDirect3D
(
device
,
&
d3d
);
/* Ask for srgb writing on D3DRTYPE_TEXTURE. Some Windows drivers do not report it on surfaces.
...
...
@@ -6747,7 +6741,7 @@ static void fog_srgbwrite_test(IDirect3DDevice9 *device)
hr
=
IDirect3DDevice9_Present
(
device
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
D3D_OK
,
"IDirect3DDevice9_Present failed with %08x
\n
"
,
hr
);
color
=
getPixelColor
(
device
,
160
,
360
);
ok
(
color
==
0x00808080
||
color
==
0x007f7f7f
||
color
==
0x00818181
,
ok
(
color
_match
(
color
,
0x00808080
,
1
)
,
"Fog with D3DRS_SRGBWRITEENABLE returned color 0x%08x, expected 0x00808080
\n
"
,
color
);
}
...
...
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