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
6340a296
Commit
6340a296
authored
May 26, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
May 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Implement IDirectInputDevice_EnumEffects WtoA conversion.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
70b25ccf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
87 deletions
+28
-87
ansi.c
dlls/dinput/ansi.c
+27
-0
device.c
dlls/dinput/device.c
+0
-12
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+1
-75
No files found.
dlls/dinput/ansi.c
View file @
6340a296
...
...
@@ -219,6 +219,33 @@ HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect( IDirectInputDevice8A *ifac
return
IDirectInputDevice8_CreateEffect
(
iface_w
,
guid
,
effect
,
out
,
outer
);
}
struct
enum_effects_wtoa_params
{
LPDIENUMEFFECTSCALLBACKA
callback
;
void
*
ref
;
};
static
BOOL
CALLBACK
enum_effects_wtoa_callback
(
const
DIEFFECTINFOW
*
info_w
,
void
*
ref
)
{
struct
enum_effects_wtoa_params
*
params
=
ref
;
DIEFFECTINFOA
info_a
=
{
sizeof
(
info_a
)};
dieffectinfo_wtoa
(
info_w
,
&
info_a
);
return
params
->
callback
(
&
info_a
,
params
->
ref
);
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_EnumEffects
(
IDirectInputDevice8A
*
iface_a
,
LPDIENUMEFFECTSCALLBACKA
callback
,
void
*
ref
,
DWORD
type
)
{
struct
enum_effects_wtoa_params
params
=
{
callback
,
ref
};
IDirectInputDeviceImpl
*
impl
=
impl_from_IDirectInputDevice8A
(
iface_a
);
IDirectInputDevice8W
*
iface_w
=
IDirectInputDevice8W_from_impl
(
impl
);
if
(
!
callback
)
return
DIERR_INVALIDPARAM
;
return
IDirectInputDevice8_EnumEffects
(
iface_w
,
enum_effects_wtoa_callback
,
&
params
,
type
);
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_GetEffectInfo
(
IDirectInputDevice8A
*
iface_a
,
DIEFFECTINFOA
*
info_a
,
REFGUID
guid
)
{
IDirectInputDeviceImpl
*
impl
=
impl_from_IDirectInputDevice8A
(
iface_a
);
...
...
dlls/dinput/device.c
View file @
6340a296
...
...
@@ -1587,18 +1587,6 @@ HRESULT WINAPI IDirectInputDevice2WImpl_CreateEffect(LPDIRECTINPUTDEVICE8W iface
return
DIERR_UNSUPPORTED
;
}
HRESULT
WINAPI
IDirectInputDevice2AImpl_EnumEffects
(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIENUMEFFECTSCALLBACKA
lpCallback
,
LPVOID
lpvRef
,
DWORD
dwFlags
)
{
IDirectInputDeviceImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
FIXME
(
"%p)->(%p,%p,0x%08x): stub!
\n
"
,
This
,
lpCallback
,
lpvRef
,
dwFlags
);
return
DI_OK
;
}
HRESULT
WINAPI
IDirectInputDevice2WImpl_EnumEffects
(
LPDIRECTINPUTDEVICE8W
iface
,
LPDIENUMEFFECTSCALLBACKW
lpCallback
,
...
...
dlls/dinput/joystick_linuxinput.c
View file @
6340a296
...
...
@@ -1093,80 +1093,6 @@ static HRESULT WINAPI JoystickWImpl_CreateEffect(LPDIRECTINPUTDEVICE8W iface, RE
/*******************************************************************************
* EnumEffects - Enumerate available FF effects
*/
static
HRESULT
WINAPI
JoystickAImpl_EnumEffects
(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIENUMEFFECTSCALLBACKA
lpCallback
,
LPVOID
pvRef
,
DWORD
dwEffType
)
{
#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION
DIEFFECTINFOA
dei
;
/* feif */
DWORD
type
=
DIEFT_GETTYPE
(
dwEffType
);
JoystickImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
TRACE
(
"(this=%p,%p,%d) type=%d
\n
"
,
This
,
pvRef
,
dwEffType
,
type
);
dei
.
dwSize
=
sizeof
(
DIEFFECTINFOA
);
if
((
type
==
DIEFT_ALL
||
type
==
DIEFT_CONSTANTFORCE
)
&&
test_bit
(
This
->
joydev
->
ffbits
,
FF_CONSTANT
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_ConstantForce
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
((
type
==
DIEFT_ALL
||
type
==
DIEFT_PERIODIC
)
&&
test_bit
(
This
->
joydev
->
ffbits
,
FF_PERIODIC
))
{
if
(
test_bit
(
This
->
joydev
->
ffbits
,
FF_SQUARE
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Square
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
joydev
->
ffbits
,
FF_SINE
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Sine
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
joydev
->
ffbits
,
FF_TRIANGLE
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Triangle
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
joydev
->
ffbits
,
FF_SAW_UP
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_SawtoothUp
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
joydev
->
ffbits
,
FF_SAW_DOWN
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_SawtoothDown
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
}
if
((
type
==
DIEFT_ALL
||
type
==
DIEFT_RAMPFORCE
)
&&
test_bit
(
This
->
joydev
->
ffbits
,
FF_RAMP
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_RampForce
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
type
==
DIEFT_ALL
||
type
==
DIEFT_CONDITION
)
{
if
(
test_bit
(
This
->
joydev
->
ffbits
,
FF_SPRING
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Spring
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
joydev
->
ffbits
,
FF_DAMPER
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Damper
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
joydev
->
ffbits
,
FF_INERTIA
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Inertia
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
if
(
test_bit
(
This
->
joydev
->
ffbits
,
FF_FRICTION
))
{
IDirectInputDevice8_GetEffectInfo
(
iface
,
&
dei
,
&
GUID_Friction
);
(
*
lpCallback
)(
&
dei
,
pvRef
);
}
}
#endif
return
DI_OK
;
}
static
HRESULT
WINAPI
JoystickWImpl_EnumEffects
(
LPDIRECTINPUTDEVICE8W
iface
,
LPDIENUMEFFECTSCALLBACKW
lpCallback
,
LPVOID
pvRef
,
...
...
@@ -1428,7 +1354,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
IDirectInputDevice2AImpl_RunControlPanel
,
IDirectInputDevice2AImpl_Initialize
,
IDirectInputDevice2AImpl_CreateEffect
,
Joystick
AImpl_EnumEffects
,
IDirectInputDevice2
AImpl_EnumEffects
,
IDirectInputDevice2AImpl_GetEffectInfo
,
IDirectInputDevice2AImpl_GetForceFeedbackState
,
IDirectInputDevice2AImpl_SendForceFeedbackCommand
,
...
...
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