mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 15:11:04 +00:00
- Exhumed: Migrate to new actor viewzoffset
property.
This commit is contained in:
parent
e3f6b5ff85
commit
13be5f7923
5 changed files with 12 additions and 15 deletions
|
@ -87,7 +87,7 @@ static int osdcmd_spawn(CCmdFuncPtr parm)
|
||||||
if (!stricmp(c, "anubis")) BuildAnubis(nullptr, initpos, sectp, inita, false);
|
if (!stricmp(c, "anubis")) BuildAnubis(nullptr, initpos, sectp, inita, false);
|
||||||
else if (!stricmp(c, "spider")) BuildSpider(nullptr, initpos, sectp, inita);
|
else if (!stricmp(c, "spider")) BuildSpider(nullptr, initpos, sectp, inita);
|
||||||
else if (!stricmp(c, "mummy")) BuildMummy(nullptr, initpos, sectp, inita);
|
else if (!stricmp(c, "mummy")) BuildMummy(nullptr, initpos, sectp, inita);
|
||||||
else if (!stricmp(c, "fish")) BuildFish(nullptr, initpos.plusZ(PlayerList[nLocalPlayer].eyelevel), sectp, inita);
|
else if (!stricmp(c, "fish")) BuildFish(nullptr, initpos.plusZ(PlayerList[nLocalPlayer].pActor->viewzoffset), sectp, inita);
|
||||||
else if (!stricmp(c, "lion")) BuildLion(nullptr, initpos, sectp, inita);
|
else if (!stricmp(c, "lion")) BuildLion(nullptr, initpos, sectp, inita);
|
||||||
else if (!stricmp(c, "lava")) BuildLava(nullptr, initpos, sectp, inita, nNetPlayerCount);
|
else if (!stricmp(c, "lava")) BuildLava(nullptr, initpos, sectp, inita, nNetPlayerCount);
|
||||||
else if (!stricmp(c, "rex")) BuildRex(nullptr, initpos, sectp, inita, nNetPlayerCount);
|
else if (!stricmp(c, "rex")) BuildRex(nullptr, initpos, sectp, inita, nNetPlayerCount);
|
||||||
|
|
|
@ -400,7 +400,7 @@ void RestartPlayer(int nPlayer)
|
||||||
}
|
}
|
||||||
|
|
||||||
plr->pPlayerGrenade = nullptr;
|
plr->pPlayerGrenade = nullptr;
|
||||||
plr->oeyelevel = plr->eyelevel = -55.;
|
pActor->oviewzoffset = pActor->viewzoffset = -55.;
|
||||||
dVertPan[nPlayer] = 0;
|
dVertPan[nPlayer] = 0;
|
||||||
|
|
||||||
nTemperature[nPlayer] = 0;
|
nTemperature[nPlayer] = 0;
|
||||||
|
@ -504,7 +504,7 @@ void StartDeathSeq(int nPlayer, int nVal)
|
||||||
StopFiringWeapon(nPlayer);
|
StopFiringWeapon(nPlayer);
|
||||||
|
|
||||||
PlayerList[nPlayer].horizon.ohoriz = PlayerList[nPlayer].horizon.horiz = nullAngle;
|
PlayerList[nPlayer].horizon.ohoriz = PlayerList[nPlayer].horizon.horiz = nullAngle;
|
||||||
PlayerList[nPlayer].oeyelevel = PlayerList[nPlayer].eyelevel = -55;
|
pActor->oviewzoffset = pActor->viewzoffset = -55;
|
||||||
PlayerList[nPlayer].nInvisible = 0;
|
PlayerList[nPlayer].nInvisible = 0;
|
||||||
dVertPan[nPlayer] = 15;
|
dVertPan[nPlayer] = 15;
|
||||||
|
|
||||||
|
@ -908,7 +908,6 @@ void AIPlayer::Tick(RunListEvent* ev)
|
||||||
PlayerList[nPlayer].horizon.backup();
|
PlayerList[nPlayer].horizon.backup();
|
||||||
PlayerList[nPlayer].angle.resetadjustment();
|
PlayerList[nPlayer].angle.resetadjustment();
|
||||||
PlayerList[nPlayer].horizon.resetadjustment();
|
PlayerList[nPlayer].horizon.resetadjustment();
|
||||||
PlayerList[nPlayer].oeyelevel = PlayerList[nPlayer].eyelevel;
|
|
||||||
|
|
||||||
pPlayerActor->vel.XY() = sPlayerInput[nPlayer].vel;
|
pPlayerActor->vel.XY() = sPlayerInput[nPlayer].vel;
|
||||||
|
|
||||||
|
@ -1170,7 +1169,7 @@ sectdone:
|
||||||
|
|
||||||
auto pViewSect = pPlayerActor->sector();
|
auto pViewSect = pPlayerActor->sector();
|
||||||
|
|
||||||
double EyeZ = PlayerList[nPlayer].eyelevel + pPlayerActor->spr.pos.Z + nQuake[nPlayer];
|
double EyeZ = pPlayerActor->getOffsetZ() + nQuake[nPlayer];
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
@ -2363,8 +2362,8 @@ sectdone:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (PlayerList[nPlayer].eyelevel < -32.5) {
|
if (pPlayerActor->viewzoffset < -32.5) {
|
||||||
PlayerList[nPlayer].eyelevel += ((-32.5 - PlayerList[nPlayer].eyelevel) * 0.5);
|
pPlayerActor->viewzoffset += ((-32.5 - pPlayerActor->viewzoffset) * 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
loc_1BD2E:
|
loc_1BD2E:
|
||||||
|
@ -2382,7 +2381,7 @@ sectdone:
|
||||||
{
|
{
|
||||||
if (PlayerList[nPlayer].nHealth > 0)
|
if (PlayerList[nPlayer].nHealth > 0)
|
||||||
{
|
{
|
||||||
PlayerList[nPlayer].eyelevel += (nActionEyeLevel[nAction] - PlayerList[nPlayer].eyelevel) * 0.5;
|
pPlayerActor->viewzoffset += (nActionEyeLevel[nAction] - pPlayerActor->viewzoffset) * 0.5;
|
||||||
|
|
||||||
if (bUnderwater)
|
if (bUnderwater)
|
||||||
{
|
{
|
||||||
|
@ -2610,9 +2609,9 @@ sectdone:
|
||||||
{
|
{
|
||||||
PlayerList[nPlayer].nThrust.Zero();
|
PlayerList[nPlayer].nThrust.Zero();
|
||||||
|
|
||||||
if (PlayerList[nPlayer].eyelevel >= -11)
|
if (pPlayerActor->viewzoffset >= -11)
|
||||||
{
|
{
|
||||||
PlayerList[nPlayer].eyelevel = -11;
|
pPlayerActor->viewzoffset = -11;
|
||||||
dVertPan[nPlayer] = 0;
|
dVertPan[nPlayer] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2620,7 +2619,7 @@ sectdone:
|
||||||
if (PlayerList[nPlayer].horizon.horiz.Sgn() > 0)
|
if (PlayerList[nPlayer].horizon.horiz.Sgn() > 0)
|
||||||
{
|
{
|
||||||
PlayerList[nPlayer].horizon.settarget(nullAngle);
|
PlayerList[nPlayer].horizon.settarget(nullAngle);
|
||||||
PlayerList[nPlayer].eyelevel -= dVertPan[nPlayer];
|
pPlayerActor->viewzoffset -= dVertPan[nPlayer];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2718,7 +2717,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, Player& w, Player*
|
||||||
("floorspr", w.pPlayerFloorSprite)
|
("floorspr", w.pPlayerFloorSprite)
|
||||||
("save", w.sPlayerSave)
|
("save", w.sPlayerSave)
|
||||||
("totalvel", w.totalvel)
|
("totalvel", w.totalvel)
|
||||||
("eyelevel", w.eyelevel)
|
|
||||||
("grenade", w.pPlayerGrenade)
|
("grenade", w.pPlayerGrenade)
|
||||||
|
|
||||||
.EndObject();
|
.EndObject();
|
||||||
|
|
|
@ -99,7 +99,6 @@ struct Player
|
||||||
PlayerSave sPlayerSave;
|
PlayerSave sPlayerSave;
|
||||||
int ototalvel;
|
int ototalvel;
|
||||||
int totalvel;
|
int totalvel;
|
||||||
double eyelevel, oeyelevel;
|
|
||||||
TObjPtr<DExhumedActor*> pPlayerGrenade;
|
TObjPtr<DExhumedActor*> pPlayerGrenade;
|
||||||
TObjPtr<DExhumedActor*> pPlayerFloorSprite;
|
TObjPtr<DExhumedActor*> pPlayerFloorSprite;
|
||||||
TObjPtr<DExhumedActor*> pDoppleSprite;
|
TObjPtr<DExhumedActor*> pDoppleSprite;
|
||||||
|
|
|
@ -676,7 +676,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
|
||||||
auto pSector =pTSprite->sectp;
|
auto pSector =pTSprite->sectp;
|
||||||
double nFloorZ = pSector->floorz;
|
double nFloorZ = pSector->floorz;
|
||||||
|
|
||||||
if (nFloorZ <= PlayerList[nLocalPlayer].eyelevel + initpos.Z) {
|
if (nFloorZ <= PlayerList[nLocalPlayer].pActor->viewzoffset + initpos.Z) {
|
||||||
pTSprite->ownerActor = nullptr;
|
pTSprite->ownerActor = nullptr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -226,7 +226,7 @@ void DrawView(double interpfrac, bool sceneonly)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nCamerapos = pPlayerActor->interpolatedpos(interpfrac).plusZ(interpolatedvalue(PlayerList[nLocalPlayer].oeyelevel, PlayerList[nLocalPlayer].eyelevel, interpfrac));
|
nCamerapos = pPlayerActor->getRenderPos(interpfrac);
|
||||||
|
|
||||||
pSector = PlayerList[nLocalPlayer].pPlayerViewSect;
|
pSector = PlayerList[nLocalPlayer].pPlayerViewSect;
|
||||||
updatesector(nCamerapos, &pSector);
|
updatesector(nCamerapos, &pSector);
|
||||||
|
|
Loading…
Reference in a new issue