- handle the last remaining uses of __int_pos that can be done with the function interface.

This commit is contained in:
Christoph Oelckers 2022-02-03 00:01:57 +01:00
parent 8ccaa0ab8c
commit 1231f6025d
8 changed files with 19 additions and 19 deletions

View file

@ -324,8 +324,8 @@ inline int32_t tspriteGetZOfSlope(const tspritetype* tspr, int dax, int day)
int heinum = tspriteGetSlope(tspr);
if (heinum == 0) return tspr->__int_pos.Z;
int const j = DMulScale(bsin(tspr->ang + 1024), day - tspr->__int_pos.Y, -bsin(tspr->ang + 512), dax - tspr->__int_pos.X, 4);
return tspr->__int_pos.Z + MulScale(heinum, j, 18);
int const j = DMulScale(bsin(tspr->ang + 1024), day - tspr->int_pos().Y, -bsin(tspr->ang + 512), dax - tspr->int_pos().X, 4);
return tspr->int_pos().Z + MulScale(heinum, j, 18);
}
inline int inside(int x, int y, const sectortype* sect)

View file

@ -259,7 +259,7 @@ static void SetWallPalV5()
void validateSprite(spritetype& spri, int sectnum, int index)
{
auto pos = spri.__int_pos;
auto pos = spri.int_pos();
bool bugged = false;
if ((unsigned)spri.statnum >= MAXSTATUS)
{

View file

@ -424,7 +424,7 @@ void HWFlat::ProcessFlatSprite(HWDrawInfo* di, tspritetype* sprite, sectortype*
if (sprite->int_pos().Z > sprite->sectp->floorz)
{
belowfloor = true;
sprite->__int_pos.Z = sprite->sectp->floorz;
sprite->set_int_z(sprite->sectp->floorz);
}
z = sprite->int_pos().Z * (1 / -256.f);
if (z == di->Viewpoint.Pos.Z) return; // looking right at the edge.

View file

@ -305,7 +305,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
p = h->spr.yvel;
if (t->pal == 1) t->__int_pos.Z -= (18 << 8);
if (t->pal == 1) t->add_int_z(-(18 << 8));
if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr)
{
@ -428,7 +428,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat
if (!h->GetOwner()) continue;
if (t->__int_pos.Z > h->floorz && t->xrepeat < 32)
if (t->int_pos().Z > h->floorz && t->xrepeat < 32)
t->set_int_z(h->floorz);
break;

View file

@ -148,7 +148,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
t->add_int_x(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.X - ps[h->spr.yvel].opos.X, 16));
t->add_int_y(-MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.Y - ps[h->spr.yvel].opos.Y, 16));
t->set_int_z(interpolatedvalue(ps[h->spr.yvel].opos.Z, ps[h->spr.yvel].pos.Z, smoothratio));
t->__int_pos.Z += PHEIGHT_RR;
t->add_int_z(PHEIGHT_RR);
h->spr.xrepeat = 24;
h->spr.yrepeat = 17;
}
@ -181,7 +181,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
h->spr.xrepeat = 24;
h->spr.yrepeat = 17;
if (h->spr.extra > 0)
t->__int_pos.Z += (6 << 8);
t->add_int_z(6 << 8);
break;
case BLOODPOOL:
case FOOTPRINTS:
@ -349,7 +349,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
p = h->spr.yvel;
if (t->pal == 1) t->__int_pos.Z -= (18 << 8);
if (t->pal == 1) t->add_int_z(-(18 << 8));
if (ps[p].over_shoulder_on > 0 && ps[p].newOwner == nullptr)
{
@ -474,7 +474,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat
if (!h->GetOwner()) continue;
if (t->__int_pos.Z > h->floorz && t->xrepeat < 32)
if (t->int_pos().Z > h->floorz && t->xrepeat < 32)
t->set_int_z(h->floorz);
if (ps[p].OnMotorcycle && p == screenpeek)

View file

@ -632,7 +632,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx)
}
pTSprite->cstat = CSTAT_SPRITE_ALIGNMENT_FLOOR | CSTAT_SPRITE_TRANSLUCENT;
pTSprite->__int_pos.Z = nFloorZ;
pTSprite->set_int_z(nFloorZ);
pTSprite->yrepeat = (uint8_t)edx;
pTSprite->xrepeat = (uint8_t)edx;
pTSprite->statnum = -3;

View file

@ -73,7 +73,7 @@ static void analyzesprites(tspriteArray& tsprites, int x, int y, int z, double c
if (pTSprite->ownerActor)
{
// interpolate sprite position
pTSprite->__int_pos = pTSprite->ownerActor->interpolatedvec3(smoothratio);
pTSprite->set_int_pos(pTSprite->ownerActor->interpolatedvec3(smoothratio));
pTSprite->ang = pTSprite->ownerActor->interpolatedang(smoothratio);
}
}
@ -110,7 +110,7 @@ static void analyzesprites(tspriteArray& tsprites, int x, int y, int z, double c
{
pTSprite->cstat |= CSTAT_SPRITE_YCENTER;
int nTileY = (tileHeight(pTSprite->picnum) * pTSprite->yrepeat) * 2;
pTSprite->__int_pos.Z -= nTileY;
pTSprite->add_int_z(-nTileY);
}
if (pTSprite->pal == 4 && pTSprite->shade >= numshades) pTSprite->shade = numshades - 1;

View file

@ -300,7 +300,7 @@ void DoShadows(tspriteArray& tsprites, tspritetype* tsp, int viewz, int camang)
}
// need to find the ground here
tSpr->__int_pos.Z = loz;
tSpr->set_int_z(loz);
// if below or close to sprites z don't bother to draw it
if ((viewz - loz) > -Z(8))
@ -480,7 +480,7 @@ void WarpCopySprite(tspriteArray& tsprites)
newTSpr->statnum = 0;
auto off = itActor1->int_pos() - newTSpr->int_pos();
newTSpr->__int_pos = itActor->int_pos() - off;
newTSpr->set_int_pos(itActor->int_pos() - off);
newTSpr->sectp = itActor->sector();
}
}
@ -624,7 +624,7 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
{
if (tsp->statnum <= STAT_SKIP4_INTERP_END)
{
tsp->__int_pos = tActor->interpolatedvec3(smr4, 18);
tsp->set_int_pos(tActor->interpolatedvec3(smr4, 18));
}
}
@ -632,7 +632,7 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
{
if (tsp->statnum <= STAT_SKIP2_INTERP_END)
{
tsp->__int_pos = tActor->interpolatedvec3(smr2, 17);
tsp->set_int_pos(tActor->interpolatedvec3(smr2, 17));
}
}
}
@ -642,7 +642,7 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
{
int32_t const floorz = getflorzofslopeptr(tActor->sector(), tActor->int_pos().X, tActor->int_pos().Y);
if (tActor->int_pos().Z > floorz)
tsp->__int_pos.Z = floorz;
tsp->set_int_z(floorz);
}
if (r_shadows && (tActor->user.Flags & SPR_SHADOW))
@ -790,7 +790,7 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int
int sr = 65536 - int(smoothratio);
tsp->add_int_x(-MulScale(pp->pos.X - pp->opos.X, sr, 16));
tsp->add_int_y(-MulScale(pp->pos.Y - pp->opos.Y, sr, 16));
tsp->__int_pos.Z -= MulScale(pp->pos.Z - pp->opos.Z, sr, 16);
tsp->add_int_z(-MulScale(pp->pos.Z - pp->opos.Z, sr, 16));
tsp->ang -= MulScale(pp->angle.ang.asbuild() - pp->angle.oang.asbuild(), sr, 16);
}
}