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
0697d1ca
Commit
0697d1ca
authored
Nov 10, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Fix DIEFF_CARTESIAN to DIEFF_SPHERICAL conversion.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
bd6d258e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
joystick_hid.c
dlls/dinput/joystick_hid.c
+8
-2
hid.c
dlls/dinput8/tests/hid.c
+0
-3
No files found.
dlls/dinput/joystick_hid.c
View file @
0697d1ca
...
...
@@ -2019,13 +2019,19 @@ static BOOL get_parameters_object_ofs( struct hid_joystick *impl, struct hid_val
static
void
convert_directions_to_spherical
(
const
DIEFFECT
*
in
,
DIEFFECT
*
out
)
{
DWORD
i
,
direction_flags
=
DIEFF_CARTESIAN
|
DIEFF_POLAR
|
DIEFF_SPHERICAL
;
DWORD
i
,
j
,
direction_flags
=
DIEFF_CARTESIAN
|
DIEFF_POLAR
|
DIEFF_SPHERICAL
;
double
tmp
;
switch
(
in
->
dwFlags
&
direction_flags
)
{
case
DIEFF_CARTESIAN
:
for
(
i
=
1
;
i
<
in
->
cAxes
;
++
i
)
out
->
rglDirection
[
i
-
1
]
=
atan2
(
in
->
rglDirection
[
i
],
in
->
rglDirection
[
0
]
);
{
tmp
=
in
->
rglDirection
[
0
];
for
(
j
=
1
;
j
<
i
;
++
j
)
tmp
=
sqrt
(
tmp
*
tmp
+
in
->
rglDirection
[
j
]
*
in
->
rglDirection
[
j
]
);
tmp
=
atan2
(
in
->
rglDirection
[
i
],
tmp
);
out
->
rglDirection
[
i
-
1
]
=
tmp
*
18000
/
M_PI
;
}
out
->
rglDirection
[
in
->
cAxes
-
1
]
=
0
;
out
->
cAxes
=
in
->
cAxes
;
break
;
...
...
dlls/dinput8/tests/hid.c
View file @
0697d1ca
...
...
@@ -6085,7 +6085,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
}
else
{
todo_wine
ok
(
desc
.
rglDirection
[
0
]
==
6343
,
"got rglDirection[0] %d expected %d
\n
"
,
desc
.
rglDirection
[
0
],
6343
);
if
(
i
==
2
)
...
...
@@ -6097,7 +6096,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
}
else
{
todo_wine
ok
(
desc
.
rglDirection
[
1
]
==
5330
,
"got rglDirection[1] %d expected %d
\n
"
,
desc
.
rglDirection
[
1
],
5330
);
ok
(
desc
.
rglDirection
[
2
]
==
0
,
"got rglDirection[2] %d expected %d
\n
"
,
...
...
@@ -6141,7 +6139,6 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
{
ok
(
hr
==
DI_OK
,
"GetParameters returned %#x
\n
"
,
hr
);
ok
(
desc
.
cAxes
==
i
,
"got cAxes %u expected 2
\n
"
,
desc
.
cAxes
);
todo_wine
ok
(
desc
.
rglDirection
[
0
]
==
15343
,
"got rglDirection[0] %d expected %d
\n
"
,
desc
.
rglDirection
[
0
],
15343
);
ok
(
desc
.
rglDirection
[
1
]
==
0
,
"got rglDirection[1] %d expected %d
\n
"
,
desc
.
rglDirection
[
1
],
0
);
...
...
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