From 98b6be4fed2f1b2bf378def37a3bb53cfcc866d4 Mon Sep 17 00:00:00 2001 From: plagman Date: Sun, 2 Oct 2011 01:00:14 +0000 Subject: [PATCH] Polymer: Discard cached sprite planes on texinvalidate Sprites would stick with their old material on global palette change. This goes through all prsprites and clobbers their CRCs so that an alternate skin / tint / highpal can be applied accordingly. git-svn-id: https://svn.eduke32.com/eduke32@2053 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index ef2512ac8..79455a87a 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -1482,16 +1482,26 @@ void polymer_invalidatelights(void) void polymer_texinvalidate(void) { - int32_t i = numsectors-1; + int32_t i; + + i = 0; + + while (i < MAXSPRITES) { + if (prsprites[i]) + prsprites[i]->crc = 0xDEADBEEF; + i++; + } + + i = numsectors - 1; if (!numsectors || !prsectors[i]) return; - + do prsectors[i--]->flags.invalidtex = 1; while (i >= 0); - i = numwalls-1; + i = numwalls - 1; do prwalls[i--]->flags.invalidtex = 1; while (i >= 0);