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
ea8e7ce4
Commit
ea8e7ce4
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*BaryCentric.
parent
50ae1e36
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
15 deletions
+65
-15
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+3
-3
math.c
dlls/d3dx8/math.c
+23
-0
math.c
dlls/d3dx8/tests/math.c
+36
-12
d3dx8math.h
include/d3dx8math.h
+3
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
ea8e7ce4
@ stdcall D3DXVec2Normalize(ptr ptr)
@ stub D3DXVec2Hermite
@ stub D3DXVec2CatmullRom
@ st
ub D3DXVec2BaryCentric
@ st
dcall D3DXVec2BaryCentric(ptr ptr ptr ptr long long)
@ stub D3DXVec2Transform
@ stub D3DXVec2TransformCoord
@ stub D3DXVec2TransformNormal
@ stdcall D3DXVec3Normalize(ptr ptr)
@ stub D3DXVec3Hermite
@ stub D3DXVec3CatmullRom
@ st
ub D3DXVec3BaryCentric
@ st
dcall D3DXVec3BaryCentric(ptr ptr ptr ptr long long)
@ stub D3DXVec3Transform
@ stub D3DXVec3TransformCoord
@ stub D3DXVec3TransformNormal
...
...
@@ -18,7 +18,7 @@
@ stdcall D3DXVec4Normalize(ptr ptr)
@ stub D3DXVec4Hermite
@ stub D3DXVec4CatmullRom
@ st
ub D3DXVec4BaryCentric
@ st
dcall D3DXVec4BaryCentric(ptr ptr ptr ptr long long)
@ stub D3DXVec4Transform
@ stub D3DXMatrixfDeterminant
@ stub D3DXMatrixMultiply
...
...
dlls/d3dx8/math.c
View file @
ea8e7ce4
...
...
@@ -54,6 +54,13 @@ D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQ
}
/*_________________D3DXVec2_____________________*/
D3DXVECTOR2
*
WINAPI
D3DXVec2BaryCentric
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
,
CONST
D3DXVECTOR2
*
pv3
,
FLOAT
f
,
FLOAT
g
)
{
pout
->
x
=
(
1
.
0
f
-
f
-
g
)
*
(
pv1
->
x
)
+
f
*
(
pv2
->
x
)
+
g
*
(
pv3
->
x
);
pout
->
y
=
(
1
.
0
f
-
f
-
g
)
*
(
pv1
->
y
)
+
f
*
(
pv2
->
y
)
+
g
*
(
pv3
->
y
);
return
pout
;
}
D3DXVECTOR2
*
WINAPI
D3DXVec2Normalize
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv
)
{
FLOAT
norm
;
...
...
@@ -74,6 +81,14 @@ D3DXVECTOR2* WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv)
/*_________________D3DXVec3_____________________*/
D3DXVECTOR3
*
WINAPI
D3DXVec3BaryCentric
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pv2
,
CONST
D3DXVECTOR3
*
pv3
,
FLOAT
f
,
FLOAT
g
)
{
pout
->
x
=
(
1
.
0
f
-
f
-
g
)
*
(
pv1
->
x
)
+
f
*
(
pv2
->
x
)
+
g
*
(
pv3
->
x
);
pout
->
y
=
(
1
.
0
f
-
f
-
g
)
*
(
pv1
->
y
)
+
f
*
(
pv2
->
y
)
+
g
*
(
pv3
->
y
);
pout
->
z
=
(
1
.
0
f
-
f
-
g
)
*
(
pv1
->
z
)
+
f
*
(
pv2
->
z
)
+
g
*
(
pv3
->
z
);
return
pout
;
}
D3DXVECTOR3
*
WINAPI
D3DXVec3Normalize
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
)
{
FLOAT
norm
;
...
...
@@ -96,6 +111,14 @@ D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv)
/*_________________D3DXVec4_____________________*/
D3DXVECTOR4
*
WINAPI
D3DXVec4BaryCentric
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv1
,
CONST
D3DXVECTOR4
*
pv2
,
CONST
D3DXVECTOR4
*
pv3
,
FLOAT
f
,
FLOAT
g
)
{
pout
->
x
=
(
1
.
0
f
-
f
-
g
)
*
(
pv1
->
x
)
+
f
*
(
pv2
->
x
)
+
g
*
(
pv3
->
x
);
pout
->
y
=
(
1
.
0
f
-
f
-
g
)
*
(
pv1
->
y
)
+
f
*
(
pv2
->
y
)
+
g
*
(
pv3
->
y
);
pout
->
z
=
(
1
.
0
f
-
f
-
g
)
*
(
pv1
->
z
)
+
f
*
(
pv2
->
z
)
+
g
*
(
pv3
->
z
);
pout
->
w
=
(
1
.
0
f
-
f
-
g
)
*
(
pv1
->
w
)
+
f
*
(
pv2
->
w
)
+
g
*
(
pv3
->
w
);
return
pout
;
}
D3DXVECTOR4
*
WINAPI
D3DXVec4Normalize
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv
)
{
FLOAT
norm
;
...
...
dlls/d3dx8/tests/math.c
View file @
ea8e7ce4
...
...
@@ -273,25 +273,33 @@ static void D3X8QuaternionTest(void)
static
void
D3X8Vector2Test
(
void
)
{
D3DXVECTOR2
expectedvec
,
gotvec
,
nul
,
u
,
v
;
D3DXVECTOR2
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
;
LPD3DXVECTOR2
funcpointer
;
FLOAT
expected
,
got
,
scale
;
FLOAT
coeff1
,
coeff2
,
expected
,
got
,
scale
;
nul
.
x
=
0
.
0
f
;
nul
.
y
=
0
.
0
f
;
u
.
x
=
3
.
0
f
;
u
.
y
=
4
.
0
f
;
v
.
x
=-
7
.
0
f
;
v
.
y
=
9
.
0
f
;
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
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
f
;
scale
=
-
6
.
5
f
;
/*_______________D3DXVec2Add__________________________*/
expectedvec
.
x
=
-
4
.
0
f
;
expectedvec
.
y
=
13
.
0
f
;
D3DXVec2Add
(
&
gotvec
,
&
u
,
&
v
);
expect_vec
(
expectedvec
,
gotvec
);
/* Tests the case NULL */
expectedvec
.
x
=
-
4
.
0
f
;
expectedvec
.
y
=
13
.
0
f
;
D3DXVec2Add
(
&
gotvec
,
&
u
,
&
v
);
expect_vec
(
expectedvec
,
gotvec
);
/* Tests the case NULL */
funcpointer
=
D3DXVec2Add
(
&
gotvec
,
NULL
,
&
v
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
funcpointer
=
D3DXVec2Add
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec2BaryCentric___________________*/
expectedvec
.
x
=
-
12
.
0
f
;
expectedvec
.
y
=
-
21
.
0
f
;
D3DXVec2BaryCentric
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
coeff1
,
coeff2
);
expect_vec
(
expectedvec
,
gotvec
);
/*_______________D3DXVec2CCW__________________________*/
expected
=
55
.
0
f
;
got
=
D3DXVec2CCW
(
&
u
,
&
v
);
...
...
@@ -397,13 +405,16 @@ static void D3X8Vector2Test(void)
static
void
D3X8Vector3Test
(
void
)
{
D3DXVECTOR3
expectedvec
,
gotvec
,
nul
,
u
,
v
;
D3DXVECTOR3
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
;
LPD3DXVECTOR3
funcpointer
;
FLOAT
expected
,
got
,
scale
;
FLOAT
coeff1
,
coeff2
,
expected
,
got
,
scale
;
nul
.
x
=
0
.
0
f
;
nul
.
y
=
0
.
0
f
;
nul
.
z
=
0
.
0
f
;
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
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
f
;
scale
=
-
6
.
5
f
;
/*_______________D3DXVec3Add__________________________*/
...
...
@@ -416,6 +427,11 @@ static void D3X8Vector3Test(void)
funcpointer
=
D3DXVec3Add
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________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
);
/*_______________D3DXVec3Cross________________________*/
expectedvec
.
x
=
-
18
.
0
f
;
expectedvec
.
y
=
40
.
0
f
;
expectedvec
.
z
=
-
30
.
0
f
;
D3DXVec3Cross
(
&
gotvec
,
&
u
,
&
v
);
...
...
@@ -518,13 +534,16 @@ static void D3X8Vector3Test(void)
static
void
D3X8Vector4Test
(
void
)
{
D3DXVECTOR4
expectedvec
,
gotvec
,
nul
,
u
,
v
;
D3DXVECTOR4
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
;
LPD3DXVECTOR4
funcpointer
;
FLOAT
expected
,
got
,
scale
;
FLOAT
coeff1
,
coeff2
,
expected
,
got
,
scale
;
nul
.
x
=
0
.
0
f
;
nul
.
y
=
0
.
0
f
;
nul
.
z
=
0
.
0
f
;
nul
.
w
=
0
.
0
f
;
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
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
;
scale
=
-
6
.
5
f
;
/*_______________D3DXVec4Add__________________________*/
...
...
@@ -537,6 +556,11 @@ static void D3X8Vector4Test(void)
funcpointer
=
D3DXVec4Add
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec4BaryCentric____________________*/
expectedvec
.
x
=
8
.
0
f
;
expectedvec
.
y
=
26
.
0
;
expectedvec
.
z
=
-
44
.
0
f
;
expectedvec
.
w
=
-
41
.
0
f
;
D3DXVec4BaryCentric
(
&
gotvec
,
&
u
,
&
v
,
&
w
,
coeff1
,
coeff2
);
expect_vec4
(
expectedvec
,
gotvec
);
/*_______________D3DXVec4Dot__________________________*/
expected
=
55
.
0
f
;
got
=
D3DXVec4Dot
(
&
u
,
&
v
);
...
...
include/d3dx8math.h
View file @
ea8e7ce4
...
...
@@ -60,10 +60,13 @@ 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
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
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
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