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
7d0f15f9
Commit
7d0f15f9
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*CatmullRom.
parent
4ff191a7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
3 deletions
+46
-3
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+3
-3
math.c
dlls/d3dx8/math.c
+24
-0
math.c
dlls/d3dx8/tests/math.c
+16
-0
d3dx8math.h
include/d3dx8math.h
+3
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
7d0f15f9
@ stdcall D3DXVec2Normalize(ptr ptr)
@ stdcall D3DXVec2Hermite(ptr ptr ptr ptr ptr long)
@ st
ub D3DXVec2CatmullRom
@ st
dcall D3DXVec2CatmullRom(ptr ptr ptr ptr long)
@ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr long long)
@ stub D3DXVec2Transform
@ stub D3DXVec2TransformCoord
@ stub D3DXVec2TransformNormal
@ stdcall D3DXVec3Normalize(ptr ptr)
@ stdcall D3DXVec3Hermite(ptr ptr ptr ptr ptr long)
@ st
ub D3DXVec3CatmullRom
@ st
dcall D3DXVec3CatmullRom(ptr ptr ptr ptr long)
@ stdcall D3DXVec3BaryCentric(ptr ptr ptr ptr long long)
@ stub D3DXVec3Transform
@ stub D3DXVec3TransformCoord
...
...
@@ -17,7 +17,7 @@
@ stub D3DXVec4Cross
@ stdcall D3DXVec4Normalize(ptr ptr)
@ stdcall D3DXVec4Hermite(ptr ptr ptr ptr ptr long)
@ st
ub D3DXVec4CatmullRom
@ st
dcall D3DXVec4CatmullRom(ptr ptr ptr ptr long)
@ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr long long)
@ stub D3DXVec4Transform
@ stub D3DXMatrixfDeterminant
...
...
dlls/d3dx8/math.c
View file @
7d0f15f9
...
...
@@ -61,6 +61,13 @@ D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv
return
pout
;
}
D3DXVECTOR2
*
WINAPI
D3DXVec2CatmullRom
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv0
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
,
CONST
D3DXVECTOR2
*
pv3
,
FLOAT
s
)
{
pout
->
x
=
0
.
5
f
*
(
2
.
0
f
*
pv1
->
x
+
(
pv2
->
x
-
pv0
->
x
)
*
s
+
(
2
.
0
f
*
pv0
->
x
-
5
.
0
f
*
pv1
->
x
+
4
.
0
f
*
pv2
->
x
-
pv3
->
x
)
*
s
*
s
+
(
pv3
->
x
-
3
.
0
f
*
pv2
->
x
+
3
.
0
f
*
pv1
->
x
-
pv0
->
x
)
*
s
*
s
*
s
);
pout
->
y
=
0
.
5
f
*
(
2
.
0
f
*
pv1
->
y
+
(
pv2
->
y
-
pv0
->
y
)
*
s
+
(
2
.
0
f
*
pv0
->
y
-
5
.
0
f
*
pv1
->
y
+
4
.
0
f
*
pv2
->
y
-
pv3
->
y
)
*
s
*
s
+
(
pv3
->
y
-
3
.
0
f
*
pv2
->
y
+
3
.
0
f
*
pv1
->
y
-
pv0
->
y
)
*
s
*
s
*
s
);
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
;
...
...
@@ -103,6 +110,14 @@ D3DXVECTOR3* WINAPI D3DXVec3BaryCentric(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv
return
pout
;
}
D3DXVECTOR3
*
WINAPI
D3DXVec3CatmullRom
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv0
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pv2
,
CONST
D3DXVECTOR3
*
pv3
,
FLOAT
s
)
{
pout
->
x
=
0
.
5
f
*
(
2
.
0
f
*
pv1
->
x
+
(
pv2
->
x
-
pv0
->
x
)
*
s
+
(
2
.
0
f
*
pv0
->
x
-
5
.
0
f
*
pv1
->
x
+
4
.
0
f
*
pv2
->
x
-
pv3
->
x
)
*
s
*
s
+
(
pv3
->
x
-
3
.
0
f
*
pv2
->
x
+
3
.
0
f
*
pv1
->
x
-
pv0
->
x
)
*
s
*
s
*
s
);
pout
->
y
=
0
.
5
f
*
(
2
.
0
f
*
pv1
->
y
+
(
pv2
->
y
-
pv0
->
y
)
*
s
+
(
2
.
0
f
*
pv0
->
y
-
5
.
0
f
*
pv1
->
y
+
4
.
0
f
*
pv2
->
y
-
pv3
->
y
)
*
s
*
s
+
(
pv3
->
y
-
3
.
0
f
*
pv2
->
y
+
3
.
0
f
*
pv1
->
y
-
pv0
->
y
)
*
s
*
s
*
s
);
pout
->
z
=
0
.
5
f
*
(
2
.
0
f
*
pv1
->
z
+
(
pv2
->
z
-
pv0
->
z
)
*
s
+
(
2
.
0
f
*
pv0
->
z
-
5
.
0
f
*
pv1
->
z
+
4
.
0
f
*
pv2
->
z
-
pv3
->
z
)
*
s
*
s
+
(
pv3
->
z
-
3
.
0
f
*
pv2
->
z
+
3
.
0
f
*
pv1
->
z
-
pv0
->
z
)
*
s
*
s
*
s
);
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
;
...
...
@@ -149,6 +164,15 @@ D3DXVECTOR4* WINAPI D3DXVec4BaryCentric(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv
return
pout
;
}
D3DXVECTOR4
*
WINAPI
D3DXVec4CatmullRom
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv0
,
CONST
D3DXVECTOR4
*
pv1
,
CONST
D3DXVECTOR4
*
pv2
,
CONST
D3DXVECTOR4
*
pv3
,
FLOAT
s
)
{
pout
->
x
=
0
.
5
f
*
(
2
.
0
f
*
pv1
->
x
+
(
pv2
->
x
-
pv0
->
x
)
*
s
+
(
2
.
0
f
*
pv0
->
x
-
5
.
0
f
*
pv1
->
x
+
4
.
0
f
*
pv2
->
x
-
pv3
->
x
)
*
s
*
s
+
(
pv3
->
x
-
3
.
0
f
*
pv2
->
x
+
3
.
0
f
*
pv1
->
x
-
pv0
->
x
)
*
s
*
s
*
s
);
pout
->
y
=
0
.
5
f
*
(
2
.
0
f
*
pv1
->
y
+
(
pv2
->
y
-
pv0
->
y
)
*
s
+
(
2
.
0
f
*
pv0
->
y
-
5
.
0
f
*
pv1
->
y
+
4
.
0
f
*
pv2
->
y
-
pv3
->
y
)
*
s
*
s
+
(
pv3
->
y
-
3
.
0
f
*
pv2
->
y
+
3
.
0
f
*
pv1
->
y
-
pv0
->
y
)
*
s
*
s
*
s
);
pout
->
z
=
0
.
5
f
*
(
2
.
0
f
*
pv1
->
z
+
(
pv2
->
z
-
pv0
->
z
)
*
s
+
(
2
.
0
f
*
pv0
->
z
-
5
.
0
f
*
pv1
->
z
+
4
.
0
f
*
pv2
->
z
-
pv3
->
z
)
*
s
*
s
+
(
pv3
->
z
-
3
.
0
f
*
pv2
->
z
+
3
.
0
f
*
pv1
->
z
-
pv0
->
z
)
*
s
*
s
*
s
);
pout
->
w
=
0
.
5
f
*
(
2
.
0
f
*
pv1
->
w
+
(
pv2
->
w
-
pv0
->
w
)
*
s
+
(
2
.
0
f
*
pv0
->
w
-
5
.
0
f
*
pv1
->
w
+
4
.
0
f
*
pv2
->
w
-
pv3
->
w
)
*
s
*
s
+
(
pv3
->
w
-
3
.
0
f
*
pv2
->
w
+
3
.
0
f
*
pv1
->
w
-
pv0
->
w
)
*
s
*
s
*
s
);
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
;
...
...
dlls/d3dx8/tests/math.c
View file @
7d0f15f9
...
...
@@ -301,6 +301,11 @@ static void D3X8Vector2Test(void)
D3DXVec2BaryCentric
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
coeff1
,
coeff2
);
expect_vec
(
expectedvec
,
gotvec
);
/*_______________D3DXVec2CatmullRom____________________*/
expectedvec
.
x
=
5820
.
25
f
;
expectedvec
.
y
=
-
3654
.
5625
f
;
D3DXVec2CatmullRom
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
&
x
,
scale
);
expect_vec
(
expectedvec
,
gotvec
);
/*_______________D3DXVec2CCW__________________________*/
expected
=
55
.
0
f
;
got
=
D3DXVec2CCW
(
&
u
,
&
v
);
...
...
@@ -437,6 +442,12 @@ static void D3X8Vector3Test(void)
/*_______________D3DXVec3BaryCentric___________________*/
expectedvec
.
x
=
-
35
.
0
f
;
expectedvec
.
y
=
-
67
.
0
;
expectedvec
.
z
=
15
.
0
f
;
D3DXVec3BaryCentric
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
coeff1
,
coeff2
);
expect_vec3
(
expectedvec
,
gotvec
);
/*_______________D3DXVec3CatmullRom____________________*/
expectedvec
.
x
=
1458
.
0
f
;
expectedvec
.
y
=
22
.
1875
f
;
expectedvec
.
z
=
4141
.
375
f
;
D3DXVec3CatmullRom
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
&
x
,
scale
);
expect_vec3
(
expectedvec
,
gotvec
);
/*_______________D3DXVec3Cross________________________*/
...
...
@@ -573,6 +584,11 @@ static void D3X8Vector4Test(void)
D3DXVec4BaryCentric
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
coeff1
,
coeff2
);
expect_vec4
(
expectedvec
,
gotvec
);
/*_______________D3DXVec4CatmullRom____________________*/
expectedvec
.
x
=
2754
.
625
f
;
expectedvec
.
y
=
2367
.
5625
f
;
expectedvec
.
z
=
1060
.
1875
f
;
expectedvec
.
w
=
131
.
3125
f
;
D3DXVec4CatmullRom
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
&
x
,
scale
);
expect_vec4
(
expectedvec
,
gotvec
);
/*_______________D3DXVec4Dot__________________________*/
expected
=
55
.
0
f
;
got
=
D3DXVec4Dot
(
&
u
,
&
v
);
...
...
include/d3dx8math.h
View file @
7d0f15f9
...
...
@@ -61,14 +61,17 @@ 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
D3DXVec2CatmullRom
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv0
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
,
CONST
D3DXVECTOR2
*
pv3
,
FLOAT
s
);
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
D3DXVec3CatmullRom
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv0
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pv2
,
CONST
D3DXVECTOR3
*
pv3
,
FLOAT
s
);
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
D3DXVec4CatmullRom
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv0
,
CONST
D3DXVECTOR4
*
pv1
,
CONST
D3DXVECTOR4
*
pv2
,
CONST
D3DXVECTOR4
*
pv3
,
FLOAT
s
);
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
);
...
...
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