- processMovement(): Re-arrange parameter variables somewhat so game-specific parameters are at the end and to allow some common defaults so they don't need specifying.

This commit is contained in:
Mitchell Richters 2020-09-25 22:26:50 +10:00
parent 73f52b2cee
commit 9b12675f4e
6 changed files with 6 additions and 6 deletions

View file

@ -46,7 +46,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
InputPacket input {}; InputPacket input {};
ApplyGlobalInput(gInput, hidInput); ApplyGlobalInput(gInput, hidInput);
processMovement(&input, &gInput, hidInput, true, scaleAdjust); processMovement(&input, &gInput, hidInput, scaleAdjust);
if (!cl_syncinput && gamestate == GS_LEVEL) if (!cl_syncinput && gamestate == GS_LEVEL)
{ {

View file

@ -1494,7 +1494,7 @@ fixed_t getincangleq16(fixed_t a, fixed_t na)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlInfo* const hidInput, bool const allowstrafe, double const scaleAdjust, double const turnscale, short const drink_amt) void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlInfo* const hidInput, double const scaleAdjust, short const drink_amt, bool const allowstrafe, double const turnscale)
{ {
// set up variables // set up variables
int const running = !!(inputBuffer->actions & SB_RUN); int const running = !!(inputBuffer->actions & SB_RUN);

View file

@ -67,7 +67,7 @@ void CompleteLevel(MapRecord* map);
int getincangle(int c, int n); int getincangle(int c, int n);
fixed_t getincangleq16(fixed_t c, fixed_t n); fixed_t getincangleq16(fixed_t c, fixed_t n);
void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlInfo* const hidInput, bool const allowstrafe, double const scaleAdjust, double const turnscale = 1, short const drink_amt = 0); void processMovement(InputPacket* currInput, InputPacket* inputBuffer, ControlInfo* const hidInput, double const scaleAdjust, short const drink_amt = 0, bool const allowstrafe = true, double const turnscale = 1);
void sethorizon(fixed_t* q16horiz, fixed_t const q16horz, ESyncBits* actions, double const scaleAdjust); void sethorizon(fixed_t* q16horiz, fixed_t const q16horz, ESyncBits* actions, double const scaleAdjust);
void applylook(fixed_t* q16ang, fixed_t* q16look_ang, fixed_t* q16rotscrnang, fixed_t* spin, fixed_t const q16avel, ESyncBits* actions, double const scaleAdjust, bool const crouching); void applylook(fixed_t* q16ang, fixed_t* q16look_ang, fixed_t* q16rotscrnang, fixed_t* spin, fixed_t const q16avel, ESyncBits* actions, double const scaleAdjust, bool const crouching);
void playerAddAngle(fixed_t* q16ang, double* helper, double adjustment); void playerAddAngle(fixed_t* q16ang, double* helper, double adjustment);

View file

@ -119,7 +119,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
} }
else else
{ {
processMovement(&input, &localInput, hidInput, true, scaleAdjust); processMovement(&input, &localInput, hidInput, scaleAdjust);
} }
if (!cl_syncinput) if (!cl_syncinput)

View file

@ -910,7 +910,7 @@ void GameInterface::GetInput(InputPacket* packet, ControlInfo* const hidInput)
else else
{ {
processInputBits(p, hidInput); processInputBits(p, hidInput);
processMovement(&input, &loc, hidInput, true, scaleAdjust, 1, p->drink_amt); processMovement(&input, &loc, hidInput, scaleAdjust, p->drink_amt);
checkCrouchToggle(p); checkCrouchToggle(p);
FinalizeInput(myconnectindex, input, false); FinalizeInput(myconnectindex, input, false);
} }

View file

@ -205,7 +205,7 @@ void GameInterface::GetInput(InputPacket *packet, ControlInfo* const hidInput)
PLAYERp pp = &Player[myconnectindex]; PLAYERp pp = &Player[myconnectindex];
processInputBits(pp, hidInput); processInputBits(pp, hidInput);
processMovement(&input, &loc, hidInput, !pp->sop, scaleAdjust, pp->sop_control ? 3. / 1.40625 : 1.); processMovement(&input, &loc, hidInput, scaleAdjust, 0, !pp->sop, pp->sop_control ? 3. / 1.40625 : 1.);
processWeapon(pp); processWeapon(pp);
if (!cl_syncinput) if (!cl_syncinput)