Merge remote-tracking branch 'remotes/Github_private/back_to_basics2' into automap

This commit is contained in:
Christoph Oelckers 2020-09-06 11:47:35 +02:00
commit 2c183bf504
4 changed files with 13 additions and 28 deletions

View file

@ -87,7 +87,6 @@ BEGIN_SW_NS
void Logo(const CompletionFunc& completion); void Logo(const CompletionFunc& completion);
void StatScreen(int FinishAnim, CompletionFunc completion); void StatScreen(int FinishAnim, CompletionFunc completion);
void getinput(InputPacket*, SWBOOL);
void pClearSpriteList(PLAYERp pp); void pClearSpriteList(PLAYERp pp);

View file

@ -67,8 +67,7 @@ void GameInterface::ResetFollowPos(bool)
Follow_posy = pp->posy; Follow_posy = pp->posy;
} }
void static void getinput(InputPacket *loc)
getinput(InputPacket *loc, SWBOOL tied)
{ {
int i; int i;
PLAYERp pp = Player + myconnectindex; PLAYERp pp = Player + myconnectindex;
@ -111,7 +110,7 @@ getinput(InputPacket *loc, SWBOOL tied)
// If in 2D follow mode, scroll around using glob vars // If in 2D follow mode, scroll around using glob vars
// Tried calling this in domovethings, but key response it too poor, skips key presses // Tried calling this in domovethings, but key response it too poor, skips key presses
// Note: this get called only during follow mode // Note: this get called only during follow mode
if (!tied && automapFollow && automapMode != am_off && pp == Player + myconnectindex && !Prediction) if (automapFollow && automapMode != am_off && pp == Player + myconnectindex && !Prediction)
MoveScrollMode2D(Player + myconnectindex); MoveScrollMode2D(Player + myconnectindex);
// !JIM! Added M_Active() so that you don't move at all while using menus // !JIM! Added M_Active() so that you don't move at all while using menus
@ -175,9 +174,6 @@ getinput(InputPacket *loc, SWBOOL tied)
keymove = NORMALKEYMOVE; keymove = NORMALKEYMOVE;
} }
if (tied)
keymove = 0;
int32_t svel = 0, vel = 0; int32_t svel = 0, vel = 0;
fixed_t q16horz = 0, q16angvel = 0; fixed_t q16horz = 0, q16angvel = 0;
@ -279,23 +275,8 @@ getinput(InputPacket *loc, SWBOOL tied)
pp->oq16horiz += pp->camq16horiz - prevcamq16horiz; pp->oq16horiz += pp->camq16horiz - prevcamq16horiz;
} }
loc->fvel += vel; loc->fvel = clamp(loc->fvel + vel, -MAXVEL, MAXVEL);
loc->svel += svel; loc->svel = clamp(loc->svel + svel, -MAXSVEL, MAXSVEL);
if (!tied)
{
vel = clamp(loc->fvel, -MAXVEL, MAXVEL);
svel = clamp(loc->svel, -MAXSVEL, MAXSVEL);
momx = mulscale9(vel, sintable[NORM_ANGLE(FixedToInt(newpp->q16ang) + 512)]);
momy = mulscale9(vel, sintable[NORM_ANGLE(FixedToInt(newpp->q16ang))]);
momx += mulscale9(svel, sintable[NORM_ANGLE(FixedToInt(newpp->q16ang))]);
momy += mulscale9(svel, sintable[NORM_ANGLE(FixedToInt(newpp->q16ang) + 1536)]);
loc->fvel = momx;
loc->svel = momy;
}
loc->q16avel += q16angvel; loc->q16avel += q16angvel;
loc->q16horz += q16horz; loc->q16horz += q16horz;
@ -380,10 +361,17 @@ getinput(InputPacket *loc, SWBOOL tied)
void GameInterface::GetInput(InputPacket *packet) void GameInterface::GetInput(InputPacket *packet)
{ {
getinput(&loc, FALSE); getinput(&loc);
if (packet) if (packet)
{ {
PLAYERp pp = &Player[myconnectindex]; PLAYERp pp = &Player[myconnectindex];
auto fvel = loc.fvel;
auto svel = loc.svel;
auto ang = FixedToInt(pp->camq16ang);
loc.fvel = mulscale9(fvel, sintable[NORM_ANGLE(ang + 512)]) + mulscale9(svel, sintable[NORM_ANGLE(ang)]);
loc.svel = mulscale9(fvel, sintable[NORM_ANGLE(ang)]) + mulscale9(svel, sintable[NORM_ANGLE(ang + 1536)]);
loc.q16ang = pp->camq16ang; loc.q16ang = pp->camq16ang;
loc.q16horiz = pp->camq16horiz; loc.q16horiz = pp->camq16horiz;
*packet = loc; *packet = loc;

View file

@ -42,8 +42,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS BEGIN_SW_NS
void getinput(InputPacket *, SWBOOL);
static uint8_t tempbuf[576], packbuf[576]; static uint8_t tempbuf[576], packbuf[576];
int PlayClock; int PlayClock;

View file

@ -7378,7 +7378,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.actions || pp->input.fvel || pp->input.svel || pp->input.q16avel || pp->input.q16horz || if (pp->input.actions & ~SB_RUN || 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