- Fixed: Decals could spread to walls which had a decal-less texture or

were flagged not to have decals.
- Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value
  from their StickToWall call and left unplaced decals behind if that happened.


SVN r2046 (trunk)
This commit is contained in:
Christoph Oelckers 2009-12-25 11:59:37 +00:00
parent 85c683e0c7
commit 23caac1c9b
2 changed files with 42 additions and 16 deletions

View file

@ -1,4 +1,8 @@
December 25, 2009 (Changes by Graf Zahl) December 25, 2009 (Changes by Graf Zahl)
- Fixed: Decals could spread to walls which had a decal-less texture or
were flagged not to have decals.
- Fixed: DBaseDecal/DImpactDecal::CloneSelf never checked the return value
from their StickToWall call and left unplaced decals behind if that happened.
- Reintroduced Doom.exe's player_t::usedown variable so that respawning a - Reintroduced Doom.exe's player_t::usedown variable so that respawning a
player does not immediately activate switches. oldbuttons was not usable player does not immediately activate switches. oldbuttons was not usable
for this. This also required that CopyPlayer preserves this info. for this. This also required that CopyPlayer preserves this info.

View file

@ -298,6 +298,13 @@ FTextureID DBaseDecal::StickToWall (side_t *wall, fixed_t x, fixed_t y, F3DFloor
else return FNullTextureID(); else return FNullTextureID();
CalcFracPos (wall, x, y); CalcFracPos (wall, x, y);
FTexture *texture = TexMan[tex];
if (texture == NULL || texture->bNoDecals)
{
return FNullTextureID();
}
return tex; return tex;
} }
@ -546,12 +553,19 @@ DBaseDecal *DBaseDecal::CloneSelf (const FDecalTemplate *tpl, fixed_t ix, fixed_
DBaseDecal *decal = new DBaseDecal(iz); DBaseDecal *decal = new DBaseDecal(iz);
if (decal != NULL) if (decal != NULL)
{ {
decal->StickToWall (wall, ix, iy, ffloor); if (decal->StickToWall (wall, ix, iy, ffloor).isValid())
{
tpl->ApplyToDecal (decal, wall); tpl->ApplyToDecal (decal, wall);
decal->AlphaColor = AlphaColor; decal->AlphaColor = AlphaColor;
decal->RenderFlags = (decal->RenderFlags & RF_DECALMASK) | decal->RenderFlags = (decal->RenderFlags & RF_DECALMASK) |
(this->RenderFlags & ~RF_DECALMASK); (this->RenderFlags & ~RF_DECALMASK);
} }
else
{
decal->Destroy();
return NULL;
}
}
return decal; return decal;
} }
@ -652,16 +666,12 @@ DImpactDecal *DImpactDecal::StaticCreate (const FDecalTemplate *tpl, fixed_t x,
} }
DImpactDecal::CheckMax(); DImpactDecal::CheckMax();
decal = new DImpactDecal (z); decal = new DImpactDecal (z);
if (decal == NULL)
FTextureID stickypic = decal->StickToWall (wall, x, y, ffloor);
FTexture *tex = TexMan[stickypic];
if (tex != NULL && tex->bNoDecals)
{ {
return NULL; return NULL;
} }
if (decal == NULL) if (!decal->StickToWall (wall, x, y, ffloor).isValid())
{ {
return NULL; return NULL;
} }
@ -685,16 +695,28 @@ DImpactDecal *DImpactDecal::StaticCreate (const FDecalTemplate *tpl, fixed_t x,
DBaseDecal *DImpactDecal::CloneSelf (const FDecalTemplate *tpl, fixed_t ix, fixed_t iy, fixed_t iz, side_t *wall, F3DFloor * ffloor) const DBaseDecal *DImpactDecal::CloneSelf (const FDecalTemplate *tpl, fixed_t ix, fixed_t iy, fixed_t iz, side_t *wall, F3DFloor * ffloor) const
{ {
if (wall->Flags & WALLF_NOAUTODECALS)
{
return NULL;
}
DImpactDecal::CheckMax(); DImpactDecal::CheckMax();
DImpactDecal *decal = new DImpactDecal(iz); DImpactDecal *decal = new DImpactDecal(iz);
if (decal != NULL) if (decal != NULL)
{ {
decal->StickToWall (wall, ix, iy, ffloor); if (decal->StickToWall (wall, ix, iy, ffloor).isValid())
{
tpl->ApplyToDecal (decal, wall); tpl->ApplyToDecal (decal, wall);
decal->AlphaColor = AlphaColor; decal->AlphaColor = AlphaColor;
decal->RenderFlags = (decal->RenderFlags & RF_DECALMASK) | decal->RenderFlags = (decal->RenderFlags & RF_DECALMASK) |
(this->RenderFlags & ~RF_DECALMASK); (this->RenderFlags & ~RF_DECALMASK);
} }
else
{
decal->Destroy();
return NULL;
}
}
return decal; return decal;
} }