- Exhumed: nCamera -> nCamerapos.

This commit is contained in:
Mitchell Richters 2022-09-07 10:14:46 +10:00 committed by Christoph Oelckers
parent 48c2b5d89a
commit dea34609cd
4 changed files with 16 additions and 16 deletions

View file

@ -809,7 +809,7 @@ void LoadObjects(TArray<DExhumedActor*>& actors)
runlist_ReadyChannel(nChannel); runlist_ReadyChannel(nChannel);
} }
nCamera = initpos; nCamerapos = initpos;
} }
void SerializeInit(FSerializer& arc) void SerializeInit(FSerializer& arc)

View file

@ -479,7 +479,7 @@ int seq_GetSeqPicnum(int16_t nSeq, int16_t edx, int16_t ebx)
int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal) int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal)
{ {
tspritetype* pTSprite = mytspriteArray->get(nSprite); tspritetype* pTSprite = mytspriteArray->get(nSprite);
int nAngle = getangle(nCamera.XY() - pTSprite->pos.XY()); int nAngle = getangle(nCamerapos.XY() - pTSprite->pos.XY());
int nSeqOffset = ((((pTSprite->int_ang() + 512) - nAngle) + 128) & kAngleMask) >> 8; int nSeqOffset = ((((pTSprite->int_ang() + 512) - nAngle) + 128) & kAngleMask) >> 8;
@ -527,7 +527,7 @@ int seq_PlotArrowSequence(int nSprite, int16_t nSeq, int nVal)
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)
{ {
tspritetype* pTSprite = mytspriteArray->get(nSprite); tspritetype* pTSprite = mytspriteArray->get(nSprite);
int nAngle = getangle(nCamera.XY() - pTSprite->pos.XY()); int nAngle = getangle(nCamerapos.XY() - pTSprite->pos.XY());
int val; int val;

View file

@ -37,7 +37,7 @@ BEGIN_PS_NS
bool bSubTitles = true; bool bSubTitles = true;
int16_t dVertPan[kMaxPlayers]; int16_t dVertPan[kMaxPlayers];
DVector3 nCamera; DVector3 nCamerapos;
bool bTouchFloor; bool bTouchFloor;
int16_t nQuake[kMaxPlayers] = { 0 }; int16_t nQuake[kMaxPlayers] = { 0 };
@ -193,7 +193,7 @@ void DrawView(double interpfrac, bool sceneonly)
{ {
DExhumedActor* pActor = SnakeList[nSnakeCam].pSprites[0]; DExhumedActor* pActor = SnakeList[nSnakeCam].pSprites[0];
nCamera = pActor->spr.pos; nCamerapos = pActor->spr.pos;
pSector = pActor->sector(); pSector = pActor->sector();
nCameraang = pActor->spr.angle; nCameraang = pActor->spr.angle;
rotscrnang = nullAngle; rotscrnang = nullAngle;
@ -214,10 +214,10 @@ void DrawView(double interpfrac, bool sceneonly)
} }
else else
{ {
nCamera = pPlayerActor->interpolatedvec3(interpfrac).plusZ(interpolatedvaluef(PlayerList[nLocalPlayer].oeyelevel, PlayerList[nLocalPlayer].eyelevel, interpfrac * MaxSmoothRatio) * zinttoworld); nCamerapos = pPlayerActor->interpolatedvec3(interpfrac).plusZ(interpolatedvaluef(PlayerList[nLocalPlayer].oeyelevel, PlayerList[nLocalPlayer].eyelevel, interpfrac * MaxSmoothRatio) * zinttoworld);
pSector = PlayerList[nLocalPlayer].pPlayerViewSect; pSector = PlayerList[nLocalPlayer].pPlayerViewSect;
updatesector(nCamera, &pSector); updatesector(nCamerapos, &pSector);
if (pSector == nullptr) pSector = PlayerList[nLocalPlayer].pPlayerViewSect; if (pSector == nullptr) pSector = PlayerList[nLocalPlayer].pPlayerViewSect;
if (!SyncInput()) if (!SyncInput())
@ -252,23 +252,23 @@ void DrawView(double interpfrac, bool sceneonly)
} }
else else
{ {
nCamera.Z = min(nCamera.Z + nQuake[nLocalPlayer] * zinttoworld, pPlayerActor->sector()->floorz); nCamerapos.Z = min(nCamerapos.Z + nQuake[nLocalPlayer] * zinttoworld, pPlayerActor->sector()->floorz);
nCameraang += DAngle::fromBam((nQuake[nLocalPlayer] % 4095) << 14); nCameraang += DAngle::fromBam((nQuake[nLocalPlayer] % 4095) << 14);
if (bCamera) if (bCamera)
{ {
nCamera.Z -= 10; nCamerapos.Z -= 10;
if (!calcChaseCamPos(nCamera, pPlayerActor, &pSector, nCameraang, nCamerapan, interpfrac * MaxSmoothRatio)) if (!calcChaseCamPos(nCamerapos, pPlayerActor, &pSector, nCameraang, nCamerapan, interpfrac * MaxSmoothRatio))
{ {
nCamera.Z += 10; nCamerapos.Z += 10;
calcChaseCamPos(nCamera, pPlayerActor, &pSector, nCameraang, nCamerapan, interpfrac * MaxSmoothRatio); calcChaseCamPos(nCamerapos, pPlayerActor, &pSector, nCameraang, nCamerapan, interpfrac * MaxSmoothRatio);
} }
} }
} }
if (pSector != nullptr) if (pSector != nullptr)
{ {
nCamera.Z = min(max(nCamera.Z, pSector->ceilingz + 1), pSector->floorz - 1); // std::clamp may fail on this one if sectors are closed. nCamerapos.Z = min(max(nCamerapos.Z, pSector->ceilingz + 1), pSector->floorz - 1);
} }
if (nFreeze == 2 || nFreeze == 1) if (nFreeze == 2 || nFreeze == 1)
@ -304,7 +304,7 @@ void DrawView(double interpfrac, bool sceneonly)
if (!nFreeze && !sceneonly) if (!nFreeze && !sceneonly)
DrawWeapons(interpfrac * MaxSmoothRatio); DrawWeapons(interpfrac * MaxSmoothRatio);
render_drawrooms(nullptr, nCamera, sectnum(pSector), nCameraang, nCamerapan, rotscrnang, interpfrac * MaxSmoothRatio); render_drawrooms(nullptr, nCamerapos, sectnum(pSector), nCameraang, nCamerapan, rotscrnang, interpfrac * MaxSmoothRatio);
if (HavePLURemap()) if (HavePLURemap())
{ {
@ -418,7 +418,7 @@ void SerializeView(FSerializer& arc)
{ {
if (arc.BeginObject("view")) if (arc.BeginObject("view"))
{ {
arc("camera", nCamera) arc("camera", nCamerapos)
("touchfloor", bTouchFloor) ("touchfloor", bTouchFloor)
("chunktotal", nChunkTotal) ("chunktotal", nChunkTotal)
("camera", bCamera) ("camera", bCamera)

View file

@ -33,7 +33,7 @@ void Clip();
extern int16_t dVertPan[]; extern int16_t dVertPan[];
extern int16_t nQuake[]; extern int16_t nQuake[];
extern DVector3 nCamera; extern DVector3 nCamerapos;
extern bool bTouchFloor; extern bool bTouchFloor;
extern int nChunkTotal; extern int nChunkTotal;
extern int gFov; extern int gFov;