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
adf4580b
Commit
adf4580b
authored
Oct 14, 2007
by
David Adam
Committed by
Alexandre Julliard
Oct 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXVec2Add with a test.
parent
a0ddecf7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
math.c
dlls/d3dx8/tests/math.c
+14
-1
d3dx8math.h
include/d3dx8math.h
+1
-0
d3dx8math.inl
include/d3dx8math.inl
+8
-0
No files found.
dlls/d3dx8/tests/math.c
View file @
adf4580b
...
...
@@ -24,14 +24,27 @@
#define admitted_error 0.00001f
#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);
static
void
D3X8Vector2Test
(
void
)
{
D3DXVECTOR2
u
,
v
;
D3DXVECTOR2
expectedvec
,
gotvec
,
u
,
v
;
LPD3DXVECTOR2
funcpointer
;
FLOAT
expected
,
got
;
u
.
x
=
3
.
0
f
;
u
.
y
=
4
.
0
f
;
v
.
x
=-
7
.
0
f
;
v
.
y
=
9
.
0
f
;
/*_______________D3DXVec2Add__________________________*/
expectedvec
.
x
=
-
4
.
0
f
;
expectedvec
.
y
=
13
.
0
f
;
D3DXVec2Add
(
&
gotvec
,
&
u
,
&
v
);
expect_vec
(
expectedvec
,
gotvec
);
/* Tests the case NULL */
funcpointer
=
D3DXVec2Add
(
&
gotvec
,
NULL
,
&
v
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
funcpointer
=
D3DXVec2Add
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec2CCW__________________________*/
expected
=
55
.
0
f
;
got
=
D3DXVec2CCW
(
&
u
,
&
v
);
...
...
include/d3dx8math.h
View file @
adf4580b
...
...
@@ -58,6 +58,7 @@ typedef struct D3DXCOLOR
FLOAT
r
,
g
,
b
,
a
;
}
D3DXCOLOR
,
*
LPD3DXCOLOR
;
D3DXVECTOR2
*
D3DXVec2Add
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
);
FLOAT
D3DXVec2CCW
(
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
);
FLOAT
D3DXVec2Dot
(
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
);
FLOAT
D3DXVec2Length
(
CONST
D3DXVECTOR2
*
pv
);
...
...
include/d3dx8math.inl
View file @
adf4580b
...
...
@@ -19,6 +19,14 @@
#ifndef __D3DX8MATH_INL__
#define __D3DX8MATH_INL__
extern inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{
if ( !pout || !pv1 || !pv2) return NULL;
pout->x = pv1->x + pv2->x;
pout->y = pv1->y + pv2->y;
return pout;
}
extern inline FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{
if ( !pv1 || !pv2) return 0.0f;
...
...
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