From 74b264dcb14d34a94fb440acfdbd4f9f741bef3b Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 9 Mar 2015 20:32:11 +0000 Subject: [PATCH] Change HICTINT_USEONART so that it applies tints to pal 0 of 8-bit tiles instead of their palswapped selves. Add HICTINT_APPLYOVERPALSWAP which applies tints to palswapped 8-bit tiles. Add HICTINT_APPLYOVERALTPAL, which applies tints to alt-pals of hightile textures. git-svn-id: https://svn.eduke32.com/eduke32@5055 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/hightile.h | 4 +++- polymer/eduke32/build/src/polymost.c | 2 +- polymer/eduke32/build/src/texcache.c | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/include/hightile.h b/polymer/eduke32/build/include/hightile.h index b2bfd1d18..6c0494986 100644 --- a/polymer/eduke32/build/include/hightile.h +++ b/polymer/eduke32/build/include/hightile.h @@ -86,8 +86,10 @@ enum HICTINT_INVERT = 2, HICTINT_COLORIZE = 4, HICTINT_USEONART = 8, + HICTINT_APPLYOVERPALSWAP = 16, + HICTINT_APPLYOVERALTPAL = 32, - HICEFFECTMASK = (1|2|4|8), + HICEFFECTMASK = (1|2|4|8|16|32), }; #define GRAYSCALE_COEFF_RED 0.3 diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 2923079d4..d62cff649 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -1527,7 +1527,7 @@ static void drawpoly(vec2f_t *dpxy, int32_t n, int32_t method) { if (pth && (pth->flags & PTH_HIGHTILE)) { - if (pth->palnum != globalpal) + if (pth->palnum != globalpal || (hictinting[globalpal].f & HICTINT_APPLYOVERALTPAL)) hictinting_apply(pc, globalpal); if (have_basepal_tint()) diff --git a/polymer/eduke32/build/src/texcache.c b/polymer/eduke32/build/src/texcache.c index 0abba5ba4..959823602 100644 --- a/polymer/eduke32/build/src/texcache.c +++ b/polymer/eduke32/build/src/texcache.c @@ -36,6 +36,9 @@ static pthtyp *texcache_tryart(int32_t dapicnum, int32_t dapalnum, int32_t dasha const int32_t j = dapicnum&(GLTEXCACHEADSIZ-1); pthtyp *pth; + if ((hictinting[dapalnum].f & HICTINT_USEONART) && !(hictinting[dapalnum].f & HICTINT_APPLYOVERPALSWAP)) + dapalnum = 0; + // load from art for (pth=texcache.list[j]; pth; pth=pth->next) if (pth->picnum == dapicnum && pth->palnum == dapalnum && pth->shade == dashade &&