From c6978350730531db4e292dac830d28f20a3fc342 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Tue, 29 Apr 2014 20:07:48 +0000 Subject: [PATCH] engine.c: extend the last workaround to all four fogpals generated at startup. git-svn-id: https://svn.eduke32.com/eduke32@4457 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 86b61094c..88fd0d0e4 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -8254,15 +8254,17 @@ int32_t loadlookups(int32_t fp, uint8_t **basepaltabptr) for (j=1; j<=255-3; j++) if (!palookup[j] && !palookup[j+1] && !palookup[j+2] && !palookup[j+3]) { - int32_t i; + int32_t i, k; makepalookup(j, NULL, 15, 15, 15, 1); makepalookup(j+1, NULL, 15, 0, 0, 1); makepalookup(j+2, NULL, 0, 15, 0, 1); makepalookup(j+3, NULL, 0, 0, 15, 1); - for (i=1; i<255; i++) - palookup[j][((numshades-1)<<8) + i] = palookup[j][((numshades-1)<<8)]; + // Make last shade value always map to the same color index. + for (k=0; k<3; k++) + for (i=1; i<255; i++) + palookup[j+k][((numshades-1)<<8) + i] = palookup[j+k][((numshades-1)<<8)]; firstfogpal = j; break;