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
bc6df7ca
Commit
bc6df7ca
authored
May 12, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
May 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.gaming.input: Implement IForceFeedbackEffect_(get|put)_Gain.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c578aa7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
11 deletions
+24
-11
force_feedback.c
dlls/dinput/tests/force_feedback.c
+1
-7
force_feedback.c
dlls/windows.gaming.input/force_feedback.c
+23
-4
No files found.
dlls/dinput/tests/force_feedback.c
View file @
bc6df7ca
...
...
@@ -5572,7 +5572,7 @@ static void test_windows_gaming_input(void)
.
code
=
IOCTL_HID_WRITE_REPORT
,
.
report_id
=
3
,
.
report_len
=
18
,
.
report_buf
=
{
3
,
0x01
,
0x04
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0x
f
f
,
0x5a
,
0x00
,
0x00
,
0x00
},
.
report_buf
=
{
3
,
0x01
,
0x04
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0x
7
f
,
0x5a
,
0x00
,
0x00
,
0x00
},
.
wine_only
=
TRUE
,
.
todo
=
TRUE
,
},
...
...
@@ -6061,12 +6061,9 @@ static void test_windows_gaming_input(void)
gain
=
12345
.
6
;
hr
=
IForceFeedbackEffect_get_Gain
(
effect
,
&
gain
);
todo_wine
ok
(
hr
==
S_OK
,
"get_Gain returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
gain
==
1
.
0
,
"got gain %f
\n
"
,
gain
);
hr
=
IForceFeedbackEffect_put_Gain
(
effect
,
0
.
5
);
todo_wine
ok
(
hr
==
S_FALSE
,
"put_Gain returned %#lx
\n
"
,
hr
);
state
=
0xdeadbeef
;
hr
=
IForceFeedbackEffect_get_State
(
effect
,
&
state
);
...
...
@@ -6317,12 +6314,9 @@ static void test_windows_gaming_input(void)
gain
=
12345
.
6
;
hr
=
IForceFeedbackEffect_get_Gain
(
effect
,
&
gain
);
todo_wine
ok
(
hr
==
S_OK
,
"get_Gain returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
gain
==
1
.
0
,
"get_MasterGain returned %f
\n
"
,
gain
);
hr
=
IForceFeedbackEffect_put_Gain
(
effect
,
0
.
5
);
todo_wine
ok
(
hr
==
S_FALSE
,
"put_Gain returned %#lx
\n
"
,
hr
);
state
=
0xdeadbeef
;
hr
=
IForceFeedbackEffect_get_State
(
effect
,
&
state
);
...
...
dlls/windows.gaming.input/force_feedback.c
View file @
bc6df7ca
...
...
@@ -19,6 +19,8 @@
#include "private.h"
#include "math.h"
#include "ddk/hidsdi.h"
#include "dinput.h"
#include "hidusage.h"
...
...
@@ -117,14 +119,31 @@ DEFINE_IINSPECTABLE_OUTER( effect, IForceFeedbackEffect, struct effect, IInspect
static
HRESULT
WINAPI
effect_get_Gain
(
IForceFeedbackEffect
*
iface
,
DOUBLE
*
value
)
{
FIXME
(
"iface %p, value %p stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
struct
effect
*
impl
=
impl_from_IForceFeedbackEffect
(
iface
);
TRACE
(
"iface %p, value %p.
\n
"
,
iface
,
value
);
EnterCriticalSection
(
&
impl
->
cs
);
*
value
=
impl
->
params
.
dwGain
/
10000
.;
LeaveCriticalSection
(
&
impl
->
cs
);
return
S_OK
;
}
static
HRESULT
WINAPI
effect_put_Gain
(
IForceFeedbackEffect
*
iface
,
DOUBLE
value
)
{
FIXME
(
"iface %p, value %f stub!
\n
"
,
iface
,
value
);
return
E_NOTIMPL
;
struct
effect
*
impl
=
impl_from_IForceFeedbackEffect
(
iface
);
HRESULT
hr
;
TRACE
(
"iface %p, value %f.
\n
"
,
iface
,
value
);
EnterCriticalSection
(
&
impl
->
cs
);
impl
->
params
.
dwGain
=
round
(
value
*
10000
);
if
(
!
impl
->
effect
)
hr
=
S_FALSE
;
else
hr
=
IDirectInputEffect_SetParameters
(
impl
->
effect
,
&
impl
->
params
,
DIEP_GAIN
);
LeaveCriticalSection
(
&
impl
->
cs
);
return
hr
;
}
static
HRESULT
WINAPI
effect_get_State
(
IForceFeedbackEffect
*
iface
,
ForceFeedbackEffectState
*
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