mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-09 15:00:48 +00:00
Fix actor[].dispicnum becoming negative.
Since the original source code release of Duke3D, there was a potentially dangerous hack where actor[].dispicnum was set to -4 to signal "this actor should not have a floor shadow for this moment" (it doesn't really work, if you ask me). Now, use another bit of actor[].flags for that purpose because setting any picnum members to negative values asks for trouble. git-svn-id: https://svn.eduke32.com/eduke32@2249 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
7e6f712ad1
commit
7a5a19a874
3 changed files with 13 additions and 2 deletions
|
@ -149,6 +149,7 @@ enum sflags_t {
|
||||||
SPRITE_USEACTIVATOR = 0x00000200,
|
SPRITE_USEACTIVATOR = 0x00000200,
|
||||||
SPRITE_NULL = 0x00000400, // null sprite in multiplayer
|
SPRITE_NULL = 0x00000400, // null sprite in multiplayer
|
||||||
SPRITE_NOCLIP = 0x00000800, // clipmove it with cliptype 0
|
SPRITE_NOCLIP = 0x00000800, // clipmove it with cliptype 0
|
||||||
|
SPRITE_NOFLOORSHADOW= 0x00001000, // for temp. internal use, per-tile flag not checked
|
||||||
};
|
};
|
||||||
|
|
||||||
// custom projectiles
|
// custom projectiles
|
||||||
|
|
|
@ -6513,10 +6513,17 @@ skip:
|
||||||
{
|
{
|
||||||
if (actor[i].dispicnum < 0)
|
if (actor[i].dispicnum < 0)
|
||||||
{
|
{
|
||||||
|
// a negative actor[i].dispicnum used to mean 'no floor shadow please' but
|
||||||
|
// that was a bad hack since the value could propagate to sprite[].picnum
|
||||||
|
OSD_Printf(OSD_ERROR "actor[%d].dispicnum = %d\n", i, actor[i].dispicnum);
|
||||||
actor[i].dispicnum++;
|
actor[i].dispicnum++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (ud.shadows && spritesortcnt < (MAXSPRITESONSCREEN-2) && getrendermode() != 4)
|
|
||||||
|
if (actor[i].flags & SPRITE_NOFLOORSHADOW)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (ud.shadows && spritesortcnt < (MAXSPRITESONSCREEN-2) && getrendermode() != 4)
|
||||||
{
|
{
|
||||||
int32_t daz,xrep,yrep;
|
int32_t daz,xrep,yrep;
|
||||||
|
|
||||||
|
|
|
@ -302,6 +302,8 @@ void A_GetZLimits(int32_t iActor)
|
||||||
|
|
||||||
s->cstat = cstat;
|
s->cstat = cstat;
|
||||||
|
|
||||||
|
actor[iActor].flags &= ~SPRITE_NOFLOORSHADOW;
|
||||||
|
|
||||||
if ((lz&49152) == 49152 && (sprite[lz&(MAXSPRITES-1)].cstat&48) == 0)
|
if ((lz&49152) == 49152 && (sprite[lz&(MAXSPRITES-1)].cstat&48) == 0)
|
||||||
{
|
{
|
||||||
const spritetype *hitspr = &sprite[lz&(MAXSPRITES-1)];
|
const spritetype *hitspr = &sprite[lz&(MAXSPRITES-1)];
|
||||||
|
@ -311,7 +313,8 @@ void A_GetZLimits(int32_t iActor)
|
||||||
if ((A_CheckEnemySprite(hitspr) && hitspr->pal != 1 && s->statnum != STAT_PROJECTILE)
|
if ((A_CheckEnemySprite(hitspr) && hitspr->pal != 1 && s->statnum != STAT_PROJECTILE)
|
||||||
|| (hitspr->picnum == APLAYER && A_CheckEnemySprite(s)))
|
|| (hitspr->picnum == APLAYER && A_CheckEnemySprite(s)))
|
||||||
{
|
{
|
||||||
actor[iActor].dispicnum = -4; // No shadows on actors
|
actor[iActor].flags |= SPRITE_NOFLOORSHADOW; // No shadows on actors
|
||||||
|
// actor[iActor].dispicnum = -4; // No shadows on actors
|
||||||
s->xvel = -256;
|
s->xvel = -256;
|
||||||
A_SetSprite(iActor,CLIPMASK0);
|
A_SetSprite(iActor,CLIPMASK0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue