mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- do proper handling of the 'no shadow' case for Duke's bad guys.
Using a flag like RedNukem instead of hacking dispicnum, which occasionally does reach the renderer and causes problems.
This commit is contained in:
parent
a13612ab9b
commit
85cce1128a
5 changed files with 18 additions and 18 deletions
|
@ -166,8 +166,9 @@ DEFINE_TFLAGS_OPERATORS(ESpriteFlags)
|
|||
|
||||
enum ESpriteBits2
|
||||
{
|
||||
CSTAT2_SPRITE_NOFIND = 1, // Invisible to neartag and hitscan
|
||||
CSTAT2_SPRITE_MAPPED = 2, // sprite was mapped for automap
|
||||
CSTAT2_SPRITE_NOFIND = 1, // Invisible to neartag and hitscan
|
||||
CSTAT2_SPRITE_MAPPED = 2, // sprite was mapped for automap
|
||||
CSTAT2_SPRITE_NOSHADOW = 4, // cast no shadow.
|
||||
};
|
||||
|
||||
// tsprite flags use the otherwise unused clipdist field.
|
||||
|
|
|
@ -279,7 +279,7 @@ void HWDrawInfo::DispatchSprites()
|
|||
int tilenum = tspr->picnum;
|
||||
auto actor = tspr->ownerActor;
|
||||
|
||||
if (actor == nullptr || tspr->xrepeat == 0 || tspr->yrepeat == 0 || tilenum >= MAXTILES)
|
||||
if (actor == nullptr || tspr->xrepeat == 0 || tspr->yrepeat == 0 || (unsigned)tilenum >= MAXTILES)
|
||||
continue;
|
||||
|
||||
actor->spr.cstat2 |= CSTAT2_SPRITE_MAPPED;
|
||||
|
|
|
@ -4832,20 +4832,21 @@ void getglobalz(DDukeActor* actor)
|
|||
getzrange({ actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z - (FOURSLEIGHT) }, actor->sector(), &actor->ceilingz, hz, &actor->floorz, lz, zr, CLIPMASK0);
|
||||
actor->spr.cstat2 = cc;
|
||||
|
||||
actor->spr.cstat2 &= ~CSTAT2_SPRITE_NOSHADOW;
|
||||
if( lz.type == kHitSprite && (lz.actor()->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0 )
|
||||
{
|
||||
if( badguy(lz.actor()) && lz.actor()->spr.pal != 1)
|
||||
{
|
||||
if( actor->spr.statnum != STAT_PROJECTILE)
|
||||
{
|
||||
actor->dispicnum = -4; // No shadows on actors
|
||||
actor->spr.cstat2 |= CSTAT2_SPRITE_NOSHADOW; // No shadows on actors
|
||||
actor->spr.xvel = -256;
|
||||
ssp(actor, CLIPMASK0);
|
||||
}
|
||||
}
|
||||
else if(lz.actor()->isPlayer() && badguy(actor) )
|
||||
{
|
||||
actor->dispicnum = -4; // No shadows on actors
|
||||
actor->spr.cstat2 |= CSTAT2_SPRITE_NOSHADOW; // No shadows on actors
|
||||
actor->spr.xvel = -256;
|
||||
ssp(actor, CLIPMASK0);
|
||||
}
|
||||
|
|
|
@ -566,15 +566,12 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
|
|||
}
|
||||
|
||||
if (h->spr.statnum == STAT_DUMMYPLAYER || badguy(h) || (h->spr.picnum == APLAYER && h->GetOwner()))
|
||||
{
|
||||
if (t->statnum != 99 && h->spr.picnum != EXPLOSION2 && h->spr.picnum != HANGLIGHT && h->spr.picnum != DOMELITE)
|
||||
{
|
||||
if (h->spr.picnum != HOTMEAT)
|
||||
{
|
||||
if (h->dispicnum < 0)
|
||||
{
|
||||
h->dispicnum++;
|
||||
continue;
|
||||
}
|
||||
else if (r_shadows && spritesortcnt < (MAXSPRITESONSCREEN - 2))
|
||||
if (r_shadows && spritesortcnt < (MAXSPRITESONSCREEN - 2) && !(h->spr.cstat2 & CSTAT2_SPRITE_NOSHADOW))
|
||||
{
|
||||
int daz;
|
||||
|
||||
|
@ -623,7 +620,8 @@ void animatesprites_d(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
|
|||
t->shade = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
switch (h->spr.picnum)
|
||||
{
|
||||
|
|
|
@ -720,15 +720,12 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
|
|||
t->shade = -127;
|
||||
|
||||
if (h->spr.statnum == STAT_DUMMYPLAYER || badguy(h) || (h->spr.picnum == APLAYER && h->GetOwner()))
|
||||
{
|
||||
if ((h->spr.cstat & CSTAT_SPRITE_ALIGNMENT_MASK) == 0 && t->statnum != 99)
|
||||
{
|
||||
if (h->spr.picnum != EXPLOSION2 && h->spr.picnum != DOMELITE && h->spr.picnum != TORNADO && h->spr.picnum != EXPLOSION3 && (h->spr.picnum != SBMOVE || isRRRA()))
|
||||
{
|
||||
if (h->dispicnum < 0)
|
||||
{
|
||||
h->dispicnum++;
|
||||
continue;
|
||||
}
|
||||
else if (r_shadows && spritesortcnt < (MAXSPRITESONSCREEN - 2))
|
||||
if (r_shadows && spritesortcnt < (MAXSPRITESONSCREEN - 2) && !(h->spr.cstat2 & CSTAT2_SPRITE_NOSHADOW))
|
||||
{
|
||||
int daz;
|
||||
|
||||
|
@ -772,6 +769,9 @@ void animatesprites_r(tspritetype* tsprite, int& spritesortcnt, int x, int y, in
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
switch (h->spr.picnum)
|
||||
|
|
Loading…
Reference in a new issue