mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 13:21:10 +00:00
let mfe_drawonlyfor flags stack
This commit is contained in:
parent
eb8cb12b8f
commit
e3393d6323
2 changed files with 81 additions and 36 deletions
|
@ -5436,6 +5436,9 @@ static void HWR_AddSprites(sector_t *sec)
|
||||||
#endif
|
#endif
|
||||||
fixed_t approx_dist, limit_dist;
|
fixed_t approx_dist, limit_dist;
|
||||||
|
|
||||||
|
INT32 splitflags;
|
||||||
|
boolean split_drawsprite; // drawing with splitscreen flags
|
||||||
|
|
||||||
// BSP is traversed by subsector.
|
// BSP is traversed by subsector.
|
||||||
// A sector might have been split into several
|
// A sector might have been split into several
|
||||||
// subsectors during BSP building.
|
// subsectors during BSP building.
|
||||||
|
@ -5455,27 +5458,37 @@ static void HWR_AddSprites(sector_t *sec)
|
||||||
{
|
{
|
||||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
split_drawsprite = false;
|
||||||
|
|
||||||
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (splitscreen)
|
splitflags = thing->eflags & (MFE_DRAWONLYFORP1|MFE_DRAWONLYFORP2|MFE_DRAWONLYFORP3|MFE_DRAWONLYFORP4);
|
||||||
|
|
||||||
|
if (splitscreen && splitflags)
|
||||||
{
|
{
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP1)
|
if (thing->eflags & MFE_DRAWONLYFORP1)
|
||||||
if (viewssnum != 0)
|
if (viewssnum == 0)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP2)
|
if (thing->eflags & MFE_DRAWONLYFORP2)
|
||||||
if (viewssnum != 1)
|
if (viewssnum == 1)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
|
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
|
||||||
if (viewssnum != 2)
|
if (viewssnum == 2)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
|
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
|
||||||
if (viewssnum != 3)
|
if (viewssnum == 3)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
split_drawsprite = true;
|
||||||
|
|
||||||
|
if (!split_drawsprite)
|
||||||
|
continue;
|
||||||
|
|
||||||
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
|
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
|
||||||
|
|
||||||
|
@ -5490,27 +5503,37 @@ static void HWR_AddSprites(sector_t *sec)
|
||||||
// Draw everything in sector, no checks
|
// Draw everything in sector, no checks
|
||||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
split_drawsprite = false;
|
||||||
|
|
||||||
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (splitscreen)
|
splitflags = thing->eflags & (MFE_DRAWONLYFORP1|MFE_DRAWONLYFORP2|MFE_DRAWONLYFORP3|MFE_DRAWONLYFORP4);
|
||||||
|
|
||||||
|
if (splitscreen && splitflags)
|
||||||
{
|
{
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP1)
|
if (thing->eflags & MFE_DRAWONLYFORP1)
|
||||||
if (viewssnum != 0)
|
if (viewssnum == 0)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP2)
|
if (thing->eflags & MFE_DRAWONLYFORP2)
|
||||||
if (viewssnum != 1)
|
if (viewssnum == 1)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
|
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
|
||||||
if (viewssnum != 2)
|
if (viewssnum == 2)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
|
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
|
||||||
if (viewssnum != 3)
|
if (viewssnum == 3)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
split_drawsprite = true;
|
||||||
|
|
||||||
|
if (!split_drawsprite)
|
||||||
|
continue;
|
||||||
|
|
||||||
HWR_ProjectSprite(thing);
|
HWR_ProjectSprite(thing);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1711,6 +1711,9 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
||||||
INT32 lightnum;
|
INT32 lightnum;
|
||||||
fixed_t approx_dist, limit_dist;
|
fixed_t approx_dist, limit_dist;
|
||||||
|
|
||||||
|
INT32 splitflags; // check if a mobj has spliscreen flags
|
||||||
|
boolean split_drawsprite; // used for splitscreen flags
|
||||||
|
|
||||||
if (rendermode != render_soft)
|
if (rendermode != render_soft)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1744,27 +1747,36 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
||||||
{
|
{
|
||||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||||
{
|
{
|
||||||
|
split_drawsprite = false;
|
||||||
|
|
||||||
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (splitscreen)
|
splitflags = thing->eflags & (MFE_DRAWONLYFORP1|MFE_DRAWONLYFORP2|MFE_DRAWONLYFORP3|MFE_DRAWONLYFORP4);
|
||||||
|
|
||||||
|
if (splitscreen && splitflags)
|
||||||
{
|
{
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP1)
|
if (thing->eflags & MFE_DRAWONLYFORP1)
|
||||||
if (viewssnum != 0)
|
if (viewssnum == 0)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP2)
|
if (thing->eflags & MFE_DRAWONLYFORP2)
|
||||||
if (viewssnum != 1)
|
if (viewssnum == 1)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
|
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
|
||||||
if (viewssnum != 2)
|
if (viewssnum == 2)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
|
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
|
||||||
if (viewssnum != 3)
|
if (viewssnum == 3)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
split_drawsprite = true;
|
||||||
|
|
||||||
|
if (!split_drawsprite)
|
||||||
|
continue;
|
||||||
|
|
||||||
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
|
approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y);
|
||||||
|
|
||||||
|
@ -1779,27 +1791,37 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
|
||||||
// Draw everything in sector, no checks
|
// Draw everything in sector, no checks
|
||||||
for (thing = sec->thinglist; thing; thing = thing->snext)
|
for (thing = sec->thinglist; thing; thing = thing->snext)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
split_drawsprite = false;
|
||||||
|
|
||||||
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
if (thing->sprite == SPR_NULL || thing->flags2 & MF2_DONTDRAW)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (splitscreen)
|
splitflags = thing->eflags & (MFE_DRAWONLYFORP1|MFE_DRAWONLYFORP2|MFE_DRAWONLYFORP3|MFE_DRAWONLYFORP4);
|
||||||
|
|
||||||
|
if (splitscreen && splitflags)
|
||||||
{
|
{
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP1)
|
if (thing->eflags & MFE_DRAWONLYFORP1)
|
||||||
if (viewssnum != 0)
|
if (viewssnum == 0)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP2)
|
if (thing->eflags & MFE_DRAWONLYFORP2)
|
||||||
if (viewssnum != 1)
|
if (viewssnum == 1)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
|
if (thing->eflags & MFE_DRAWONLYFORP3 && splitscreen > 1)
|
||||||
if (viewssnum != 2)
|
if (viewssnum == 2)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
|
|
||||||
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
|
if (thing->eflags & MFE_DRAWONLYFORP4 && splitscreen > 2)
|
||||||
if (viewssnum != 3)
|
if (viewssnum == 3)
|
||||||
continue;
|
split_drawsprite = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
split_drawsprite = true;
|
||||||
|
|
||||||
|
if (!split_drawsprite)
|
||||||
|
continue;
|
||||||
|
|
||||||
R_ProjectSprite(thing);
|
R_ProjectSprite(thing);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue