diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index a7176bae2..23db1d7d4 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -73,7 +73,6 @@ int32_t globalflags; static int8_t tempbuf[MAXWALLS]; // referenced from asm -int32_t reciptable[2048]; intptr_t asm1, asm2; int32_t globalx1, globaly2, globalx3, globaly3; @@ -319,9 +318,6 @@ static int32_t engineLoadTables(void) { int32_t i; - for (i=0; i<2048; i++) - reciptable[i] = DivScale(2048, i+2048, 30); - for (i=0; i<=512; i++) sintable[i] = bsinf(i); for (i=513; i<1024; i++) diff --git a/source/build/src/engine_priv.h b/source/build/src/engine_priv.h index 1baa6e87e..cb3e3e6f8 100644 --- a/source/build/src/engine_priv.h +++ b/source/build/src/engine_priv.h @@ -69,7 +69,6 @@ extern int32_t rx1[MAXWALLSB], ry1[MAXWALLSB]; extern int16_t bunchp2[MAXWALLSB]; extern int16_t numscans, numbunches; extern int32_t rxi[8], ryi[8]; -extern int32_t reciptable[2048]; // int32_t wallmost(int16_t *mostbuf, int32_t w, int32_t sectnum, char dastat); diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index cf2674003..1cd1f55ec 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -915,16 +915,6 @@ skip: ; #endif } -// Moved in from pragmas.h -static inline int32_t krecipasm(int32_t i) -{ - // Ken did this - union { int32_t i; float f; } x; - x.f = (float)i; - i = x.i; - return ((reciptable[(i >> 12) & 2047] >> (((i - 0x3f800000) >> 23) & 31)) ^ (i >> 31)); -} - // variables that are set to ceiling- or floor-members, depending // on which one is processed right now static int32_t global_cf_z; @@ -956,14 +946,14 @@ static void polymost_internal_nonparallaxed(vec2f_t n0, vec2f_t n1, float ryp0, wall[wall[sec->wallptr].point2].y - wall[sec->wallptr].y }; float r; + int length = ksqrt(uhypsq(xy.x, xy.y)); if (globalorientation & 2) { - int i = krecipasm(ksqrt(uhypsq(xy.x,xy.y))); - r = i * (1.f/1073741824.f); + r = 1.f / length; } else { - int i = ksqrt(uhypsq(xy.x,xy.y)); if (i == 0) i = 1024; else i = 1048576 / i; + int i; if (length == 0) i = 1024; else i = 1048576 / length; // consider integer truncation r = i * (1.f/1048576.f); }