A couple of stylistic cleanups and missed DAMETH_* flags substitutions.

git-svn-id: https://svn.eduke32.com/eduke32@4489 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-05-30 00:02:14 +00:00
parent 89bbfcbdea
commit 95a6c01045
3 changed files with 17 additions and 14 deletions

View file

@ -1344,7 +1344,7 @@ void polymer_inb4rotatesprite(int16_t tilenum, char pal, int8_t s
{ {
_prmaterial rotatespritematerial; _prmaterial rotatespritematerial;
polymer_getbuildmaterial(&rotatespritematerial, tilenum, pal, shade, 0, 4); polymer_getbuildmaterial(&rotatespritematerial, tilenum, pal, shade, 0, DAMETH_CLAMPED);
rotatespritematerialbits = polymer_bindmaterial(rotatespritematerial, NULL, 0); rotatespritematerialbits = polymer_bindmaterial(rotatespritematerial, NULL, 0);
} }
@ -3621,7 +3621,7 @@ void polymer_updatesprite(int32_t snum)
} }
polymer_getbuildmaterial(&s->plane.material, curpicnum, tspr->pal, tspr->shade, polymer_getbuildmaterial(&s->plane.material, curpicnum, tspr->pal, tspr->shade,
sector[tspr->sectnum].visibility, 4); sector[tspr->sectnum].visibility, DAMETH_CLAMPED);
if (tspr->cstat & 2) if (tspr->cstat & 2)
{ {
@ -4001,7 +4001,7 @@ static void polymer_drawskybox(int16_t tilenum, char palnum, int8_t shad
while (i < 6) while (i < 6)
{ {
drawingskybox = i + 1; drawingskybox = i + 1;
pth = texcache_fetch(tilenum, palnum, 0, 4); pth = texcache_fetch(tilenum, palnum, 0, DAMETH_CLAMPED);
color[0] = color[1] = color[2] = getshadefactor(shade); color[0] = color[1] = color[2] = getshadefactor(shade);

View file

@ -1433,7 +1433,7 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method)
pthtyp *pth, *detailpth, *glowpth; pthtyp *pth, *detailpth, *glowpth;
int32_t texunits = GL_TEXTURE0_ARB; int32_t texunits = GL_TEXTURE0_ARB;
if (skyclamphack) method |= 4; if (skyclamphack) method |= DAMETH_CLAMPED;
pth = our_texcache_fetch(method&(~3)); pth = our_texcache_fetch(method&(~3));
if (!pth) if (!pth)
@ -4843,7 +4843,7 @@ int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, i
{ {
int32_t ousehightile = usehightile; int32_t ousehightile = usehightile;
usehightile = usehitile && usehightile; usehightile = usehitile && usehightile;
pth = texcache_fetch(wallnum,0,0,4); pth = texcache_fetch(wallnum, 0, 0, DAMETH_CLAMPED);
if (usehightile) if (usehightile)
loadedhitile[wallnum>>3] |= (1<<(wallnum&7)); loadedhitile[wallnum>>3] |= (1<<(wallnum&7));
usehightile = ousehightile; usehightile = ousehightile;
@ -5292,7 +5292,7 @@ void polymost_precache(int32_t dapicnum, int32_t dapalnum, int32_t datype)
hicprecaching = 1; hicprecaching = 1;
texcache_fetch(dapicnum, dapalnum, 0, (datype & 1) << 2); texcache_fetch(dapicnum, dapalnum, 0, (datype & 1)*DAMETH_CLAMPED);
hicprecaching = 0; hicprecaching = 0;
if (datype == 0 || !usemodels) return; if (datype == 0 || !usemodels) return;

View file

@ -30,17 +30,15 @@ static const char *texcache_errorstr[TEXCACHEERRORS] = {
// <dashade>: ignored if not in Polymost+r_usetileshades // <dashade>: ignored if not in Polymost+r_usetileshades
pthtyp *texcache_fetch(int32_t dapicnum, int32_t dapalnum, int32_t dashade, int32_t dameth) pthtyp *texcache_fetch(int32_t dapicnum, int32_t dapalnum, int32_t dashade, int32_t dameth)
{ {
int32_t i, j; int32_t i;
hicreplctyp *si; pthtyp *pth;
pthtyp *pth, *pth2;
j = (dapicnum&(GLTEXCACHEADSIZ-1)); const int32_t j = dapicnum&(GLTEXCACHEADSIZ-1);
hicreplctyp *const si = usehightile ? hicfindsubst(dapicnum,dapalnum,drawingskybox) : NULL;
if (getrendermode() != REND_POLYMOST || !r_usetileshades) if (getrendermode() != REND_POLYMOST || !r_usetileshades)
dashade = 0; dashade = 0;
si = usehightile ? hicfindsubst(dapicnum,dapalnum,drawingskybox) : NULL;
if (!si) if (!si)
{ {
if (drawingskybox || dapalnum >= (MAXPALOOKUPS - RESERVEDPALS)) return NULL; if (drawingskybox || dapalnum >= (MAXPALOOKUPS - RESERVEDPALS)) return NULL;
@ -86,6 +84,9 @@ pthtyp *texcache_fetch(int32_t dapicnum, int32_t dapalnum, int32_t dashade, int3
// possibly fetch an already loaded multitexture :_) // possibly fetch an already loaded multitexture :_)
if (dapalnum >= (MAXPALOOKUPS - RESERVEDPALS)) if (dapalnum >= (MAXPALOOKUPS - RESERVEDPALS))
for (i = (GLTEXCACHEADSIZ - 1); i >= 0; i--) for (i = (GLTEXCACHEADSIZ - 1); i >= 0; i--)
{
const pthtyp *pth2;
for (pth2=texcache.list[i]; pth2; pth2=pth2->next) for (pth2=texcache.list[i]; pth2; pth2=pth2->next)
{ {
if (pth2->hicr && pth2->hicr->filename && Bstrcasecmp(pth2->hicr->filename, si->filename) == 0) if (pth2->hicr && pth2->hicr->filename && Bstrcasecmp(pth2->hicr->filename, si->filename) == 0)
@ -96,12 +97,14 @@ pthtyp *texcache_fetch(int32_t dapicnum, int32_t dapalnum, int32_t dashade, int3
if (pth2->flags & PTH_HASALPHA) if (pth2->flags & PTH_HASALPHA)
pth->flags |= PTH_HASALPHA; pth->flags |= PTH_HASALPHA;
pth->hicr = si; pth->hicr = si;
pth->next = texcache.list[j];
pth->next = texcache.list[j];
texcache.list[j] = pth; texcache.list[j] = pth;
return(pth); return(pth);
} }
} }
}
if (gloadtile_hi(dapicnum,dapalnum,drawingskybox,si,dameth,pth,1, (si->palnum>0) ? 0 : hictinting[dapalnum].f)) if (gloadtile_hi(dapicnum,dapalnum,drawingskybox,si,dameth,pth,1, (si->palnum>0) ? 0 : hictinting[dapalnum].f))
{ {