mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
LUT for slope recip calculations in classic. DONT_BUILD.
git-svn-id: https://svn.eduke32.com/eduke32@4714 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
999f789438
commit
e677923165
2 changed files with 7 additions and 2 deletions
|
@ -96,6 +96,7 @@ void hlineasm4(int32_t cnt, int32_t skiploadincs, int32_t paloffs, uint32_t by,
|
|||
|
||||
|
||||
///// Sloped ceiling/floor vertical line functions /////
|
||||
extern int32_t sloptable[16384];
|
||||
|
||||
void slopevlin(intptr_t p, int32_t i, intptr_t slopaloffs, int32_t cnt, int32_t bx, int32_t by)
|
||||
{
|
||||
|
@ -107,7 +108,7 @@ void slopevlin(intptr_t p, int32_t i, intptr_t slopaloffs, int32_t cnt, int32_t
|
|||
slopalptr = (intptr_t *)slopaloffs;
|
||||
for (; cnt>0; cnt--)
|
||||
{
|
||||
i = krecipasm(bz>>6); bz += bzinc;
|
||||
i = (sloptable[(bz>>6)+8192]); 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))]);
|
||||
|
|
|
@ -187,6 +187,7 @@ int32_t globalx1, globaly2, globalx3, globaly3;
|
|||
};
|
||||
#endif
|
||||
|
||||
int32_t sloptable[16384];
|
||||
static intptr_t slopalookup[16384]; // was 2048
|
||||
#if defined(USE_OPENGL)
|
||||
palette_t palookupfog[MAXPALOOKUPS];
|
||||
|
@ -4239,7 +4240,7 @@ static void tslopevlin(uint8_t *p, int32_t i, const intptr_t *slopalptr, int32_t
|
|||
uint8_t ch;
|
||||
uint32_t u, v;
|
||||
|
||||
i = krecipasm(bz>>6); bz += bzinc;
|
||||
i = (sloptable[(bz>>6)+8192]); bz += bzinc;
|
||||
u = bx + xtou*i;
|
||||
v = by + ytov*i;
|
||||
ch = *(uint8_t *)(slopalptr[0] + buf[((u>>(32-logx))<<logy)+(v>>(32-logy))]);
|
||||
|
@ -8009,6 +8010,9 @@ static int32_t loadtables(void)
|
|||
for (i=0; i<2048; i++)
|
||||
reciptable[i] = divscale30(2048, i+2048);
|
||||
|
||||
for (i=0; i<16384; i++)
|
||||
sloptable[i] = krecipasm(i-8192);
|
||||
|
||||
for (i=0; i<=512; i++)
|
||||
sintable[i] = (int16_t)(16384.f * sinf((float)i * BANG2RAD));
|
||||
for (i=513; i<1024; i++)
|
||||
|
|
Loading…
Reference in a new issue