Add new tint flag 256, which always skips hightile when picking an image source.

git-svn-id: https://svn.eduke32.com/eduke32@6218 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-06-21 13:46:59 +00:00
parent 986a545ff5
commit ad46ac785f
5 changed files with 18 additions and 8 deletions

View File

@ -108,6 +108,8 @@ enum
HICTINT_BLENDMASK = 64|128,
HICTINT_ALWAYSUSEART = 256,
HICTINT_PRECOMPUTED = HICTINT_COLORIZE | HICTINT_BLENDMASK,
HICTINT_IN_MEMORY = HICTINT_PRECOMPUTED | HICTINT_GRAYSCALE | HICTINT_INVERT,

View File

@ -68,7 +68,7 @@ extern int32_t globalpal;
// Compare with polymer_eligible_for_artmap()
static FORCE_INLINE int32_t eligible_for_tileshades(int32_t const picnum, int32_t const pal)
{
return !usehightile || !hicfindsubst(picnum, pal);
return !usehightile || !hicfindsubst(picnum, pal, hictinting[pal].f & HICTINT_ALWAYSUSEART);
}
static inline float getshadefactor(int32_t const shade)

View File

@ -4206,7 +4206,7 @@ static void polymer_drawartsky(int16_t tilenum, char palnum, int8_t shad
if (pth->palnum != palnum || (pth->effects & HICTINT_IN_MEMORY) || (tintflags & HICTINT_APPLYOVERALTPAL))
hictinting_apply(glcolors[i], palnum);
}
else if (tintflags & HICTINT_USEONART)
else if (tintflags & (HICTINT_USEONART|HICTINT_ALWAYSUSEART))
hictinting_apply(glcolors[i], palnum);
}
@ -4298,7 +4298,7 @@ static void polymer_drawskybox(int16_t tilenum, char palnum, int8_t shad
if (pth->palnum != palnum || (pth->effects & HICTINT_IN_MEMORY) || (tintflags & HICTINT_APPLYOVERALTPAL))
hictinting_apply(color, palnum);
}
else if (tintflags & HICTINT_USEONART)
else if (tintflags & (HICTINT_USEONART|HICTINT_ALWAYSUSEART))
hictinting_apply(color, palnum);
}
@ -4948,6 +4948,14 @@ static _prbucket* polymer_getbuildmaterial(_prmaterial* material, int16_t tile
// Lazily fill in all the textures we need, move this to precaching later
if (pr_artmapping && !(globalflags & GLOBAL_NO_GL_TILESHADES) && polymer_eligible_for_artmap(tilenum, pth))
{
polytintflags_t const tintflags = hictinting[pal].f;
if (tintflags & (HICTINT_USEONART|HICTINT_ALWAYSUSEART))
{
if (!(tintflags & HICTINT_APPLYOVERPALSWAP))
pal = 0;
}
if (!prartmaps[tilenum] || !prbasepalmaps[curbasepal] || !prlookups[pal])
polymer_setupartmap(tilenum, pal);
@ -5001,7 +5009,7 @@ static _prbucket* polymer_getbuildmaterial(_prmaterial* material, int16_t tile
if (pth->palnum != pal || (pth->effects & HICTINT_IN_MEMORY) || (tintflags & HICTINT_APPLYOVERALTPAL))
hictinting_apply_ub(material->diffusemodulation, pal);
}
else if (tintflags & HICTINT_USEONART)
else if (tintflags & (HICTINT_USEONART|HICTINT_ALWAYSUSEART))
hictinting_apply_ub(material->diffusemodulation, pal);
}

View File

@ -440,7 +440,7 @@ static inline void fogcalc(int32_t tile, int32_t shade, int32_t vis, int32_t pal
{
if (shade > 0 && getrendermode() == REND_POLYMOST && r_usetileshades == 1 &&
!(globalflags & GLOBAL_NO_GL_TILESHADES) &&
(!usehightile || !hicfindsubst(tile, pal)) &&
(!usehightile || !hicfindsubst(tile, pal, hictinting[pal].f & HICTINT_ALWAYSUSEART)) &&
(!usemodels || md_tilehasmodel(tile, pal) < 0))
shade >>= 1;
@ -1844,7 +1844,7 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
if (pth->palnum != globalpal || (pth->effects & HICTINT_IN_MEMORY) || (tintflags & HICTINT_APPLYOVERALTPAL))
hictinting_apply(pc, globalpal);
}
else if (tintflags & HICTINT_USEONART)
else if (tintflags & (HICTINT_USEONART|HICTINT_ALWAYSUSEART))
hictinting_apply(pc, globalpal);
}

View File

@ -35,7 +35,7 @@ static pthtyp *texcache_tryart(int32_t const dapicnum, int32_t const dapalnum, i
int32_t searchpalnum = dapalnum;
polytintflags_t const tintflags = hictinting[dapalnum].f;
if (tintflags & HICTINT_USEONART)
if (tintflags & (HICTINT_USEONART|HICTINT_ALWAYSUSEART))
{
tintpalnum = dapalnum;
if (!(tintflags & HICTINT_APPLYOVERPALSWAP))
@ -107,7 +107,7 @@ pthtyp *texcache_fetchmulti(pthtyp *pth, hicreplctyp *si, int32_t dapicnum, int3
pthtyp *texcache_fetch(int32_t dapicnum, int32_t dapalnum, int32_t dashade, int32_t dameth)
{
const int32_t j = dapicnum & (GLTEXCACHEADSIZ - 1);
hicreplctyp *si = usehightile ? hicfindsubst(dapicnum, dapalnum) : NULL;
hicreplctyp *si = usehightile ? hicfindsubst(dapicnum, dapalnum, hictinting[dapalnum].f & HICTINT_ALWAYSUSEART) : NULL;
if (drawingskybox && usehightile)
if ((si = hicfindskybox(dapicnum, dapalnum)) == NULL)