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
ef5fa6c7
Commit
ef5fa6c7
authored
Nov 19, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Only scale parameter value if its physical range is defined.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b2ba9737
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
joystick_hid.c
dlls/dinput/joystick_hid.c
+6
-2
No files found.
dlls/dinput/joystick_hid.c
View file @
ef5fa6c7
...
...
@@ -676,8 +676,12 @@ static void set_report_value( struct hid_joystick *impl, char *report_buf,
phy_min
=
caps
->
physical_min
;
phy_max
=
caps
->
physical_max
;
if
(
value
>
phy_max
||
value
<
phy_min
)
value
=
-
1
;
else
value
=
log_min
+
(
value
-
phy_min
)
*
(
log_max
-
log_min
)
/
(
phy_max
-
phy_min
);
if
(
phy_max
||
phy_min
)
{
if
(
value
>
phy_max
||
value
<
phy_min
)
value
=
-
1
;
else
value
=
log_min
+
(
value
-
phy_min
)
*
(
log_max
-
log_min
)
/
(
phy_max
-
phy_min
);
}
status
=
HidP_SetUsageValue
(
HidP_Output
,
caps
->
usage_page
,
caps
->
link_collection
,
caps
->
usage_min
,
value
,
preparsed
,
report_buf
,
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_SetUsageValue %04x:%04x returned %#x
\n
"
,
...
...
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