Skip to content

Commit

Permalink
ControllerInterface: Remove unused ClearInputState
Browse files Browse the repository at this point in the history
  • Loading branch information
magcius committed Nov 28, 2014
1 parent 367a42d commit 61fcfc4
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 36 deletions.
Expand Up @@ -148,9 +148,6 @@ bool ControllerInterface::UpdateInput()
{
if (d->UpdateInput())
++ok_count;
//else
// disabled. it might be causing problems
//(*d)->ClearInputState();
}

return (m_devices.size() == ok_count);
Expand Down
Expand Up @@ -149,7 +149,9 @@ Joystick::Joystick( /*const LPCDIDEVICEINSTANCE lpddi, */const LPDIRECTINPUTDEVI
InitForceFeedback(m_device, (int)objects.size());
}

ClearInputState();
ZeroMemory(&m_state_in, sizeof(m_state_in));
// set hats to center
memset(m_state_in.rgdwPOV, 0xFF, sizeof(m_state_in.rgdwPOV));
}

Joystick::~Joystick()
Expand All @@ -158,13 +160,6 @@ Joystick::~Joystick()
m_device->Release();
}

void Joystick::ClearInputState()
{
ZeroMemory(&m_state_in, sizeof(m_state_in));
// set hats to center
memset(m_state_in.rgdwPOV, 0xFF, sizeof(m_state_in.rgdwPOV));
}

std::string Joystick::GetName() const
{
return GetDeviceName(m_device);
Expand Down
Expand Up @@ -54,8 +54,6 @@ class Joystick : public ForceFeedback::ForceFeedbackDevice
public:
bool UpdateInput();

void ClearInputState();

Joystick(const LPDIRECTINPUTDEVICE8 device, const unsigned int index);
~Joystick();

Expand Down
14 changes: 0 additions & 14 deletions Source/Core/InputCommon/ControllerInterface/Device.cpp
Expand Up @@ -66,20 +66,6 @@ Device::Output* Device::FindOutput(const std::string &name) const
return nullptr;
}

//
// Device :: ClearInputState
//
// Device classes should override this function
// ControllerInterface will call this when the device returns failure during UpdateInput
// used to try to set all buttons and axes to their default state when user unplugs a gamepad during play
// buttons/axes that were held down at the time of unplugging should be seen as not pressed after unplugging
//
void Device::ClearInputState()
{
// this is going to be called for every UpdateInput call that fails
// kinda slow but, w/e, should only happen when user unplugs a device while playing
}

bool Device::Control::InputGateOn()
{
if (SConfig::GetInstance().m_BackgroundInput)
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/InputCommon/ControllerInterface/Device.h
Expand Up @@ -103,8 +103,6 @@ class Device
virtual bool UpdateInput() { return true; }
virtual bool UpdateOutput() { return true; }

virtual void ClearInputState();

const std::vector<Input*>& Inputs() const { return m_inputs; }
const std::vector<Output*>& Outputs() const { return m_outputs; }

Expand Down
5 changes: 0 additions & 5 deletions Source/Core/InputCommon/ControllerInterface/XInput/XInput.cpp
Expand Up @@ -165,11 +165,6 @@ Device::Device(const XINPUT_CAPABILITIES& caps, u8 index)
AddOutput(new Motor(i, (&m_state_out.wLeftMotorSpeed)[i], 65535));
}

ClearInputState();
}

void Device::ClearInputState()
{
ZeroMemory(&m_state_in, sizeof(m_state_in));
}

Expand Down
2 changes: 0 additions & 2 deletions Source/Core/InputCommon/ControllerInterface/XInput/XInput.h
Expand Up @@ -76,8 +76,6 @@ class Device : public Core::Device
bool UpdateInput();
bool UpdateOutput();

void ClearInputState();

Device(const XINPUT_CAPABILITIES& capabilities, u8 index);

std::string GetName() const;
Expand Down

0 comments on commit 61fcfc4

Please sign in to comment.