From d934bfd985c5c929dc3b5851c28ea542f57498fc Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 14 Nov 2020 22:15:17 +1100 Subject: [PATCH] - buildutils: Replace `sintable[]` use within Duke's gameexec.cpp with `bsin()`/`bcos()`. --- source/games/duke/src/gameexec.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index d0b9edcdc..9b9c45efd 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -1975,11 +1975,11 @@ int ParseState::parse(void) break; case concmd_strafeleft: insptr++; - movesprite_ex(g_ac, sintable[(g_sp->ang + 1024) & 2047] >> 10, sintable[(g_sp->ang + 512) & 2047] >> 10, g_sp->zvel, CLIPMASK0, coll); + movesprite_ex(g_ac, -bsin(g_sp->ang, -10), bcos(g_sp->ang, -10), g_sp->zvel, CLIPMASK0, coll); break; case concmd_straferight: insptr++; - movesprite_ex(g_ac, sintable[(g_sp->ang - 0) & 2047] >> 10, sintable[(g_sp->ang - 512) & 2047] >> 10, g_sp->zvel, CLIPMASK0, coll); + movesprite_ex(g_ac, bsin(g_sp->ang, -10), -bcos(g_sp->ang, -10), g_sp->zvel, CLIPMASK0, coll); break; case concmd_larrybird: insptr++; @@ -2451,8 +2451,8 @@ int ParseState::parse(void) case concmd_slapplayer: insptr++; forceplayerangle(g_p); - ps[g_p].posxv -= sintable[(ps[g_p].angle.ang.asbuild() + 512) & 2047] << 7; - ps[g_p].posyv -= sintable[ps[g_p].angle.ang.asbuild() & 2047] << 7; + ps[g_p].posxv -= ps[g_p].angle.ang.bcos(7); + ps[g_p].posyv -= ps[g_p].angle.ang.bsin(7); return 0; case concmd_wackplayer: insptr++; @@ -2460,8 +2460,8 @@ int ParseState::parse(void) forceplayerangle(g_p); else { - ps[g_p].posxv -= sintable[(ps[g_p].angle.ang.asbuild() + 512) & 2047] << 10; - ps[g_p].posyv -= sintable[ps[g_p].angle.ang.asbuild() & 2047] << 10; + ps[g_p].posxv -= ps[g_p].angle.ang.bcos(10); + ps[g_p].posyv -= ps[g_p].angle.ang.bsin(10); ps[g_p].jumping_counter = 767; ps[g_p].jumping_toggle = 1; } @@ -3396,8 +3396,7 @@ int ParseState::parse(void) int lValue; insptr++; i = *(insptr++); // ID of def - lValue = GetGameVarID(*insptr, g_ac, g_p); - lValue = sintable[lValue & 2047]; + lValue = bsin(GetGameVarID(*insptr, g_ac, g_p)); SetGameVarID(i, lValue, g_ac, g_p); insptr++; break;