diff --git a/polymer/eduke32/build/include/polymer.h b/polymer/eduke32/build/include/polymer.h index b6f51534c..c2ab4759b 100644 --- a/polymer/eduke32/build/include/polymer.h +++ b/polymer/eduke32/build/include/polymer.h @@ -351,6 +351,12 @@ static inline void polymer_invalidateartmap(int32_t tilenum) } } +// Compare with eligible_for_tileshades() +static inline int32_t polymer_eligible_for_artmap(int32_t tilenum, const pthtyp *pth) +{ + return ((!pth || !pth->hicr) && tilenum < (MAXTILES - 4)); +} + # ifdef POLYMER_C // CORE diff --git a/polymer/eduke32/build/include/polymost.h b/polymer/eduke32/build/include/polymost.h index 90a14e8aa..3b35198a0 100644 --- a/polymer/eduke32/build/include/polymost.h +++ b/polymer/eduke32/build/include/polymost.h @@ -56,6 +56,7 @@ extern int32_t r_usetileshades; extern int16_t globalpicnum; extern int32_t globalpal; +// Compare with polymer_eligible_for_artmap() static inline int32_t eligible_for_tileshades(int32_t picnum, int32_t pal) { return (!usehightile || !hicfindsubst(picnum, pal, 0)) && diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 128446d85..763a6be3c 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -4621,7 +4621,7 @@ static void polymer_getbuildmaterial(_prmaterial* material, int16_t tile } // Lazily fill in all the textures we need, move this to precaching later - if (pr_artmapping && (!pth || !pth->hicr) && tilenum < (MAXTILES - 4)) { + if (pr_artmapping && polymer_eligible_for_artmap(tilenum, pth)) { if (!prartmaps[tilenum]) { char *tilebuffer = (char *)waloff[tilenum]; char *tempbuffer = (char *)Bmalloc(tilesizx[tilenum] * tilesizy[tilenum]); diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index aca57eb76..712849616 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -1526,7 +1526,8 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method) float pc[4]; #ifdef POLYMER - if (getrendermode() == REND_POLYMER && pr_artmapping) + if (getrendermode() == REND_POLYMER && pr_artmapping && + polymer_eligible_for_artmap(globalpicnum, pth)) pc[0] = pc[1] = pc[2] = 1.0f; else #endif