diff --git a/source/core/binaryangle.h b/source/core/binaryangle.h index e5abfb44c..d383258a4 100644 --- a/source/core/binaryangle.h +++ b/source/core/binaryangle.h @@ -419,26 +419,14 @@ inline constexpr int32_t interpolatedangle(int32_t oang, int32_t ang, int const return oang + MulScale(((ang + 1024 - oang) & 2047) - 1024, smoothratio, scale); } -inline constexpr binangle interpolatedangle(binangle oang, binangle ang, double const smoothratio, int const scale = 16) -{ - return bamang(oang.asbam() + MulScale(((ang.asbam() + 0x80000000 - oang.asbam()) & 0xFFFFFFFF) - 0x80000000, int(smoothratio), scale)); -} - -inline constexpr binangle interpolatedangle(binangle oang, binangle ang, int const smoothratio, int const scale = 16) -{ - return bamang(oang.asbam() + MulScale(((ang.asbam() + 0x80000000 - oang.asbam()) & 0xFFFFFFFF) - 0x80000000, smoothratio, scale)); -} - -// FIXME: Can't rely on overloading this to functions we're trying to deprecate. OK for now. inline constexpr DAngle interpolatedangle(DAngle oang, DAngle ang, double const smoothratio, int const scale = 16) { - return DAngle::fromBam(interpolatedangle(bamang(oang.BAMs()), bamang(ang.BAMs()), int(smoothratio), scale).asbam()); + return DAngle::fromBam(oang.BAMs() + MulScale(((ang.BAMs() + 0x80000000 - oang.BAMs()) & 0xFFFFFFFF) - 0x80000000, int(smoothratio), scale)); } -// FIXME: Can't rely on overloading this to functions we're trying to deprecate. OK for now. inline constexpr DAngle interpolatedangle(DAngle oang, DAngle ang, int const smoothratio, int const scale = 16) { - return DAngle::fromBam(interpolatedangle(bamang(oang.BAMs()), bamang(ang.BAMs()), smoothratio, scale).asbam()); + return DAngle::fromBam(oang.BAMs() + MulScale(((ang.BAMs() + 0x80000000 - oang.BAMs()) & 0xFFFFFFFF) - 0x80000000, smoothratio, scale)); } inline constexpr fixedhoriz interpolatedhorizon(fixedhoriz oval, fixedhoriz val, double const smoothratio, int const scale = 16) diff --git a/source/games/blood/src/qav.cpp b/source/games/blood/src/qav.cpp index 6e174b0dd..95d6ef3f6 100644 --- a/source/games/blood/src/qav.cpp +++ b/source/games/blood/src/qav.cpp @@ -198,7 +198,7 @@ void QAV::Draw(double x, double y, int ticks, int stat, int shade, int palnum, b tileX += interpolatedvaluef(prevTile->x, thisTile->x, smoothratio); tileY += interpolatedvaluef(prevTile->y, thisTile->y, smoothratio); tileZ = interpolatedvaluef(prevTile->z, thisTile->z, smoothratio); - tileA = interpolatedangle(buildang(prevTile->angle), buildang(thisTile->angle), smoothratio).asbuildf(); + tileA = interpolatedangle(DAngle::fromBuild(prevTile->angle), DAngle::fromBuild(thisTile->angle), smoothratio).Buildfang(); tileShade = interpolatedvalue(prevTile->shade, thisTile->shade, smoothratio) + shade; auto prevAlpha = ((stat | prevTile->stat) & RS_TRANS1) ? glblend[0].def[!!((stat | prevTile->stat) & RS_TRANS2)].alpha : 1.; auto thisAlpha = (tileStat & RS_TRANS1) ? glblend[0].def[!!(tileStat & RS_TRANS2)].alpha : 1.; diff --git a/source/games/exhumed/src/gun.cpp b/source/games/exhumed/src/gun.cpp index 1a3e1d23b..d63cafa7b 100644 --- a/source/games/exhumed/src/gun.cpp +++ b/source/games/exhumed/src/gun.cpp @@ -927,7 +927,7 @@ void DrawWeapons(double smooth) if (cl_hudinterpolation) { - nBobAngle = interpolatedangle(buildang(obobangle), buildang(bobangle), smooth).asbuildf(); + nBobAngle = interpolatedangle(DAngle::fromBuild(obobangle), DAngle::fromBuild(bobangle), smooth).Buildfang(); nVal = interpolatedvaluef(PlayerList[nLocalPlayer].ototalvel, PlayerList[nLocalPlayer].totalvel, smooth, 16) * 0.5; } else