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
081a2891
Commit
081a2891
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 IRampForceEffect_SetParameters(WithEnvelope).
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aba20b06
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
11 deletions
+64
-11
force_feedback.c
dlls/dinput/tests/force_feedback.c
+1
-5
force_feedback.c
dlls/windows.gaming.input/force_feedback.c
+8
-1
provider.idl
dlls/windows.gaming.input/provider.idl
+13
-0
ramp_effect.c
dlls/windows.gaming.input/ramp_effect.c
+42
-5
No files found.
dlls/dinput/tests/force_feedback.c
View file @
081a2891
...
...
@@ -5604,7 +5604,6 @@ static void test_windows_gaming_input(void)
.
report_id
=
10
,
.
report_len
=
6
,
.
report_buf
=
{
10
,
0x01
,
0xc8
,
0x00
,
0x20
,
0x03
},
.
todo
=
TRUE
,
},
/* set envelope */
{
...
...
@@ -5612,14 +5611,13 @@ static void test_windows_gaming_input(void)
.
report_id
=
8
,
.
report_len
=
8
,
.
report_buf
=
{
8
,
0x01
,
0x19
,
0x4c
,
0x14
,
0x00
,
0x3c
,
0x00
},
.
todo
=
TRUE
,
},
/* update effect */
{
.
code
=
IOCTL_HID_WRITE_REPORT
,
.
report_id
=
3
,
.
report_len
=
18
,
.
report_buf
=
{
3
,
0x01
,
0x05
,
0x08
,
0x
00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0xff
,
0xff
,
0x5a
,
0x00
,
0x00
,
0x00
},
.
report_buf
=
{
3
,
0x01
,
0x05
,
0x08
,
0x
5a
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x0a
,
0x00
,
0xff
,
0xff
,
0xce
,
0x00
,
0x00
,
0x00
},
.
wine_only
=
TRUE
,
.
todo
=
TRUE
,
},
...
...
@@ -6399,11 +6397,9 @@ static void test_windows_gaming_input(void)
ok
(
hr
==
S_OK
,
"QueryInterface returned %#lx
\n
"
,
hr
);
hr
=
IRampForceEffect_SetParameters
(
ramp_effect
,
direction
,
end_direction
,
duration
);
todo_wine
ok
(
hr
==
S_OK
,
"SetParameters returned %#lx
\n
"
,
hr
);
hr
=
IRampForceEffect_SetParametersWithEnvelope
(
ramp_effect
,
direction
,
end_direction
,
0
.
1
,
0
.
2
,
0
.
3
,
delay
,
attack_duration
,
duration
,
release_duration
,
1
);
todo_wine
ok
(
hr
==
S_OK
,
"SetParametersWithEnvelope returned %#lx
\n
"
,
hr
);
IRampForceEffect_Release
(
ramp_effect
);
...
...
dlls/windows.gaming.input/force_feedback.c
View file @
081a2891
...
...
@@ -131,7 +131,14 @@ static HRESULT WINAPI effect_impl_put_Parameters( IWineForceFeedbackEffectImpl *
break
;
case
WineForceFeedbackEffectType_Ramp
:
FIXME
(
"stub!
\n
"
);
impl
->
repeat_count
=
params
.
ramp
.
repeat_count
;
impl
->
ramp_force
.
lStart
=
round
(
params
.
ramp
.
gain
*
params
.
ramp
.
start_vector
.
X
*
10000
);
impl
->
ramp_force
.
lEnd
=
round
(
params
.
ramp
.
gain
*
params
.
ramp
.
end_vector
.
X
*
10000
);
impl
->
params
.
dwDuration
=
params
.
ramp
.
duration
.
Duration
/
10
;
impl
->
params
.
dwStartDelay
=
params
.
ramp
.
start_delay
.
Duration
/
10
;
impl
->
directions
[
0
]
=
round
(
-
params
.
ramp
.
start_vector
.
X
*
10000
);
impl
->
directions
[
1
]
=
round
(
-
params
.
ramp
.
start_vector
.
Y
*
10000
);
impl
->
directions
[
2
]
=
round
(
-
params
.
ramp
.
start_vector
.
Z
*
10000
);
break
;
case
WineForceFeedbackEffectType_Periodic_SineWave
:
...
...
dlls/windows.gaming.input/provider.idl
View file @
081a2891
...
...
@@ -38,6 +38,7 @@ namespace Windows.Gaming.Input.Custom {
typedef
struct
WineGameControllerState
WineGameControllerState
;
typedef
struct
WineGameControllerVibration
WineGameControllerVibration
;
typedef
struct
WineConstantEffectParameters
WineConstantEffectParameters
;
typedef
struct
WineRampEffectParameters
WineRampEffectParameters
;
typedef
struct
WineForceFeedbackEffectEnvelope
WineForceFeedbackEffectEnvelope
;
typedef
union
WineForceFeedbackEffectParameters
WineForceFeedbackEffectParameters
;
interface
IWineGameControllerProvider
;
...
...
@@ -100,6 +101,17 @@ namespace Windows.Gaming.Input.Custom {
FLOAT
gain
;
}
;
struct
WineRampEffectParameters
{
WineForceFeedbackEffectType
type
;
Windows
.
Foundation.Numerics.Vector3
start_vector
;
Windows
.
Foundation.Numerics.Vector3
end_vector
;
Windows
.
Foundation.TimeSpan
duration
;
Windows
.
Foundation.TimeSpan
start_delay
;
UINT32
repeat_count
;
FLOAT
gain
;
}
;
struct
WineForceFeedbackEffectEnvelope
{
FLOAT
attack_gain
;
...
...
@@ -112,6 +124,7 @@ namespace Windows.Gaming.Input.Custom {
{
WineForceFeedbackEffectType
type
;
WineConstantEffectParameters
constant
;
WineRampEffectParameters
ramp
;
}
;
[
...
...
dlls/windows.gaming.input/ramp_effect.c
View file @
081a2891
...
...
@@ -99,9 +99,23 @@ static HRESULT WINAPI effect_GetTrustLevel( IRampForceEffect *iface, TrustLevel
static
HRESULT
WINAPI
effect_SetParameters
(
IRampForceEffect
*
iface
,
Vector3
start_vector
,
Vector3
end_vector
,
TimeSpan
duration
)
{
FIXME
(
"iface %p, start_vector %s, end_vector %s, duration %I64u stub!
\n
"
,
iface
,
WineForceFeedbackEffectParameters
params
=
{
.
ramp
=
{
.
type
=
WineForceFeedbackEffectType_Ramp
,
.
start_vector
=
start_vector
,
.
end_vector
=
end_vector
,
.
duration
=
duration
,
.
repeat_count
=
1
,
},
};
struct
ramp_effect
*
impl
=
impl_from_IRampForceEffect
(
iface
);
TRACE
(
"iface %p, start_vector %s, end_vector %s, duration %I64u.
\n
"
,
iface
,
debugstr_vector3
(
&
start_vector
),
debugstr_vector3
(
&
end_vector
),
duration
.
Duration
);
return
E_NOTIMPL
;
return
IWineForceFeedbackEffectImpl_put_Parameters
(
impl
->
IWineForceFeedbackEffectImpl_inner
,
params
,
NULL
);
}
static
HRESULT
WINAPI
effect_SetParametersWithEnvelope
(
IRampForceEffect
*
iface
,
Vector3
start_vector
,
Vector3
end_vector
,
FLOAT
attack_gain
,
...
...
@@ -109,11 +123,34 @@ static HRESULT WINAPI effect_SetParametersWithEnvelope( IRampForceEffect *iface,
TimeSpan
attack_duration
,
TimeSpan
sustain_duration
,
TimeSpan
release_duration
,
UINT32
repeat_count
)
{
FIXME
(
"iface %p, start_vector %s, end_vector %s, attack_gain %f, sustain_gain %f, release_gain %f, start_delay %I64u, attack_duration %I64u, "
"sustain_duration %I64u, release_duration %I64u, repeat_count %u stub!
\n
"
,
iface
,
debugstr_vector3
(
&
start_vector
),
debugstr_vector3
(
&
end_vector
),
WineForceFeedbackEffectParameters
params
=
{
.
ramp
=
{
.
type
=
WineForceFeedbackEffectType_Ramp
,
.
start_vector
=
start_vector
,
.
end_vector
=
end_vector
,
.
duration
=
{
attack_duration
.
Duration
+
sustain_duration
.
Duration
+
release_duration
.
Duration
},
.
start_delay
=
start_delay
,
.
repeat_count
=
repeat_count
,
.
gain
=
sustain_gain
,
},
};
WineForceFeedbackEffectEnvelope
envelope
=
{
.
attack_gain
=
attack_gain
,
.
release_gain
=
release_gain
,
.
attack_duration
=
attack_duration
,
.
release_duration
=
release_duration
,
};
struct
ramp_effect
*
impl
=
impl_from_IRampForceEffect
(
iface
);
TRACE
(
"iface %p, start_vector %s, end_vector %s, attack_gain %f, sustain_gain %f, release_gain %f, start_delay %I64u, attack_duration %I64u, "
"sustain_duration %I64u, release_duration %I64u, repeat_count %u.
\n
"
,
iface
,
debugstr_vector3
(
&
start_vector
),
debugstr_vector3
(
&
end_vector
),
attack_gain
,
sustain_gain
,
release_gain
,
start_delay
.
Duration
,
attack_duration
.
Duration
,
sustain_duration
.
Duration
,
release_duration
.
Duration
,
repeat_count
);
return
E_NOTIMPL
;
return
IWineForceFeedbackEffectImpl_put_Parameters
(
impl
->
IWineForceFeedbackEffectImpl_inner
,
params
,
&
envelope
);
}
static
const
struct
IRampForceEffectVtbl
effect_vtbl
=
...
...
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