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
b69038e3
Commit
b69038e3
authored
Nov 08, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Allow NULL pointer for optional arguments of D3DXIntersectTri.
parent
275ee4b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
mesh.c
dlls/d3dx9_36/mesh.c
+3
-3
mesh.c
dlls/d3dx9_36/tests/mesh.c
+9
-0
No files found.
dlls/d3dx9_36/mesh.c
View file @
b69038e3
...
...
@@ -2407,9 +2407,9 @@ BOOL WINAPI D3DXIntersectTri(const D3DXVECTOR3 *p0, const D3DXVECTOR3 *p1, const
D3DXVec4Transform
(
&
vec
,
&
vec
,
&
m
);
if
(
(
vec
.
x
>=
0
.
0
f
)
&&
(
vec
.
y
>=
0
.
0
f
)
&&
(
vec
.
x
+
vec
.
y
<=
1
.
0
f
)
&&
(
vec
.
z
>=
0
.
0
f
)
)
{
*
pu
=
vec
.
x
;
*
pv
=
vec
.
y
;
*
pdist
=
fabsf
(
vec
.
z
);
if
(
pu
)
*
pu
=
vec
.
x
;
if
(
pv
)
*
pv
=
vec
.
y
;
if
(
pdist
)
*
pdist
=
fabsf
(
vec
.
z
);
return
TRUE
;
}
}
...
...
dlls/d3dx9_36/tests/mesh.c
View file @
b69038e3
...
...
@@ -1104,6 +1104,9 @@ static void D3DXIntersectTriTest(void)
ok
(
compare
(
exp_v
,
got_v
),
"Expected v = %f, got %f
\n
"
,
exp_v
,
got_v
);
ok
(
compare
(
exp_dist
,
got_dist
),
"Expected distance = %f, got %f
\n
"
,
exp_dist
,
got_dist
);
got_res
=
D3DXIntersectTri
(
&
vertex
[
0
],
&
vertex
[
1
],
&
vertex
[
2
],
&
position
,
&
ray
,
NULL
,
NULL
,
NULL
);
ok
(
got_res
==
exp_res
,
"Expected result = %d, got %d
\n
"
,
exp_res
,
got_res
);
/*Only positive ray is taken in account*/
vertex
[
0
].
x
=
1
.
0
f
;
vertex
[
0
].
y
=
0
.
0
f
;
vertex
[
0
].
z
=
0
.
0
f
;
...
...
@@ -1119,6 +1122,9 @@ static void D3DXIntersectTriTest(void)
got_res
=
D3DXIntersectTri
(
&
vertex
[
0
],
&
vertex
[
1
],
&
vertex
[
2
],
&
position
,
&
ray
,
&
got_u
,
&
got_v
,
&
got_dist
);
ok
(
got_res
==
exp_res
,
"Expected result = %d, got %d
\n
"
,
exp_res
,
got_res
);
got_res
=
D3DXIntersectTri
(
&
vertex
[
0
],
&
vertex
[
1
],
&
vertex
[
2
],
&
position
,
&
ray
,
NULL
,
NULL
,
NULL
);
ok
(
got_res
==
exp_res
,
"Expected result = %d, got %d
\n
"
,
exp_res
,
got_res
);
/*Intersection between ray and triangle in a same plane is considered as empty*/
vertex
[
0
].
x
=
4
.
0
f
;
vertex
[
0
].
y
=
0
.
0
f
;
vertex
[
0
].
z
=
0
.
0
f
;
...
...
@@ -1133,6 +1139,9 @@ static void D3DXIntersectTriTest(void)
got_res
=
D3DXIntersectTri
(
&
vertex
[
0
],
&
vertex
[
1
],
&
vertex
[
2
],
&
position
,
&
ray
,
&
got_u
,
&
got_v
,
&
got_dist
);
ok
(
got_res
==
exp_res
,
"Expected result = %d, got %d
\n
"
,
exp_res
,
got_res
);
got_res
=
D3DXIntersectTri
(
&
vertex
[
0
],
&
vertex
[
1
],
&
vertex
[
2
],
&
position
,
&
ray
,
NULL
,
NULL
,
NULL
);
ok
(
got_res
==
exp_res
,
"Expected result = %d, got %d
\n
"
,
exp_res
,
got_res
);
}
static
void
D3DXCreateMeshTest
(
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