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
3e264ced
Commit
3e264ced
authored
Nov 08, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Nov 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Handle NULL arguments in D3DXVec3Unproject.
parent
a5d56507
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
math.c
dlls/d3dx9_36/math.c
+5
-9
math.c
dlls/d3dx9_36/tests/math.c
+12
-0
No files found.
dlls/d3dx9_36/math.c
View file @
3e264ced
...
...
@@ -1936,16 +1936,12 @@ D3DXVECTOR3* WINAPI D3DXVec3Unproject(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv,
TRACE
(
"(%p, %p, %p, %p, %p, %p)
\n
"
,
pout
,
pv
,
pviewport
,
pprojection
,
pview
,
pworld
);
if
(
pworld
)
{
D3DXMatrixMultiply
(
&
m
,
pworld
,
pview
);
D3DXMatrixMultiply
(
&
m
,
&
m
,
pprojection
);
}
else
{
D3DXMatrixMultiply
(
&
m
,
pview
,
pprojection
);
}
D3DXMatrixIdentity
(
&
m
);
if
(
pworld
)
D3DXMatrixMultiply
(
&
m
,
&
m
,
pworld
);
if
(
pview
)
D3DXMatrixMultiply
(
&
m
,
&
m
,
pview
);
if
(
pprojection
)
D3DXMatrixMultiply
(
&
m
,
&
m
,
pprojection
);
D3DXMatrixInverse
(
&
m
,
NULL
,
&
m
);
*
pout
=
*
pv
;
if
(
pviewport
)
{
...
...
dlls/d3dx9_36/tests/math.c
View file @
3e264ced
...
...
@@ -1401,6 +1401,18 @@ static void D3DXVector3Test(void)
D3DXMatrixMultiply
(
&
mat
,
&
world
,
&
view
);
D3DXVec3Unproject
(
&
gotvec
,
&
u
,
&
viewport
,
&
projection
,
&
mat
,
NULL
);
expect_vec3
(
expectedvec
,
gotvec
);
/* Projection matrix can be omitted */
D3DXMatrixMultiply
(
&
mat
,
&
view
,
&
projection
);
D3DXVec3Unproject
(
&
gotvec
,
&
u
,
&
viewport
,
NULL
,
&
mat
,
&
world
);
expect_vec3
(
expectedvec
,
gotvec
);
/* View matrix can be omitted */
D3DXMatrixMultiply
(
&
mat
,
&
world
,
&
view
);
D3DXVec3Unproject
(
&
gotvec
,
&
u
,
&
viewport
,
&
projection
,
NULL
,
&
mat
);
expect_vec3
(
expectedvec
,
gotvec
);
/* All matrices can be omitted */
expectedvec
.
x
=
-
1
.
002500
f
;
expectedvec
.
y
=
0
.
997059
f
;
expectedvec
.
z
=
2
.
571429
f
;
D3DXVec3Unproject
(
&
gotvec
,
&
u
,
&
viewport
,
NULL
,
NULL
,
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
);
...
...
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