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
604867c9
Commit
604867c9
authored
Oct 18, 2007
by
David Adam
Committed by
Alexandre Julliard
Oct 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXQuaternionIsIdentity.
parent
4be363ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
math.c
dlls/d3dx8/tests/math.c
+15
-2
d3dx8math.inl
include/d3dx8math.inl
+6
-0
No files found.
dlls/d3dx8/tests/math.c
View file @
604867c9
...
...
@@ -32,9 +32,10 @@
static
void
D3X8QuaternionTest
(
void
)
{
D3DXQUATERNION
expectedquat
,
gotquat
,
q
,
r
;
D3DXQUATERNION
expectedquat
,
gotquat
,
q
,
r
,
s
;
LPD3DXQUATERNION
funcpointer
;
FLOAT
expected
,
got
;
BOOL
expectedbool
,
gotbool
;
q
.
x
=
1
.
0
f
,
q
.
y
=
2
.
0
f
;
q
.
z
=
4
.
0
f
;
q
.
w
=
10
.
0
f
;
r
.
x
=
-
3
.
0
f
;
r
.
y
=
4
.
0
f
;
r
.
z
=
-
5
.
0
f
;
r
.
w
=
7
.
0
;
...
...
@@ -49,7 +50,6 @@ static void D3X8QuaternionTest(void)
funcpointer
=
D3DXQuaternionConjugate
(
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXQuaternionDot______________________*/
expected
=
55
.
0
f
;
got
=
D3DXQuaternionDot
(
&
q
,
&
r
);
...
...
@@ -70,6 +70,19 @@ static void D3X8QuaternionTest(void)
funcpointer
=
D3DXQuaternionIdentity
(
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXQuaternionIsIdentity________________*/
s
.
x
=
0
.
0
f
;
s
.
y
=
0
.
0
f
;
s
.
z
=
0
.
0
f
;
s
.
w
=
1
.
0
f
;
expectedbool
=
TRUE
;
gotbool
=
D3DXQuaternionIsIdentity
(
&
s
);
ok
(
expectedbool
==
gotbool
,
"Expected boolean : %d, Got bool : %d
\n
"
,
expectedbool
,
gotbool
);
s
.
x
=
2
.
3
f
;
s
.
y
=
-
4
.
2
f
;
s
.
z
=
1
.
2
f
;
s
.
w
=
0
.
2
f
;
expectedbool
=
FALSE
;
gotbool
=
D3DXQuaternionIsIdentity
(
&
q
);
ok
(
expectedbool
==
gotbool
,
"Expected boolean : %d, Got bool : %d
\n
"
,
expectedbool
,
gotbool
);
/* Test the NULL case */
gotbool
=
D3DXQuaternionIsIdentity
(
NULL
);
ok
(
gotbool
==
FALSE
,
"Expected boolean: %d, Got boolean: %d
\n
"
,
FALSE
,
gotbool
);
/*_______________D3DXQuaternionLength__________________________*/
expected
=
11
.
0
f
;
got
=
D3DXQuaternionLength
(
&
q
);
...
...
include/d3dx8math.inl
View file @
604867c9
...
...
@@ -284,6 +284,12 @@ static inline D3DXQUATERNION* D3DXQuaternionIdentity(D3DXQUATERNION *pout)
return pout;
}
static inline BOOL D3DXQuaternionIsIdentity(D3DXQUATERNION *pq)
{
if ( !pq) return FALSE;
return ( (pq->x == 0.0f) && (pq->y == 0.0f) && (pq->z == 0.0f) && (pq->w == 1.0f) );
}
static inline FLOAT D3DXQuaternionLength(CONST D3DXQUATERNION *pq)
{
if (!pq) 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