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
720fb79d
Commit
720fb79d
authored
Oct 30, 2007
by
David Adam
Committed by
Alexandre Julliard
Oct 31, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXMatrixfDeterminant.
parent
08d17fd2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
7 deletions
+31
-7
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+15
-0
math.c
dlls/d3dx8/tests/math.c
+13
-6
d3dx8math.h
include/d3dx8math.h
+2
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
720fb79d
...
...
@@ -20,7 +20,7 @@
@ stdcall D3DXVec4CatmullRom(ptr ptr ptr ptr long)
@ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr long long)
@ stdcall D3DXVec4Transform(ptr ptr ptr)
@ st
ub D3DXMatrixfDeterminant
@ st
dcall D3DXMatrixfDeterminant(ptr)
@ stub D3DXMatrixMultiply
@ stub D3DXMatrixTranspose
@ stub D3DXMatrixInverse
...
...
dlls/d3dx8/math.c
View file @
720fb79d
...
...
@@ -29,6 +29,21 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dx8
);
/*_________________D3DXMatrix____________________*/
FLOAT
WINAPI
D3DXMatrixfDeterminant
(
CONST
D3DXMATRIX
*
pm
)
{
D3DXVECTOR4
minor
,
v1
,
v2
,
v3
;
FLOAT
det
;
v1
.
x
=
pm
->
m
[
0
][
0
];
v1
.
y
=
pm
->
m
[
1
][
0
];
v1
.
z
=
pm
->
m
[
2
][
0
];
v1
.
w
=
pm
->
m
[
3
][
0
];
v2
.
x
=
pm
->
m
[
0
][
1
];
v2
.
y
=
pm
->
m
[
1
][
1
];
v2
.
z
=
pm
->
m
[
2
][
1
];
v2
.
w
=
pm
->
m
[
3
][
1
];
v3
.
x
=
pm
->
m
[
0
][
2
];
v3
.
y
=
pm
->
m
[
1
][
2
];
v3
.
z
=
pm
->
m
[
2
][
2
];
v3
.
w
=
pm
->
m
[
3
][
2
];
D3DXVec4Cross
(
&
minor
,
&
v1
,
&
v2
,
&
v3
);
det
=
-
(
pm
->
m
[
0
][
3
]
*
minor
.
x
+
pm
->
m
[
1
][
3
]
*
minor
.
y
+
pm
->
m
[
2
][
3
]
*
minor
.
z
+
pm
->
m
[
3
][
3
]
*
minor
.
w
);
return
det
;
}
/*_________________D3DXQUATERNION________________*/
D3DXQUATERNION
*
WINAPI
D3DXQuaternionNormalize
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
)
...
...
dlls/d3dx8/tests/math.c
View file @
720fb79d
...
...
@@ -125,14 +125,21 @@ static void D3DXMatrixTest(void)
{
D3DXMATRIX
mat
;
BOOL
expected
,
got
;
FLOAT
expectedfloat
,
gotfloat
;
U
(
mat
).
m
[
0
][
1
]
=
5
.
0
f
;
U
(
mat
).
m
[
0
][
2
]
=
7
.
0
f
;
U
(
mat
).
m
[
0
][
3
]
=
8
.
0
f
;
U
(
mat
).
m
[
1
][
0
]
=
11
.
0
f
;
U
(
mat
).
m
[
1
][
2
]
=
16
.
0
f
;
U
(
mat
).
m
[
1
][
3
]
=
33
.
0
f
;
U
(
mat
).
m
[
2
][
0
]
=
19
.
0
f
;
U
(
mat
).
m
[
2
][
1
]
=
-
21
.
0
f
;
U
(
mat
).
m
[
2
][
3
]
=
43
.
0
f
;
U
(
mat
).
m
[
3
][
0
]
=
2
.
0
f
;
U
(
mat
).
m
[
3
][
1
]
=
3
.
0
f
;
U
(
mat
).
m
[
3
][
2
]
=
-
4
.
0
f
;
U
(
mat
).
m
[
0
][
0
]
=
10
.
0
f
;
U
(
mat
).
m
[
1
][
1
]
=
20
.
0
f
;
U
(
mat
).
m
[
2
][
2
]
=
30
.
0
f
;
U
(
mat
).
m
[
3
][
3
]
=
-
40
.
0
f
;
/*____________D3DXMatrixfDeterminant_____________*/
expectedfloat
=
-
147888
.
0
f
;
gotfloat
=
D3DXMatrixfDeterminant
(
&
mat
);
ok
(
fabs
(
gotfloat
-
expectedfloat
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expectedfloat
,
gotfloat
);
/*____________D3DXMatrixIsIdentity______________*/
U
(
mat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
mat
).
m
[
0
][
2
]
=
7
.
0
f
;
U
(
mat
).
m
[
0
][
3
]
=
8
.
0
f
;
U
(
mat
).
m
[
1
][
0
]
=
11
.
0
f
;
U
(
mat
).
m
[
1
][
2
]
=
0
.
0
f
;
U
(
mat
).
m
[
1
][
3
]
=
0
.
0
f
;
U
(
mat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
mat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
mat
).
m
[
2
][
3
]
=
0
.
0
f
;
U
(
mat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
mat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
mat
).
m
[
3
][
2
]
=
0
.
0
f
;
U
(
mat
).
m
[
0
][
0
]
=
1
.
0
f
;
U
(
mat
).
m
[
1
][
1
]
=
1
.
0
f
;
U
(
mat
).
m
[
2
][
2
]
=
1
.
0
f
;
U
(
mat
).
m
[
3
][
3
]
=
1
.
0
f
;
expected
=
FALSE
;
got
=
D3DXMatrixIsIdentity
(
&
mat
);
ok
(
expected
==
got
,
"Expected : %d, Got : %d
\n
"
,
expected
,
got
);
...
...
include/d3dx8math.h
View file @
720fb79d
...
...
@@ -58,6 +58,8 @@ typedef struct D3DXCOLOR
FLOAT
r
,
g
,
b
,
a
;
}
D3DXCOLOR
,
*
LPD3DXCOLOR
;
FLOAT
WINAPI
D3DXMatrixfDeterminant
(
CONST
D3DXMATRIX
*
pm
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionNormalize
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
D3DXVECTOR2
*
WINAPI
D3DXVec2BaryCentric
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
,
CONST
D3DXVECTOR2
*
pv3
,
FLOAT
f
,
FLOAT
g
);
...
...
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