- Make the turbo turn functions static within gameinput.cpp.

This commit is contained in:
Mitchell Richters 2023-03-30 23:20:18 +11:00
parent 359371527b
commit 9e1ca0cb8f
3 changed files with 6 additions and 9 deletions

View file

@ -95,17 +95,17 @@ static inline bool scaletozero(DAngle& angle, const double scale, const DAngle p
static double turnheldtime;
void updateTurnHeldAmt(const double scaleAdjust)
static inline void updateTurnHeldAmt(const double scaleAdjust)
{
turnheldtime += getTicrateScale(BUILDTICRATE) * scaleAdjust;
}
bool isTurboTurnTime()
static inline bool isTurboTurnTime()
{
return turnheldtime >= getTicrateScale(TURBOTURNBASE);
}
void resetTurnHeldAmt()
static inline void resetTurnHeldAmt()
{
turnheldtime = 0;
}
@ -238,13 +238,14 @@ void processVehicleInput(HIDInput* const hidInput, InputPacket* const inputBuffe
void clearLocalInputBuffer()
{
inputBuffer = {};
resetTurnHeldAmt();
}
void getInput(const double scaleAdjust, PlayerAngles* const plrAngles, InputPacket* packet)
{
if (M_Active() || gamestate != GS_LEVEL || !plrAngles || !plrAngles->pActor)
{
clearLocalInputBuffer();
inputBuffer = {};
return;
}
@ -267,7 +268,7 @@ void getInput(const double scaleAdjust, PlayerAngles* const plrAngles, InputPack
if (packet)
{
*packet = inputBuffer;
clearLocalInputBuffer();
inputBuffer = {};
}
}

View file

@ -82,9 +82,6 @@ class FSerializer;
FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerAngles& w, PlayerAngles* def);
void updateTurnHeldAmt(const double scaleAdjust);
bool isTurboTurnTime();
void resetTurnHeldAmt();
void clearLocalInputBuffer();
void processVehicleInput(HIDInput* const hidInput, InputPacket* const inputBuffer, InputPacket* const currInput, const double scaleAdjust, const float baseVel, const float velScale, const bool canMove, const bool canTurn, const bool attenuate);
void getInput(const double scaleAdjust, PlayerAngles* const plrAngles, InputPacket* packet = nullptr);

View file

@ -140,7 +140,6 @@ void InputState::ClearAllInput()
crouch_toggle = false;
buttonMap.ResetButtonStates(); // this is important. If all input is cleared, the buttons must be cleared as well.
clearLocalInputBuffer(); // also clear game local input state.
resetTurnHeldAmt();
}