- Exhumed: Move dVertPan[] array into Player struct.

This commit is contained in:
Mitchell Richters 2023-03-23 17:22:28 +11:00
parent 095b33fa67
commit 05fd2911a4
4 changed files with 7 additions and 9 deletions

View file

@ -404,7 +404,7 @@ void RestartPlayer(int nPlayer)
plr->pPlayerGrenade = nullptr;
pActor->oviewzoffset = pActor->viewzoffset = -55.;
dVertPan[nPlayer] = 0;
plr->dVertPan = 0;
nTemperature[nPlayer] = 0;
@ -508,7 +508,7 @@ void StartDeathSeq(int nPlayer, int nVal)
PlayerList[nPlayer].pActor->PrevAngles.Pitch = PlayerList[nPlayer].pActor->spr.Angles.Pitch = nullAngle;
pActor->oviewzoffset = pActor->viewzoffset = -55;
PlayerList[nPlayer].nInvisible = 0;
dVertPan[nPlayer] = 15;
PlayerList[nPlayer].dVertPan = 15;
pActor->spr.cstat &= ~CSTAT_SPRITE_INVISIBLE;
@ -2593,18 +2593,18 @@ sectdone:
if (pPlayerActor->viewzoffset >= -11)
{
pPlayerActor->viewzoffset = -11;
dVertPan[nPlayer] = 0;
PlayerList[nPlayer].dVertPan = 0;
}
else
{
if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Sgn() > 0)
{
pPlayerActor->spr.Angles.Pitch = nullAngle;
pPlayerActor->viewzoffset -= dVertPan[nPlayer];
pPlayerActor->viewzoffset -= PlayerList[nPlayer].dVertPan;
}
else
{
PlayerList[nPlayer].pActor->spr.Angles.Pitch -= maphoriz(dVertPan[nPlayer]);
PlayerList[nPlayer].pActor->spr.Angles.Pitch -= maphoriz(PlayerList[nPlayer].dVertPan);
if (PlayerList[nPlayer].pActor->spr.Angles.Pitch.Degrees() <= -38)
{
@ -2618,7 +2618,7 @@ sectdone:
}
}
dVertPan[nPlayer]--;
PlayerList[nPlayer].dVertPan--;
}
}
}

View file

@ -98,6 +98,7 @@ struct Player
int16_t nPlayerPushSound;
int16_t nTauntTimer;
uint16_t nPlayerWeapons; // each set bit represents a weapon the player has
int16_t dVertPan;
PlayerSave sPlayerSave;
int ototalvel;
int totalvel;

View file

@ -36,7 +36,6 @@ BEGIN_PS_NS
bool bSubTitles = true;
int16_t dVertPan[kMaxPlayers];
DVector3 nCamerapos;
bool bTouchFloor;
@ -346,7 +345,6 @@ void SerializeView(FSerializer& arc)
("touchfloor", bTouchFloor)
("chunktotal", nChunkTotal)
("camera", bCamera)
.Array("vertpan", dVertPan, countof(dVertPan))
.Array("quake", nQuake, countof(nQuake))
.EndObject();
}

View file

@ -28,7 +28,6 @@ void DrawStatusBar();
void DrawView(double interpfrac, bool sceneonly = false);
void ResetView();
extern int16_t dVertPan[];
extern double nQuake[];
extern DVector3 nCamerapos;
extern bool bTouchFloor;