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
7e797083
Commit
7e797083
authored
Feb 02, 2009
by
Vincent Pelletier
Committed by
Alexandre Julliard
Feb 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Fix effect direction conversion from DIEFF_CARTESIAN coordinates.
parent
209820c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
effect_linuxinput.c
dlls/dinput/effect_linuxinput.c
+9
-7
No files found.
dlls/dinput/effect_linuxinput.c
View file @
7e797083
...
...
@@ -55,6 +55,7 @@ struct LinuxInputEffectImpl
struct
ff_effect
effect
;
/* Effect data */
int
gain
;
/* Effect gain */
int
first_axis_is_x
;
int
*
fd
;
/* Parent device */
struct
list
*
entry
;
/* Entry into the parent's list of effects */
};
...
...
@@ -548,6 +549,7 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
return
DIERR_INVALIDPARAM
;
else
if
(
peff
->
cAxes
<
1
)
return
DIERR_INCOMPLETEEFFECT
;
This
->
first_axis_is_x
=
peff
->
rgdwAxes
[
0
]
==
DIJOFS_X
;
}
/* some of this may look funky, but it's 'cause the linux driver and directx have
...
...
@@ -572,15 +574,15 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
}
}
else
{
/* two axes */
if
(
peff
->
dwFlags
&
DIEFF_CARTESIAN
)
{
/* avoid divide-by-zero */
if
(
peff
->
rglDirection
[
1
]
==
0
)
{
if
(
peff
->
rglDirection
[
0
]
>=
0
)
This
->
effect
.
direction
=
0x4000
;
else
if
(
peff
->
rglDirection
[
0
]
<
0
)
This
->
effect
.
direction
=
0xC000
;
LONG
x
,
y
;
if
(
This
->
first_axis_is_x
)
{
x
=
peff
->
rglDirection
[
0
];
y
=
peff
->
rglDirection
[
1
];
}
else
{
This
->
effect
.
direction
=
(
int
)(
atan
(
peff
->
rglDirection
[
0
]
/
peff
->
rglDirection
[
1
])
*
0x7FFF
/
(
3
*
M_PI
));
x
=
peff
->
rglDirection
[
1
];
y
=
peff
->
rglDirection
[
0
];
}
This
->
effect
.
direction
=
(
int
)((
3
*
M_PI
/
2
-
atan2
(
y
,
x
))
*
-
0x7FFF
/
M_PI
);
}
else
{
/* Polar and spherical are the same for 2 axes */
/* Precision is important here, so we do double math with exact constants */
...
...
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