From 5b379decc62600e79fbbbb42648c98325ae72f36 Mon Sep 17 00:00:00 2001 From: plagman Date: Sat, 20 Aug 2011 21:05:04 +0000 Subject: [PATCH] Polymer: handle floor/ceiling translucency. Assigns the right alpha value to floor/ceiling planes if their translucency bits are set and make sure that changing the cstat now triggers an update of the material for editing purposes. This doesn't do anything by itself, but will be needed to correctly draw floor/ceiling masks. git-svn-id: https://svn.eduke32.com/eduke32@1977 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 4459921da..860e89450 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -2261,8 +2261,6 @@ static int32_t polymer_updatesector(int16_t sectnum) wal = &wall[sec->wallptr + i]; } - s->floorstat = sec->floorstat; - s->ceilingstat = sec->ceilingstat; s->floorxpanning = sec->floorxpanning; s->ceilingxpanning = sec->ceilingxpanning; s->floorypanning = sec->floorypanning; @@ -2281,6 +2279,8 @@ attributes: } if ((!s->flags.empty) && (!s->flags.invalidtex) && + (sec->floorstat == s->floorstat) && + (sec->ceilingstat == s->ceilingstat) && (sec->floorshade == s->floorshade) && (sec->ceilingshade == s->ceilingshade) && (sec->floorpal == s->floorpal) && @@ -2290,10 +2290,29 @@ attributes: goto finish; polymer_getbuildmaterial(&s->floor.material, floorpicnum, sec->floorpal, sec->floorshade, 0); + + if (s->floorstat & 256) { + if (s->floorstat & 128) { + s->floor.material.diffusemodulation[3] = 0x55; + } else { + s->floor.material.diffusemodulation[3] = 0xAA; + } + } + polymer_getbuildmaterial(&s->ceil.material, ceilingpicnum, sec->ceilingpal, sec->ceilingshade, 0); + if (s->ceilingstat & 256) { + if (s->ceilingstat & 128) { + s->ceil.material.diffusemodulation[3] = 0x55; + } else { + s->ceil.material.diffusemodulation[3] = 0xAA; + } + } + s->flags.invalidtex = 0; + s->floorstat = sec->floorstat; + s->ceilingstat = sec->ceilingstat; s->floorshade = sec->floorshade; s->ceilingshade = sec->ceilingshade; s->floorpal = sec->floorpal;