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
fec8aae2
Commit
fec8aae2
authored
Apr 25, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.gaming.input: Implement IForceFeedbackMotor_(get|put)_MasterGain.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cd240052
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
force_feedback.c
dlls/dinput/tests/force_feedback.c
+1
-5
force_feedback.c
dlls/windows.gaming.input/force_feedback.c
+33
-4
No files found.
dlls/dinput/tests/force_feedback.c
View file @
fec8aae2
...
...
@@ -5063,7 +5063,6 @@ static void test_windows_gaming_input(void)
.
report_id
=
6
,
.
report_len
=
2
,
.
report_buf
=
{
6
,
0x7f
},
.
todo
=
TRUE
,
};
static
struct
hid_expect
expect_pause
=
{
...
...
@@ -5306,15 +5305,12 @@ static void test_windows_gaming_input(void)
gain
=
12345
.
6
;
hr
=
IForceFeedbackMotor_get_MasterGain
(
motor
,
&
gain
);
todo_wine
ok
(
hr
==
S_OK
,
"get_MasterGain returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
gain
==
1
.
0
,
"got gain %f
\n
"
,
gain
);
set_hid_expect
(
file
,
&
expect_set_gain
,
sizeof
(
expect_set_gain
)
);
hr
=
IForceFeedbackMotor_put_MasterGain
(
motor
,
0
.
5
);
todo_wine
ok
(
hr
==
S_OK
,
"put_MasterGain returned %#lx
\n
"
,
hr
);
wait_hid_expect
_
(
__FILE__
,
__LINE__
,
file
,
100
,
TRUE
);
/* device gain reports are written asynchronously */
wait_hid_expect
(
file
,
100
);
/* device gain reports are written asynchronously */
enabled
=
FALSE
;
hr
=
IForceFeedbackMotor_get_IsEnabled
(
motor
,
&
enabled
);
...
...
dlls/windows.gaming.input/force_feedback.c
View file @
fec8aae2
...
...
@@ -111,14 +111,43 @@ static HRESULT WINAPI motor_get_AreEffectsPaused( IForceFeedbackMotor *iface, BO
static
HRESULT
WINAPI
motor_get_MasterGain
(
IForceFeedbackMotor
*
iface
,
double
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
struct
motor
*
impl
=
impl_from_IForceFeedbackMotor
(
iface
);
DIPROPDWORD
gain
=
{
.
diph
=
{
.
dwSize
=
sizeof
(
DIPROPDWORD
),
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
),
.
dwHow
=
DIPH_DEVICE
,
},
};
HRESULT
hr
;
TRACE
(
"iface %p, value %p.
\n
"
,
iface
,
value
);
if
(
FAILED
(
hr
=
IDirectInputDevice8_GetProperty
(
impl
->
device
,
DIPROP_FFGAIN
,
&
gain
.
diph
)))
*
value
=
1
.;
else
*
value
=
gain
.
dwData
/
10000
.;
return
hr
;
}
static
HRESULT
WINAPI
motor_put_MasterGain
(
IForceFeedbackMotor
*
iface
,
double
value
)
{
FIXME
(
"iface %p, value %#I64x stub!
\n
"
,
iface
,
*
(
UINT64
*
)
&
value
);
return
E_NOTIMPL
;
struct
motor
*
impl
=
impl_from_IForceFeedbackMotor
(
iface
);
DIPROPDWORD
gain
=
{
.
diph
=
{
.
dwSize
=
sizeof
(
DIPROPDWORD
),
.
dwHeaderSize
=
sizeof
(
DIPROPHEADER
),
.
dwHow
=
DIPH_DEVICE
,
},
};
TRACE
(
"iface %p, value %f.
\n
"
,
iface
,
value
);
gain
.
dwData
=
10000
*
value
;
return
IDirectInputDevice8_SetProperty
(
impl
->
device
,
DIPROP_FFGAIN
,
&
gain
.
diph
);
}
static
HRESULT
WINAPI
motor_get_IsEnabled
(
IForceFeedbackMotor
*
iface
,
BOOLEAN
*
value
)
...
...
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