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
d9bd1c49
Commit
d9bd1c49
authored
Nov 26, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
joy.cpl: Read the effect parameters instead of storing them.
The direction and axis arrays are also not pointing to valid memory anymore.
parent
85790d83
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
main.c
dlls/joy.cpl/main.c
+15
-9
No files found.
dlls/joy.cpl/main.c
View file @
d9bd1c49
...
...
@@ -71,7 +71,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(joycpl);
struct
Effect
{
IDirectInputEffect
*
effect
;
DIEFFECT
params
;
DIEFFECTINFOW
info
;
};
...
...
@@ -217,7 +216,6 @@ static BOOL CALLBACK enum_effects( const DIEFFECTINFOW *info, void *context )
}
joystick
->
effects
[
joystick
->
cur_effect
].
effect
=
effect
;
joystick
->
effects
[
joystick
->
cur_effect
].
params
=
params
;
joystick
->
effects
[
joystick
->
cur_effect
].
info
=
*
info
;
joystick
->
cur_effect
+=
1
;
...
...
@@ -906,21 +904,29 @@ static DWORD WINAPI ff_input_thread(void *param)
int
i
;
struct
Joystick
*
joy
=
&
data
->
joysticks
[
data
->
chosen_joystick
];
int
chosen_effect
=
joy
->
chosen_effect
;
DIEFFECT
*
dieffect
;
DWORD
flags
=
DIEP_AXES
|
DIEP_DIRECTION
|
DIEP_NORESTART
;
LONG
direction
[
3
]
=
{
0
};
DWORD
axes
[
3
]
=
{
0
};
DIEFFECT
params
=
{
.
dwSize
=
sizeof
(
DIEFFECT
),
.
dwFlags
=
DIEFF_CARTESIAN
|
DIEFF_OBJECTOFFSETS
,
.
rglDirection
=
direction
,
.
rgdwAxes
=
axes
,
.
cAxes
=
3
,
};
RECT
r
;
Sleep
(
TEST_POLL_TIME
);
/* Skip this if we have no effects */
if
(
joy
->
num_effects
==
0
||
chosen_effect
<
0
)
continue
;
if
(
joy
->
num_effects
==
0
||
chosen_effect
<
0
||
!
joy
->
effects
[
chosen_effect
].
effect
)
continue
;
poll_input
(
joy
,
&
state
);
/* Set ff parameters and draw the axis */
dieffect
=
&
joy
->
effects
[
chosen_effect
].
params
;
dieffect
->
rgdwAxes
[
0
]
=
state
.
lX
;
dieffect
->
rgdwAxes
[
1
]
=
state
.
lY
;
IDirectInputEffect_GetParameters
(
joy
->
effects
[
chosen_effect
].
effect
,
&
params
,
flags
);
params
.
rgdwAxes
[
0
]
=
state
.
lX
;
params
.
rgdwAxes
[
1
]
=
state
.
lY
;
r
.
left
=
FF_AXIS_X
+
state
.
lX
;
r
.
top
=
FF_AXIS_Y
+
state
.
lY
;
...
...
@@ -932,7 +938,7 @@ static DWORD WINAPI ff_input_thread(void *param)
for
(
i
=
0
;
i
<
TEST_MAX_BUTTONS
;
i
++
)
if
(
state
.
rgbButtons
[
i
])
{
IDirectInputEffect_SetParameters
(
joy
->
effects
[
chosen_effect
].
effect
,
dieffect
,
flags
);
IDirectInputEffect_SetParameters
(
joy
->
effects
[
chosen_effect
].
effect
,
&
params
,
flags
);
IDirectInputEffect_Start
(
joy
->
effects
[
chosen_effect
].
effect
,
1
,
0
);
break
;
}
...
...
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