- Make legacy weapon drawers in PlayerAngles local to Redneck code, they will eventually go.

This commit is contained in:
Mitchell Richters 2022-12-11 11:54:00 +11:00 committed by Christoph Oelckers
parent 318ff64f36
commit cca36b8061
5 changed files with 22 additions and 25 deletions

View file

@ -111,10 +111,6 @@ struct PlayerAngles
}
}
// Miscellaneous helpers.
double angLOOKANGHALF(double const interpfrac) { return angLERPLOOKANG(interpfrac).Normalized180().Degrees() * (128. / 45.); }
double angLOOKINGARC(double const interpfrac) { return fabs(angLERPLOOKANG(interpfrac).Normalized180().Degrees() * (1024. / 1620.)); }
// Legacy, to be removed.
DAngle horizSUM(const double interpfrac = 1) { return ZzHORIZON() + interpolatedvalue(PrevViewAngles.Pitch, ViewAngles.Pitch, interpfrac); }

View file

@ -133,8 +133,10 @@ void displayweapon_r(int snum, double interpfrac)
TiltStatus = p->TiltStatus;
}
look_anghalf = p->Angles.angLOOKANGHALF(interpfrac);
looking_arc = p->Angles.angLOOKINGARC(interpfrac);
auto playerLook = interpolatedvalue(p->Angles.PrevViewAngles.Yaw, p->Angles.ViewAngles.Yaw, interpfrac);
look_anghalf = playerLook.Normalized180().Degrees() * (128. / 45.);
looking_arc = fabs(playerLook.Normalized180().Degrees() * (1024. / 1620.));
hard_landing *= 8.;
gun_pos -= fabs(p->GetActor()->spr.scale.X < 0.125 ? BobVal(weapon_sway * 4.) * 32 : BobVal(weapon_sway * 0.5) * 16);

View file

@ -1000,13 +1000,12 @@ void DrawWeapons(double interpfrac)
nShade = PlayerList[nLocalPlayer].pActor->spr.shade;
}
double const look_anghalf = PlayerList[nLocalPlayer].Angles.angLOOKANGHALF(interpfrac);
double const looking_arc = PlayerList[nLocalPlayer].Angles.angLOOKINGARC(interpfrac);
const auto weaponOffsets = PlayerList[nLocalPlayer].Angles.getWeaponOffsets(interpfrac);
const auto angle = -weaponOffsets.second;
xOffset += weaponOffsets.first.X;
yOffset += weaponOffsets.first.Y;
xOffset -= look_anghalf;
yOffset += looking_arc;
seq_DrawGunSequence(var_28, PlayerList[nLocalPlayer].nSeqSize2, xOffset, yOffset, nShade, nPal, screenalign);
seq_DrawGunSequence(var_28, PlayerList[nLocalPlayer].nSeqSize2, xOffset, yOffset, nShade, nPal, angle, screenalign);
if (nWeapon != kWeaponM60)
return;
@ -1042,7 +1041,7 @@ void DrawWeapons(double interpfrac)
nSeqOffset = var_30 + 4;
}
seq_DrawGunSequence(nSeqOffset, PlayerList[nLocalPlayer].nSeqSize2, xOffset, yOffset, nShade, nPal);
seq_DrawGunSequence(nSeqOffset, PlayerList[nLocalPlayer].nSeqSize2, xOffset, yOffset, nShade, nPal, angle);
return;
}
case 1:
@ -1055,25 +1054,25 @@ void DrawWeapons(double interpfrac)
return;
}
seq_DrawGunSequence(var_30 + 8, edx, xOffset, yOffset, nShade, nPal);
seq_DrawGunSequence(var_30 + 8, edx, xOffset, yOffset, nShade, nPal, angle);
if (nClip <= 3) {
return;
}
seq_DrawGunSequence(var_30 + 9, edx, xOffset, yOffset, nShade, nPal);
seq_DrawGunSequence(var_30 + 9, edx, xOffset, yOffset, nShade, nPal, angle);
if (nClip <= 6) {
return;
}
seq_DrawGunSequence(var_30 + 10, edx, xOffset, yOffset, nShade, nPal);
seq_DrawGunSequence(var_30 + 10, edx, xOffset, yOffset, nShade, nPal, angle);
if (nClip <= 25) {
return;
}
seq_DrawGunSequence(var_30 + 11, edx, xOffset, yOffset, nShade, nPal);
seq_DrawGunSequence(var_30 + 11, edx, xOffset, yOffset, nShade, nPal, angle);
return;
}
case 2:
@ -1086,25 +1085,25 @@ void DrawWeapons(double interpfrac)
return;
}
seq_DrawGunSequence(var_30 + 8, dx, xOffset, yOffset, nShade, nPal);
seq_DrawGunSequence(var_30 + 8, dx, xOffset, yOffset, nShade, nPal, angle);
if (nClip <= 3) {
return;
}
seq_DrawGunSequence(var_30 + 9, dx, xOffset, yOffset, nShade, nPal);
seq_DrawGunSequence(var_30 + 9, dx, xOffset, yOffset, nShade, nPal, angle);
if (nClip <= 6) {
return;
}
seq_DrawGunSequence(var_30 + 10, dx, xOffset, yOffset, nShade, nPal);
seq_DrawGunSequence(var_30 + 10, dx, xOffset, yOffset, nShade, nPal, angle);
if (nClip <= 25) {
return;
}
seq_DrawGunSequence(var_30 + 11, dx, xOffset, yOffset, nShade, nPal);
seq_DrawGunSequence(var_30 + 11, dx, xOffset, yOffset, nShade, nPal, angle);
return;
}
@ -1141,7 +1140,7 @@ void DrawWeapons(double interpfrac)
nSeqOffset = var_30 + 17;
}
seq_DrawGunSequence(nSeqOffset, ax, xOffset, yOffset, nShade, nPal);
seq_DrawGunSequence(nSeqOffset, ax, xOffset, yOffset, nShade, nPal, angle);
return;
}
}

View file

@ -426,7 +426,7 @@ void seq_DrawPilotLightSeq(double xOffset, double yOffset)
//
//---------------------------------------------------------------------------
int seq_DrawGunSequence(int nSeqOffset, int16_t dx, double xOffs, double yOffs, int nShade, int nPal, bool align)
int seq_DrawGunSequence(int nSeqOffset, int16_t dx, double xOffs, double yOffs, int nShade, int nPal, DAngle angle, bool align)
{
int nFrame = SeqBase[nSeqOffset] + dx;
int nFrameBase = FrameBase[nFrame];
@ -461,7 +461,7 @@ int seq_DrawGunSequence(int nSeqOffset, int16_t dx, double xOffs, double yOffs,
alpha = 0.3;
}
hud_drawsprite(x + xOffs, y + yOffs, 65536, 0, nTile, nShade, nPal, stat, alpha);
hud_drawsprite(x + xOffs, y + yOffs, 65536, angle.Buildfang(), nTile, nShade, nPal, stat, alpha);
nFrameBase++;
}

View file

@ -137,7 +137,7 @@ int seq_GetSeqPicnum2(int16_t nSeq, int16_t nFrame);
int seq_GetSeqPicnum(int16_t nSeq, int16_t edx, int16_t ebx);
void seq_DrawStatusSequence(int16_t nSequence, uint16_t edx, int16_t ebx);
int seq_DrawGunSequence(int nSeqOffset, int16_t dx, double xOffs, double yOffs, int nShade, int nPal, bool align = false);
int seq_DrawGunSequence(int nSeqOffset, int16_t dx, double xOffs, double yOffs, int nShade, int nPal, DAngle angle, bool align = false);
int16_t seq_GetFrameFlag(int16_t val, int16_t nFrame);
int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx);
int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal);