diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index 9ee5fa526..bffc39f7d 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -207,48 +207,32 @@ enum { BAMBITS = 21, BAMUNIT = 1 << BAMBITS, - SINTABLEBITS = 30, - SINTABLEUNIT = 1 << SINTABLEBITS, - BUILDSINBITS = 14, }; constexpr double BAngRadian = pi::pi() * (1. / 1024.); constexpr double BAngToDegree = 360. / 2048.; constexpr DAngle DAngleBuildToDeg = DAngle::fromDeg(BAngToDegree); -inline constexpr double sinscale(const int shift) -{ - return shift >= -BUILDSINBITS ? uint64_t(1) << (BUILDSINBITS + shift) : 1. / (uint64_t(1) << abs(BUILDSINBITS + shift)); -} - - //--------------------------------------------------------------------------- // // Build sine inline functions. // //--------------------------------------------------------------------------- -inline int bsin(const int ang, int shift = 0) +inline int bsin(const int ang) { - return int(g_sinbam(ang * BAMUNIT) * sinscale(shift)); + return int(g_sinbam(ang * BAMUNIT) * 16384); } //--------------------------------------------------------------------------- // // Build cosine inline functions. -// -// About shifts: -// -6 -> * 16 -// -7 -> * 8 -// -8 -> * 4 -// -9 -> * 2 -// -10 -> * 1 // //--------------------------------------------------------------------------- -inline int bcos(const int ang, int shift = 0) +inline int bcos(const int ang) { - return int(g_cosbam(ang * BAMUNIT) * sinscale(shift)); + return int(g_cosbam(ang * BAMUNIT) * 16384); } //---------------------------------------------------------------------------