mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- Make legacy weapon drawers in PlayerAngles local to Redneck code, they will eventually go.
This commit is contained in:
parent
318ff64f36
commit
cca36b8061
5 changed files with 22 additions and 25 deletions
|
@ -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.
|
// Legacy, to be removed.
|
||||||
DAngle horizSUM(const double interpfrac = 1) { return ZzHORIZON() + interpolatedvalue(PrevViewAngles.Pitch, ViewAngles.Pitch, interpfrac); }
|
DAngle horizSUM(const double interpfrac = 1) { return ZzHORIZON() + interpolatedvalue(PrevViewAngles.Pitch, ViewAngles.Pitch, interpfrac); }
|
||||||
|
|
|
@ -133,8 +133,10 @@ void displayweapon_r(int snum, double interpfrac)
|
||||||
TiltStatus = p->TiltStatus;
|
TiltStatus = p->TiltStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
look_anghalf = p->Angles.angLOOKANGHALF(interpfrac);
|
auto playerLook = interpolatedvalue(p->Angles.PrevViewAngles.Yaw, p->Angles.ViewAngles.Yaw, interpfrac);
|
||||||
looking_arc = p->Angles.angLOOKINGARC(interpfrac);
|
|
||||||
|
look_anghalf = playerLook.Normalized180().Degrees() * (128. / 45.);
|
||||||
|
looking_arc = fabs(playerLook.Normalized180().Degrees() * (1024. / 1620.));
|
||||||
hard_landing *= 8.;
|
hard_landing *= 8.;
|
||||||
|
|
||||||
gun_pos -= fabs(p->GetActor()->spr.scale.X < 0.125 ? BobVal(weapon_sway * 4.) * 32 : BobVal(weapon_sway * 0.5) * 16);
|
gun_pos -= fabs(p->GetActor()->spr.scale.X < 0.125 ? BobVal(weapon_sway * 4.) * 32 : BobVal(weapon_sway * 0.5) * 16);
|
||||||
|
|
|
@ -1000,13 +1000,12 @@ void DrawWeapons(double interpfrac)
|
||||||
nShade = PlayerList[nLocalPlayer].pActor->spr.shade;
|
nShade = PlayerList[nLocalPlayer].pActor->spr.shade;
|
||||||
}
|
}
|
||||||
|
|
||||||
double const look_anghalf = PlayerList[nLocalPlayer].Angles.angLOOKANGHALF(interpfrac);
|
const auto weaponOffsets = PlayerList[nLocalPlayer].Angles.getWeaponOffsets(interpfrac);
|
||||||
double const looking_arc = PlayerList[nLocalPlayer].Angles.angLOOKINGARC(interpfrac);
|
const auto angle = -weaponOffsets.second;
|
||||||
|
xOffset += weaponOffsets.first.X;
|
||||||
|
yOffset += weaponOffsets.first.Y;
|
||||||
|
|
||||||
xOffset -= look_anghalf;
|
seq_DrawGunSequence(var_28, PlayerList[nLocalPlayer].nSeqSize2, xOffset, yOffset, nShade, nPal, angle, screenalign);
|
||||||
yOffset += looking_arc;
|
|
||||||
|
|
||||||
seq_DrawGunSequence(var_28, PlayerList[nLocalPlayer].nSeqSize2, xOffset, yOffset, nShade, nPal, screenalign);
|
|
||||||
|
|
||||||
if (nWeapon != kWeaponM60)
|
if (nWeapon != kWeaponM60)
|
||||||
return;
|
return;
|
||||||
|
@ -1042,7 +1041,7 @@ void DrawWeapons(double interpfrac)
|
||||||
nSeqOffset = var_30 + 4;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -1055,25 +1054,25 @@ void DrawWeapons(double interpfrac)
|
||||||
return;
|
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) {
|
if (nClip <= 3) {
|
||||||
return;
|
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) {
|
if (nClip <= 6) {
|
||||||
return;
|
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) {
|
if (nClip <= 25) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
seq_DrawGunSequence(var_30 + 11, edx, xOffset, yOffset, nShade, nPal);
|
seq_DrawGunSequence(var_30 + 11, edx, xOffset, yOffset, nShade, nPal, angle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -1086,25 +1085,25 @@ void DrawWeapons(double interpfrac)
|
||||||
return;
|
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) {
|
if (nClip <= 3) {
|
||||||
return;
|
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) {
|
if (nClip <= 6) {
|
||||||
return;
|
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) {
|
if (nClip <= 25) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
seq_DrawGunSequence(var_30 + 11, dx, xOffset, yOffset, nShade, nPal);
|
seq_DrawGunSequence(var_30 + 11, dx, xOffset, yOffset, nShade, nPal, angle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1141,7 +1140,7 @@ void DrawWeapons(double interpfrac)
|
||||||
nSeqOffset = var_30 + 17;
|
nSeqOffset = var_30 + 17;
|
||||||
}
|
}
|
||||||
|
|
||||||
seq_DrawGunSequence(nSeqOffset, ax, xOffset, yOffset, nShade, nPal);
|
seq_DrawGunSequence(nSeqOffset, ax, xOffset, yOffset, nShade, nPal, angle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 nFrame = SeqBase[nSeqOffset] + dx;
|
||||||
int nFrameBase = FrameBase[nFrame];
|
int nFrameBase = FrameBase[nFrame];
|
||||||
|
@ -461,7 +461,7 @@ int seq_DrawGunSequence(int nSeqOffset, int16_t dx, double xOffs, double yOffs,
|
||||||
alpha = 0.3;
|
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++;
|
nFrameBase++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
int seq_GetSeqPicnum(int16_t nSeq, int16_t edx, int16_t ebx);
|
||||||
void seq_DrawStatusSequence(int16_t nSequence, uint16_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);
|
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_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx);
|
||||||
int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal);
|
int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal);
|
||||||
|
|
Loading…
Reference in a new issue