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
28276e8f
Commit
28276e8f
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 D3DXVec2Minimize with a test.
parent
43d13935
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
0 deletions
+20
-0
math.c
dlls/d3dx8/tests/math.c
+11
-0
d3dx8math.h
include/d3dx8math.h
+1
-0
d3dx8math.inl
include/d3dx8math.inl
+8
-0
No files found.
dlls/d3dx8/tests/math.c
View file @
28276e8f
...
...
@@ -87,6 +87,17 @@ static void D3X8Vector2Test(void)
got
=
D3DXVec2LengthSq
(
NULL
);
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
/*_______________D3DXVec2Minimize__________________________*/
expectedvec
.
x
=
-
7
.
0
f
;
expectedvec
.
y
=
4
.
0
f
;
/*vecgot.x=0.0f; vecgot.y=0.0f;*/
D3DXVec2Minimize
(
&
gotvec
,
&
u
,
&
v
);
expect_vec
(
expectedvec
,
gotvec
);
/* Tests the case NULL */
funcpointer
=
D3DXVec2Minimize
(
&
gotvec
,
NULL
,
&
v
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
funcpointer
=
D3DXVec2Minimize
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec2Subtract__________________________*/
expectedvec
.
x
=
10
.
0
f
;
expectedvec
.
y
=
-
5
.
0
f
;
D3DXVec2Subtract
(
&
gotvec
,
&
u
,
&
v
);
...
...
include/d3dx8math.h
View file @
28276e8f
...
...
@@ -63,6 +63,7 @@ FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2);
FLOAT
D3DXVec2Dot
(
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
);
FLOAT
D3DXVec2Length
(
CONST
D3DXVECTOR2
*
pv
);
FLOAT
D3DXVec2LengthSq
(
CONST
D3DXVECTOR2
*
pv
);
D3DXVECTOR2
*
D3DXVec2Minimize
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
);
D3DXVECTOR2
*
D3DXVec2Subtract
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
);
#endif
/* __D3DX8MATH_H__ */
include/d3dx8math.inl
View file @
28276e8f
...
...
@@ -51,6 +51,14 @@ extern inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv)
return( (pv->x) * (pv->x) + (pv->y) * (pv->y) );
}
extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{
if ( !pout || !pv1 || !pv2) return NULL;
pout->x = min(pv1->x , pv2->x);
pout->y = min(pv1->y , pv2->y);
return pout;
}
extern inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{
if ( !pout || !pv1 || !pv2) return NULL;
...
...
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