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
32ffef33
Commit
32ffef33
authored
Mar 14, 2018
by
David Adam
Committed by
Alexandre Julliard
Mar 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Improve vertices computation in D3DXCreatePolygon().
Signed-off-by:
Matteo Bruni
<
mbruni@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5865f87c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
mesh.c
dlls/d3dx9_36/mesh.c
+6
-4
mesh.c
dlls/d3dx9_36/tests/mesh.c
+7
-4
No files found.
dlls/d3dx9_36/mesh.c
View file @
32ffef33
...
...
@@ -4565,7 +4565,7 @@ HRESULT WINAPI D3DXCreatePolygon(struct IDirect3DDevice9 *device, float length,
struct
vertex
*
vertices
;
WORD
(
*
faces
)[
3
];
DWORD
(
*
adjacency_buf
)[
3
];
float
scale
;
float
angle
,
scale
;
unsigned
int
i
;
TRACE
(
"device %p, length %f, sides %u, mesh %p, adjacency %p.
\n
"
,
...
...
@@ -4593,7 +4593,9 @@ HRESULT WINAPI D3DXCreatePolygon(struct IDirect3DDevice9 *device, float length,
return
hr
;
}
scale
=
0
.
5
f
*
length
/
sinf
(
D3DX_PI
/
sides
);
angle
=
D3DX_PI
/
sides
;
scale
=
0
.
5
f
*
length
/
sinf
(
angle
);
angle
*=
2
.
0
f
;
vertices
[
0
].
position
.
x
=
0
.
0
f
;
vertices
[
0
].
position
.
y
=
0
.
0
f
;
...
...
@@ -4604,8 +4606,8 @@ HRESULT WINAPI D3DXCreatePolygon(struct IDirect3DDevice9 *device, float length,
for
(
i
=
0
;
i
<
sides
;
++
i
)
{
vertices
[
i
+
1
].
position
.
x
=
cosf
(
2
.
0
f
*
D3DX_PI
*
i
/
sides
)
*
scale
;
vertices
[
i
+
1
].
position
.
y
=
sinf
(
2
.
0
f
*
D3DX_PI
*
i
/
sides
)
*
scale
;
vertices
[
i
+
1
].
position
.
x
=
cosf
(
angle
*
i
)
*
scale
;
vertices
[
i
+
1
].
position
.
y
=
sinf
(
angle
*
i
)
*
scale
;
vertices
[
i
+
1
].
position
.
z
=
0
.
0
f
;
vertices
[
i
+
1
].
normal
.
x
=
0
.
0
f
;
vertices
[
i
+
1
].
normal
.
y
=
0
.
0
f
;
...
...
dlls/d3dx9_36/tests/mesh.c
View file @
32ffef33
...
...
@@ -2683,12 +2683,14 @@ static void D3DXCreateBoxTest(void)
static
BOOL
compute_polygon
(
struct
mesh
*
mesh
,
float
length
,
unsigned
int
sides
)
{
unsigned
int
i
;
float
scale
;
float
angle
,
scale
;
if
(
!
new_mesh
(
mesh
,
sides
+
1
,
sides
))
return
FALSE
;
scale
=
0
.
5
f
*
length
/
sinf
(
D3DX_PI
/
sides
);
angle
=
D3DX_PI
/
sides
;
scale
=
0
.
5
f
*
length
/
sinf
(
angle
);
angle
*=
2
.
0
f
;
mesh
->
vertices
[
0
].
position
.
x
=
0
.
0
f
;
mesh
->
vertices
[
0
].
position
.
y
=
0
.
0
f
;
...
...
@@ -2699,8 +2701,8 @@ static BOOL compute_polygon(struct mesh *mesh, float length, unsigned int sides)
for
(
i
=
0
;
i
<
sides
;
++
i
)
{
mesh
->
vertices
[
i
+
1
].
position
.
x
=
cosf
(
2
.
0
f
*
D3DX_PI
*
i
/
sides
)
*
scale
;
mesh
->
vertices
[
i
+
1
].
position
.
y
=
sinf
(
2
.
0
f
*
D3DX_PI
*
i
/
sides
)
*
scale
;
mesh
->
vertices
[
i
+
1
].
position
.
x
=
cosf
(
angle
*
i
)
*
scale
;
mesh
->
vertices
[
i
+
1
].
position
.
y
=
sinf
(
angle
*
i
)
*
scale
;
mesh
->
vertices
[
i
+
1
].
position
.
z
=
0
.
0
f
;
mesh
->
vertices
[
i
+
1
].
normal
.
x
=
0
.
0
f
;
mesh
->
vertices
[
i
+
1
].
normal
.
y
=
0
.
0
f
;
...
...
@@ -2807,6 +2809,7 @@ static void D3DXCreatePolygonTest(void)
test_polygon
(
device
,
10
.
0
f
,
5
);
test_polygon
(
device
,
10
.
0
f
,
10
);
test_polygon
(
device
,
20
.
0
f
,
10
);
test_polygon
(
device
,
20
.
0
f
,
32000
);
free_test_context
(
test_context
);
}
...
...
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