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
90c4757b
Commit
90c4757b
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*TransformCoord.
parent
fa58dcee
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
4 deletions
+65
-4
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+2
-2
math.c
dlls/d3dx8/math.c
+39
-0
math.c
dlls/d3dx8/tests/math.c
+22
-2
d3dx8math.h
include/d3dx8math.h
+2
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
90c4757b
...
...
@@ -3,14 +3,14 @@
@ stdcall D3DXVec2CatmullRom(ptr ptr ptr ptr long)
@ stdcall D3DXVec2BaryCentric(ptr ptr ptr ptr long long)
@ stdcall D3DXVec2Transform(ptr ptr ptr)
@ st
ub D3DXVec2TransformCoord
@ st
dcall D3DXVec2TransformCoord(ptr ptr ptr)
@ 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)
@ stdcall D3DXVec3Transform(ptr ptr ptr)
@ st
ub D3DXVec3TransformCoord
@ st
dcall D3DXVec3TransformCoord(ptr ptr ptr)
@ stub D3DXVec3TransformNormal
@ stub D3DXVec3Project
@ stub D3DXVec3Unproject
...
...
dlls/d3dx8/math.c
View file @
90c4757b
...
...
@@ -109,6 +109,24 @@ D3DXVECTOR4* WINAPI D3DXVec2Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR2 *pv,
return
pout
;
}
D3DXVECTOR2
*
WINAPI
D3DXVec2TransformCoord
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
FLOAT
norm
;
norm
=
pm
->
m
[
0
][
3
]
*
pv
->
x
+
pm
->
m
[
1
][
3
]
*
pv
->
y
+
pm
->
m
[
3
][
3
];
if
(
norm
)
{
pout
->
x
=
(
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
3
][
0
])
/
norm
;
pout
->
y
=
(
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
3
][
1
])
/
norm
;
}
else
{
pout
->
x
=
0
.
0
f
;
pout
->
y
=
0
.
0
f
;
}
return
pout
;
}
/*_________________D3DXVec3_____________________*/
D3DXVECTOR3
*
WINAPI
D3DXVec3BaryCentric
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pv2
,
CONST
D3DXVECTOR3
*
pv3
,
FLOAT
f
,
FLOAT
g
)
...
...
@@ -171,6 +189,27 @@ D3DXVECTOR4* WINAPI D3DXVec3Transform(D3DXVECTOR4 *pout, CONST D3DXVECTOR3 *pv,
return
pout
;
}
D3DXVECTOR3
*
WINAPI
D3DXVec3TransformCoord
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
)
{
FLOAT
norm
;
norm
=
pm
->
m
[
0
][
3
]
*
pv
->
x
+
pm
->
m
[
1
][
3
]
*
pv
->
y
+
pm
->
m
[
2
][
3
]
*
pv
->
z
+
pm
->
m
[
3
][
3
];
if
(
norm
)
{
pout
->
x
=
(
pm
->
m
[
0
][
0
]
*
pv
->
x
+
pm
->
m
[
1
][
0
]
*
pv
->
y
+
pm
->
m
[
2
][
0
]
*
pv
->
z
+
pm
->
m
[
3
][
0
])
/
norm
;
pout
->
y
=
(
pm
->
m
[
0
][
1
]
*
pv
->
x
+
pm
->
m
[
1
][
1
]
*
pv
->
y
+
pm
->
m
[
2
][
1
]
*
pv
->
z
+
pm
->
m
[
3
][
1
])
/
norm
;
pout
->
z
=
(
pm
->
m
[
0
][
2
]
*
pv
->
x
+
pm
->
m
[
1
][
2
]
*
pv
->
y
+
pm
->
m
[
2
][
2
]
*
pv
->
z
+
pm
->
m
[
3
][
2
])
/
norm
;
}
else
{
pout
->
x
=
0
.
0
f
;
pout
->
y
=
0
.
0
f
;
pout
->
z
=
0
.
0
f
;
}
return
pout
;
}
/*_________________D3DXVec4_____________________*/
D3DXVECTOR4
*
WINAPI
D3DXVec4BaryCentric
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR4
*
pv1
,
CONST
D3DXVECTOR4
*
pv2
,
CONST
D3DXVECTOR4
*
pv3
,
FLOAT
f
,
FLOAT
g
)
...
...
dlls/d3dx8/tests/math.c
View file @
90c4757b
...
...
@@ -273,7 +273,7 @@ static void D3X8QuaternionTest(void)
static
void
D3X8Vector2Test
(
void
)
{
D3DXVECTOR2
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
,
x
;
D3DXVECTOR2
expectedvec
,
gotvec
,
nul
,
nulproj
,
u
,
v
,
w
,
x
;
LPD3DXVECTOR2
funcpointer
;
D3DXVECTOR4
expectedtrans
,
gottrans
;
D3DXMATRIX
mat
;
...
...
@@ -423,11 +423,21 @@ static void D3X8Vector2Test(void)
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
);
/*_______________D3DXVec2TransformCoord_______________________*/
expectedvec
.
x
=
0
.
6
f
;
expectedvec
.
y
=
11
.
0
f
/
15
.
0
f
;
D3DXVec2TransformCoord
(
&
gotvec
,
&
u
,
&
mat
);
expect_vec
(
expectedvec
,
gotvec
);
/* Test the nul projected vector */
nulproj
.
x
=
-
2
.
0
f
;
nulproj
.
y
=
-
1
.
0
f
;
expectedvec
.
x
=
0
.
0
f
;
expectedvec
.
y
=
0
.
0
f
;
D3DXVec2TransformCoord
(
&
gotvec
,
&
nulproj
,
&
mat
);
expect_vec
(
expectedvec
,
gotvec
);
}
static
void
D3X8Vector3Test
(
void
)
{
D3DXVECTOR3
expectedvec
,
gotvec
,
nul
,
u
,
v
,
w
,
x
;
D3DXVECTOR3
expectedvec
,
gotvec
,
nul
,
nulproj
,
u
,
v
,
w
,
x
;
LPD3DXVECTOR3
funcpointer
;
D3DXVECTOR4
expectedtrans
,
gottrans
;
D3DXMATRIX
mat
;
...
...
@@ -576,6 +586,16 @@ static void D3X8Vector3Test(void)
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
);
/*_______________D3DXVec3TransformCoord_______________________*/
expectedvec
.
x
=
70
.
0
f
/
124
.
0
f
;
expectedvec
.
y
=
88
.
0
f
/
124
.
0
f
;
expectedvec
.
z
=
106
.
0
f
/
124
.
0
f
;
D3DXVec3TransformCoord
(
&
gotvec
,
&
u
,
&
mat
);
expect_vec3
(
expectedvec
,
gotvec
);
/* Test the nul projected vector */
nulproj
.
x
=
1
.
0
f
;
nulproj
.
y
=
-
1
.
0
f
,
nulproj
.
z
=
-
1
.
0
f
;
expectedvec
.
x
=
0
.
0
f
;
expectedvec
.
y
=
0
.
0
f
;
expectedvec
.
z
=
0
.
0
f
;
D3DXVec3TransformCoord
(
&
gotvec
,
&
nulproj
,
&
mat
);
expect_vec3
(
expectedvec
,
gotvec
);
}
static
void
D3X8Vector4Test
(
void
)
...
...
include/d3dx8math.h
View file @
90c4757b
...
...
@@ -65,12 +65,14 @@ D3DXVECTOR2* WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv0
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
);
D3DXVECTOR2
*
WINAPI
D3DXVec2TransformCoord
(
D3DXVECTOR2
*
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
);
D3DXVECTOR3
*
WINAPI
D3DXVec3TransformCoord
(
D3DXVECTOR3
*
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
);
...
...
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