From 3610609659535b293d9fb7f25f334b22bc40eb0d Mon Sep 17 00:00:00 2001 From: NY00123 Date: Sat, 4 Apr 2020 19:41:57 +0000 Subject: [PATCH] Add a workaround for possible rounding errors in calculations of sintable and radarang. sintable[512] was different in a 32-bit build. From-SVN: r8796 --- source/build/src/engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index a373b83e7..828f65c7d 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -1667,14 +1667,14 @@ static int32_t engineLoadTables(void) reciptable[i] = divscale30(2048, i+2048); for (i=0; i<=512; i++) - sintable[i] = (int16_t)(16384.f * sinf((float)i * BANG2RAD)); + sintable[i] = (int16_t)(16384.f * sinf((float)i * BANG2RAD) + 0.0001f); for (i=513; i<1024; i++) sintable[i] = sintable[1024-i]; for (i=1024; i<2048; i++) sintable[i] = -sintable[i-1024]; for (i=0; i<640; i++) - radarang[i] = (int16_t)(atanf(((float)(640-i)-0.5f) * (1.f/160.f)) * (-64.f * (1.f/BANG2RAD))); + radarang[i] = (int16_t)(atanf(((float)(640-i)-0.5f) * (1.f/160.f)) * (-64.f * (1.f/BANG2RAD)) + 0.0001f); for (i=0; i<640; i++) radarang[1279-i] = -radarang[i];