- handle a few leftovers in Blood.

This commit is contained in:
Christoph Oelckers 2022-08-25 23:36:24 +02:00
parent 204d6018f4
commit 75ab0cf018
3 changed files with 13 additions and 15 deletions

View file

@ -3142,9 +3142,9 @@ void useVelocityChanger(DBloodActor* actor, sectortype* sect, DBloodActor* initi
if (toAng)
{
if (toAng180)
RotatePoint(&pSprite->vel.X, &pSprite->vel.Y, kAng180, pSprite->spr.pos.X, pSprite->spr.pos.Y);
RotatePoint(&pSprite->vel.X, &pSprite->vel.Y, kAng180, pSprite->int_pos().X, pSprite->int_pos().Y);
else
RotatePoint(&pSprite->vel.X, &pSprite->vel.Y, (nAng - vAng) & 2047, pSprite->spr.pos.X, pSprite->spr.pos.Y);
RotatePoint(&pSprite->vel.X, &pSprite->vel.Y, (nAng - vAng) & 2047, pSprite->int_pos().X, pSprite->int_pos().Y);
vAng = getVelocityAngle(pSprite);
@ -3299,7 +3299,7 @@ void useTeleportTarget(DBloodActor* sourceactor, DBloodActor* actor)
if (sourceactor->xspr.data3 & kModernTypeFlag2)
{
int vAng = getVelocityAngle(actor);
RotatePoint(&actor->vel.X, &actor->vel.Y, (sourceactor->spr.ang - vAng) & 2047, actor->spr.pos.X, actor->spr.pos.Y);
RotatePoint(&actor->vel.X, &actor->vel.Y, (sourceactor->spr.ang - vAng) & 2047, actor->int_pos().X, actor->int_pos().Y);
}
if (sourceactor->xspr.data3 & kModernTypeFlag4)
@ -3367,9 +3367,9 @@ void useEffectGen(DBloodActor* sourceactor, DBloodActor* actor)
if (actor->insector())
{
if (sourceactor->xspr.data4 == 3)
pos = getflorzofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y);
pos = getflorzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y);
else
pos = getceilzofslopeptr(actor->sector(), actor->spr.pos.X, actor->spr.pos.Y);
pos = getceilzofslopeptr(actor->sector(), actor->int_pos().X, actor->int_pos().Y);
break;
}

View file

@ -197,8 +197,8 @@ TArray<DBloodActor*> getSpritesNearWalls(sectortype* pSrcSect, int nDist)
if (skip.Find(ac))
continue;
sx = ac->spr.pos.X; qx = sx - wx;
sy = ac->spr.pos.Y; qy = sy - wy;
sx = ac->int_pos().X; qx = sx - wx;
sy = ac->int_pos().Y; qy = sy - wy;
num = DMulScale(qx, lx, qy, ly, 4);
den = DMulScale(lx, lx, ly, ly, 4);

View file

@ -989,8 +989,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
RotatePoint(&x, &y, ang, a4, a5);
viewBackupSpriteLoc(ac);
ac->spr.ang = (ac->spr.ang + v14) & 2047;
ac->spr.pos.X = x + vc - a4;
ac->spr.pos.Y = y + v8 - a5;
ac->set_int_xy(x + vc - a4, y + v8 - a5);
}
else if (ac->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE)
{
@ -998,8 +997,7 @@ void TranslateSector(sectortype* pSector, int a2, int a3, int a4, int a5, int a6
RotatePoint(&x, &y, -ang, a4, sprDy);
viewBackupSpriteLoc(ac);
ac->spr.ang = (ac->spr.ang - v14) & 2047;
ac->spr.pos.X = x - (vc - a4);
ac->spr.pos.Y = y - (v8 - a5);
ac->set_int_xy(x + vc - a4, y + v8 - a5);
}
}
}
@ -1066,7 +1064,7 @@ void ZTranslateSector(sectortype* pSector, XSECTOR* pXSector, int a3, int a4)
if (ac && (ac->spr.cstat & CSTAT_SPRITE_MOVE_FORWARD))
{
viewBackupSpriteLoc(ac);
ac->spr.pos.Z += pSector->floorz - oldZ;
ac->add_int_z(pSector->floorz - oldZ);
}
}
}
@ -1104,7 +1102,7 @@ void ZTranslateSector(sectortype* pSector, XSECTOR* pXSector, int a3, int a4)
if (ac && (ac->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE))
{
viewBackupSpriteLoc(ac);
ac->spr.pos.Z += pSector->ceilingz - oldZ;
ac->add_int_z(pSector->ceilingz - oldZ);
}
}
}
@ -2272,7 +2270,7 @@ static void UpdateBasePoints(sectortype* pSector)
if (ptr1)
{
for (auto& ac : *ptr1)
ac->basePoint = ac->spr.pos;
ac->basePoint = ac->int_pos();
}
}
#endif
@ -2284,7 +2282,7 @@ static void UpdateBasePoints(sectortype* pSector)
BloodSectIterator it(pSector);
while (auto actor = it.Next())
{
actor->basePoint = actor->spr.pos;
actor->basePoint = actor->int_pos();
}
}