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
7bfd6342
Commit
7bfd6342
authored
Oct 28, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Oct 29, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Handle NULL viewport in D3DXVec3Unproject.
parent
d1a99fee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
math.c
dlls/d3dx9_36/math.c
+13
-8
math.c
dlls/d3dx9_36/tests/math.c
+4
-0
No files found.
dlls/d3dx9_36/math.c
View file @
7bfd6342
...
...
@@ -1928,22 +1928,27 @@ D3DXVECTOR3* WINAPI D3DXVec3TransformNormalArray(D3DXVECTOR3* out, UINT outstrid
D3DXVECTOR3
*
WINAPI
D3DXVec3Unproject
(
D3DXVECTOR3
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
CONST
D3DVIEWPORT9
*
pviewport
,
CONST
D3DXMATRIX
*
pprojection
,
CONST
D3DXMATRIX
*
pview
,
CONST
D3DXMATRIX
*
pworld
)
{
D3DXMATRIX
m
;
D3DXVECTOR3
out
;
TRACE
(
"(%p, %p, %p, %p, %p, %p)
\n
"
,
pout
,
pv
,
pviewport
,
pprojection
,
pview
,
pworld
);
if
(
pworld
)
{
if
(
pworld
)
{
D3DXMatrixMultiply
(
&
m
,
pworld
,
pview
);
D3DXMatrixMultiply
(
&
m
,
&
m
,
pprojection
);
}
else
{
}
else
{
D3DXMatrixMultiply
(
&
m
,
pview
,
pprojection
);
}
D3DXMatrixInverse
(
&
m
,
NULL
,
&
m
);
out
.
x
=
2
.
0
f
*
(
pv
->
x
-
pviewport
->
X
)
/
pviewport
->
Width
-
1
.
0
f
;
out
.
y
=
1
.
0
f
-
2
.
0
f
*
(
pv
->
y
-
pviewport
->
Y
)
/
pviewport
->
Height
;
out
.
z
=
(
pv
->
z
-
pviewport
->
MinZ
)
/
(
pviewport
->
MaxZ
-
pviewport
->
MinZ
);
D3DXVec3TransformCoord
(
&
out
,
&
out
,
&
m
);
*
pout
=
out
;
*
pout
=
*
pv
;
if
(
pviewport
)
{
pout
->
x
=
2
.
0
f
*
(
pout
->
x
-
pviewport
->
X
)
/
pviewport
->
Width
-
1
.
0
f
;
pout
->
y
=
1
.
0
f
-
2
.
0
f
*
(
pout
->
y
-
pviewport
->
Y
)
/
pviewport
->
Height
;
pout
->
z
=
(
pout
->
z
-
pviewport
->
MinZ
)
/
(
pviewport
->
MaxZ
-
pviewport
->
MinZ
);
}
D3DXVec3TransformCoord
(
pout
,
pout
,
&
m
);
return
pout
;
}
...
...
dlls/d3dx9_36/tests/math.c
View file @
7bfd6342
...
...
@@ -1381,6 +1381,10 @@ static void D3DXVector3Test(void)
D3DXMatrixMultiply
(
&
mat
,
&
world
,
&
view
);
D3DXVec3Unproject
(
&
gotvec
,
&
u
,
&
viewport
,
&
projection
,
&
mat
,
NULL
);
expect_vec3
(
expectedvec
,
gotvec
);
/* Viewport can be omitted */
expectedvec
.
x
=
-
11
.
01
8396
f
;
expectedvec
.
y
=
3
.
218991
f
;
expectedvec
.
z
=
1
.
380329
f
;
D3DXVec3Unproject
(
&
gotvec
,
&
u
,
NULL
,
&
projection
,
&
view
,
&
world
);
expect_vec3
(
expectedvec
,
gotvec
);
}
static
void
D3DXVector4Test
(
void
)
...
...
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