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
4ff191a7
Commit
4ff191a7
authored
Oct 26, 2007
by
David Adam
Committed by
Alexandre Julliard
Oct 29, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DX*Hermite.
parent
ea8e7ce4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
12 deletions
+78
-12
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+3
-3
math.c
dlls/d3dx8/math.c
+46
-0
math.c
dlls/d3dx8/tests/math.c
+26
-9
d3dx8math.h
include/d3dx8math.h
+3
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
4ff191a7
@ stdcall D3DXVec2Normalize(ptr ptr)
@ st
ub D3DXVec2Hermite
@ st
dcall D3DXVec2Hermite(ptr ptr ptr ptr ptr long)
@ stub D3DXVec2CatmullRom
@ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr long long)
@ stub D3DXVec2Transform
@ stub D3DXVec2TransformCoord
@ stub D3DXVec2TransformNormal
@ stdcall D3DXVec3Normalize(ptr ptr)
@ st
ub D3DXVec3Hermite
@ st
dcall D3DXVec3Hermite(ptr ptr ptr ptr ptr long)
@ stub D3DXVec3CatmullRom
@ stdcall D3DXVec3BaryCentric(ptr ptr ptr ptr long long)
@ stub D3DXVec3Transform
...
...
@@ -16,7 +16,7 @@
@ stub D3DXVec3Unproject
@ stub D3DXVec4Cross
@ stdcall D3DXVec4Normalize(ptr ptr)
@ st
ub D3DXVec4Hermite
@ st
dcall D3DXVec4Hermite(ptr ptr ptr ptr ptr long)
@ stub D3DXVec4CatmullRom
@ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr long long)
@ stub D3DXVec4Transform
...
...
dlls/d3dx8/math.c
View file @
4ff191a7
...
...
@@ -61,6 +61,20 @@ D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv
return
pout
;
}
D3DXVECTOR2
*
WINAPI
D3DXVec2Hermite
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pt1
,
CONST
D3DXVECTOR2
*
pv2
,
CONST
D3DXVECTOR2
*
pt2
,
FLOAT
s
)
{
FLOAT
h1
,
h2
,
h3
,
h4
;
h1
=
2
.
0
f
*
s
*
s
*
s
-
3
.
0
f
*
s
*
s
+
1
.
0
f
;
h2
=
s
*
s
*
s
-
2
.
0
f
*
s
*
s
+
s
;
h3
=
-
2
.
0
f
*
s
*
s
*
s
+
3
.
0
f
*
s
*
s
;
h4
=
s
*
s
*
s
-
s
*
s
;
pout
->
x
=
h1
*
(
pv1
->
x
)
+
h2
*
(
pt1
->
x
)
+
h3
*
(
pv2
->
x
)
+
h4
*
(
pt2
->
x
);
pout
->
y
=
h1
*
(
pv1
->
y
)
+
h2
*
(
pt1
->
y
)
+
h3
*
(
pv2
->
y
)
+
h4
*
(
pt2
->
y
);
return
pout
;
}
D3DXVECTOR2
*
WINAPI
D3DXVec2Normalize
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv
)
{
FLOAT
norm
;
...
...
@@ -89,6 +103,21 @@ D3DXVECTOR3* WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv
return
pout
;
}
D3DXVECTOR3
*
WINAPI
D3DXVec3Hermite
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pt1
,
CONST
D3DXVECTOR3
*
pv2
,
CONST
D3DXVECTOR3
*
pt2
,
FLOAT
s
)
{
FLOAT
h1
,
h2
,
h3
,
h4
;
h1
=
2
.
0
f
*
s
*
s
*
s
-
3
.
0
f
*
s
*
s
+
1
.
0
f
;
h2
=
s
*
s
*
s
-
2
.
0
f
*
s
*
s
+
s
;
h3
=
-
2
.
0
f
*
s
*
s
*
s
+
3
.
0
f
*
s
*
s
;
h4
=
s
*
s
*
s
-
s
*
s
;
pout
->
x
=
h1
*
(
pv1
->
x
)
+
h2
*
(
pt1
->
x
)
+
h3
*
(
pv2
->
x
)
+
h4
*
(
pt2
->
x
);
pout
->
y
=
h1
*
(
pv1
->
y
)
+
h2
*
(
pt1
->
y
)
+
h3
*
(
pv2
->
y
)
+
h4
*
(
pt2
->
y
);
pout
->
z
=
h1
*
(
pv1
->
z
)
+
h2
*
(
pt1
->
z
)
+
h3
*
(
pv2
->
z
)
+
h4
*
(
pt2
->
z
);
return
pout
;
}
D3DXVECTOR3
*
WINAPI
D3DXVec3Normalize
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
)
{
FLOAT
norm
;
...
...
@@ -119,6 +148,23 @@ D3DXVECTOR4* WINAPI D3DXVec4BaryCentric(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv
pout
->
w
=
(
1
.
0
f
-
f
-
g
)
*
(
pv1
->
w
)
+
f
*
(
pv2
->
w
)
+
g
*
(
pv3
->
w
);
return
pout
;
}
D3DXVECTOR4
*
WINAPI
D3DXVec4Hermite
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv1
,
CONST
D3DXVECTOR4
*
pt1
,
CONST
D3DXVECTOR4
*
pv2
,
CONST
D3DXVECTOR4
*
pt2
,
FLOAT
s
)
{
FLOAT
h1
,
h2
,
h3
,
h4
;
h1
=
2
.
0
f
*
s
*
s
*
s
-
3
.
0
f
*
s
*
s
+
1
.
0
f
;
h2
=
s
*
s
*
s
-
2
.
0
f
*
s
*
s
+
s
;
h3
=
-
2
.
0
f
*
s
*
s
*
s
+
3
.
0
f
*
s
*
s
;
h4
=
s
*
s
*
s
-
s
*
s
;
pout
->
x
=
h1
*
(
pv1
->
x
)
+
h2
*
(
pt1
->
x
)
+
h3
*
(
pv2
->
x
)
+
h4
*
(
pt2
->
x
);
pout
->
y
=
h1
*
(
pv1
->
y
)
+
h2
*
(
pt1
->
y
)
+
h3
*
(
pv2
->
y
)
+
h4
*
(
pt2
->
y
);
pout
->
z
=
h1
*
(
pv1
->
z
)
+
h2
*
(
pt1
->
z
)
+
h3
*
(
pv2
->
z
)
+
h4
*
(
pt2
->
z
);
pout
->
w
=
h1
*
(
pv1
->
w
)
+
h2
*
(
pt1
->
w
)
+
h3
*
(
pv2
->
w
)
+
h4
*
(
pt2
->
w
);
return
pout
;
}
D3DXVECTOR4
*
WINAPI
D3DXVec4Normalize
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv
)
{
FLOAT
norm
;
...
...
dlls/d3dx8/tests/math.c
View file @
4ff191a7
...
...
@@ -27,7 +27,7 @@
#define expect_vec(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error),"Expected Vector= (%f, %f)\n , Got Vector= (%f, %f)\n", expectedvec.x, expectedvec.y, gotvec.x, gotvec.y);
#define expect_vec3(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error)&&(fabs(expectedvec.z-gotvec.z)<admitted_error),"Expected Vector= (%f, %f,%f)\n , Got Vector= (%f, %f, %f)\n", expectedvec.x, expectedvec.y, expectedvec.z, gotvec.x, gotvec.y, gotvec.z);
#define expect_vec3(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error)&&(fabs(expectedvec.z-gotvec.z)<admitted_error),"Expected Vector= (%f, %f,
%f)\n , Got Vector= (%f, %f, %f)\n", expectedvec.x, expectedvec.y, expectedvec.z, gotvec.x, gotvec.y, gotvec.z);
#define expect_vec4(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error)&&(fabs(expectedvec.z-gotvec.z)<admitted_error)&&(fabs(expectedvec.w-gotvec.w)<admitted_error),"Expected Vector= (%f, %f, %f, %f)\n , Got Vector= (%f, %f, %f, %f)\n", expectedvec.x, expectedvec.y, expectedvec.z, expectedvec.w, gotvec.x, gotvec.y, gotvec.z, gotvec.w);
...
...
@@ -273,7 +273,7 @@ static void D3X8QuaternionTest(void)
static
void
D3X8Vector2Test
(
void
)
{
D3DXVECTOR2
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
;
D3DXVECTOR2
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
,
x
;
LPD3DXVECTOR2
funcpointer
;
FLOAT
coeff1
,
coeff2
,
expected
,
got
,
scale
;
...
...
@@ -281,6 +281,7 @@ static void D3X8Vector2Test(void)
u
.
x
=
3
.
0
f
;
u
.
y
=
4
.
0
f
;
v
.
x
=
-
7
.
0
f
;
v
.
y
=
9
.
0
f
;
w
.
x
=
4
.
0
f
;
w
.
y
=
-
3
.
0
f
;
x
.
x
=
2
.
0
f
;
x
.
y
=
-
11
.
0
f
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
f
;
scale
=
-
6
.
5
f
;
...
...
@@ -313,10 +314,10 @@ static void D3X8Vector2Test(void)
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
/*_______________D3DXVec2Dot__________________________*/
expected
=
15
.
0
f
;
got
=
D3DXVec2Dot
(
&
u
,
&
v
);
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
/* Tests the case NULL */
expected
=
15
.
0
f
;
got
=
D3DXVec2Dot
(
&
u
,
&
v
);
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
/* Tests the case NULL */
expected
=
0
.
0
f
;
got
=
D3DXVec2Dot
(
NULL
,
&
v
);
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
...
...
@@ -324,6 +325,11 @@ static void D3X8Vector2Test(void)
got
=
D3DXVec2Dot
(
NULL
,
NULL
);
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
/*_______________D3DXVec2Hermite__________________________*/
expectedvec
.
x
=
2604
.
625
f
;
expectedvec
.
y
=
-
4533
.
0
f
;
D3DXVec2Hermite
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
&
x
,
scale
);
expect_vec
(
expectedvec
,
gotvec
);
/*_______________D3DXVec2Length__________________________*/
expected
=
5
.
0
f
;
got
=
D3DXVec2Length
(
&
u
);
...
...
@@ -405,7 +411,7 @@ static void D3X8Vector2Test(void)
static
void
D3X8Vector3Test
(
void
)
{
D3DXVECTOR3
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
;
D3DXVECTOR3
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
,
x
;
LPD3DXVECTOR3
funcpointer
;
FLOAT
coeff1
,
coeff2
,
expected
,
got
,
scale
;
...
...
@@ -413,6 +419,7 @@ static void D3X8Vector3Test(void)
u
.
x
=
9
.
0
f
;
u
.
y
=
6
.
0
f
;
u
.
z
=
2
.
0
f
;
v
.
x
=
2
.
0
f
;
v
.
y
=
-
3
.
0
f
;
v
.
z
=
-
4
.
0
;
w
.
x
=
3
.
0
f
;
w
.
y
=
-
5
.
0
f
;
w
.
z
=
7
.
0
f
;
x
.
x
=
4
.
0
f
;
x
.
y
=
1
.
0
f
;
x
.
z
=
11
.
0
f
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
f
;
scale
=
-
6
.
5
f
;
...
...
@@ -453,6 +460,11 @@ static void D3X8Vector3Test(void)
got
=
D3DXVec3Dot
(
NULL
,
NULL
);
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
/*_______________D3DXVec3Hermite__________________________*/
expectedvec
.
x
=
-
6045
.
75
f
;
expectedvec
.
y
=
-
6650
.
0
f
;
expectedvec
.
z
=
1358
.
875
f
;
D3DXVec3Hermite
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
&
x
,
scale
);
expect_vec3
(
expectedvec
,
gotvec
);
/*_______________D3DXVec3Length__________________________*/
expected
=
11
.
0
f
;
got
=
D3DXVec3Length
(
&
u
);
...
...
@@ -534,7 +546,7 @@ static void D3X8Vector3Test(void)
static
void
D3X8Vector4Test
(
void
)
{
D3DXVECTOR4
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
;
D3DXVECTOR4
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
,
x
;
LPD3DXVECTOR4
funcpointer
;
FLOAT
coeff1
,
coeff2
,
expected
,
got
,
scale
;
...
...
@@ -542,7 +554,7 @@ static void D3X8Vector4Test(void)
u
.
x
=
1
.
0
f
;
u
.
y
=
2
.
0
f
;
u
.
z
=
4
.
0
f
;
u
.
w
=
10
.
0
;
v
.
x
=
-
3
.
0
f
;
v
.
y
=
4
.
0
f
;
v
.
z
=
-
5
.
0
f
;
v
.
w
=
7
.
0
;
w
.
x
=
4
.
0
f
;
w
.
y
=
6
.
0
f
;
w
.
z
=
-
2
.
0
f
;
w
.
w
=
1
.
0
f
;
x
.
x
=
6
.
0
f
;
x
.
y
=
-
7
.
0
f
;
x
.
z
=
8
.
0
f
;
x
.
w
=
-
9
.
0
f
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
;
scale
=
-
6
.
5
f
;
...
...
@@ -573,6 +585,11 @@ static void D3X8Vector4Test(void)
got
=
D3DXVec4Dot
(
NULL
,
NULL
);
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
/*_______________D3DXVec4Hermite_________________________*/
expectedvec
.
x
=
1224
.
625
f
;
expectedvec
.
y
=
3461
.
625
f
;
expectedvec
.
z
=
-
4758
.
875
f
;
expectedvec
.
w
=
-
5781
.
5
f
;
D3DXVec4Hermite
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
&
x
,
scale
);
expect_vec4
(
expectedvec
,
gotvec
);
/*_______________D3DXVec4Length__________________________*/
expected
=
11
.
0
f
;
got
=
D3DXVec4Length
(
&
u
);
...
...
include/d3dx8math.h
View file @
4ff191a7
...
...
@@ -61,12 +61,15 @@ typedef struct D3DXCOLOR
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
);
D3DXVECTOR2
*
WINAPI
D3DXVec2Hermite
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pt1
,
CONST
D3DXVECTOR2
*
pv2
,
CONST
D3DXVECTOR2
*
pt2
,
FLOAT
s
);
D3DXVECTOR2
*
WINAPI
D3DXVec2Normalize
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv
);
D3DXVECTOR3
*
WINAPI
D3DXVec3BaryCentric
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pv2
,
CONST
D3DXVECTOR3
*
pv3
,
FLOAT
f
,
FLOAT
g
);
D3DXVECTOR3
*
WINAPI
D3DXVec3Hermite
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pt1
,
CONST
D3DXVECTOR3
*
pv2
,
CONST
D3DXVECTOR3
*
pt2
,
FLOAT
s
);
D3DXVECTOR3
*
WINAPI
D3DXVec3Normalize
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
);
D3DXVECTOR4
*
WINAPI
D3DXVec4BaryCentric
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv1
,
CONST
D3DXVECTOR4
*
pv2
,
CONST
D3DXVECTOR4
*
pv3
,
FLOAT
f
,
FLOAT
g
);
D3DXVECTOR4
*
WINAPI
D3DXVec4Hermite
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv1
,
CONST
D3DXVECTOR4
*
pt1
,
CONST
D3DXVECTOR4
*
pv2
,
CONST
D3DXVECTOR4
*
pt2
,
FLOAT
s
);
D3DXVECTOR4
*
WINAPI
D3DXVec4Normalize
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv
);
#include <d3dx8math.inl>
...
...
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