From 26ca7e7fc04eb6f15bf70b74a63d3c5990f0ddc5 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 24 Apr 2009 04:02:39 +0000 Subject: [PATCH] Sprite cstat 16384: invisible w/ shadows this also adds shadows for the player when in first person git-svn-id: https://svn.eduke32.com/eduke32@1343 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 4 ++++ polymer/eduke32/source/game.c | 30 +++++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 6548375ce..7fe96c29e 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -1000,6 +1000,8 @@ void polymer_drawsprite(int32_t snum) spriteplane.material.diffusemodulation[3] *= (1.0f - spriteext[tspr->owner].alpha); + if (tspr->cstat & 16384) spriteplane.material.diffusemodulation[3] = 0.0f; + if (((tspr->cstat>>4) & 3) == 0) xratio = (float)(tspr->xrepeat) * 0.20f; // 32 / 160 else @@ -3031,6 +3033,8 @@ static void polymer_drawmdsprite(spritetype *tspr) color[3] *= (1.0f - spriteext[tspr->owner].alpha); + if (tspr->cstat & 16384) color[3] = 0.0f; + if (pr_gpusmoothing) mdspritematerial.frameprogress = m->interpol; diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 528c50384..35f675e3a 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -7163,11 +7163,33 @@ void G_DoSpriteAnimations(int32_t x,int32_t y,int32_t a,int32_t smoothratio) if (s->owner >= 0 && display_mirror == 0 && g_player[p].ps->over_shoulder_on == 0) if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek)) { - t->owner = -1; - t->xrepeat = t->yrepeat = 0; - continue; - } +// t->owner = -1; +// t->xrepeat = t->yrepeat = 0; + t->cstat |= 16384; +#if defined(POLYMOST) && defined(USE_OPENGL) + if (getrendermode() >= 3 && usemodels && md_tilehasmodel(s->picnum,t->pal) >= 0 && !(spriteext[i].flags&SPREXT_NOTMD)) + { + k = 0; + t->cstat &= ~4; + } + else +#endif + { + k = (((s->ang+3072+128-a)&2047)>>8)&7; + if (k>4) + { + k = 8-k; + t->cstat |= 4; + } + else t->cstat &= ~4; + } + if (sector[t->sectnum].lotag == 2) k += 1795-1405; + else if ((ActorExtra[i].floorz-s->z) > (64<<8)) k += 60; + + t->picnum += k; + t->pal = g_player[p].ps->palookup; + } PALONLY: if (sector[sect].floorpal && sector[sect].floorpal < g_numRealPalettes && !A_CheckSpriteFlags(t->owner,SPRITE_NOPAL))