Add SLOPTABLESIZ preprocessor definition

git-svn-id: https://svn.eduke32.com/eduke32@7718 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-06-25 11:30:03 +00:00 committed by Christoph Oelckers
parent 3cdc20cac1
commit 3130b51a96
3 changed files with 11 additions and 8 deletions

View file

@ -16,6 +16,11 @@
# define CLASSIC_NONPOW2_YSIZE_WALLS
#endif
#define SLOPTABLESIZ 32768
#define HALFSLOPTABLESIZ (SLOPTABLESIZ>>1)
extern int32_t sloptable[SLOPTABLESIZ];
/** Definitions of high-precision integer types. **/
// Should be used for values that represent coordinates with which calculations
// like dot product are carried out. Substituting 32-bit ints for these will

View file

@ -107,8 +107,6 @@ void hlineasm4(bssize_t cnt, int32_t skiploadincs, int32_t paloffs, uint32_t by,
///// Sloped ceiling/floor vertical line functions /////
extern int32_t sloptable[32768];
void slopevlin(intptr_t p, int32_t i, intptr_t slopaloffs, bssize_t cnt, int32_t bx, int32_t by)
{
intptr_t * A_C_RESTRICT slopalptr;
@ -119,7 +117,7 @@ void slopevlin(intptr_t p, int32_t i, intptr_t slopaloffs, bssize_t cnt, int32_t
slopalptr = (intptr_t *)slopaloffs;
for (; cnt>0; cnt--)
{
i = (sloptable[(bz>>6)+16384]); bz += bzinc;
i = (sloptable[(bz>>6)+HALFSLOPTABLESIZ]); bz += bzinc;
u = bx+(inthi_t)globalx3*i;
v = by+(inthi_t)globaly3*i;
(*(char *)p) = *(char *)(((intptr_t)slopalptr[0])+gbuf[((u>>(32-glogx))<<glogy)+(v>>(32-glogy))]);

View file

@ -164,7 +164,7 @@ int32_t globalx1, globaly2, globalx3, globaly3;
}
#endif
int32_t sloptable[32768];
int32_t sloptable[SLOPTABLESIZ];
static intptr_t slopalookup[16384]; // was 2048
static int32_t no_radarang2 = 0;
@ -3393,7 +3393,7 @@ static void tslopevlin(uint8_t *p, const intptr_t *slopalptr, bssize_t cnt, int3
do
{
int const i = (sloptable[(bz>>6)+16384]); bz += bzinc;
int const i = (sloptable[(bz>>6)+HALFSLOPTABLESIZ]); bz += bzinc;
uint32_t u = bx + xtou*i;
uint32_t v = by + ytov*i;
uint8_t ch = buf[((u>>(32-logx))<<logy)+(v>>(32-logy))];
@ -3423,7 +3423,7 @@ static void mslopevlin(uint8_t *p, const intptr_t *slopalptr, bssize_t cnt, int3
do
{
int const i = (sloptable[(bz>>6)+16384]); bz += bzinc;
int const i = (sloptable[(bz>>6)+HALFSLOPTABLESIZ]); bz += bzinc;
uint32_t u = bx + xtou*i;
uint32_t v = by + ytov*i;
uint8_t ch = buf[((u>>(32-logx))<<logy)+(v>>(32-logy))];
@ -7229,8 +7229,8 @@ static int32_t engineLoadTables(void)
for (i=0; i<2048; i++)
reciptable[i] = divscale30(2048, i+2048);
for (i=0; i<32768; i++)
sloptable[i] = krecipasm(i-16384);
for (i=0; i<SLOPTABLESIZ; i++)
sloptable[i] = krecipasm(i-HALFSLOPTABLESIZ);
for (i=0; i<=512; i++)
sintable[i] = (int16_t)(16384.f * sinf((float)i * BANG2RAD));