From ad46ac785f6f6c70b916048d58d81731b025ef7d Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 21 Jun 2017 13:46:59 +0000 Subject: [PATCH] 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 --- source/build/include/hightile.h | 2 ++ source/build/include/polymost.h | 2 +- source/build/src/polymer.cpp | 14 +++++++++++--- source/build/src/polymost.cpp | 4 ++-- source/build/src/texcache.cpp | 4 ++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/source/build/include/hightile.h b/source/build/include/hightile.h index 4c24ca51e..3f37c2817 100644 --- a/source/build/include/hightile.h +++ b/source/build/include/hightile.h @@ -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, diff --git a/source/build/include/polymost.h b/source/build/include/polymost.h index 661ad2675..acdb09f23 100644 --- a/source/build/include/polymost.h +++ b/source/build/include/polymost.h @@ -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) diff --git a/source/build/src/polymer.cpp b/source/build/src/polymer.cpp index 7c9b563e4..da59f35f4 100644 --- a/source/build/src/polymer.cpp +++ b/source/build/src/polymer.cpp @@ -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); } diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index 546a394a9..2f2589950 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -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); } diff --git a/source/build/src/texcache.cpp b/source/build/src/texcache.cpp index 693270b10..b25aa93b8 100644 --- a/source/build/src/texcache.cpp +++ b/source/build/src/texcache.cpp @@ -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)