- Rename PlayerAngle::rotscrnang in preparation for replacement work.

This commit is contained in:
Mitchell Richters 2022-11-25 16:29:02 +11:00 committed by Christoph Oelckers
parent 3a0ec29c18
commit 7d34288290
9 changed files with 23 additions and 23 deletions

View file

@ -225,14 +225,14 @@ void PlayerHorizon::applyPitch(float const horz, ESyncBits* actions, double cons
void PlayerAngle::applyinput(float const avel, ESyncBits* actions, double const scaleAdjust)
{
// Process angle return to zeros.
scaletozero(rotscrnang, YAW_LOOKRETURN, scaleAdjust);
scaletozero(ZzROTSCRNANG, YAW_LOOKRETURN, scaleAdjust);
scaletozero(ZzLOOKANG, YAW_LOOKRETURN, scaleAdjust);
// Process keyboard input.
if (auto looking = !!(*actions & SB_LOOK_RIGHT) - !!(*actions & SB_LOOK_LEFT))
{
ZzLOOKANG += getTicrateScale(YAW_LOOKINGSPEED) * getCorrectedScale(scaleAdjust) * looking;
rotscrnang -= getTicrateScale(YAW_ROTATESPEED) * getCorrectedScale(scaleAdjust) * looking;
ZzROTSCRNANG -= getTicrateScale(YAW_ROTATESPEED) * getCorrectedScale(scaleAdjust) * looking;
}
if (!movementlocked())
@ -336,7 +336,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerAngle& w, Pl
{
arc("ang", w.ZzANGLE)
("lookang", w.ZzLOOKANG)
("rotscrnang", w.rotscrnang)
("rotscrnang", w.ZzROTSCRNANG)
("spin", w.spin)
("inputdisabled", w.inputdisabled)
.EndObject();
@ -345,7 +345,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerAngle& w, Pl
{
w.ZzOLDANGLE = w.ZzANGLE;
w.ZzOLDLOOKANG = w.ZzLOOKANG;
w.orotscrnang = w.rotscrnang;
w.orotscrnang = w.ZzROTSCRNANG;
w.inputdisabled = w.inputdisabled;
w.resetadjustment();
}

View file

@ -100,7 +100,7 @@ private:
struct PlayerAngle
{
DAngle ZzANGLE, ZzOLDANGLE, ZzLOOKANG, ZzOLDLOOKANG, rotscrnang, orotscrnang, spin;
DAngle ZzANGLE, ZzOLDANGLE, ZzLOOKANG, ZzOLDLOOKANG, ZzROTSCRNANG, orotscrnang, spin;
friend FSerializer& Serialize(FSerializer& arc, const char* keyname, PlayerAngle& w, PlayerAngle* def);
@ -112,13 +112,13 @@ struct PlayerAngle
{
ZzOLDANGLE = ZzANGLE;
ZzOLDLOOKANG = ZzLOOKANG;
orotscrnang = rotscrnang;
orotscrnang = ZzROTSCRNANG;
}
void restore()
{
ZzANGLE = ZzOLDANGLE;
ZzLOOKANG = ZzOLDLOOKANG;
rotscrnang = orotscrnang;
ZzROTSCRNANG = orotscrnang;
}
// Commonly used getters.
@ -127,9 +127,9 @@ struct PlayerAngle
DAngle interpolatedsum(double const interpfrac) { return interpolatedvalue(osum(), sum(), interpfrac); }
DAngle interpolatedang(double const interpfrac) { return interpolatedvalue(ZzOLDANGLE, ZzANGLE, interpfrac); }
DAngle interpolatedlookang(double const interpfrac) { return interpolatedvalue(ZzOLDLOOKANG, ZzLOOKANG, interpfrac); }
DAngle interpolatedrotscrn(double const interpfrac) { return interpolatedvalue(orotscrnang, rotscrnang, interpfrac); }
DAngle interpolatedrotscrn(double const interpfrac) { return interpolatedvalue(orotscrnang, ZzROTSCRNANG, interpfrac); }
DAngle renderlookang(double const interpfrac) { return !SyncInput() ? ZzLOOKANG : interpolatedlookang(interpfrac); }
DAngle renderrotscrn(double const interpfrac) { return !SyncInput() ? rotscrnang : interpolatedrotscrn(interpfrac); }
DAngle renderrotscrn(double const interpfrac) { return !SyncInput() ? ZzROTSCRNANG : interpolatedrotscrn(interpfrac); }
// Ticrate playsim adjustment helpers.
void resetadjustment() { adjustment = nullAngle; }

View file

@ -503,7 +503,7 @@ static void SetupView(PLAYER* pPlayer, DVector3& cPos, DAngle& cA, DAngle& cH, s
{
cA = pPlayer->angle.sum();
cH = pPlayer->horizon.horizSUM();
rotscrnang = pPlayer->angle.rotscrnang;
rotscrnang = pPlayer->angle.ZzROTSCRNANG;
}
else
{

View file

@ -710,8 +710,8 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor,
break;
case PLAYER_ROTSCRNANG:
if (bSet) ps[iPlayer].angle.orotscrnang = ps[iPlayer].angle.rotscrnang = mapangle(lValue);
else SetGameVarID(lVar2, ps[iPlayer].angle.rotscrnang.Buildang(), sActor, sPlayer);
if (bSet) ps[iPlayer].angle.orotscrnang = ps[iPlayer].angle.ZzROTSCRNANG = mapangle(lValue);
else SetGameVarID(lVar2, ps[iPlayer].angle.ZzROTSCRNANG.Buildang(), sActor, sPlayer);
break;
case PLAYER_DEAD_FLAG:
@ -2261,7 +2261,7 @@ int ParseState::parse(void)
ps[g_p].weapreccnt = 0;
ps[g_p].ftq = 0;
ps[g_p].vel.X = ps[g_p].vel.Y = 0;
if (!isRR()) ps[g_p].angle.orotscrnang = ps[g_p].angle.rotscrnang = nullAngle;
if (!isRR()) ps[g_p].angle.orotscrnang = ps[g_p].angle.ZzROTSCRNANG = nullAngle;
ps[g_p].falling_counter = 0;

View file

@ -119,7 +119,7 @@ void forceplayerangle(int snum)
p->horizon.addPitch(DAngle::fromDeg(-26.566));
p->sync.actions |= SB_CENTERVIEW;
p->angle.rotscrnang = p->angle.ZzLOOKANG = (DAngle22_5 - randomAngle(45)) / 2.;
p->angle.ZzROTSCRNANG = p->angle.ZzLOOKANG = (DAngle22_5 - randomAngle(45)) / 2.;
}
//---------------------------------------------------------------------------
@ -629,7 +629,7 @@ void playerisdead(int snum, int psectlotag, double floorz, double ceilingz)
pushmove(p->GetActor()->spr.pos.XY(), p->GetActor()->getOffsetZ(), &p->cursector, 8, 4, 20, CLIPMASK0);
if (floorz > ceilingz + 16 && actor->spr.pal != 1)
p->angle.rotscrnang = DAngle::fromBuild(p->dead_flag + ((floorz + p->GetActor()->getOffsetZ()) * 2));
p->angle.ZzROTSCRNANG = DAngle::fromBuild(p->dead_flag + ((floorz + p->GetActor()->getOffsetZ()) * 2));
p->on_warping_sector = 0;
@ -741,13 +741,13 @@ void player_struct::apply_seasick(double factor)
if (SeaSick < 250)
{
if (SeaSick >= 180)
angle.rotscrnang += DAngle::fromDeg(24 * factor * BAngToDegree);
angle.ZzROTSCRNANG += DAngle::fromDeg(24 * factor * BAngToDegree);
else if (SeaSick >= 130)
angle.rotscrnang -= DAngle::fromDeg(24 * factor * BAngToDegree);
angle.ZzROTSCRNANG -= DAngle::fromDeg(24 * factor * BAngToDegree);
else if (SeaSick >= 70)
angle.rotscrnang += DAngle::fromDeg(24 * factor * BAngToDegree);
angle.ZzROTSCRNANG += DAngle::fromDeg(24 * factor * BAngToDegree);
else if (SeaSick >= 20)
angle.rotscrnang -= DAngle::fromDeg(24 * factor * BAngToDegree);
angle.ZzROTSCRNANG -= DAngle::fromDeg(24 * factor * BAngToDegree);
}
if (SeaSick < 250)
angle.ZzLOOKANG = DAngle::fromDeg(((krand() & 255) - 128) * factor * BAngToDegree);

View file

@ -152,7 +152,7 @@ void resetplayerstats(int snum)
p->holoduke_on = nullptr;
p->angle.ZzOLDLOOKANG = p->angle.ZzLOOKANG = (currentLevel->levelNumber & 1)? DAngle90 : -DAngle90;
p->angle.orotscrnang = p->angle.rotscrnang = nullAngle;
p->angle.orotscrnang = p->angle.ZzROTSCRNANG = nullAngle;
p->newOwner =nullptr;
p->jumping_counter = 0;

View file

@ -271,7 +271,7 @@ void displayrooms(int snum, double interpfrac, bool sceneonly)
setgamepalette(setpal(p));
// set screen rotation.
rotscrnang = !SyncInput() ? p->angle.rotscrnang : p->angle.interpolatedrotscrn(interpfrac);
rotscrnang = !SyncInput() ? p->angle.ZzROTSCRNANG : p->angle.interpolatedrotscrn(interpfrac);
// use player's actor initially.
viewer = p->GetActor();

View file

@ -236,7 +236,7 @@ void DrawView(double interpfrac, bool sceneonly)
{
nCamerapan = PlayerList[nLocalPlayer].horizon.horizSUM();
nCameraang = PlayerList[nLocalPlayer].angle.sum();
rotscrnang = PlayerList[nLocalPlayer].angle.rotscrnang;
rotscrnang = PlayerList[nLocalPlayer].angle.ZzROTSCRNANG;
}
else
{

View file

@ -1252,7 +1252,7 @@ void drawscreen(PLAYER* pp, double interpfrac, bool sceneonly)
{
tang = pp->angle.sum();
thoriz = pp->horizon.horizSUM();
trotscrnang = pp->angle.rotscrnang;
trotscrnang = pp->angle.ZzROTSCRNANG;
}
tsect = camerapp->cursector;