From 1b8c79b0d87c50a57f79e411690478db59d89cd8 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sun, 20 Dec 2015 05:18:47 +0000 Subject: [PATCH] Polymodes: In gloadtile_art, (1) get the current texel's index, (2) apply alpha if index == 255, (3) get the index by indexing into the specified palookup table, and then (4) apply fullbright considerations. Previously these tasks were performed in order 1432. git-svn-id: https://svn.eduke32.com/eduke32@5467 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymost.c | 30 ++++++++++++---------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index cdf3e5b5e..52a539c8c 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -839,13 +839,24 @@ void gloadtile_art(int32_t dapic, int32_t dapal, int32_t tintpalnum, int32_t das dacol = *(char *)(waloff[dapic]+x2*tsiz.y+y2); + if (dacol == 255) + { + wpptr->a = 0; + hasalpha = 1; + } + else + wpptr->a = 255; + + { + char *p = (char *)(palookup[dapal])+(int32_t)(dashade<<8); + dacol = (uint8_t)p[dacol]; + } + if (!fullbrightloadingpass) { // regular texture if (IsPaletteIndexFullbright(dacol) && dofullbright) hasfullbright = 1; - - wpptr->a = 255; } else { @@ -855,21 +866,6 @@ void gloadtile_art(int32_t dapic, int32_t dapal, int32_t tintpalnum, int32_t das wpptr->a = 0; hasalpha = 1; } - else // fullbright - { - wpptr->a = 255; - } - } - - { - char *p = (char *)(palookup[dapal])+(int32_t)(dashade<<8); - dacol = (uint8_t)p[dacol]; - } - - if (dacol == 255) - { - wpptr->a = 0; - hasalpha = 1; } bricolor((palette_t *)wpptr, dacol);