mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 06:54:46 +00:00
joy.cpl: Remove unnecessary joystick forcefeedback member.
This commit is contained in:
parent
9b4cd90850
commit
b274278d0e
|
@ -78,7 +78,6 @@ struct effect
|
||||||
struct Joystick
|
struct Joystick
|
||||||
{
|
{
|
||||||
IDirectInputDevice8W *device;
|
IDirectInputDevice8W *device;
|
||||||
BOOL forcefeedback;
|
|
||||||
|
|
||||||
struct list effects;
|
struct list effects;
|
||||||
IDirectInputEffect *effect_selected;
|
IDirectInputEffect *effect_selected;
|
||||||
|
@ -216,10 +215,10 @@ static BOOL CALLBACK enum_effects( const DIEFFECTINFOW *info, void *context )
|
||||||
|
|
||||||
static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *context)
|
static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *context)
|
||||||
{
|
{
|
||||||
|
DIDEVCAPS caps = {.dwSize = sizeof(DIDEVCAPS)};
|
||||||
struct JoystickData *data = context;
|
struct JoystickData *data = context;
|
||||||
struct Joystick *joystick;
|
struct Joystick *joystick;
|
||||||
DIPROPRANGE proprange;
|
DIPROPRANGE proprange;
|
||||||
DIDEVCAPS caps;
|
|
||||||
|
|
||||||
if (data->joysticks == NULL)
|
if (data->joysticks == NULL)
|
||||||
{
|
{
|
||||||
|
@ -233,15 +232,11 @@ static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *cont
|
||||||
IDirectInput8_CreateDevice(data->di, &instance->guidInstance, &joystick->device, NULL);
|
IDirectInput8_CreateDevice(data->di, &instance->guidInstance, &joystick->device, NULL);
|
||||||
IDirectInputDevice8_SetDataFormat(joystick->device, &c_dfDIJoystick);
|
IDirectInputDevice8_SetDataFormat(joystick->device, &c_dfDIJoystick);
|
||||||
|
|
||||||
caps.dwSize = sizeof(caps);
|
|
||||||
IDirectInputDevice8_GetCapabilities(joystick->device, &caps);
|
|
||||||
|
|
||||||
joystick->forcefeedback = caps.dwFlags & DIDC_FORCEFEEDBACK;
|
|
||||||
|
|
||||||
list_init( &joystick->effects );
|
list_init( &joystick->effects );
|
||||||
joystick->effect_selected = NULL;
|
joystick->effect_selected = NULL;
|
||||||
|
|
||||||
if (joystick->forcefeedback) data->num_ff++;
|
IDirectInputDevice8_GetCapabilities(joystick->device, &caps);
|
||||||
|
if (caps.dwFlags & DIDC_FORCEFEEDBACK) data->num_ff++;
|
||||||
|
|
||||||
/* Set axis range to ease the GUI visualization */
|
/* Set axis range to ease the GUI visualization */
|
||||||
proprange.diph.dwSize = sizeof(DIPROPRANGE);
|
proprange.diph.dwSize = sizeof(DIPROPRANGE);
|
||||||
|
@ -252,9 +247,6 @@ static BOOL CALLBACK enum_callback(const DIDEVICEINSTANCEW *instance, void *cont
|
||||||
proprange.lMax = TEST_AXIS_MAX;
|
proprange.lMax = TEST_AXIS_MAX;
|
||||||
|
|
||||||
IDirectInputDevice_SetProperty(joystick->device, DIPROP_RANGE, &proprange.diph);
|
IDirectInputDevice_SetProperty(joystick->device, DIPROP_RANGE, &proprange.diph);
|
||||||
|
|
||||||
if (!joystick->forcefeedback) return DIENUM_CONTINUE;
|
|
||||||
|
|
||||||
IDirectInputDevice8_EnumEffects( joystick->device, enum_effects, (void *)joystick, 0 );
|
IDirectInputDevice8_EnumEffects( joystick->device, enum_effects, (void *)joystick, 0 );
|
||||||
|
|
||||||
return DIENUM_CONTINUE;
|
return DIENUM_CONTINUE;
|
||||||
|
|
Loading…
Reference in a new issue