Revert bad attempt at fixing cstat 1024

git-svn-id: https://svn.eduke32.com/eduke32@5723 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2016-05-13 22:15:20 +00:00
parent f23eb60036
commit 2d9f205c69

View file

@ -2624,11 +2624,12 @@ static int get_screen_coords(const vec2_t p1, const vec2_t p2,
// //
static void scansector(int16_t startsectnum) static void scansector(int16_t startsectnum)
{ {
int32_t sectorbordercnt;
if (startsectnum < 0) if (startsectnum < 0)
return; return;
sectorborder[0] = startsectnum; sectorborder[0] = startsectnum, sectorbordercnt = 1;
int32_t sectorbordercnt = 1;
do do
{ {
@ -2641,15 +2642,16 @@ static void scansector(int16_t startsectnum)
{ {
const spritetype *const spr = &sprite[i]; const spritetype *const spr = &sprite[i];
if (((spr->cstat & 0x8000) && !showinvisibility) || spr->xrepeat == 0 || spr->yrepeat == 0) if (((spr->cstat&0x8000) == 0 || showinvisibility) &&
continue; spr->xrepeat > 0 && spr->yrepeat > 0)
{
int32_t xs = spr->x-globalposx, ys = spr->y-globalposy;
vec2_t const s = { spr->x-globalposx, spr->y-globalposy }; if ((spr->cstat&48) || ((coord_t)xs*cosglobalang+(coord_t)ys*singlobalang > 0))
if ((spr->cstat&(64+48))!=(64+16) || dmulscale6(sintable[(spr->ang+512)&2047],-xs, sintable[spr->ang&2047],-ys) > 0)
if ((spr->cstat&48) || ((coord_t)s.x*cosglobalang+(coord_t)s.y*singlobalang > 0)) if (engine_addtsprite(i, sectnum))
if ((spr->cstat&(64+48))!=(64+16) || dmulscale6(sintable[(spr->ang+512)&2047],-s.x, sintable[spr->ang&2047],-s.y) > 0) break;
if (engine_addtsprite(i, sectnum)) }
break;
} }
gotsector[sectnum>>3] |= pow2char[sectnum&7]; gotsector[sectnum>>3] |= pow2char[sectnum&7];
@ -9893,7 +9895,11 @@ killsprite:
while (i) while (i)
{ {
i--; i--;
if (tspriteptr[i] != NULL) if (tspriteptr[i] != NULL && ((tspriteptr[i]->cstat & 1024) != 1024
#ifdef POLYMER
|| getrendermode() == REND_POLYMER
#endif
))
{ {
vec2f_t spr; vec2f_t spr;
const tspritetype *tspr = tspriteptr[i]; const tspritetype *tspr = tspriteptr[i];
@ -9965,10 +9971,10 @@ killsprite:
{ {
debugmask_add(i | 32768, tspr->owner); debugmask_add(i | 32768, tspr->owner);
drawsprite(i); drawsprite(i);
#ifdef POLYMER
if (tspr->cstat & 1024 && getrendermode() == REND_POLYMOST) if (tspr->cstat & 1024 && getrendermode() == REND_POLYMER)
continue; continue;
#endif
tspriteptr[i] = NULL; tspriteptr[i] = NULL;
} }
} }
@ -9984,33 +9990,36 @@ killsprite:
while (i) while (i)
{ {
i--; i--;
if (tspriteptr[i] != NULL) if (tspriteptr[i] != NULL && ((tspriteptr[i]->cstat & 1024) != 1024
#ifdef POLYMER
|| getrendermode() == REND_POLYMER
#endif
))
{ {
debugmask_add(i | 32768, tspriteptr[i]->owner); debugmask_add(i | 32768, tspriteptr[i]->owner);
drawsprite(i); drawsprite(i);
tspriteptr[i] = NULL;
if ((tspriteptr[i]->cstat & 1024) != 1024 || getrendermode() != REND_POLYMOST)
tspriteptr[i] = NULL;
} }
} }
#ifdef USE_OPENGL #ifdef USE_OPENGL
if (getrendermode() == REND_POLYMOST) if (getrendermode() >= REND_POLYMOST)
{
bglDepthMask(GL_FALSE); bglDepthMask(GL_FALSE);
#endif
while (spritesortcnt) while (spritesortcnt)
{
spritesortcnt--;
if (tspriteptr[spritesortcnt] != NULL && (tspriteptr[spritesortcnt]->cstat & 1024))
{ {
spritesortcnt--; drawsprite(spritesortcnt);
if (tspriteptr[spritesortcnt] != NULL && (tspriteptr[spritesortcnt]->cstat & 1024)) tspriteptr[spritesortcnt] = NULL;
{
drawsprite(spritesortcnt);
tspriteptr[spritesortcnt] = NULL;
}
} }
bglDepthMask(GL_TRUE);
} }
#ifdef USE_OPENGL
if (getrendermode() >= REND_POLYMOST)
bglDepthMask(GL_TRUE);
#endif #endif
#ifdef POLYMER #ifdef POLYMER