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
0bebad66
Commit
0bebad66
authored
Jul 17, 2008
by
H. Verbeet
Committed by
Alexandre Julliard
Jul 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Replace color_near() with color_match().
parent
b4bc3f26
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
24 deletions
+4
-24
visual.c
dlls/d3d9/tests/visual.c
+4
-24
No files found.
dlls/d3d9/tests/visual.c
View file @
0bebad66
...
...
@@ -6373,26 +6373,6 @@ out:
IDirect3D9_Release
(
d3d
);
}
/* Return true if color is near the expected value */
static
int
color_near
(
DWORD
color
,
DWORD
expected
)
{
const
BYTE
slop
=
2
;
BYTE
r
,
g
,
b
;
BYTE
rx
,
gx
,
bx
;
r
=
(
color
&
0x00ff0000
)
>>
16
;
g
=
(
color
&
0x0000ff00
)
>>
8
;
b
=
(
color
&
0x000000ff
);
rx
=
(
expected
&
0x00ff0000
)
>>
16
;
gx
=
(
expected
&
0x0000ff00
)
>>
8
;
bx
=
(
expected
&
0x000000ff
);
return
((
r
>=
(
rx
-
slop
))
&&
(
r
<=
(
rx
+
slop
)))
&&
((
g
>=
(
gx
-
slop
))
&&
(
g
<=
(
gx
+
slop
)))
&&
((
b
>=
(
bx
-
slop
))
&&
(
b
<=
(
bx
+
slop
)));
}
static
void
shademode_test
(
IDirect3DDevice9
*
device
)
{
/* Render a quad and try all of the different fixed function shading models. */
...
...
@@ -6494,9 +6474,9 @@ static void shademode_test(IDirect3DDevice9 *device)
case
D3DSHADE_GOURAUD
:
/* Should be an interpolated blend */
ok
(
color_
near
(
color0
,
0x000dca28
),
ok
(
color_
match
(
color0
,
D3DCOLOR_ARGB
(
0x00
,
0x0d
,
0xca
,
0x28
),
2
),
"GOURAUD shading has color0 %08x, expected 0x00dca28
\n
"
,
color0
);
ok
(
color_
near
(
color1
,
0x000d45c7
),
ok
(
color_
match
(
color1
,
D3DCOLOR_ARGB
(
0x00
,
0x0d
,
0x45
,
0xc7
),
2
),
"GOURAUD shading has color1 %08x, expected 0x000d45c7
\n
"
,
color1
);
color0_gouraud
=
color0
;
...
...
@@ -6506,9 +6486,9 @@ static void shademode_test(IDirect3DDevice9 *device)
break
;
case
D3DSHADE_PHONG
:
/* Should be the same as GOURAUD, since no hardware implements this */
ok
(
color_
near
(
color0
,
0x000dca28
),
ok
(
color_
match
(
color0
,
D3DCOLOR_ARGB
(
0x00
,
0x0d
,
0xca
,
0x28
),
2
),
"PHONG shading has color0 %08x, expected 0x000dca28
\n
"
,
color0
);
ok
(
color_
near
(
color1
,
0x000d45c7
),
ok
(
color_
match
(
color1
,
D3DCOLOR_ARGB
(
0x00
,
0x0d
,
0x45
,
0xc7
),
2
),
"PHONG shading has color1 %08x, expected 0x000d45c7
\n
"
,
color1
);
ok
(
color0
==
color0_gouraud
,
"difference between GOURAUD and PHONG shading detected: %08x %08x
\n
"
,
...
...
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