From 8f75f06efde56ce291ea40be7267551ca0232551 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 4 Jan 2021 21:18:07 +1100 Subject: [PATCH] - Replace `tmulscale##()` calls with `TMulScale()` from common. --- source/blood/src/actor.cpp | 2 +- source/build/include/pragmas.h | 8 -------- source/common/utility/m_fixed.h | 1 + 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index 44b205cdd..bef8af83e 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -2631,7 +2631,7 @@ int actFloorBounceVector(int *x, int *y, int *z, int nSector, int a5) int t5 = divscale16(t2, t3); int t6 = mulscale30(t5, Cos(angle)); int t7 = mulscale30(t5, Sin(angle)); - int t8 = tmulscale16(*x, t6, *y, t7, *z, t4); + int t8 = TMulScale(*x, t6, *y, t7, *z, t4, 16); int t9 = mulscale16(t8, 0x10000+a5); *x -= mulscale16(t6, t9); *y -= mulscale16(t7, t9); diff --git a/source/build/include/pragmas.h b/source/build/include/pragmas.h index 367fb4f20..575df272e 100644 --- a/source/build/include/pragmas.h +++ b/source/build/include/pragmas.h @@ -65,14 +65,6 @@ static inline int32_t scale(int32_t eax, int32_t edx, int32_t ecx) { \ return ((eax * edx) + (esi * edi)) / (double)(qw(1) << a); \ } \ - static FORCE_INLINE int32_t tmulscale##a(int32_t eax, int32_t edx, int32_t ebx, int32_t ecx, int32_t esi, int32_t edi) \ - { \ - return dw(((qw(eax) * edx) + (qw(ebx) * ecx) + (qw(esi) * edi)) >> by(a)); \ - } \ - static FORCE_INLINE double ftmulscale##a(double eax, double edx, double ebx, double ecx, double esi, double edi) \ - { \ - return ((eax * edx) + (ebx * ecx) + (esi * edi)) / (double)(qw(1) << a); \ - } EDUKE32_GENERATE_PRAGMAS diff --git a/source/common/utility/m_fixed.h b/source/common/utility/m_fixed.h index 99115df6e..60abea9e9 100644 --- a/source/common/utility/m_fixed.h +++ b/source/common/utility/m_fixed.h @@ -8,6 +8,7 @@ __forceinline constexpr int32_t MulScale(int32_t a, int32_t b, int32_t shift) { return (int32_t)(((int64_t)a * b) >> shift); } __forceinline constexpr int32_t DMulScale(int32_t a, int32_t b, int32_t c, int32_t d, int32_t shift) { return (int32_t)(((int64_t)a * b + (int64_t)c * d) >> shift); } +__forceinline constexpr int32_t TMulScale(int32_t a, int32_t b, int32_t c, int32_t d, int32_t e, int32_t f, int32_t shift) { return (int32_t)(((int64_t)a * b + (int64_t)c * d + (int64_t)e * f) >> shift); } __forceinline constexpr int32_t DivScale(int32_t a, int32_t b, int shift) { return (int32_t)(((int64_t)a << shift) / b); } #include "xs_Float.h"