Fixes for 0 based joysticks and joystick axes in simulation.

Change-Id: I67608450d0818b38f6d5b5c709190433f2dc5cf5
This commit is contained in:
Alex Henning
2014-11-06 18:54:30 -05:00
parent 18de3aebdd
commit 3b53f84c8f
7 changed files with 54 additions and 35 deletions

View File

@@ -70,7 +70,7 @@ void Joystick::InitJoystick(uint32_t numAxisTypes, uint32_t numButtonTypes)
joysticks[i] = NULL;
joySticksInitialized = true;
}
joysticks[m_port - 1] = this;
joysticks[m_port] = this;
m_ds = DriverStation::GetInstance();
m_axes = new uint32_t[numAxisTypes];
@@ -79,11 +79,11 @@ void Joystick::InitJoystick(uint32_t numAxisTypes, uint32_t numButtonTypes)
Joystick * Joystick::GetStickForPort(uint32_t port)
{
Joystick *stick = joysticks[port - 1];
Joystick *stick = joysticks[port];
if (stick == NULL)
{
stick = new Joystick(port);
joysticks[port - 1] = stick;
joysticks[port] = stick;
}
return stick;
}