Rename 'numpalookups' to 'numshades' internally.

git-svn-id: https://svn.eduke32.com/eduke32@2504 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-03-20 18:32:00 +00:00
parent 8a50b75de2
commit 51398ca749
5 changed files with 25 additions and 25 deletions

View file

@ -325,7 +325,7 @@ EXTERN int32_t totalclock;
EXTERN int32_t numframes, randomseed;
EXTERN int16_t sintable[2048];
EXTERN uint8_t palette[768];
EXTERN int16_t numpalookups;
EXTERN int16_t numshades;
EXTERN char *palookup[MAXPALOOKUPS];
EXTERN char parallaxtype, showinvisibility;
EXTERN int32_t parallaxyoffs, parallaxyscale;

View file

@ -2356,7 +2356,7 @@ char palfadedelta = 0;
//
static inline int32_t getpalookup(int32_t davis, int32_t dashade)
{
return(min(max(dashade+(davis>>8),0),numpalookups-1));
return(min(max(dashade+(davis>>8),0),numshades-1));
}
static void setpalettefade_calc(uint8_t offset);
@ -7444,10 +7444,10 @@ static void loadpalette(void)
if ((fil = kopen4load("palette.dat",0)) == -1) return;
kread(fil,palette,768);
kread(fil,&numpalookups,2); numpalookups = B_LITTLE16(numpalookups);
kread(fil,&numshades,2); numshades = B_LITTLE16(numshades);
if ((palookup[0] = (char *)Bmalloc(numpalookups<<8)) == NULL)
allocache((intptr_t *)&palookup[0],numpalookups<<8,&permanentlock);
if ((palookup[0] = (char *)Bmalloc(numshades<<8)) == NULL)
allocache((intptr_t *)&palookup[0],numshades<<8,&permanentlock);
if ((transluc = (char *)Bmalloc(65536)) == NULL)
allocache((intptr_t *)&transluc,65536,&permanentlock);
@ -7456,7 +7456,7 @@ static void loadpalette(void)
fixtransluscence(FP_OFF(transluc));
kread(fil,palookup[globalpal],numpalookups<<8);
kread(fil,palookup[globalpal],numshades<<8);
kread(fil,transluc,65536);
if (crc32once((uint8_t *)transluc, 65536)==0x94a1fac6)
@ -8872,7 +8872,7 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
if ((picanm[globalpicnum]&192) != 0) globalpicnum += animateoffs((int16_t)globalpicnum,s);
if (waloff[globalpicnum] == 0) loadtile(globalpicnum);
globalbufplc = waloff[globalpicnum];
globalshade = max(min(sec->floorshade,numpalookups-1),0);
globalshade = max(min(sec->floorshade,numshades-1),0);
globvis = globalhisibility;
if (sec->visibility != 0) globvis = mulscale4(globvis,(int32_t)((uint8_t)(sec->visibility+16)));
globalpolytype = 0;
@ -9018,7 +9018,7 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
globalshade = ((int32_t)sector[spr->sectnum].ceilingshade);
else
globalshade = ((int32_t)sector[spr->sectnum].floorshade);
globalshade = max(min(globalshade+spr->shade+6,numpalookups-1),0);
globalshade = max(min(globalshade+spr->shade+6,numshades-1),0);
asm3 = FP_OFF(palookup[spr->pal]+(globalshade<<8));
globvis = globalhisibility;
if (sec->visibility != 0) globvis = mulscale4(globvis,(int32_t)((uint8_t)(sec->visibility+16)));
@ -13515,8 +13515,8 @@ void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8
if (palookup[palnum] == NULL)
{
//Allocate palookup buffer
if ((palookup[palnum] = (char *)Bmalloc(numpalookups<<8)) == NULL)
allocache((intptr_t *)&palookup[palnum],numpalookups<<8,&permanentlock);
if ((palookup[palnum] = (char *)Bmalloc(numshades<<8)) == NULL)
allocache((intptr_t *)&palookup[palnum],numshades<<8,&permanentlock);
}
if (dastat == 0) return;
@ -13528,7 +13528,7 @@ void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8
{
ptr = (char *)(FP_OFF(palookup[0])+remapbuf[i]);
ptr2 = (char *)(FP_OFF(palookup[palnum])+i);
for (j=0; j<numpalookups; j++)
for (j=0; j<numshades; j++)
{ *ptr2 = *ptr; ptr += 256; ptr2 += 256; }
}
#if defined(USE_OPENGL)
@ -13540,9 +13540,9 @@ void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8
else
{
ptr2 = palookup[palnum];
for (i=0; i<numpalookups; i++)
for (i=0; i<numshades; i++)
{
palscale = divscale16(i,numpalookups);
palscale = divscale16(i,numshades);
for (j=0; j<256; j++)
{
ptr = (char *)&palette[remapbuf[j]*3];

View file

@ -2083,7 +2083,7 @@ static int32_t md3draw(md3model_t *m, const spritetype *tspr)
bglEnable(GL_TEXTURE_2D);
pc[0] = pc[1] = pc[2] = ((float)(numpalookups-min(max((globalshade * shadescale)+m->shadeoff,0),numpalookups)))/((float)numpalookups);
pc[0] = pc[1] = pc[2] = ((float)(numshades-min(max((globalshade * shadescale)+m->shadeoff,0),numshades)))/((float)numshades);
if (!(hictinting[globalpal].f&4))
{
if (!(m->flags&1) || (!(tspr->owner >= MAXSPRITES) && sector[sprite[tspr->owner].sectnum].floorpal!=0))
@ -3278,7 +3278,7 @@ int32_t voxdraw(voxmodel_t *m, const spritetype *tspr)
bglEnable(GL_TEXTURE_2D);
pc[0] = pc[1] = pc[2] = ((float)(numpalookups-min(max((globalshade * shadescale)+m->shadeoff,0),numpalookups)))/((float)numpalookups);
pc[0] = pc[1] = pc[2] = ((float)(numshades-min(max((globalshade * shadescale)+m->shadeoff,0),numshades)))/((float)numshades);
pc[0] *= (float)hictinting[globalpal].r / 255.0;
pc[1] *= (float)hictinting[globalpal].g / 255.0;
pc[2] *= (float)hictinting[globalpal].b / 255.0;

View file

@ -3767,7 +3767,7 @@ static void polymer_drawartsky(int16_t tilenum, char palnum, int8_t shad
glpics[i] = pth ? pth->glpic : 0;
glcolors[i][0] = glcolors[i][1] = glcolors[i][2] =
((float)(numpalookups-min(max(shade*shadescale,0),numpalookups)))/((float)numpalookups);
((float)(numshades-min(max(shade*shadescale,0),numshades)))/((float)numshades);
if (pth && (pth->flags & 2))
{
@ -3848,7 +3848,7 @@ static void polymer_drawskybox(int16_t tilenum, char palnum, int8_t shad
pth = gltexcache(tilenum, palnum, 4);
color[0] = color[1] = color[2] =
((float)(numpalookups-min(max(shade*shadescale,0),numpalookups)))/((float)numpalookups);
((float)(numshades-min(max(shade*shadescale,0),numshades)))/((float)numshades);
if (pth && (pth->flags & 2))
{
@ -4075,7 +4075,7 @@ static void polymer_drawmdsprite(spritetype *tspr)
color = mdspritematerial.diffusemodulation;
color[0] = color[1] = color[2] =
((float)(numpalookups-min(max((tspr->shade * shadescale)+m->shadeoff,0),numpalookups)))/((float)numpalookups) * 0xFF;
((float)(numshades-min(max((tspr->shade * shadescale)+m->shadeoff,0),numshades)))/((float)numshades) * 0xFF;
usinghighpal = (pr_highpalookups &&
prhighpalookups[curbasepal][tspr->pal].map);
@ -4458,7 +4458,7 @@ static void polymer_getbuildmaterial(_prmaterial* material, int16_t tile
material->diffusemodulation[0] =
material->diffusemodulation[1] =
material->diffusemodulation[2] =
((float)(numpalookups-min(max((shade * shadescale),0),numpalookups)))/((float)numpalookups) * 0xFF;
((float)(numshades-min(max((shade * shadescale),0),numshades)))/((float)numshades) * 0xFF;
if (pth->flags & 2)
{

View file

@ -2267,8 +2267,8 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
{
float pc[4];
int32_t shadebound = (shadescale_unbounded || globalshade>=numpalookups) ? numpalookups : numpalookups-1;
f = ((float)(numpalookups-min(max((globalshade * shadescale),0),shadebound)))/((float)numpalookups);
int32_t shadebound = (shadescale_unbounded || globalshade>=numshades) ? numshades : numshades-1;
f = ((float)(numshades-min(max((globalshade * shadescale),0),shadebound)))/((float)numshades);
pc[0] = pc[1] = pc[2] = f;
switch (method&3)
{
@ -2548,7 +2548,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
nguo = uu[0] - ox*ngux - oy*nguy;
ngvo = vv[0] - ox*ngvx - oy*ngvy;
}
palptr = &palookup[globalpal][min(max((int32_t)(globalshade * shadescale),0),numpalookups-1)<<8]; //<-need to make shade not static!
palptr = &palookup[globalpal][min(max((int32_t)(globalshade * shadescale),0),numshades-1)<<8]; //<-need to make shade not static!
tsizxm1 = tsizx-1; xmodnice = (!(tsizxm1&tsizx));
tsizym1 = tsizy-1; ymulnice = (!(tsizym1&tsizy));
@ -2559,7 +2559,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
}
else
{
dacol = palookup[0][(int32_t)(*(char *)(waloff[globalpicnum]))+(min(max((int32_t)(globalshade * shadescale),0),numpalookups-1)<<8)];
dacol = palookup[0][(int32_t)(*(char *)(waloff[globalpicnum]))+(min(max((int32_t)(globalshade * shadescale),0),numshades-1)<<8)];
}
if (grhalfxdown10x < 0) //Hack for mirrors
@ -5963,7 +5963,7 @@ void polymost_fillpolygon(int32_t npoints)
pthtyp *pth;
float f,a=0.0;
int32_t i;
int32_t shadebound = (shadescale_unbounded || globalshade>=numpalookups) ? numpalookups : numpalookups-1;
int32_t shadebound = (shadescale_unbounded || globalshade>=numshades) ? numshades : numshades-1;
globalx1 = mulscale16(globalx1,xyaspect);
globaly2 = mulscale16(globaly2,xyaspect);
@ -5987,7 +5987,7 @@ void polymost_fillpolygon(int32_t npoints)
pth = gltexcache(globalpicnum,globalpal,0);
bglBindTexture(GL_TEXTURE_2D, pth ? pth->glpic : 0);
f = ((float)(numpalookups-min(max((globalshade * shadescale),0),shadebound)))/((float)numpalookups);
f = ((float)(numshades-min(max((globalshade * shadescale),0),shadebound)))/((float)numshades);
switch ((globalorientation>>7)&3)
{
case 0: