Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
fa58dcee
Commit
fa58dcee
authored
Oct 27, 2007
by
David Adam
Committed by
Alexandre Julliard
Oct 29, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DX*Transform.
parent
145264ef
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
3 deletions
+68
-3
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+3
-3
math.c
dlls/d3dx8/math.c
+27
-0
math.c
dlls/d3dx8/tests/math.c
+35
-0
d3dx8math.h
include/d3dx8math.h
+3
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
fa58dcee
...
...
@@ -2,14 +2,14 @@
@ stdcall D3DXVec2Hermite(ptr ptr ptr ptr ptr long)
@ stdcall D3DXVec2CatmullRom(ptr ptr ptr ptr long)
@ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr long long)
@ st
ub D3DXVec2Transform
@ st
dcall D3DXVec2Transform(ptr ptr ptr)
@ stub D3DXVec2TransformCoord
@ stub D3DXVec2TransformNormal
@ stdcall D3DXVec3Normalize(ptr ptr)
@ stdcall D3DXVec3Hermite(ptr ptr ptr ptr ptr long)
@ stdcall D3DXVec3CatmullRom(ptr ptr ptr ptr long)
@ stdcall D3DXVec3BaryCentric(ptr ptr ptr ptr long long)
@ st
ub D3DXVec3Transform
@ st
dcall D3DXVec3Transform(ptr ptr ptr)
@ stub D3DXVec3TransformCoord
@ stub D3DXVec3TransformNormal
@ stub D3DXVec3Project
...
...
@@ -19,7 +19,7 @@
@ stdcall D3DXVec4Hermite(ptr ptr ptr ptr ptr long)
@ stdcall D3DXVec4CatmullRom(ptr ptr ptr ptr long)
@ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr long long)
@ st
ub D3DXVec4Transform
@ st
dcall D3DXVec4Transform(ptr ptr ptr)
@ stub D3DXMatrixfDeterminant
@ stub D3DXMatrixMultiply
@ stub D3DXMatrixTranspose
...
...
dlls/d3dx8/math.c
View file @
fa58dcee
...
...
@@ -100,6 +100,15 @@ D3DXVECTOR2* WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv)
return
pout
;
}
D3DXVECTOR4
*
WINAPI
D3DXVec2Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR2
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
pout
->
x
=
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
3
][
0
];
pout
->
y
=
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
3
][
1
];
pout
->
z
=
pm
->
m
[
0
][
2
]
*
pv
->
x
+
pm
->
m
[
1
][
2
]
*
pv
->
y
+
pm
->
m
[
3
][
2
];
pout
->
w
=
pm
->
m
[
0
][
3
]
*
pv
->
x
+
pm
->
m
[
1
][
3
]
*
pv
->
y
+
pm
->
m
[
3
][
3
];
return
pout
;
}
/*_________________D3DXVec3_____________________*/
D3DXVECTOR3
*
WINAPI
D3DXVec3BaryCentric
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pv2
,
CONST
D3DXVECTOR3
*
pv3
,
FLOAT
f
,
FLOAT
g
)
...
...
@@ -153,6 +162,15 @@ D3DXVECTOR3* WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv)
return
pout
;
}
D3DXVECTOR4
*
WINAPI
D3DXVec3Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
pout
->
x
=
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
2
][
0
]
*
pv
->
z
+
pm
->
m
[
3
][
0
];
pout
->
y
=
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
2
][
1
]
*
pv
->
z
+
pm
->
m
[
3
][
1
];
pout
->
z
=
pm
->
m
[
0
][
2
]
*
pv
->
x
+
pm
->
m
[
1
][
2
]
*
pv
->
y
+
pm
->
m
[
2
][
2
]
*
pv
->
z
+
pm
->
m
[
3
][
2
];
pout
->
w
=
pm
->
m
[
0
][
3
]
*
pv
->
x
+
pm
->
m
[
1
][
3
]
*
pv
->
y
+
pm
->
m
[
2
][
3
]
*
pv
->
z
+
pm
->
m
[
3
][
3
];
return
pout
;
}
/*_________________D3DXVec4_____________________*/
D3DXVECTOR4
*
WINAPI
D3DXVec4BaryCentric
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv1
,
CONST
D3DXVECTOR4
*
pv2
,
CONST
D3DXVECTOR4
*
pv3
,
FLOAT
f
,
FLOAT
g
)
...
...
@@ -210,3 +228,12 @@ D3DXVECTOR4* WINAPI D3DXVec4Normalize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv)
}
return
pout
;
}
D3DXVECTOR4
*
WINAPI
D3DXVec4Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
pout
->
x
=
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
2
][
0
]
*
pv
->
z
+
pm
->
m
[
3
][
0
]
*
pv
->
w
;
pout
->
y
=
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
2
][
1
]
*
pv
->
z
+
pm
->
m
[
3
][
1
]
*
pv
->
w
;
pout
->
z
=
pm
->
m
[
0
][
2
]
*
pv
->
x
+
pm
->
m
[
1
][
2
]
*
pv
->
y
+
pm
->
m
[
2
][
2
]
*
pv
->
z
+
pm
->
m
[
3
][
2
]
*
pv
->
w
;
pout
->
w
=
pm
->
m
[
0
][
3
]
*
pv
->
x
+
pm
->
m
[
1
][
3
]
*
pv
->
y
+
pm
->
m
[
2
][
3
]
*
pv
->
z
+
pm
->
m
[
3
][
3
]
*
pv
->
w
;
return
pout
;
}
dlls/d3dx8/tests/math.c
View file @
fa58dcee
...
...
@@ -275,6 +275,8 @@ static void D3X8Vector2Test(void)
{
D3DXVECTOR2
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
,
x
;
LPD3DXVECTOR2
funcpointer
;
D3DXVECTOR4
expectedtrans
,
gottrans
;
D3DXMATRIX
mat
;
FLOAT
coeff1
,
coeff2
,
expected
,
got
,
scale
;
nul
.
x
=
0
.
0
f
;
nul
.
y
=
0
.
0
f
;
...
...
@@ -283,6 +285,11 @@ static void D3X8Vector2Test(void)
w
.
x
=
4
.
0
f
;
w
.
y
=
-
3
.
0
f
;
x
.
x
=
2
.
0
f
;
x
.
y
=
-
11
.
0
f
;
mat
.
m
[
0
][
0
]
=
1
.
0
f
;
mat
.
m
[
0
][
1
]
=
2
.
0
f
;
mat
.
m
[
0
][
2
]
=
3
.
0
f
;
mat
.
m
[
0
][
3
]
=
4
.
0
f
;
mat
.
m
[
1
][
0
]
=
5
.
0
f
;
mat
.
m
[
1
][
1
]
=
6
.
0
f
;
mat
.
m
[
1
][
2
]
=
7
.
0
f
;
mat
.
m
[
1
][
3
]
=
8
.
0
f
;
mat
.
m
[
2
][
0
]
=
9
.
0
f
;
mat
.
m
[
2
][
1
]
=
10
.
0
f
;
mat
.
m
[
2
][
2
]
=
11
.
0
f
;
mat
.
m
[
2
][
3
]
=
12
.
0
f
;
mat
.
m
[
3
][
0
]
=
13
.
0
f
;
mat
.
m
[
3
][
1
]
=
14
.
0
f
;
mat
.
m
[
3
][
2
]
=
15
.
0
f
;
mat
.
m
[
3
][
3
]
=
16
.
0
f
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
f
;
scale
=
-
6
.
5
f
;
...
...
@@ -412,12 +419,18 @@ static void D3X8Vector2Test(void)
funcpointer
=
D3DXVec2Subtract
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec2Transform_______________________*/
expectedtrans
.
x
=
36
.
0
f
;
expectedtrans
.
y
=
44
.
0
f
;
expectedtrans
.
z
=
52
.
0
f
;
expectedtrans
.
w
=
60
.
0
f
;
D3DXVec2Transform
(
&
gottrans
,
&
u
,
&
mat
);
expect_vec4
(
expectedtrans
,
gottrans
);
}
static
void
D3X8Vector3Test
(
void
)
{
D3DXVECTOR3
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
,
x
;
LPD3DXVECTOR3
funcpointer
;
D3DXVECTOR4
expectedtrans
,
gottrans
;
D3DXMATRIX
mat
;
FLOAT
coeff1
,
coeff2
,
expected
,
got
,
scale
;
nul
.
x
=
0
.
0
f
;
nul
.
y
=
0
.
0
f
;
nul
.
z
=
0
.
0
f
;
...
...
@@ -426,6 +439,11 @@ static void D3X8Vector3Test(void)
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
;
mat
.
m
[
0
][
0
]
=
1
.
0
f
;
mat
.
m
[
0
][
1
]
=
2
.
0
f
;
mat
.
m
[
0
][
2
]
=
3
.
0
f
;
mat
.
m
[
0
][
3
]
=
4
.
0
f
;
mat
.
m
[
1
][
0
]
=
5
.
0
f
;
mat
.
m
[
1
][
1
]
=
6
.
0
f
;
mat
.
m
[
1
][
2
]
=
7
.
0
f
;
mat
.
m
[
1
][
3
]
=
8
.
0
f
;
mat
.
m
[
2
][
0
]
=
9
.
0
f
;
mat
.
m
[
2
][
1
]
=
10
.
0
f
;
mat
.
m
[
2
][
2
]
=
11
.
0
f
;
mat
.
m
[
2
][
3
]
=
12
.
0
f
;
mat
.
m
[
3
][
0
]
=
13
.
0
f
;
mat
.
m
[
3
][
1
]
=
14
.
0
f
;
mat
.
m
[
3
][
2
]
=
15
.
0
f
;
mat
.
m
[
3
][
3
]
=
16
.
0
f
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
f
;
scale
=
-
6
.
5
f
;
...
...
@@ -554,12 +572,18 @@ static void D3X8Vector3Test(void)
funcpointer
=
D3DXVec3Subtract
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec3Transform_______________________*/
expectedtrans
.
x
=
70
.
0
f
;
expectedtrans
.
y
=
88
.
0
f
;
expectedtrans
.
z
=
106
.
0
f
;
expectedtrans
.
w
=
124
.
0
f
;
D3DXVec3Transform
(
&
gottrans
,
&
u
,
&
mat
);
expect_vec4
(
expectedtrans
,
gottrans
);
}
static
void
D3X8Vector4Test
(
void
)
{
D3DXVECTOR4
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
,
x
;
LPD3DXVECTOR4
funcpointer
;
D3DXVECTOR4
expectedtrans
,
gottrans
;
D3DXMATRIX
mat
;
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
;
...
...
@@ -567,6 +591,12 @@ static void D3X8Vector4Test(void)
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
;
mat
.
m
[
0
][
0
]
=
1
.
0
f
;
mat
.
m
[
0
][
1
]
=
2
.
0
f
;
mat
.
m
[
0
][
2
]
=
3
.
0
f
;
mat
.
m
[
0
][
3
]
=
4
.
0
f
;
mat
.
m
[
1
][
0
]
=
5
.
0
f
;
mat
.
m
[
1
][
1
]
=
6
.
0
f
;
mat
.
m
[
1
][
2
]
=
7
.
0
f
;
mat
.
m
[
1
][
3
]
=
8
.
0
f
;
mat
.
m
[
2
][
0
]
=
9
.
0
f
;
mat
.
m
[
2
][
1
]
=
10
.
0
f
;
mat
.
m
[
2
][
2
]
=
11
.
0
f
;
mat
.
m
[
2
][
3
]
=
12
.
0
f
;
mat
.
m
[
3
][
0
]
=
13
.
0
f
;
mat
.
m
[
3
][
1
]
=
14
.
0
f
;
mat
.
m
[
3
][
2
]
=
15
.
0
f
;
mat
.
m
[
3
][
3
]
=
16
.
0
f
;
coeff1
=
2
.
0
f
;
coeff2
=
5
.
0
;
scale
=
-
6
.
5
f
;
...
...
@@ -683,6 +713,11 @@ static void D3X8Vector4Test(void)
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
funcpointer
=
D3DXVec4Subtract
(
NULL
,
NULL
,
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXVec4Transform_______________________*/
expectedtrans
.
x
=
177
.
0
f
;
expectedtrans
.
y
=
194
.
0
f
;
expectedtrans
.
z
=
211
.
0
f
;
expectedtrans
.
w
=
228
.
0
f
;
D3DXVec4Transform
(
&
gottrans
,
&
u
,
&
mat
);
expect_vec4
(
expectedtrans
,
gottrans
);
}
START_TEST
(
math
)
...
...
include/d3dx8math.h
View file @
fa58dcee
...
...
@@ -64,16 +64,19 @@ D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv
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
);
D3DXVECTOR4
*
WINAPI
D3DXVec2Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR2
*
pv
,
CONST
D3DXMATRIX
*
pm
);
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
D3DXVec3Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
);
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
);
D3DXVECTOR4
*
WINAPI
D3DXVec4Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv
,
CONST
D3DXMATRIX
*
pm
);
#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