From a8cc6c11895c95140fbbca2dcd13b7d855b159db Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 26 Sep 2022 18:24:56 +0200 Subject: [PATCH] - floatified angles in useSectorWindGen plus two other set_int_ang. --- source/games/blood/src/actor.cpp | 2 +- source/games/blood/src/animatesprite.cpp | 2 +- source/games/blood/src/nnexts.cpp | 14 ++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index a1462a27c..c6674f328 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -6489,7 +6489,7 @@ DBloodActor* actFireMissile(DBloodActor* actor, int xyoff, int zoff, int dx, int spawned->spr.xrepeat = pMissileInfo->xrepeat; spawned->spr.yrepeat = pMissileInfo->yrepeat; spawned->spr.picnum = pMissileInfo->picnum; - spawned->set_int_ang((actor->int_ang() + pMissileInfo->angleOfs) & 2047); + spawned->spr.angle = actor->spr.angle += DAngle::fromBuild(pMissileInfo->angleOfs); spawned->set_int_bvel_x(MulScale(pMissileInfo->velocity, dx, 14)); spawned->set_int_bvel_y(MulScale(pMissileInfo->velocity, dy, 14)); spawned->set_int_bvel_z(MulScale(pMissileInfo->velocity, dz, 14)); diff --git a/source/games/blood/src/animatesprite.cpp b/source/games/blood/src/animatesprite.cpp index 4be935c29..c67bf4caa 100644 --- a/source/games/blood/src/animatesprite.cpp +++ b/source/games/blood/src/animatesprite.cpp @@ -479,7 +479,7 @@ static tspritetype* viewAddEffect(tspriteArray& tsprites, int nTSprite, VIEW_EFF if (cl_showweapon == 2 && r_voxels && nVoxel != -1) { auto gView = &gPlayer[gViewIndex]; - pNSprite->set_int_ang((gView->actor->int_ang() + 512) & 2047); // always face viewer + pNSprite->angle = gView->actor->spr.angle += DAngle90; // always face viewer pNSprite->cstat |= CSTAT_SPRITE_ALIGNMENT_SLAB; pNSprite->cstat &= ~CSTAT_SPRITE_YFLIP; pNSprite->picnum = nVoxel; diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index c9a461e01..cd019b0f1 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -3430,12 +3430,12 @@ void useSectorWindGen(DBloodActor* sourceactor, sectortype* pSector) if ((sourceactor->spr.flags & kModernTypeFlag1)) pXSector->panAlways = pXSector->windAlways = 1; - int ang = sourceactor->int_ang(); + DAngle angle = sourceactor->spr.angle; if (sourceactor->xspr.data4 <= 0) { if ((sourceactor->xspr.data1 & 0x0002)) { - while (sourceactor->int_ang() == ang) + while (sourceactor->spr.angle == angle) sourceactor->spr.angle = RandomAngle(); } } @@ -3443,13 +3443,15 @@ void useSectorWindGen(DBloodActor* sourceactor, sectortype* pSector) else if (sourceactor->spr.cstat & CSTAT_SPRITE_MOVE_REVERSE) sourceactor->spr.angle -= mapangle(sourceactor->xspr.data4); else if (sourceactor->xspr.sysData1 == 0) { - if ((ang += sourceactor->xspr.data4) >= kAng180) sourceactor->xspr.sysData1 = 1; - sourceactor->set_int_ang(ClipHigh(ang, kAng180)); + angle += mapangle(sourceactor->xspr.data4); + if (angle >= DAngle180) sourceactor->xspr.sysData1 = 1; + sourceactor->spr.angle = min(angle, DAngle180); } else { - if ((ang -= sourceactor->xspr.data4) <= -kAng180) sourceactor->xspr.sysData1 = 0; - sourceactor->set_int_ang(ClipLow(ang, -kAng180)); + angle -= mapangle(sourceactor->xspr.data4); + if (angle <= -DAngle180) sourceactor->xspr.sysData1 = 0; + sourceactor->spr.angle = max(angle, -DAngle180); } pXSector->windAng = sourceactor->spr.angle;