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
147600b6
Commit
147600b6
authored
Nov 11, 2007
by
David Adam
Committed by
Alexandre Julliard
Nov 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXVec3Unproject.
parent
6c902b42
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
1 deletion
+23
-1
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+15
-0
math.c
dlls/d3dx8/tests/math.c
+6
-0
d3dx8math.h
include/d3dx8math.h
+1
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
147600b6
...
...
@@ -13,7 +13,7 @@
@ stdcall D3DXVec3TransformCoord(ptr ptr ptr)
@ stdcall D3DXVec3TransformNormal(ptr ptr ptr)
@ stdcall D3DXVec3Project(ptr ptr ptr ptr ptr ptr)
@ st
ub D3DXVec3Unproject
@ st
dcall D3DXVec3Unproject(ptr ptr ptr ptr ptr ptr)
@ stdcall D3DXVec4Cross(ptr ptr ptr ptr)
@ stdcall D3DXVec4Normalize(ptr ptr)
@ stdcall D3DXVec4Hermite(ptr ptr ptr ptr ptr long)
...
...
dlls/d3dx8/math.c
View file @
147600b6
...
...
@@ -606,6 +606,21 @@ D3DXVECTOR3* WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, CONST D3DXVECTOR3
}
D3DXVECTOR3
*
WINAPI
D3DXVec3Unproject
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DVIEWPORT8
*
pviewport
,
CONST
D3DXMATRIX
*
pprojection
,
CONST
D3DXMATRIX
*
pview
,
CONST
D3DXMATRIX
*
pworld
)
{
D3DXMATRIX
m1
,
m2
,
m3
;
D3DXVECTOR3
vec
;
D3DXMatrixMultiply
(
&
m1
,
pworld
,
pview
);
D3DXMatrixMultiply
(
&
m2
,
&
m1
,
pprojection
);
D3DXMatrixInverse
(
&
m3
,
NULL
,
&
m2
);
vec
.
x
=
2
.
0
f
*
(
pv
->
x
-
pviewport
->
X
)
/
pviewport
->
Width
-
1
.
0
f
;
vec
.
y
=
1
.
0
f
-
2
.
0
f
*
(
pv
->
y
-
pviewport
->
Y
)
/
pviewport
->
Height
;
vec
.
z
=
(
pv
->
z
-
pviewport
->
MinZ
)
/
(
pviewport
->
MaxZ
-
pviewport
->
MinZ
);
D3DXVec3TransformCoord
(
pout
,
&
vec
,
&
m3
);
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 @
147600b6
...
...
@@ -878,6 +878,12 @@ static void D3X8Vector3Test(void)
expectedvec
.
x
=
57
.
0
f
;
expectedvec
.
y
=
74
.
0
f
;
expectedvec
.
z
=
91
.
0
f
;
D3DXVec3TransformNormal
(
&
gotvec
,
&
u
,
&
mat
);
expect_vec3
(
expectedvec
,
gotvec
);
/*_______________D3DXVec3Unproject_________________________*/
expectedvec
.
x
=
-
2
.
913411
f
;
expectedvec
.
y
=
1
.
593215
f
;
expectedvec
.
z
=
0
.
380724
f
;
D3DXMatrixPerspectiveFovLH
(
&
projection
,
D3DX_PI
/
4
.
0
f
,
20
.
0
f
/
17
.
0
f
,
1
.
0
f
,
1000
.
0
f
);
D3DXVec3Unproject
(
&
gotvec
,
&
u
,
&
viewport
,
&
projection
,
&
view
,
&
world
);
expect_vec3
(
expectedvec
,
gotvec
);
}
static
void
D3X8Vector4Test
(
void
)
...
...
include/d3dx8math.h
View file @
147600b6
...
...
@@ -304,6 +304,7 @@ D3DXVECTOR3* WINAPI D3DXVec3Project(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, CO
D3DXVECTOR4
*
WINAPI
D3DXVec3Transform
(
D3DXVECTOR4
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
);
D3DXVECTOR3
*
WINAPI
D3DXVec3TransformCoord
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
);
D3DXVECTOR3
*
WINAPI
D3DXVec3TransformNormal
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DXMATRIX
*
pm
);
D3DXVECTOR3
*
WINAPI
D3DXVec3Unproject
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DVIEWPORT8
*
pviewport
,
CONST
D3DXMATRIX
*
pprojection
,
CONST
D3DXMATRIX
*
pview
,
CONST
D3DXMATRIX
*
pworld
);
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