diff --git a/source/core/maptypes.h b/source/core/maptypes.h index a3d788b94..0366c0253 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -504,6 +504,30 @@ struct tspritetype : public spritetypebase { __int_pos = pos; } + void add_int_x(int x) + { + __int_pos.X += x; + } + void set_int_x(int x) + { + __int_pos.X = x; + } + void add_int_y(int x) + { + __int_pos.Y += x; + } + void set_int_y(int x) + { + __int_pos.Y = x; + } + void add_int_z(int x) + { + __int_pos.Z += x; + } + void set_int_z(int x) + { + __int_pos.Z = x; + } }; class tspriteArray diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index c0ba0c78b..f648f686a 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -318,13 +318,13 @@ void HWDrawInfo::DispatchSprites() if (actor->sprext.renderflags & SPREXT_AWAY1) { - tspr->__int_pos.X += bcos(tspr->ang, -13); - tspr->__int_pos.Y += bsin(tspr->ang, -13); + tspr->add_int_x(bcos(tspr->ang, -13)); + tspr->add_int_y(bsin(tspr->ang, -13)); } else if (actor->sprext.renderflags & SPREXT_AWAY2) { - tspr->__int_pos.X -= bcos(tspr->ang, -13); - tspr->__int_pos.Y -= bsin(tspr->ang, -13); + tspr->add_int_x(-bcos(tspr->ang, -13)); + tspr->add_int_y(-bsin(tspr->ang, -13)); } switch (tspr->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) diff --git a/source/core/rendering/scene/hw_flats.cpp b/source/core/rendering/scene/hw_flats.cpp index c38c8c7be..061e949fc 100644 --- a/source/core/rendering/scene/hw_flats.cpp +++ b/source/core/rendering/scene/hw_flats.cpp @@ -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->__int_pos.Z = sprite->sectp->floorz; } z = sprite->int_pos().Z * (1 / -256.f); if (z == di->Viewpoint.Pos.Z) return; // looking right at the edge. diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index 8b8b12e38..d7b63adb6 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -170,7 +170,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF if (perc >= 75) pNSprite2->pal = 0; else if (perc >= 50) pNSprite2->pal = 6; - pNSprite2->__int_pos.Z = top - 2048; + pNSprite2->set_int_z(top - 2048); pNSprite2->shade = -128; break; } @@ -207,7 +207,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF pNSprite->shade = -128; pNSprite->pal = 0; - pNSprite->__int_pos.Z = top; + pNSprite->set_int_z(top); if (nViewEffect == kViewEffectFlag) pNSprite->xrepeat = pNSprite->yrepeat = 24; else @@ -221,7 +221,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF if (!pNSprite) break; - pNSprite->__int_pos.Z = pTSprite->int_pos().Z; + pNSprite->set_int_z(pTSprite->int_pos().Z); pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pNSprite->shade = -128; pNSprite->xrepeat = pTSprite->xrepeat; @@ -267,7 +267,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; pNSprite->xrepeat = pNSprite->yrepeat = 24; pNSprite->picnum = 626; - pNSprite->__int_pos.Z = top; + pNSprite->set_int_z(top); break; } case kViewEffectTrail: @@ -314,7 +314,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF break; pNSprite->shade = -128; - pNSprite->__int_pos.Z = pTSprite->int_pos().Z; + pNSprite->set_int_z(pTSprite->int_pos().Z); pNSprite->picnum = 908; pNSprite->statnum = kStatDecoration; pNSprite->xrepeat = pNSprite->yrepeat = (tileWidth(pTSprite->picnum) * pTSprite->xrepeat) / 64; @@ -328,7 +328,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF int top, bottom; GetSpriteExtents(pTSprite, &top, &bottom); - pNSprite->__int_pos.Z = top; + pNSprite->set_int_z(top); if (IsDudeSprite(pTSprite)) pNSprite->picnum = 672; else @@ -347,7 +347,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF int top, bottom; GetSpriteExtents(pTSprite, &top, &bottom); - pNSprite->__int_pos.Z = bottom; + pNSprite->set_int_z(bottom); if (pTSprite->type >= kDudeBase && pTSprite->type < kDudeMax) pNSprite->picnum = 672; else @@ -366,7 +366,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF int top, bottom; GetSpriteExtents(pTSprite, &top, &bottom); - pNSprite->__int_pos.Z = top; + pNSprite->set_int_z(top); pNSprite->picnum = 2101; pNSprite->shade = -128; pNSprite->xrepeat = pNSprite->yrepeat = (tileWidth(pTSprite->picnum) * pTSprite->xrepeat) / 32; @@ -380,7 +380,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF int top, bottom; GetSpriteExtents(pTSprite, &top, &bottom); - pNSprite->__int_pos.Z = bottom; + pNSprite->set_int_z(bottom); pNSprite->picnum = 2101; pNSprite->shade = -128; pNSprite->xrepeat = pNSprite->yrepeat = (tileWidth(pTSprite->picnum) * pTSprite->xrepeat) / 32; @@ -431,7 +431,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF pNSprite->shade = -128; pNSprite->pal = 2; pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT; - pNSprite->__int_pos.Z = pTSprite->int_pos().Z; + pNSprite->set_int_z(pTSprite->int_pos().Z); pNSprite->xrepeat = pTSprite->xrepeat; pNSprite->yrepeat = pTSprite->yrepeat; pNSprite->picnum = 2427; @@ -479,7 +479,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF if (!pNSprite) break; - pNSprite->__int_pos.Z = pTSprite->int_pos().Z; + pNSprite->set_int_z(pTSprite->int_pos().Z); if (gDetail > 1) pNSprite->cstat |= CSTAT_SPRITE_TRANSLUCENT | CSTAT_SPRITE_TRANS_FLIP; pNSprite->shade = ClipLow(pTSprite->shade - 32, -128); @@ -513,8 +513,8 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF pNSprite->picnum = nVoxel; if (pPlayer->curWeapon == kWeapLifeLeech) // position lifeleech behind player { - pNSprite->__int_pos.X += MulScale(128, Cos(gView->actor->spr.ang), 30); - pNSprite->__int_pos.Y += MulScale(128, Sin(gView->actor->spr.ang), 30); + pNSprite->add_int_x(MulScale(128, Cos(gView->actor->spr.ang), 30)); + pNSprite->add_int_y(MulScale(128, Sin(gView->actor->spr.ang), 30)); } if ((pPlayer->curWeapon == kWeapLifeLeech) || (pPlayer->curWeapon == kWeapVoodooDoll)) // make lifeleech/voodoo doll always face viewer like sprite pNSprite->ang = (pNSprite->ang + 512) & 2047; // offset angle 90 degrees @@ -578,7 +578,7 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t if (cl_interpolate && owneractor->interpolated && !(pTSprite->flags & 512)) { - pTSprite->int_pos() = owneractor->interpolatedvec3(gInterpolate); + pTSprite->set_int_pos(owneractor->interpolatedvec3(gInterpolate)); pTSprite->ang = owneractor->interpolatedang(gInterpolate); } int nAnim = 0; @@ -902,9 +902,9 @@ void viewProcessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t auto pNTSprite = viewAddEffect(tsprites, nTSprite, kViewEffectShoot); if (pNTSprite) { POSTURE* pPosture = &pPlayer->pPosture[pPlayer->lifeMode][pPlayer->posture]; - pNTSprite->__int_pos.X += MulScale(pPosture->zOffset, Cos(pTSprite->ang), 28); - pNTSprite->__int_pos.Y += MulScale(pPosture->zOffset, Sin(pTSprite->ang), 28); - pNTSprite->__int_pos.Z = pPlayer->actor->int_pos().Z - pPosture->xOffset; + pNTSprite->add_int_x(MulScale(pPosture->zOffset, Cos(pTSprite->ang), 28)); + pNTSprite->add_int_y(MulScale(pPosture->zOffset, Sin(pTSprite->ang), 28)); + pNTSprite->set_int_z(pPlayer->actor->int_pos().Z - pPosture->xOffset); } } diff --git a/source/games/blood/src/db.h b/source/games/blood/src/db.h index e79e645cc..58cdc3e42 100644 --- a/source/games/blood/src/db.h +++ b/source/games/blood/src/db.h @@ -82,7 +82,7 @@ extern int gSkyCount; void GetSpriteExtents(spritetypebase const* const pSprite, int* top, int* bottom) { - *top = *bottom = pSprite->__int_pos.Z; + *top = *bottom = pSprite->int_pos().Z; if ((pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR) { int height = tileHeight(pSprite->picnum); diff --git a/source/games/duke/src/animatesprites_d.cpp b/source/games/duke/src/animatesprites_d.cpp index 9b0a3abdd..8d00932ae 100644 --- a/source/games/duke/src/animatesprites_d.cpp +++ b/source/games/duke/src/animatesprites_d.cpp @@ -165,14 +165,14 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat if (t->statnum == 99) continue; if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && ps[h->spr.yvel].newOwner == nullptr && h->GetOwner()) { - t->__int_pos.X -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.X - ps[h->spr.yvel].opos.X, 16); - t->__int_pos.Y -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.Y - ps[h->spr.yvel].opos.Y, 16); - t->__int_pos.Z = interpolatedvalue(ps[h->spr.yvel].opos.Z, ps[h->spr.yvel].pos.Z, smoothratio); - t->__int_pos.Z += PHEIGHT_DUKE; + 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->add_int_z(PHEIGHT_DUKE); } else if (!actorflag(h, SFLAG_NOINTERPOLATE)) { - t->__int_pos = h->interpolatedvec3(smoothratio); + t->set_int_pos(h->interpolatedvec3(smoothratio)); } auto sectp = h->sector(); @@ -183,7 +183,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat switch (h->spr.picnum) { case DUKELYINGDEAD: - t->__int_pos.Z += (24 << 8); + t->add_int_z(24 << 8); break; case BLOODPOOL: case FOOTPRINTS: @@ -226,14 +226,14 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat else { t->ang = getangle(x - t->int_pos().X, y - t->int_pos().Y); - t->__int_pos.X = OwnerAc->int_pos().X + bcos(t->ang, -10); - t->__int_pos.Y = OwnerAc->int_pos().Y + bsin(t->ang, -10); + t->set_int_x(OwnerAc->int_pos().X + bcos(t->ang, -10)); + t->set_int_y(OwnerAc->int_pos().Y + bsin(t->ang, -10)); } } break; case ATOMICHEALTH: - t->__int_pos.Z -= (4 << 8); + t->add_int_z(-(4 << 8)); break; case CRYSTALAMMO: t->shade = bsin(PlayClock << 4, -10); @@ -355,8 +355,8 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat } if (h->GetOwner()) - newtspr->__int_pos.Z = ps[p].pos.Z - (12 << 8); - else newtspr->__int_pos.Z = h->int_pos().Z - (51 << 8); + newtspr->set_int_z(ps[p].pos.Z - (12 << 8)); + else newtspr->set_int_z(h->int_pos().Z - (51 << 8)); if (ps[p].curr_weapon == HANDBOMB_WEAPON) { newtspr->xrepeat = 10; @@ -429,7 +429,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) - t->__int_pos.Z = h->floorz; + t->set_int_z(h->floorz); break; @@ -588,7 +588,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat shadowspr->shade = 127; shadowspr->cstat |= CSTAT_SPRITE_TRANSLUCENT; - shadowspr->__int_pos.Z = daz; + shadowspr->set_int_z(daz); shadowspr->pal = 4; if (hw_models && md_tilehasmodel(t->picnum, t->pal) >= 0) @@ -602,9 +602,9 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat else { // Alter the shadow's position so that it appears behind the sprite itself. - int look = getangle(shadowspr->int_pos() - ps[screenpeek].pos.X, shadowspr->__int_pos.Y - ps[screenpeek].pos.Y); - shadowspr->__int_pos.X += bcos(look, -9); - shadowspr->__int_pos.Y += bsin(look, -9); + int look = getangle(shadowspr->int_pos().X - ps[screenpeek].pos.X, shadowspr->int_pos().Y - ps[screenpeek].pos.Y); + shadowspr->add_int_x(bcos(look, -9)); + shadowspr->add_int_y(bsin(look, -9)); } } } @@ -623,7 +623,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat case LASERLINE: if (!OwnerAc) break; if (t->sectp->lotag == 2) t->pal = 8; - t->__int_pos.Z = OwnerAc->int_pos().Z - (3 << 8); + t->set_int_z(OwnerAc->int_pos().Z - (3 << 8)); if (gs.lasermode == 2 && ps[screenpeek].heat_on == 0) t->yrepeat = 0; t->shade = -127; @@ -654,7 +654,7 @@ void animatesprites_d(tspriteArray& tsprites, int x, int y, int a, int smoothrat case BURNING2: if (!OwnerAc) break; if (!actorflag(OwnerAc, SFLAG_NOFLOORFIRE)) - t->__int_pos.Z = t->sectp->floorz; + t->set_int_z(t->sectp->floorz); t->shade = -127; break; case COOLEXPLOSION1: diff --git a/source/games/duke/src/animatesprites_r.cpp b/source/games/duke/src/animatesprites_r.cpp index aab96f98a..1a5062eac 100644 --- a/source/games/duke/src/animatesprites_r.cpp +++ b/source/games/duke/src/animatesprites_r.cpp @@ -145,16 +145,16 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat if (t->statnum == 99) continue; if (h->spr.statnum != STAT_ACTOR && h->spr.picnum == APLAYER && ps[h->spr.yvel].newOwner == nullptr && h->GetOwner()) { - t->__int_pos.X -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.X - ps[h->spr.yvel].opos.X, 16); - t->__int_pos.Y -= MulScale(MaxSmoothRatio - smoothratio, ps[h->spr.yvel].pos.Y - ps[h->spr.yvel].opos.Y, 16); - t->__int_pos.Z = interpolatedvalue(ps[h->spr.yvel].opos.Z, ps[h->spr.yvel].pos.Z, smoothratio); + 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; h->spr.xrepeat = 24; h->spr.yrepeat = 17; } else if (!actorflag(h, SFLAG_NOINTERPOLATE)) { - t->__int_pos = h->interpolatedvec3(smoothratio); + t->set_int_pos(h->interpolatedvec3(smoothratio)); } auto sectp = h->sector(); @@ -220,10 +220,10 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat else { t->ang = getangle(x - t->int_pos().X, y - t->int_pos().Y); - t->__int_pos.X = OwnerAc->int_pos().X; - t->__int_pos.Y = OwnerAc->int_pos().Y; - t->__int_pos.X += bcos(t->ang, -10); - t->__int_pos.Y += bsin(t->ang, -10); + t->set_int_x(OwnerAc->int_pos().X); + t->set_int_y(OwnerAc->int_pos().Y); + t->add_int_x(bcos(t->ang, -10)); + t->add_int_y(bsin(t->ang, -10)); } } break; @@ -397,8 +397,8 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat } if (h->GetOwner()) - newtspr->__int_pos.Z = ps[p].pos.Z - (12 << 8); - else newtspr->__int_pos.Z = h->int_pos().Z - (51 << 8); + newtspr->set_int_z(ps[p].pos.Z - (12 << 8)); + else newtspr->set_int_z(h->int_pos().Z - (51 << 8)); if (ps[p].curr_weapon == HANDBOMB_WEAPON) { newtspr->xrepeat = 10; @@ -475,7 +475,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) - t->__int_pos.Z = h->floorz; + t->set_int_z(h->floorz); if (ps[p].OnMotorcycle && p == screenpeek) { @@ -746,7 +746,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat shadowspr->shade = 127; shadowspr->cstat |= CSTAT_SPRITE_TRANSLUCENT; - shadowspr->__int_pos.Z = daz; + shadowspr->set_int_z(daz); shadowspr->pal = 4; if (hw_models && md_tilehasmodel(t->picnum, t->pal) >= 0) @@ -760,9 +760,9 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat else { // Alter the shadow's position so that it appears behind the sprite itself. - int look = getangle(shadowspr->__int_pos.X - ps[screenpeek].pos.X, shadowspr->__int_pos.Y - ps[screenpeek].pos.Y); - shadowspr->__int_pos.X += bcos(look, -9); - shadowspr->__int_pos.Y += bsin(look, -9); + int look = getangle(shadowspr->int_pos().X - ps[screenpeek].pos.X, shadowspr->int_pos().Y - ps[screenpeek].pos.Y); + shadowspr->add_int_x(bcos(look, -9)); + shadowspr->add_int_y(bsin(look, -9)); } } } @@ -813,7 +813,7 @@ void animatesprites_r(tspriteArray& tsprites, int x, int y, int a, int smoothrat case FIRE: case BURNING: if (!OwnerAc || !actorflag(OwnerAc, SFLAG_NOFLOORFIRE)) - t->__int_pos.Z = t->sectp->floorz; + t->set_int_z(t->sectp->floorz); t->shade = -127; break; case WALLLIGHT3: diff --git a/source/games/exhumed/src/sequence.cpp b/source/games/exhumed/src/sequence.cpp index bf2911030..1afae44fa 100644 --- a/source/games/exhumed/src/sequence.cpp +++ b/source/games/exhumed/src/sequence.cpp @@ -626,7 +626,7 @@ int seq_PlotSequence(int nSprite, int16_t edx, int16_t nFrame, int16_t ecx) { pTSprite->picnum = nShadowPic; - edx = ((tileWidth(nPict) << 5) / nShadowWidth) - ((nFloorZ - pTSprite->__int_pos.Z) >> 10); + edx = ((tileWidth(nPict) << 5) / nShadowWidth) - ((nFloorZ - pTSprite->int_pos().Z) >> 10); if (edx < 1) { edx = 1; } diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index ce901c09c..9df2deaf0 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -336,8 +336,8 @@ void DoShadows(tspriteArray& tsprites, tspritetype* tsp, int viewz, int camang) { // Alter the shadow's position so that it appears behind the sprite itself. int look = getangle(tSpr->int_pos().X - Player[screenpeek].si.X, tSpr->int_pos().Y - Player[screenpeek].si.Y); - tSpr->__int_pos.X += bcos(look, -9); - tSpr->__int_pos.Y += bsin(look, -9); + tSpr->add_int_x(bcos(look, -9)); + tSpr->add_int_y(bsin(look, -9)); } // Check for voxel items and use a round generic pic if so @@ -406,12 +406,12 @@ void DoMotionBlur(tspriteArray& tsprites, tspritetype const * const tsp) *tSpr = *tsp; tSpr->cstat |= CSTAT_SPRITE_TRANSLUCENT|CSTAT_SPRITE_TRANS_FLIP; - tSpr->__int_pos.X += dx; - tSpr->__int_pos.Y += dy; + tSpr->add_int_x(dx); + tSpr->add_int_y(dy); dx += nx; dy += ny; - tSpr->__int_pos.Z += dz; + tSpr->add_int_z(dz); dz += nz; tSpr->xrepeat = uint8_t(xrepeat); @@ -479,7 +479,7 @@ void WarpCopySprite(tspriteArray& tsprites) tspritetype* newTSpr = renderAddTsprite(tsprites, itActor2); newTSpr->statnum = 0; - auto off = itActor1->int_pos() - newTSpr->__int_pos; + auto off = itActor1->int_pos() - newTSpr->int_pos(); newTSpr->__int_pos = itActor->int_pos() - off; newTSpr->sectp = itActor->sector(); } @@ -492,7 +492,7 @@ void DoStarView(tspritetype* tsp, DSWActor* tActor, int viewz) { extern STATE s_Star[], s_StarDown[]; extern STATE s_StarStuck[], s_StarDownStuck[]; - int zdiff = viewz - tsp->__int_pos.Z; + int zdiff = viewz - tsp->int_pos().Z; if (labs(zdiff) > Z(24)) { @@ -517,7 +517,7 @@ DSWActor* CopySprite(sprt const* tsp, sectortype* newsector) auto actorNew = insertActor(newsector, STAT_FAF_COPY); - actorNew->set_int_pos(tsp->__int_pos); + actorNew->set_int_pos(tsp->int_pos()); actorNew->spr.cstat = tsp->cstat; actorNew->spr.picnum = tsp->picnum; actorNew->spr.pal = tsp->pal; @@ -788,8 +788,8 @@ void analyzesprites(tspriteArray& tsprites, int viewx, int viewy, int viewz, int { pp = tActor->user.PlayerP; int sr = 65536 - int(smoothratio); - tsp->__int_pos.X -= MulScale(pp->pos.X - pp->opos.X, sr, 16); - tsp->__int_pos.Y -= MulScale(pp->pos.Y - pp->opos.Y, sr, 16); + 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->ang -= MulScale(pp->angle.ang.asbuild() - pp->angle.oang.asbuild(), sr, 16); } @@ -908,8 +908,8 @@ void post_analyzesprites(tspriteArray& tsprites) continue; } - tsp->__int_pos.X = atsp->int_pos().X; - tsp->__int_pos.Y = atsp->int_pos().Y; + tsp->set_int_x(atsp->int_pos().X); + tsp->set_int_y(atsp->int_pos().Y); // statnum is priority - draw this ALWAYS first at 0 // statnum is priority - draw this ALWAYS last at MAXSTATUS if ((atsp->extra & SPRX_BURNABLE))