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
8d8a5f06
Commit
8d8a5f06
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 D3DXVec2Lerp with a test.
parent
18123a93
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
+10
-0
d3dx8math.h
include/d3dx8math.h
+1
-0
d3dx8math.inl
include/d3dx8math.inl
+9
-0
No files found.
dlls/d3dx8/tests/math.c
View file @
8d8a5f06
...
...
@@ -88,6 +88,16 @@ static void D3X8Vector2Test(void)
got
=
D3DXVec2LengthSq
(
NULL
);
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
/*_______________D3DXVec2Lerp__________________________*/
expectedvec
.
x
=
68
.
0
f
;
expectedvec
.
y
=
-
28
.
5
f
;
D3DXVec2Lerp
(
&
gotvec
,
&
u
,
&
v
,
scale
);
expect_vec
(
expectedvec
,
gotvec
);
/* Tests the case NULL */
funcpointer
=
D3DXVec2Lerp
(
&
gotvec
,
NULL
,
&
v
,
scale
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
funcpointer
=
D3DXVec2Lerp
(
NULL
,
NULL
,
NULL
,
scale
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec2Maximize__________________________*/
expectedvec
.
x
=
3
.
0
f
;
expectedvec
.
y
=
9
.
0
f
;
D3DXVec2Maximize
(
&
gotvec
,
&
u
,
&
v
);
...
...
include/d3dx8math.h
View file @
8d8a5f06
...
...
@@ -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
*
D3DXVec2Lerp
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
,
FLOAT
s
);
D3DXVECTOR2
*
D3DXVec2Maximize
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
);
D3DXVECTOR2
*
D3DXVec2Minimize
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
);
D3DXVECTOR2
*
D3DXVec2Scale
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv
,
FLOAT
s
);
...
...
include/d3dx8math.inl
View file @
8d8a5f06
...
...
@@ -51,6 +51,14 @@ extern inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv)
return( (pv->x) * (pv->x) + (pv->y) * (pv->y) );
}
extern inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s)
{
if ( !pout || !pv1 || !pv2) return NULL;
pout->x = (1-s) * (pv1->x) + s * (pv2->x);
pout->y = (1-s) * (pv1->y) + s * (pv2->y);
return pout;
}
extern inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{
if ( !pout || !pv1 || !pv2) return NULL;
...
...
@@ -66,6 +74,7 @@ extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2
pout->y = min(pv1->y , pv2->y);
return pout;
}
extern inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s)
{
if ( !pout || !pv) 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