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
37abfa73
Commit
37abfa73
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 IConditionForceEffect_SetParameters.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
84fe8c22
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
14 deletions
+44
-14
force_feedback.c
dlls/dinput/tests/force_feedback.c
+0
-11
condition_effect.c
dlls/windows.gaming.input/condition_effect.c
+18
-2
force_feedback.c
dlls/windows.gaming.input/force_feedback.c
+12
-1
provider.idl
dlls/windows.gaming.input/provider.idl
+14
-0
No files found.
dlls/dinput/tests/force_feedback.c
View file @
37abfa73
...
@@ -5514,23 +5514,13 @@ static void test_windows_gaming_input(void)
...
@@ -5514,23 +5514,13 @@ static void test_windows_gaming_input(void)
.
report_id
=
4
,
.
report_id
=
4
,
.
report_len
=
12
,
.
report_len
=
12
,
.
report_buf
=
{
4
,
0x01
,
0x00
,
0x70
,
0x17
,
0x7b
,
0x02
,
0xe9
,
0x04
,
0x4c
,
0x66
,
0x7f
},
.
report_buf
=
{
4
,
0x01
,
0x00
,
0x70
,
0x17
,
0x7b
,
0x02
,
0xe9
,
0x04
,
0x4c
,
0x66
,
0x7f
},
.
todo
=
TRUE
,
},
},
/* update effect */
/* update effect */
{
{
.
code
=
IOCTL_HID_WRITE_REPORT
,
.
code
=
IOCTL_HID_WRITE_REPORT
,
.
report_id
=
3
,
.
report_id
=
3
,
.
report_len
=
18
,
.
report_len
=
18
,
.
report_buf
=
{
3
,
0x01
,
0x03
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0x5a
,
0x00
,
0x00
,
0x00
},
.
wine_only
=
TRUE
,
.
todo
=
TRUE
,
},
{
.
code
=
IOCTL_HID_WRITE_REPORT
,
.
report_id
=
3
,
.
report_len
=
18
,
.
report_buf
=
{
3
,
0x01
,
0x03
,
0x08
,
0xff
,
0xff
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0x99
,
0x00
,
0x00
,
0x00
},
.
report_buf
=
{
3
,
0x01
,
0x03
,
0x08
,
0xff
,
0xff
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0x99
,
0x00
,
0x00
,
0x00
},
.
todo
=
TRUE
,
},
},
};
};
struct
hid_expect
expect_create_constant
[]
=
struct
hid_expect
expect_create_constant
[]
=
...
@@ -6216,7 +6206,6 @@ static void test_windows_gaming_input(void)
...
@@ -6216,7 +6206,6 @@ static void test_windows_gaming_input(void)
ok
(
hr
==
S_OK
,
"get_Kind returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"get_Kind returned %#lx
\n
"
,
hr
);
ok
(
condition_kind
==
ConditionForceEffectKind_Spring
,
"got kind %u
\n
"
,
condition_kind
);
ok
(
condition_kind
==
ConditionForceEffectKind_Spring
,
"got kind %u
\n
"
,
condition_kind
);
hr
=
IConditionForceEffect_SetParameters
(
condition_effect
,
direction
,
0
.
1
,
0
.
2
,
0
.
3
,
0
.
4
,
0
.
5
,
0
.
6
);
hr
=
IConditionForceEffect_SetParameters
(
condition_effect
,
direction
,
0
.
1
,
0
.
2
,
0
.
3
,
0
.
4
,
0
.
5
,
0
.
6
);
todo_wine
ok
(
hr
==
S_OK
,
"SetParameters returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"SetParameters returned %#lx
\n
"
,
hr
);
IConditionForceEffect_Release
(
condition_effect
);
IConditionForceEffect_Release
(
condition_effect
);
...
...
dlls/windows.gaming.input/condition_effect.c
View file @
37abfa73
...
@@ -110,10 +110,26 @@ static HRESULT WINAPI effect_get_Kind( IConditionForceEffect *iface, ConditionFo
...
@@ -110,10 +110,26 @@ static HRESULT WINAPI effect_get_Kind( IConditionForceEffect *iface, ConditionFo
static
HRESULT
WINAPI
effect_SetParameters
(
IConditionForceEffect
*
iface
,
Vector3
direction
,
FLOAT
positive_coeff
,
FLOAT
negative_coeff
,
static
HRESULT
WINAPI
effect_SetParameters
(
IConditionForceEffect
*
iface
,
Vector3
direction
,
FLOAT
positive_coeff
,
FLOAT
negative_coeff
,
FLOAT
max_positive_magnitude
,
FLOAT
max_negative_magnitude
,
FLOAT
deadzone
,
FLOAT
bias
)
FLOAT
max_positive_magnitude
,
FLOAT
max_negative_magnitude
,
FLOAT
deadzone
,
FLOAT
bias
)
{
{
FIXME
(
"iface %p, direction %s, positive_coeff %f, negative_coeff %f, max_positive_magnitude %f, max_negative_magnitude %f, deadzone %f, bias %f stub!
\n
"
,
struct
condition_effect
*
impl
=
impl_from_IConditionForceEffect
(
iface
);
WineForceFeedbackEffectParameters
params
=
{
.
condition
=
{
.
type
=
WineForceFeedbackEffectType_Condition
+
impl
->
kind
,
.
direction
=
direction
,
.
positive_coeff
=
positive_coeff
,
.
negative_coeff
=
negative_coeff
,
.
max_positive_magnitude
=
max_positive_magnitude
,
.
max_negative_magnitude
=
max_negative_magnitude
,
.
deadzone
=
deadzone
,
.
bias
=
bias
,
},
};
TRACE
(
"iface %p, direction %s, positive_coeff %f, negative_coeff %f, max_positive_magnitude %f, max_negative_magnitude %f, deadzone %f, bias %f.
\n
"
,
iface
,
debugstr_vector3
(
&
direction
),
positive_coeff
,
negative_coeff
,
max_positive_magnitude
,
max_negative_magnitude
,
deadzone
,
bias
);
iface
,
debugstr_vector3
(
&
direction
),
positive_coeff
,
negative_coeff
,
max_positive_magnitude
,
max_negative_magnitude
,
deadzone
,
bias
);
return
E_NOTIMPL
;
return
IWineForceFeedbackEffectImpl_put_Parameters
(
impl
->
IWineForceFeedbackEffectImpl_inner
,
params
,
NULL
)
;
}
}
static
const
struct
IConditionForceEffectVtbl
effect_vtbl
=
static
const
struct
IConditionForceEffectVtbl
effect_vtbl
=
...
...
dlls/windows.gaming.input/force_feedback.c
View file @
37abfa73
...
@@ -162,7 +162,18 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl *
...
@@ -162,7 +162,18 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl *
case
WineForceFeedbackEffectType_Condition_Damper
:
case
WineForceFeedbackEffectType_Condition_Damper
:
case
WineForceFeedbackEffectType_Condition_Inertia
:
case
WineForceFeedbackEffectType_Condition_Inertia
:
case
WineForceFeedbackEffectType_Condition_Friction
:
case
WineForceFeedbackEffectType_Condition_Friction
:
FIXME
(
"stub!
\n
"
);
impl
->
repeat_count
=
1
;
impl
->
condition
.
lPositiveCoefficient
=
round
(
atan
(
params
.
condition
.
positive_coeff
)
/
M_PI_2
*
10000
);
impl
->
condition
.
lNegativeCoefficient
=
round
(
atan
(
params
.
condition
.
negative_coeff
)
/
M_PI_2
*
10000
);
impl
->
condition
.
dwPositiveSaturation
=
round
(
params
.
condition
.
max_positive_magnitude
*
10000
);
impl
->
condition
.
dwNegativeSaturation
=
round
(
params
.
condition
.
max_negative_magnitude
*
10000
);
impl
->
condition
.
lDeadBand
=
round
(
params
.
condition
.
deadzone
*
10000
);
impl
->
condition
.
lOffset
=
round
(
params
.
condition
.
bias
*
10000
);
impl
->
params
.
dwDuration
=
-
1
;
impl
->
params
.
dwStartDelay
=
0
;
impl
->
directions
[
0
]
=
round
(
params
.
condition
.
direction
.
X
*
10000
);
impl
->
directions
[
1
]
=
round
(
params
.
condition
.
direction
.
Y
*
10000
);
impl
->
directions
[
2
]
=
round
(
params
.
condition
.
direction
.
Z
*
10000
);
break
;
break
;
}
}
...
...
dlls/windows.gaming.input/provider.idl
View file @
37abfa73
...
@@ -37,6 +37,7 @@ namespace Windows.Gaming.Input.Custom {
...
@@ -37,6 +37,7 @@ namespace Windows.Gaming.Input.Custom {
typedef
enum
WineForceFeedbackEffectType
WineForceFeedbackEffectType
;
typedef
enum
WineForceFeedbackEffectType
WineForceFeedbackEffectType
;
typedef
struct
WineGameControllerState
WineGameControllerState
;
typedef
struct
WineGameControllerState
WineGameControllerState
;
typedef
struct
WineGameControllerVibration
WineGameControllerVibration
;
typedef
struct
WineGameControllerVibration
WineGameControllerVibration
;
typedef
struct
WineConditionEffectParameters
WineConditionEffectParameters
;
typedef
struct
WineConstantEffectParameters
WineConstantEffectParameters
;
typedef
struct
WineConstantEffectParameters
WineConstantEffectParameters
;
typedef
struct
WineRampEffectParameters
WineRampEffectParameters
;
typedef
struct
WineRampEffectParameters
WineRampEffectParameters
;
typedef
struct
WinePeriodicEffectParameters
WinePeriodicEffectParameters
;
typedef
struct
WinePeriodicEffectParameters
WinePeriodicEffectParameters
;
...
@@ -92,6 +93,18 @@ namespace Windows.Gaming.Input.Custom {
...
@@ -92,6 +93,18 @@ namespace Windows.Gaming.Input.Custom {
UINT16
right
;
UINT16
right
;
}
;
}
;
struct
WineConditionEffectParameters
{
WineForceFeedbackEffectType
type
;
Windows
.
Foundation.Numerics.Vector3
direction
;
FLOAT
positive_coeff
;
FLOAT
negative_coeff
;
FLOAT
max_positive_magnitude
;
FLOAT
max_negative_magnitude
;
FLOAT
deadzone
;
FLOAT
bias
;
}
;
struct
WineConstantEffectParameters
struct
WineConstantEffectParameters
{
{
WineForceFeedbackEffectType
type
;
WineForceFeedbackEffectType
type
;
...
@@ -137,6 +150,7 @@ namespace Windows.Gaming.Input.Custom {
...
@@ -137,6 +150,7 @@ namespace Windows.Gaming.Input.Custom {
union
WineForceFeedbackEffectParameters
union
WineForceFeedbackEffectParameters
{
{
WineForceFeedbackEffectType
type
;
WineForceFeedbackEffectType
type
;
WineConditionEffectParameters
condition
;
WineConstantEffectParameters
constant
;
WineConstantEffectParameters
constant
;
WineRampEffectParameters
ramp
;
WineRampEffectParameters
ramp
;
WinePeriodicEffectParameters
periodic
;
WinePeriodicEffectParameters
periodic
;
...
...
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