- SW: Rename q16horz to q16horiz and q16aimvel to q16horz for consistency and to avoid confusion down the track.

This commit is contained in:
Mitchell Richters 2020-08-27 08:00:50 +10:00
parent 78a024a50c
commit 55f688b13f
4 changed files with 26 additions and 26 deletions

View file

@ -173,7 +173,7 @@ struct InputPacket
int16_t fvel; int16_t fvel;
fix16_t q16avel; fix16_t q16avel;
fix16_t q16horz; fix16_t q16horz;
fix16_t q16aimvel; // only used by SW fix16_t q16horiz; // only used by SW
fix16_t q16ang; // only used by SW fix16_t q16ang; // only used by SW
// Making this a union lets some constructs fail. Since these names are transitional only the added memory use doesn't really matter. // Making this a union lets some constructs fail. Since these names are transitional only the added memory use doesn't really matter.

View file

@ -75,7 +75,7 @@ double elapsedInputTicks;
double scaleAdjustmentToInterval(double x) { return x * (120 / synctics) / (1000.0 / elapsedInputTicks); } double scaleAdjustmentToInterval(double x) { return x * (120 / synctics) / (1000.0 / elapsedInputTicks); }
void DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16angvel); void DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16angvel);
void DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel); void DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16horz);
void GameInterface::ResetFollowPos(bool) void GameInterface::ResetFollowPos(bool)
@ -195,7 +195,7 @@ getinput(InputPacket *loc, SWBOOL tied)
keymove = 0; keymove = 0;
int32_t svel = 0, vel = 0; int32_t svel = 0, vel = 0;
fix16_t q16aimvel = 0, q16angvel = 0; fix16_t q16horz = 0, q16angvel = 0;
if (buttonMap.ButtonDown(gamefunc_Strafe) && !pp->sop) if (buttonMap.ButtonDown(gamefunc_Strafe) && !pp->sop)
{ {
@ -209,14 +209,14 @@ getinput(InputPacket *loc, SWBOOL tied)
} }
if (mouseaim) if (mouseaim)
q16aimvel = fix16_ssub(q16aimvel, fix16_from_float(info.mousey / aimvelScale)); q16horz = fix16_ssub(q16horz, fix16_from_float(info.mousey / aimvelScale));
else else
vel -= (info.mousey * ticrateScale) * 8.f; vel -= (info.mousey * ticrateScale) * 8.f;
if (in_mouseflip) if (in_mouseflip)
q16aimvel = -q16aimvel; q16horz = -q16horz;
q16aimvel -= fix16_from_dbl(scaleAdjustmentToInterval((info.dpitch * ticrateScale) / aimvelScale)); q16horz -= fix16_from_dbl(scaleAdjustmentToInterval((info.dpitch * ticrateScale) / aimvelScale));
svel -= info.dx * keymove; svel -= info.dx * keymove;
vel -= info.dz * keymove; vel -= info.dz * keymove;
@ -276,13 +276,13 @@ getinput(InputPacket *loc, SWBOOL tied)
vel += -keymove; vel += -keymove;
q16angvel = fix16_clamp(q16angvel, -fix16_from_int(MAXANGVEL), fix16_from_int(MAXANGVEL)); q16angvel = fix16_clamp(q16angvel, -fix16_from_int(MAXANGVEL), fix16_from_int(MAXANGVEL));
q16aimvel = fix16_clamp(q16aimvel, -fix16_from_int(MAXHORIZVEL), fix16_from_int(MAXHORIZVEL)); q16horz = fix16_clamp(q16horz, -fix16_from_int(MAXHORIZVEL), fix16_from_int(MAXHORIZVEL));
void DoPlayerTeleportPause(PLAYERp pp); void DoPlayerTeleportPause(PLAYERp pp);
if (PedanticMode) if (PedanticMode)
{ {
q16angvel = fix16_floor(q16angvel); q16angvel = fix16_floor(q16angvel);
q16aimvel = fix16_floor(q16aimvel); q16horz = fix16_floor(q16horz);
} }
else else
{ {
@ -291,7 +291,7 @@ getinput(InputPacket *loc, SWBOOL tied)
if (TEST(pp->Flags2, PF2_INPUT_CAN_TURN)) if (TEST(pp->Flags2, PF2_INPUT_CAN_TURN))
DoPlayerTurn(pp, &pp->camq16ang, q16angvel); DoPlayerTurn(pp, &pp->camq16ang, q16angvel);
if (TEST(pp->Flags2, PF2_INPUT_CAN_AIM)) if (TEST(pp->Flags2, PF2_INPUT_CAN_AIM))
DoPlayerHorizon(pp, &pp->camq16horiz, q16aimvel); DoPlayerHorizon(pp, &pp->camq16horiz, q16horz);
pp->oq16ang += pp->camq16ang - prevcamq16ang; pp->oq16ang += pp->camq16ang - prevcamq16ang;
pp->oq16horiz += pp->camq16horiz - prevcamq16horiz; pp->oq16horiz += pp->camq16horiz - prevcamq16horiz;
} }
@ -315,7 +315,7 @@ getinput(InputPacket *loc, SWBOOL tied)
} }
loc->q16avel += q16angvel; loc->q16avel += q16angvel;
loc->q16aimvel += q16aimvel; loc->q16horz += q16horz;
if (!CommEnabled) if (!CommEnabled)
{ {

View file

@ -80,9 +80,9 @@ typedef struct
int32_t fvel; int32_t fvel;
int32_t svel; int32_t svel;
fix16_t q16avel; fix16_t q16avel;
fix16_t q16aimvel;
fix16_t q16ang;
fix16_t q16horz; fix16_t q16horz;
fix16_t q16ang;
fix16_t q16horiz;
int32_t bits; int32_t bits;
} SW_AVERAGE_PACKET; } SW_AVERAGE_PACKET;
@ -200,9 +200,9 @@ UpdateInputs(void)
AveragePacket.fvel += loc.fvel; AveragePacket.fvel += loc.fvel;
AveragePacket.svel += loc.svel; AveragePacket.svel += loc.svel;
AveragePacket.q16avel += loc.q16avel; AveragePacket.q16avel += loc.q16avel;
AveragePacket.q16aimvel += loc.q16aimvel; AveragePacket.q16horz += loc.q16horz;
AveragePacket.q16ang = Player[myconnectindex].camq16ang; AveragePacket.q16ang = Player[myconnectindex].camq16ang;
AveragePacket.q16horz = Player[myconnectindex].camq16horiz; AveragePacket.q16horiz = Player[myconnectindex].camq16horiz;
SET(AveragePacket.bits, loc.bits); SET(AveragePacket.bits, loc.bits);
Bmemset(&loc, 0, sizeof(loc)); Bmemset(&loc, 0, sizeof(loc));
@ -222,9 +222,9 @@ UpdateInputs(void)
loc.fvel = AveragePacket.fvel / MovesPerPacket; loc.fvel = AveragePacket.fvel / MovesPerPacket;
loc.svel = AveragePacket.svel / MovesPerPacket; loc.svel = AveragePacket.svel / MovesPerPacket;
loc.q16avel = fix16_div(AveragePacket.q16avel, fix16_from_int(MovesPerPacket)); loc.q16avel = fix16_div(AveragePacket.q16avel, fix16_from_int(MovesPerPacket));
loc.q16aimvel = fix16_div(AveragePacket.q16aimvel, fix16_from_int(MovesPerPacket)); loc.q16horz = fix16_div(AveragePacket.q16horz, fix16_from_int(MovesPerPacket));
loc.q16ang = AveragePacket.q16ang; loc.q16ang = AveragePacket.q16ang;
loc.q16horz = AveragePacket.q16horz; loc.q16horiz = AveragePacket.q16horiz;
loc.bits = AveragePacket.bits; loc.bits = AveragePacket.bits;
memset(&AveragePacket, 0, sizeof(AveragePacket)); memset(&AveragePacket, 0, sizeof(AveragePacket));

View file

@ -1911,7 +1911,7 @@ PlayerAutoLook(PLAYERp pp)
extern int PlaxCeilGlobZadjust, PlaxFloorGlobZadjust; extern int PlaxCeilGlobZadjust, PlaxFloorGlobZadjust;
void void
DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel) DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16horz)
{ {
int i; int i;
#define HORIZ_SPEED (16) #define HORIZ_SPEED (16)
@ -1922,7 +1922,7 @@ DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel)
if (!PedanticMode && (pq16horiz == &pp->q16horiz)) if (!PedanticMode && (pq16horiz == &pp->q16horiz))
{ {
SET(pp->Flags2, PF2_INPUT_CAN_AIM); SET(pp->Flags2, PF2_INPUT_CAN_AIM);
pp->q16horiz = pp->input.q16horz; pp->q16horiz = pp->input.q16horiz;
if ((pp == &Player[myconnectindex]) || (pp == ppp)) // No coop view? if ((pp == &Player[myconnectindex]) || (pp == ppp)) // No coop view?
pp->oq16horiz = pp->q16horiz; pp->oq16horiz = pp->q16horiz;
return; return;
@ -1932,9 +1932,9 @@ DoPlayerHorizon(PLAYERp pp, fix16_t *pq16horiz, fix16_t q16aimvel)
if (cl_slopetilting) if (cl_slopetilting)
PlayerAutoLook(pp); PlayerAutoLook(pp);
if (q16aimvel) if (q16horz)
{ {
pp->q16horizbase += q16aimvel; pp->q16horizbase += q16horz;
SET(pp->Flags, PF_LOCK_HORIZ | PF_LOOKING); SET(pp->Flags, PF_LOCK_HORIZ | PF_LOOKING);
} }
@ -2717,7 +2717,7 @@ DoPlayerMove(PLAYERp pp)
DoPlayerSetWadeDepth(pp); DoPlayerSetWadeDepth(pp);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel); DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
if (pp->cursectnum >= 0 && TEST(sector[pp->cursectnum].extra, SECTFX_DYNAMIC_AREA)) if (pp->cursectnum >= 0 && TEST(sector[pp->cursectnum].extra, SECTFX_DYNAMIC_AREA))
{ {
@ -2925,7 +2925,7 @@ DoPlayerMoveBoat(PLAYERp pp)
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->posx, pp->posy); OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->posx, pp->posy);
pp->cursectnum = save_sectnum; // for speed pp->cursectnum = save_sectnum; // for speed
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel); DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
} }
void DoTankTreads(PLAYERp pp) void DoTankTreads(PLAYERp pp)
@ -3404,7 +3404,7 @@ DoPlayerMoveTank(PLAYERp pp)
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->posx, pp->posy); OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->posx, pp->posy);
pp->cursectnum = save_sectnum; // for speed pp->cursectnum = save_sectnum; // for speed
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel); DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
DoTankTreads(pp); DoTankTreads(pp);
} }
@ -3421,7 +3421,7 @@ DoPlayerMoveTurret(PLAYERp pp)
OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->sop->xmid, pp->sop->ymid); OperateSectorObject(pp->sop, fix16_to_int(pp->q16ang), pp->sop->xmid, pp->sop->ymid);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel); DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
} }
void void
@ -3998,7 +3998,7 @@ DoPlayerClimb(PLAYERp pp)
sp->z = pp->posz + PLAYER_HEIGHT; sp->z = pp->posz + PLAYER_HEIGHT;
changespritesect(pp->PlayerSprite, pp->cursectnum); changespritesect(pp->PlayerSprite, pp->cursectnum);
DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16aimvel); DoPlayerHorizon(pp, &pp->q16horiz, pp->input.q16horz);
if (FAF_ConnectArea(pp->cursectnum)) if (FAF_ConnectArea(pp->cursectnum))
{ {
@ -7426,7 +7426,7 @@ void ChopsCheck(PLAYERp pp)
{ {
if (!M_Active() && !TEST(pp->Flags, PF_DEAD) && !pp->sop_riding && numplayers <= 1) if (!M_Active() && !TEST(pp->Flags, PF_DEAD) && !pp->sop_riding && numplayers <= 1)
{ {
if ((pp->input.bits|pp->input.fvel|pp->input.svel|pp->input.q16avel|pp->input.q16aimvel) || if ((pp->input.bits|pp->input.fvel|pp->input.svel|pp->input.q16avel|pp->input.q16horz) ||
TEST(pp->Flags, PF_CLIMBING|PF_FALLING|PF_DIVING)) TEST(pp->Flags, PF_CLIMBING|PF_FALLING|PF_DIVING))
{ {
// Hit a input key or other reason to stop chops // Hit a input key or other reason to stop chops