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
d36df763
Commit
d36df763
authored
Jul 24, 2008
by
Philip Nilsson
Committed by
Alexandre Julliard
Jul 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Implement D3DXPlaneTransformArray.
parent
ae45f70c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
3 deletions
+47
-3
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
math.c
dlls/d3dx9_36/math.c
+18
-0
math.c
dlls/d3dx9_36/tests/math.c
+27
-2
d3dx9math.h
include/d3dx9math.h
+1
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
d36df763
...
...
@@ -235,7 +235,7 @@
@ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr) d3dx8.D3DXPlaneIntersectLine
@ stdcall D3DXPlaneNormalize(ptr ptr) d3dx8.D3DXPlaneNormalize
@ stdcall D3DXPlaneTransform(ptr ptr ptr) d3dx8.D3DXPlaneTransform
@ st
ub D3DXPlaneTransformArray
@ st
dcall D3DXPlaneTransformArray(ptr long ptr long ptr long)
@ stub D3DXPreprocessShader
@ stub D3DXPreprocessShaderFromFileA
@ stub D3DXPreprocessShaderFromFileW
...
...
dlls/d3dx9_36/math.c
View file @
d36df763
...
...
@@ -27,6 +27,24 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dx
);
/*************************************************************************
* D3DXPlaneTransformArray
*/
D3DXPLANE
*
WINAPI
D3DXPlaneTransformArray
(
D3DXPLANE
*
out
,
UINT
outstride
,
CONST
D3DXPLANE
*
in
,
UINT
instride
,
CONST
D3DXMATRIX
*
matrix
,
UINT
elements
)
{
UINT
i
;
TRACE
(
"
\n
"
);
for
(
i
=
0
;
i
<
elements
;
++
i
)
{
D3DXPlaneTransform
(
(
D3DXPLANE
*
)((
char
*
)
out
+
outstride
*
i
),
(
CONST
D3DXPLANE
*
)((
const
char
*
)
in
+
instride
*
i
),
matrix
);
}
return
out
;
}
/*************************************************************************
* D3DXVec2TransformArray
*
* Transform an array of vectors by a matrix.
...
...
dlls/d3dx9_36/tests/math.c
View file @
d36df763
...
...
@@ -34,6 +34,17 @@
exp[i].x, exp[i].y, exp[i].z, exp[i].w, \
i); \
}
#define compare_planes(exp, out) \
for (i = 0; i < ARRAY_SIZE + 2; ++i) { \
ok(relative_error(exp[i].a, out[i].a) < admitted_error && \
relative_error(exp[i].b, out[i].b) < admitted_error && \
relative_error(exp[i].c, out[i].c) < admitted_error && \
relative_error(exp[i].d, out[i].d) < admitted_error, \
"Got (%f, %f, %f, %f), expected (%f, %f, %f, %f) for index %d.\n", \
out[i].a, out[i].b, out[i].c, out[i].d, \
exp[i].a, exp[i].b, exp[i].c, exp[i].d, \
i); \
}
/* The mathematical properties are checked in the d3dx8 testsuite.
*
...
...
@@ -56,6 +67,9 @@ static void test_D3DXVec_Array(void)
D3DXVECTOR4
inp_vec
[
ARRAY_SIZE
];
D3DXVECTOR4
out_vec
[
ARRAY_SIZE
+
2
];
D3DXVECTOR4
exp_vec
[
ARRAY_SIZE
+
2
];
D3DXPLANE
inp_plane
[
ARRAY_SIZE
];
D3DXPLANE
out_plane
[
ARRAY_SIZE
+
2
];
D3DXPLANE
exp_plane
[
ARRAY_SIZE
+
2
];
viewport
.
Width
=
800
;
viewport
.
MinZ
=
0
.
2
f
;
viewport
.
X
=
10
;
viewport
.
Height
=
680
;
viewport
.
MaxZ
=
0
.
9
f
;
viewport
.
Y
=
5
;
...
...
@@ -63,11 +77,13 @@ static void test_D3DXVec_Array(void)
for
(
i
=
0
;
i
<
ARRAY_SIZE
+
2
;
++
i
)
{
out_vec
[
i
].
x
=
out_vec
[
i
].
y
=
out_vec
[
i
].
z
=
out_vec
[
i
].
w
=
0
.
0
f
;
exp_vec
[
i
].
x
=
exp_vec
[
i
].
y
=
exp_vec
[
i
].
z
=
exp_vec
[
i
].
w
=
0
.
0
f
;
out_plane
[
i
].
a
=
out_plane
[
i
].
b
=
out_plane
[
i
].
c
=
out_plane
[
i
].
d
=
0
.
0
f
;
exp_plane
[
i
].
a
=
exp_plane
[
i
].
b
=
exp_plane
[
i
].
c
=
exp_plane
[
i
].
d
=
0
.
0
f
;
}
for
(
i
=
0
;
i
<
ARRAY_SIZE
;
++
i
)
{
inp_vec
[
i
].
x
=
inp_vec
[
i
].
z
=
i
;
inp_vec
[
i
].
y
=
inp_vec
[
i
].
w
=
ARRAY_SIZE
-
i
;
inp_
plane
[
i
].
a
=
inp_plane
[
i
].
c
=
inp_
vec
[
i
].
x
=
inp_vec
[
i
].
z
=
i
;
inp_
plane
[
i
].
b
=
inp_plane
[
i
].
d
=
inp_
vec
[
i
].
y
=
inp_vec
[
i
].
w
=
ARRAY_SIZE
-
i
;
}
U
(
mat
).
m
[
0
][
0
]
=
1
.
0
f
;
U
(
mat
).
m
[
0
][
1
]
=
2
.
0
f
;
U
(
mat
).
m
[
0
][
2
]
=
3
.
0
f
;
U
(
mat
).
m
[
0
][
3
]
=
4
.
0
f
;
...
...
@@ -169,6 +185,15 @@ static void test_D3DXVec_Array(void)
exp_vec
[
5
].
x
=
58
.
0
f
;
exp_vec
[
5
].
y
=
68
.
0
f
;
exp_vec
[
5
].
z
=
78
.
0
f
;
exp_vec
[
5
].
w
=
88
.
0
f
;
D3DXVec4TransformArray
(
out_vec
+
1
,
sizeof
(
D3DXVECTOR4
),
inp_vec
,
sizeof
(
D3DXVECTOR4
),
&
mat
,
ARRAY_SIZE
);
compare_vectors
(
exp_vec
,
out_vec
);
/* D3DXPlaneTransformArray */
exp_plane
[
1
].
a
=
90
.
0
f
;
exp_plane
[
1
].
b
=
100
.
0
f
;
exp_plane
[
1
].
c
=
110
.
0
f
;
exp_plane
[
1
].
d
=
120
.
0
f
;
exp_plane
[
2
].
a
=
82
.
0
f
;
exp_plane
[
2
].
b
=
92
.
0
f
;
exp_plane
[
2
].
c
=
102
.
0
f
;
exp_plane
[
2
].
d
=
112
.
0
f
;
exp_plane
[
3
].
a
=
74
.
0
f
;
exp_plane
[
3
].
b
=
84
.
0
f
;
exp_plane
[
3
].
c
=
94
.
0
f
;
exp_plane
[
3
].
d
=
104
.
0
f
;
exp_plane
[
4
].
a
=
66
.
0
f
;
exp_plane
[
4
].
b
=
76
.
0
f
;
exp_plane
[
4
].
c
=
86
.
0
f
;
exp_plane
[
4
].
d
=
96
.
0
f
;
exp_plane
[
5
].
a
=
58
.
0
f
;
exp_plane
[
5
].
b
=
68
.
0
f
;
exp_plane
[
5
].
c
=
78
.
0
f
;
exp_plane
[
5
].
d
=
88
.
0
f
;
D3DXPlaneTransformArray
(
out_plane
+
1
,
sizeof
(
D3DXPLANE
),
inp_plane
,
sizeof
(
D3DXPLANE
),
&
mat
,
ARRAY_SIZE
);
compare_planes
(
exp_plane
,
out_plane
);
}
START_TEST
(
math
)
...
...
include/d3dx9math.h
View file @
d36df763
...
...
@@ -302,6 +302,7 @@ D3DXPLANE* WINAPI D3DXPlaneFromPoints(D3DXPLANE *pout, CONST D3DXVECTOR3 *pv1, C
D3DXVECTOR3
*
WINAPI
D3DXPlaneIntersectLine
(
D3DXVECTOR3
*
pout
,
CONST
D3DXPLANE
*
pp
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pv2
);
D3DXPLANE
*
WINAPI
D3DXPlaneNormalize
(
D3DXPLANE
*
pout
,
CONST
D3DXPLANE
*
pp
);
D3DXPLANE
*
WINAPI
D3DXPlaneTransform
(
D3DXPLANE
*
pout
,
CONST
D3DXPLANE
*
pplane
,
CONST
D3DXMATRIX
*
pm
);
D3DXPLANE
*
WINAPI
D3DXPlaneTransformArray
(
D3DXPLANE
*
pout
,
UINT
outstride
,
CONST
D3DXPLANE
*
pplane
,
UINT
pstride
,
CONST
D3DXMATRIX
*
pm
,
UINT
n
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionBaryCentric
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
,
CONST
D3DXQUATERNION
*
pq3
,
FLOAT
f
,
FLOAT
g
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionExp
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
...
...
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