- Duke: Floatify player_struct::fric.

This commit is contained in:
Mitchell Richters 2022-09-14 22:15:24 +10:00 committed by Christoph Oelckers
parent 6310b06118
commit a178ef1ff6
3 changed files with 8 additions and 7 deletions

View file

@ -4254,8 +4254,8 @@ void handle_se26(DDukeActor* actor)
for (int p = connecthead; p >= 0; p = connectpoint2[p])
if (ps[p].GetActor()->sector() == actor->sector() && ps[p].on_ground)
{
ps[p].fric.X += int(vect.X * 512);
ps[p].fric.Y += int(vect.Y * 512);
ps[p].fric.X += vect.X;
ps[p].fric.Y += vect.Y;
ps[p].pos.Z += zvel;
}
@ -4378,8 +4378,8 @@ void handle_se24(DDukeActor *actor, bool scroll, int shift)
{
if (abs(ps[p].pos.Z - ps[p].truefz) < gs.playerheight + 9)
{
ps[p].fric.X += x << 3;
ps[p].fric.Y += y << 3;
ps[p].fric.X += x * (1. / 64.);
ps[p].fric.Y += y * (1. / 64.);
}
}
}

View file

@ -852,8 +852,8 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju
if (packet)
{
*packet = loc;
packet->fvel = MulScale(loc.fvel, p->angle.ang.Cos() * (1 << 14), 9) - MulScale(loc.svel, p->angle.ang.Sin() * (1 << 14), 9) + p->fric.X;
packet->svel = MulScale(loc.fvel, p->angle.ang.Sin() * (1 << 14), 9) + MulScale(loc.svel, p->angle.ang.Cos() * (1 << 14), 9) + p->fric.Y;
packet->fvel = MulScale(loc.fvel, p->angle.ang.Cos() * (1 << 14), 9) - MulScale(loc.svel, p->angle.ang.Sin() * (1 << 14), 9) + p->fric.X * 512.;
packet->svel = MulScale(loc.fvel, p->angle.ang.Sin() * (1 << 14), 9) + MulScale(loc.svel, p->angle.ang.Cos() * (1 << 14), 9) + p->fric.Y * 512.;
loc = {};
}
}

View file

@ -205,6 +205,7 @@ struct player_struct
DVector3 vel;
DVector3 pos, opos;
DVector2 bobpos;
DVector2 fric;
// player's horizon and angle structs.
PlayerHorizon horizon;
@ -218,7 +219,7 @@ struct player_struct
PalEntry pals;
// this was a global variable originally.
vec2_t fric, exit, loogie[64];
vec2_t exit, loogie[64];
// weapon drawer variables and their interpolation counterparts.
int weapon_sway;