mirror of https://github.com/PCSX2/pcsx2.git
USB: Properly initialise effect unions (C rules gotcha)
This commit is contained in:
parent
a979d2283f
commit
c679de8e39
|
@ -31,6 +31,10 @@ namespace usb_pad
|
||||||
SDLFFDevice::SDLFFDevice(SDL_Haptic* haptic)
|
SDLFFDevice::SDLFFDevice(SDL_Haptic* haptic)
|
||||||
: m_haptic(haptic)
|
: m_haptic(haptic)
|
||||||
{
|
{
|
||||||
|
std::memset(&m_constant_effect, 0, sizeof(m_constant_effect));
|
||||||
|
std::memset(&m_spring_effect, 0, sizeof(m_spring_effect));
|
||||||
|
std::memset(&m_damper_effect, 0, sizeof(m_damper_effect));
|
||||||
|
std::memset(&m_friction_effect, 0, sizeof(m_friction_effect));
|
||||||
}
|
}
|
||||||
|
|
||||||
SDLFFDevice::~SDLFFDevice()
|
SDLFFDevice::~SDLFFDevice()
|
||||||
|
|
|
@ -45,19 +45,19 @@ namespace usb_pad
|
||||||
|
|
||||||
SDL_Haptic* m_haptic = nullptr;
|
SDL_Haptic* m_haptic = nullptr;
|
||||||
|
|
||||||
SDL_HapticEffect m_constant_effect = {};
|
SDL_HapticEffect m_constant_effect;
|
||||||
int m_constant_effect_id = -1;
|
int m_constant_effect_id = -1;
|
||||||
bool m_constant_effect_running = false;
|
bool m_constant_effect_running = false;
|
||||||
|
|
||||||
SDL_HapticEffect m_spring_effect = {};
|
SDL_HapticEffect m_spring_effect;
|
||||||
int m_spring_effect_id = -1;
|
int m_spring_effect_id = -1;
|
||||||
bool m_spring_effect_running = false;
|
bool m_spring_effect_running = false;
|
||||||
|
|
||||||
SDL_HapticEffect m_damper_effect = {};
|
SDL_HapticEffect m_damper_effect;
|
||||||
int m_damper_effect_id = -1;
|
int m_damper_effect_id = -1;
|
||||||
bool m_damper_effect_running = false;
|
bool m_damper_effect_running = false;
|
||||||
|
|
||||||
SDL_HapticEffect m_friction_effect = {};
|
SDL_HapticEffect m_friction_effect;
|
||||||
int m_friction_effect_id = -1;
|
int m_friction_effect_id = -1;
|
||||||
bool m_friction_effect_running = false;
|
bool m_friction_effect_running = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue