From fb5811855d1d3704bda32f496f301d7f02c8c684 Mon Sep 17 00:00:00 2001 From: plagman Date: Sun, 14 Jun 2009 13:35:19 +0000 Subject: [PATCH] Adds cstat 8192 for sprites that do not cast shadows and documents it in build.h. git-svn-id: https://svn.eduke32.com/eduke32@1433 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 3 ++- polymer/eduke32/build/src/polymer.c | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index f7e0ae5f7..24355203d 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -148,7 +148,8 @@ typedef struct BPACK // bit 7: 1 = Real centered centering, 0 = foot center "C" // bit 8: 1 = Blocking sprite (use with hitscan / cliptype 1) "H" // bit 9: 1 = Transluscence reversing, 0 = normal "T" -// bits 10-13: reserved +// bits 10-12: reserved +// bit 13: 1 = does not cast shadow // bit 14: 1 = invisible but casts shadow // bit 15: 1 = Invisible sprite, 0 = not invisible diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index d5e03bdde..bef64a04e 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -927,6 +927,11 @@ void polymer_drawsprite(int32_t snum) if (tspr->owner < 0 || tspr->picnum < 0) return; + if ((tspr->cstat & 8192) && (depth && !mirrors[depth-1].plane)) + return; + if ((tspr->cstat & 16384) && (!depth || mirrors[depth-1].plane)) + return; + fogcalc(tspr->shade,sector[tspr->sectnum].visibility,sector[tspr->sectnum].floorpal); bglFogf(GL_FOG_DENSITY,fogresult); bglFogfv(GL_FOG_COLOR,fogcol); @@ -2992,8 +2997,6 @@ static inline void polymer_scansprites(int16_t sectnum, spritetype* localtsprit (spr->xrepeat > 0) && (spr->yrepeat > 0) && (*localspritesortcnt < MAXSPRITESONSCREEN)) { - if ((spr->cstat & 16384) && (!depth || mirrors[depth-1].plane)) - continue; copybufbyte(spr,&localtsprite[*localspritesortcnt],sizeof(spritetype)); localtsprite[(*localspritesortcnt)++].owner = i; }