From 1d28ebec98177645ee2e90a497b368ec866e4932 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 30 Aug 2022 22:18:41 +0200 Subject: [PATCH] - eliminated add_int_z and add_int_y wrappers --- source/core/maptypes.h | 8 -------- source/games/blood/src/animatesprite.cpp | 6 ++---- source/games/sw/src/draw.cpp | 4 ++-- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/source/core/maptypes.h b/source/core/maptypes.h index eec69d037..8dfa937d2 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -527,14 +527,6 @@ struct tspritetype : public spritetypebase DCoreActor* ownerActor; int time; - void add_int_x(int x) - { - pos.X += x * inttoworld; - } - void add_int_y(int x) - { - pos.Y += x * inttoworld; - } void add_int_z(int x) { pos.Z += x * zinttoworld; diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index 0ebc82f81..b18ce60d4 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -483,8 +483,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF pNSprite->picnum = nVoxel; if (pPlayer->curWeapon == kWeapLifeLeech) // position lifeleech behind player { - pNSprite->add_int_x(MulScale(128, Cos(gView->actor->int_ang()), 30)); - pNSprite->add_int_y(MulScale(128, Sin(gView->actor->int_ang()), 30)); + pNSprite->pos.XY() += gView->actor->spr.angle.ToVector() * 8; } if ((pPlayer->curWeapon == kWeapLifeLeech) || (pPlayer->curWeapon == kWeapVoodooDoll)) // make lifeleech/voodoo doll always face viewer like sprite pNSprite->set_int_ang((pNSprite->int_ang() + 512) & 2047); // offset angle 90 degrees @@ -874,8 +873,7 @@ 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->add_int_x(MulScale(pPosture->zOffset, Cos(pTSprite->int_ang()), 28)); - pNTSprite->add_int_y(MulScale(pPosture->zOffset, Sin(pTSprite->int_ang()), 28)); + pNTSprite->pos.XY() += pTSprite->angle.ToVector() * pPosture->zOffset * 0.25; pNTSprite->set_int_z(pPlayer->actor->int_pos().Z - pPosture->xOffset); } } diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index fecc22286..c4c3c4af9 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -408,8 +408,8 @@ void DoMotionBlur(tspriteArray& tsprites, tspritetype const * const tsp) *tSpr = *tsp; tSpr->cstat |= CSTAT_SPRITE_TRANSLUCENT|CSTAT_SPRITE_TRANS_FLIP; - tSpr->add_int_x(dx); - tSpr->add_int_y(dy); + tSpr->pos.X += (dx * inttoworld); + tSpr->pos.Y += (dy * inttoworld); dx += nx; dy += ny;