- Remove GameInterface::reapplyInputBits() and directly perform operation in GameTicker().

This commit is contained in:
Mitchell Richters 2023-10-02 18:11:51 +11:00
parent 02bd017d07
commit 6de8fc91d6
6 changed files with 2 additions and 8 deletions

View file

@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "menu.h"
#include "gamestate.h"
#include "gameinput.h"
#include "coreplayer.h"
#include "g_input.h"
#include "d_net.h"
@ -276,10 +277,8 @@ void GameInput::processInputBits()
}
else dpad_lock = 0;
gi->reapplyInputBits(&inputBuffer);
const auto crouchState = gi->getCrouchState();
inputBuffer.actions |= ActionsToSend;
inputBuffer.actions |= ActionsToSend | (PlayerArray[myconnectindex]->cmd.ucmd.actions & SB_CENTERVIEW);
ActionsToSend = 0;
if (buttonMap.ButtonDown(gamefunc_Aim_Up) || (buttonMap.ButtonDown(gamefunc_Dpad_Aiming) && joyAxes[JOYAXIS_Forward] > 0))

View file

@ -116,7 +116,6 @@ struct GameInterface
virtual void RemoveQAVInterpProps(const int res_id) { }
virtual bool WantEscape() { return false; }
virtual void StartSoundEngine() = 0;
virtual void reapplyInputBits(InputPacket* const input) = 0;
virtual void doPlayerMovement(const float scaleAdjust) = 0;
virtual unsigned getCrouchState() = 0;

View file

@ -136,7 +136,6 @@ struct GameInterface : public ::GameInterface
void AddQAVInterpProps(const int res_id, const FString& interptype, const bool loopable, const TMap<int, TArray<int>>&& ignoredata) override;
void RemoveQAVInterpProps(const int res_id) override;
void StartSoundEngine() override;
void reapplyInputBits(InputPacket* const input) override { input->actions |= getPlayer(myconnectindex)->cmd.ucmd.actions & (~(SB_BUTTON_MASK | SB_RUN | SB_WEAPONMASK_BITS) | SB_CENTERVIEW); }
void doPlayerMovement(const float scaleAdjust) override { gameInput.processMovement(&getPlayer(myconnectindex)->Angles, scaleAdjust); }
unsigned getCrouchState() override;
};

View file

@ -37,7 +37,6 @@ struct GameInterface : public ::GameInterface
void SerializeGameState(FSerializer& arc) override;
void ExitFromMenu() override;
void DrawPlayerSprite(const DVector2& origin, bool onteam) override;
void reapplyInputBits(InputPacket* const input) override { input->actions |= PlayerArray[myconnectindex]->cmd.ucmd.actions & SB_CENTERVIEW; }
void doPlayerMovement(const float scaleAdjust) override;
unsigned getCrouchState() override;
void UpdateSounds() override;

View file

@ -239,7 +239,6 @@ struct GameInterface : public ::GameInterface
void processSprites(tspriteArray& tsprites, const DVector3& view, DAngle viewang, double interpfrac) override;
int GetCurrentSkill() override;
void StartSoundEngine() override;
void reapplyInputBits(InputPacket* const input) override { input->actions |= getPlayer(nLocalPlayer)->cmd.ucmd.actions & SB_CENTERVIEW; }
void doPlayerMovement(const float scaleAdjust) override { gameInput.processMovement(&getPlayer(nLocalPlayer)->Angles, scaleAdjust); }
unsigned getCrouchState() override;
};

View file

@ -1901,7 +1901,6 @@ struct GameInterface : public ::GameInterface
int GetCurrentSkill() override;
void StartSoundEngine() override;
unsigned getCrouchState() override;
void reapplyInputBits(InputPacket* const input) override { input->actions |= getPlayer(myconnectindex)->cmd.ucmd.actions & SB_CENTERVIEW; }
void doPlayerMovement(const float scaleAdjust) override
{
const auto pp = getPlayer(myconnectindex);