- Don't loop through all joystick axes and zero them in I_GetAxes().

* The caller should be passing a 0-init'd array through.
This commit is contained in:
Mitchell Richters 2023-04-04 09:55:44 +10:00
parent 133c8fa80b
commit 23bff9f701
3 changed files with 1 additions and 16 deletions

View file

@ -1202,11 +1202,6 @@ void I_GetJoysticks(TArray<IJoystickConfig*>& sticks)
void I_GetAxes(float axes[NUM_JOYAXIS])
{
for (size_t i = 0; i < NUM_JOYAXIS; ++i)
{
axes[i] = 0.0f;
}
if (use_joystick && NULL != s_joystickManager)
{
s_joystickManager->AddAxes(axes);

View file

@ -324,10 +324,6 @@ void I_GetJoysticks(TArray<IJoystickConfig *> &sticks)
void I_GetAxes(float axes[NUM_JOYAXIS])
{
for (int i = 0; i < NUM_JOYAXIS; ++i)
{
axes[i] = 0;
}
if (use_joystick && JoystickManager)
{
JoystickManager->AddAxes(axes);

View file

@ -635,15 +635,9 @@ void I_StartFrame ()
void I_GetAxes(float axes[NUM_JOYAXIS])
{
int i;
for (i = 0; i < NUM_JOYAXIS; ++i)
{
axes[i] = 0;
}
if (use_joystick)
{
for (i = 0; i < NUM_JOYDEVICES; ++i)
for (unsigned i = 0; i < NUM_JOYDEVICES; ++i)
{
if (JoyDevices[i] != NULL)
{