Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
5edd2cfa
Commit
5edd2cfa
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 D3DXPlaneMatrixIsIdentity.
parent
73f59692
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
1 deletion
+46
-1
math.c
dlls/d3dx8/tests/math.c
+28
-0
d3dx8math.inl
include/d3dx8math.inl
+18
-1
No files found.
dlls/d3dx8/tests/math.c
View file @
5edd2cfa
...
...
@@ -122,6 +122,33 @@ static void D3DXColorTest(void)
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
}
static
void
D3DXMatrixTest
(
void
)
{
D3DXMATRIX
mat
;
BOOL
expected
,
got
;
/*____________D3DXMatrixIsIdentity______________*/
mat
.
m
[
0
][
1
]
=
0
.
0
f
;
mat
.
m
[
0
][
2
]
=
7
.
0
f
;
mat
.
m
[
0
][
3
]
=
8
.
0
f
;
mat
.
m
[
1
][
0
]
=
11
.
0
f
;
mat
.
m
[
1
][
2
]
=
0
.
0
f
;
mat
.
m
[
1
][
3
]
=
0
.
0
f
;
mat
.
m
[
2
][
0
]
=
0
.
0
f
;
mat
.
m
[
2
][
1
]
=
0
.
0
f
;
mat
.
m
[
2
][
3
]
=
0
.
0
f
;
mat
.
m
[
3
][
0
]
=
0
.
0
f
;
mat
.
m
[
3
][
1
]
=
0
.
0
f
;
mat
.
m
[
3
][
2
]
=
0
.
0
f
;
mat
.
m
[
0
][
0
]
=
1
.
0
f
;
mat
.
m
[
1
][
1
]
=
1
.
0
f
;
mat
.
m
[
2
][
2
]
=
1
.
0
f
;
mat
.
m
[
3
][
3
]
=
1
.
0
f
;
expected
=
FALSE
;
got
=
D3DXMatrixIsIdentity
(
&
mat
);
ok
(
expected
==
got
,
"Expected : %d, Got : %d
\n
"
,
expected
,
got
);
D3DXMatrixIdentity
(
&
mat
);
expected
=
TRUE
;
got
=
D3DXMatrixIsIdentity
(
&
mat
);
ok
(
expected
==
got
,
"Expected : %d, Got : %d
\n
"
,
expected
,
got
);
/* Test the NULL case */
expected
=
FALSE
;
got
=
D3DXMatrixIsIdentity
(
NULL
);
ok
(
expected
==
got
,
"Expected : %d, Got : %d
\n
"
,
expected
,
got
);
}
static
void
D3DXPlaneTest
(
void
)
{
D3DXPLANE
plane
;
...
...
@@ -566,6 +593,7 @@ static void D3X8Vector4Test(void)
START_TEST
(
math
)
{
D3DXColorTest
();
D3DXMatrixTest
();
D3DXPlaneTest
();
D3X8QuaternionTest
();
D3X8Vector2Test
();
...
...
include/d3dx8math.inl
View file @
5edd2cfa
...
...
@@ -320,7 +320,7 @@ static inline D3DXVECTOR4* D3DXVec4Subtract(D3DXVECTOR4 *pout, CONST D3DXVECTOR4
/*__________________D3DXMatrix____________________*/
static inline D3DXMATRIX* D3DXMatrixIdentity(D3DXMATRIX *pout
)
static inline D3DXMATRIX* D3DXMatrixIdentity(D3DXMATRIX *pout)
{
if ( !pout ) return NULL;
pout->m[0][1] = 0.0f;
...
...
@@ -342,6 +342,23 @@ static inline D3DXMATRIX* D3DXMatrixIdentity(D3DXMATRIX *pout )
return pout;
}
static inline BOOL D3DXMatrixIsIdentity(D3DXMATRIX *pm)
{
int i,j;
D3DXMATRIX testmatrix;
BOOL equal=TRUE;
if ( !pm ) return FALSE;
D3DXMatrixIdentity(&testmatrix);
for (i=0; i<4; i++)
{
for (j=0; j<4; j++)
{
if ( fabs(pm->m[i][j] - testmatrix.m[i][j]) > 0.0001 ) equal = FALSE;
}
}
return equal;
}
/*__________________D3DXPLANE____________________*/
...
...
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