From 5fba68ffe108899d6dd4208ab42e91597014e175 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 30 Aug 2022 20:59:21 +0200 Subject: [PATCH] =?UTF-8?q?-=20floatified=20Blood=E2=80=99s=20kViewEffectT?= =?UTF-8?q?rail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/games/blood/src/animatesprite.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index 023a8a096..0ebc82f81 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -241,14 +241,14 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF } case kViewEffectTrail: { - int nAng = pTSprite->int_ang(); + auto nAng = pTSprite->angle; if (pTSprite->cstat & CSTAT_SPRITE_ALIGNMENT_WALL) { - nAng = (nAng + 512) & 2047; + nAng += DAngle90; } else { - nAng = (nAng + 1024) & 2047; + nAng += DAngle180; } for (int i = 0; i < 5; i++) { @@ -257,10 +257,9 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF if (!pNSprite) break; - int nLen = 128 + (i << 7); - int x = MulScale(nLen, Cos(nAng), 30); - int y = MulScale(nLen, Sin(nAng), 30); - pNSprite->set_int_pos({ pTSprite->int_pos().X + x, pTSprite->int_pos().Y + y, pTSprite->int_pos().Z }); + double nLen = 8.0 * (i + 1); + auto vect = nAng.ToVector() * nLen; + pNSprite->pos = pTSprite->pos + vect; assert(pSector); auto pSector2 = pSector; updatesectorz(pNSprite->pos, &pSector2);