- Remove GameInput::prepareHidInput() and GameInput::resetHidInput().

* Also reverts 23bff9f701, but changes the loop into a `memset()` call instead.
This commit is contained in:
Mitchell Richters 2023-04-04 20:05:03 +10:00
parent d454455d22
commit 0eba341ac1
5 changed files with 8 additions and 21 deletions

View file

@ -1202,6 +1202,8 @@ void I_GetJoysticks(TArray<IJoystickConfig*>& sticks)
void I_GetAxes(float axes[NUM_JOYAXIS])
{
memset(axes, 0, sizeof(axes));
if (use_joystick && NULL != s_joystickManager)
{
s_joystickManager->AddAxes(axes);

View file

@ -324,6 +324,8 @@ void I_GetJoysticks(TArray<IJoystickConfig *> &sticks)
void I_GetAxes(float axes[NUM_JOYAXIS])
{
memset(axes, 0, sizeof(axes));
if (use_joystick && JoystickManager)
{
JoystickManager->AddAxes(axes);

View file

@ -635,6 +635,8 @@ void I_StartFrame ()
void I_GetAxes(float axes[NUM_JOYAXIS])
{
memset(axes, 0, sizeof(axes));
if (use_joystick)
{
for (unsigned i = 0; i < NUM_JOYDEVICES; ++i)

View file

@ -219,23 +219,6 @@ void GameInput::processVehicle(PlayerAngles* const plrAngles, const float scaleA
}
//---------------------------------------------------------------------------
//
// Prepares received backend input for use throughout class.
//
//---------------------------------------------------------------------------
void GameInput::prepareHidInput()
{
I_GetAxes(joyAxes);
}
void GameInput::resetHidInput()
{
memset(joyAxes, 0, sizeof(joyAxes));
mouseInput.Zero();
}
//---------------------------------------------------------------------------
//
// Processes all the input bits.
@ -345,10 +328,10 @@ void GameInput::getInput(const double scaleAdjust, InputPacket* packet)
return;
}
prepareHidInput();
I_GetAxes(joyAxes);
processInputBits();
gi->doPlayerMovement(!SyncInput() ? (float)scaleAdjust : 1.f);
resetHidInput();
mouseInput.Zero();
if (packet)
{

View file

@ -42,8 +42,6 @@ class GameInput
// Prototypes for private member functions.
void processInputBits();
void prepareHidInput();
void resetHidInput();
public:
// Bit sender updates.