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
6ebc5cef
Commit
6ebc5cef
authored
Oct 23, 2007
by
David Adam
Committed by
Alexandre Julliard
Oct 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXPlaneColorNegative.
parent
a00353b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
math.c
dlls/d3dx8/tests/math.c
+31
-0
d3dx8math.inl
include/d3dx8math.inl
+10
-0
No files found.
dlls/d3dx8/tests/math.c
View file @
6ebc5cef
...
...
@@ -24,12 +24,42 @@
#define admitted_error 0.00001f
#define expect_color(expectedcolor,gotcolor) ok((fabs(expectedcolor.r-gotcolor.r)<admitted_error)&&(fabs(expectedcolor.g-gotcolor.g)<admitted_error)&&(fabs(expectedcolor.b-gotcolor.b)<admitted_error)&&(fabs(expectedcolor.a-gotcolor.a)<admitted_error),"Expected Color= (%f, %f, %f, %f)\n , Got Color= (%f, %f, %f, %f)\n", expectedcolor.r, expectedcolor.g, expectedcolor.b, expectedcolor.a, gotcolor.r, gotcolor.g, gotcolor.b, gotcolor.a);
#define expect_vec(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error),"Expected Vector= (%f, %f)\n , Got Vector= (%f, %f)\n", expectedvec.x, expectedvec.y, gotvec.x, gotvec.y);
#define expect_vec3(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error)&&(fabs(expectedvec.z-gotvec.z)<admitted_error),"Expected Vector= (%f, %f,%f)\n , Got Vector= (%f, %f, %f)\n", expectedvec.x, expectedvec.y, expectedvec.z, gotvec.x, gotvec.y, gotvec.z);
#define expect_vec4(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error)&&(fabs(expectedvec.z-gotvec.z)<admitted_error)&&(fabs(expectedvec.w-gotvec.w)<admitted_error),"Expected Vector= (%f, %f, %f, %f)\n , Got Vector= (%f, %f, %f, %f)\n", expectedvec.x, expectedvec.y, expectedvec.z, expectedvec.w, gotvec.x, gotvec.y, gotvec.z, gotvec.w);
static
void
D3DXColorTest
(
void
)
{
D3DXCOLOR
color
,
color1
,
expected
,
got
;
LPD3DXCOLOR
funcpointer
;
color
.
r
=
0
.
2
f
;
color
.
g
=
0
.
75
f
;
color
.
b
=
0
.
41
f
;
color
.
a
=
0
.
93
f
;
/*_______________D3DXColorNegative________________*/
expected
.
r
=
0
.
8
f
;
expected
.
g
=
0
.
25
f
;
expected
.
b
=
0
.
59
f
;
expected
.
a
=
0
.
93
f
;
D3DXColorNegative
(
&
got
,
&
color
);
expect_color
(
got
,
expected
);
/* Test the greater than 1 case */
color1
.
r
=
0
.
2
f
;
color1
.
g
=
1
.
75
f
;
color1
.
b
=
0
.
41
f
;
color1
.
a
=
0
.
93
f
;
expected
.
r
=
0
.
8
f
;
expected
.
g
=
-
0
.
75
f
;
expected
.
b
=
0
.
59
f
;
expected
.
a
=
0
.
93
f
;
D3DXColorNegative
(
&
got
,
&
color1
);
expect_color
(
got
,
expected
);
/* Test the negative case */
color1
.
r
=
0
.
2
f
;
color1
.
g
=
-
0
.
75
f
;
color1
.
b
=
0
.
41
f
;
color1
.
a
=
0
.
93
f
;
expected
.
r
=
0
.
8
f
;
expected
.
g
=
1
.
75
f
;
expected
.
b
=
0
.
59
f
;
expected
.
a
=
0
.
93
f
;
D3DXColorNegative
(
&
got
,
&
color1
);
expect_color
(
got
,
expected
);
/* Test the NULL case */
funcpointer
=
D3DXColorNegative
(
&
got
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
funcpointer
=
D3DXColorNegative
(
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
}
static
void
D3DXPlaneTest
(
void
)
{
D3DXPLANE
plane
;
...
...
@@ -473,6 +503,7 @@ static void D3X8Vector4Test(void)
START_TEST
(
math
)
{
D3DXColorTest
();
D3DXPlaneTest
();
D3X8QuaternionTest
();
D3X8Vector2Test
();
...
...
include/d3dx8math.inl
View file @
6ebc5cef
...
...
@@ -19,6 +19,16 @@
#ifndef __D3DX8MATH_INL__
#define __D3DX8MATH_INL__
static inline D3DXCOLOR* D3DXColorNegative(D3DXCOLOR *pout, CONST D3DXCOLOR *pc)
{
if ( !pout || !pc ) return NULL;
pout->r = 1.0f - pc->r;
pout->g = 1.0f - pc->g;
pout->b = 1.0f - pc->b;
pout->a = pc->a;
return pout;
}
/*_______________D3DXVECTOR2________________________*/
static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
...
...
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