- floatify half the movesprite calls.

This commit is contained in:
Christoph Oelckers 2022-09-10 23:43:54 +02:00
parent ab3184eed8
commit 6854e8030d
6 changed files with 16 additions and 22 deletions

View file

@ -821,7 +821,7 @@ void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& nVel)
{
// Unlike the above, this one *did* scale vect
vect2 = nAngle.ToVector() * pActor->fClipdist() * 0.25 + vect;
movesprite_(pActor, FloatToFixed<18>(vect2.X), FloatToFixed<18>(vect2.Y), 0, 0, 0, CLIPMASK0);
movesprite(pActor, vect2, 0, 0, CLIPMASK0);
}
}
}
@ -943,7 +943,7 @@ Collision AngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int threshol
auto veclen = vec.Length();
double zz = g_sindeg(pActor->vel.Z * 45) * veclen;
return movesprite_(pActor, FloatToFixed<18>(vec.X), FloatToFixed<18>(vec.Y), zz * 4096 + BobVal(zbob) * 512, 0, 0, nClipType);
return movesprite(pActor, vec, zz * 16 + BobVal(zbob) * 2, 0, nClipType);
}
DAngle GetWallNormal(walltype* pWall)

View file

@ -1037,7 +1037,7 @@ void AISlide::Tick(RunListEvent* ev)
double nSeekB = LongSeek(&y, SlideData[nSlide].pos[4].Y, 1.25, 1.25);
dragpoint(SlideData[nSlide].pWall1, x, y);
movesprite_(SlideData[nSlide].pActor, FloatToFixed<18>(nSeekA), FloatToFixed<18>(nSeekB), 0, 0, 0, CLIPMASK1);
movesprite(SlideData[nSlide].pActor, DVector2(nSeekA, nSeekB), 0, 0, CLIPMASK1);
if (nSeekA == 0 && nSeekB == 0)
{

View file

@ -715,7 +715,7 @@ void AIPlayer::Damage(RunListEvent* ev)
bool CheckMovingBlocks(int nPlayer, Collision& nMove, DVector3& spr_pos, sectortype* spr_sect)
{
auto pPlayerActor = PlayerList[nPlayer].pActor;
int const z = (pPlayerActor->int_zvel() * 4) >> 2;
double const zz = pPlayerActor->vel.Z;
if (nMove.type == kHitSector || nMove.type == kHitWall)
{
@ -768,7 +768,7 @@ bool CheckMovingBlocks(int nPlayer, Collision& nMove, DVector3& spr_pos, sectort
ChangeActorSect(pPlayerActor, spr_sect);
}
movesprite_(pPlayerActor, FloatToFixed<18>(vel.X), FloatToFixed<18>(vel.Y), z, 5120, -5120, CLIPMASK0);
movesprite(pPlayerActor, vel, zz, -20, CLIPMASK0);
return true;
}
}
@ -897,17 +897,15 @@ void AIPlayer::Tick(RunListEvent* ev)
auto playerPos = pPlayerActor->spr.pos.XY();
int x = (sPlayerInput[nPlayer].xVel * 4) >> 2;
int y = (sPlayerInput[nPlayer].yVel * 4) >> 2;
int const z = (pPlayerActor->int_zvel() * 4) >> 2;
DVector2 vect(FixedToFloat<18>(sPlayerInput[nPlayer].xVel), FixedToFloat<18>(sPlayerInput[nPlayer].yVel));
double zz = pPlayerActor->vel.Z;
if (pPlayerActor->vel.Z > 32)
pPlayerActor->vel.Z = 32;
if (PlayerList[nPlayer].bIsMummified)
{
x /= 2;
y /= 2;
vect *= 0.5;
}
auto spr_pos = pPlayerActor->spr.pos;
@ -922,14 +920,14 @@ void AIPlayer::Tick(RunListEvent* ev)
nMove.setNone();
if (bSlipMode)
{
pPlayerActor->add_int_pos({ (x >> 14), (y >> 14), 0 });
pPlayerActor->spr.pos += vect;
SetActor(pPlayerActor, pPlayerActor->spr.pos);
pPlayerActor->spr.pos.Z = pPlayerActor->sector()->floorz;
}
else
{
nMove = movesprite_(pPlayerActor, x, y, z, 5120, -5120, CLIPMASK0);
nMove = movesprite(pPlayerActor, vect, zz, -20, CLIPMASK0);
auto pPlayerSect = pPlayerActor->sector();
@ -1096,7 +1094,7 @@ sectdone:
double fz = pViewSect->floorz - 20;
pPlayerActor->spr.pos = DVector3(spr_pos.XY(), fz);
auto coll = movesprite_(pPlayerActor, x, y, 0, 5120, 0, CLIPMASK0);
auto coll = movesprite(pPlayerActor, vect, 0, 0, CLIPMASK0);
if (coll.type == kHitWall)
{
ChangeActorSect(pPlayerActor, pPlayerActor->sector());

View file

@ -332,7 +332,7 @@ Collision QueenAngleChase(DExhumedActor* pActor, DExhumedActor* pActor2, int thr
double zz = pActor->pitch.Sin() * veclen;
return movesprite_(pActor, FloatToFixed<18>(vec.X), FloatToFixed<18>(vec.Y), zz * 4096 + BobVal(bobangle) * 512, 0, 0, CLIPMASK1);
return movesprite(pActor, vec, zz * 16 + BobVal(bobangle) * 2, 0, CLIPMASK1);
}
int DestroyTailPart()
@ -931,9 +931,9 @@ void AIQueenHead::Tick(RunListEvent* ev)
// DEMO-TODO: in disassembly angle was used without masking and thus causing OOB issue.
// This behavior probably would be needed emulated for demo compatibility
auto dv = nAngle.ToVector() * 64;
int dz = (RandomSize(5) - RandomSize(5)) << 7;
double dz = (RandomSize(5) - RandomSize(5)) * 0.5;
movesprite_(pActor, FloatToFixed<18>(dv.X), FloatToFixed<18>(dv.Y), dz, 0, 0, CLIPMASK1);
movesprite(pActor, dv, dz, 0, CLIPMASK1);
BlowChunks(pActor);
BuildExplosion(pActor);

View file

@ -140,7 +140,7 @@ void AISoul::Tick(RunListEvent* ev)
double nVel = DAngle::fromBuild(pActor->spr.extra).Cos();
auto vect = pActor->spr.angle.ToVector() * nVel * 8;
auto coll = movesprite_(pActor, FloatToFixed<18>(vect.X), FloatToFixed<18>(vect.Y), pActor->int_zvel(), 5120, 0, CLIPMASK0);
auto coll = movesprite(pActor,vect, pActor->vel.Z, 0, CLIPMASK0);
if (coll.exbits & 0x10000)
{
DExhumedActor* pSet = pActor->pTarget;

View file

@ -305,11 +305,7 @@ void AISnake::Tick(RunListEvent* ev)
{
SEARCH_ENEMY:
auto vec = pActor->spr.angle.ToVector() * 37.5;
nMov = movesprite_(pActor,
FixedToFloat<18>(vec.X),
FixedToFloat<18>(vec.Y),
bsin(SnakeList[nSnake].nAngle, -5),
0, 0, CLIPMASK1);
nMov = movesprite(pActor, vec, BobVal(SnakeList[nSnake].nAngle) * 2, 0, CLIPMASK1);
FindSnakeEnemy(nSnake);