From b1b0da28529f8f820d742af71be38c2f59152a06 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 8 Feb 2014 14:37:53 +0000 Subject: [PATCH] Polymer: factor out polymer_invalidateartmap(), use it in invalidatetile(). This fixes updating the viewscreen in Polymer's ART mapping mode. git-svn-id: https://svn.eduke32.com/eduke32@4304 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/polymer.h | 11 +++++++++++ polymer/eduke32/build/src/engine.c | 3 +++ polymer/eduke32/build/src/polymer.c | 7 +------ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/polymer/eduke32/build/include/polymer.h b/polymer/eduke32/build/include/polymer.h index cdec32c50..86c928ed7 100644 --- a/polymer/eduke32/build/include/polymer.h +++ b/polymer/eduke32/build/include/polymer.h @@ -340,6 +340,17 @@ static inline void polymer_invalidatesprite(int32_t i) prsprites[i]->crc = 0xDEADBEEF; } +static inline void polymer_invalidateartmap(int32_t tilenum) +{ + extern GLuint prartmaps[MAXTILES]; + + if (prartmaps[tilenum]) + { + bglDeleteTextures(1, &prartmaps[tilenum]); + prartmaps[tilenum] = 0; + } +} + # ifdef POLYMER_C // CORE diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 2de921499..79ccf7a04 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -17381,6 +17381,9 @@ void invalidatetile(int16_t tilenume, int32_t pal, int32_t how) for (np = firstpal; np < firstpal+numpals; np++) gltexinvalidate(tilenume, np, hp); } + + if (getrendermode() == REND_POLYMER) + polymer_invalidateartmap(tilenume); } #endif } diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 3976b5154..493a63271 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -2231,12 +2231,7 @@ static void polymer_freeboard(void) i = 0; while (i < MAXTILES) { - if (prartmaps[i]) - { - bglDeleteTextures(1, &prartmaps[i]); - prartmaps[i] = 0; - } - + polymer_invalidateartmap(i); i++; }