- Fixed: When drawing with a special colormap the quad's flags weren't cleared

which could cause crashes.
- Added custom special colormaps to DECORATE.
- Cleaned up special colormap code and removed lots of dependencies on the
  knowledge of the tables' contents.



SVN r1860 (trunk)
This commit is contained in:
Christoph Oelckers 2009-09-21 13:15:36 +00:00
commit c285f38a02
17 changed files with 224 additions and 231 deletions

View file

@ -139,14 +139,7 @@ PalEntry APowerup::GetBlend ()
if (EffectTics <= BLINKTHRESHOLD && !(EffectTics & 8))
return 0;
if (BlendColor == INVERSECOLOR ||
BlendColor == GOLDCOLOR ||
// [BC] HAX!
BlendColor == REDCOLOR ||
BlendColor == GREENCOLOR ||
BlendColor == BLUECOLOR)
return 0;
if (IsSpecialColormap(BlendColor)) return 0;
return BlendColor;
}
@ -175,37 +168,19 @@ void APowerup::DoEffect ()
if (EffectTics > 0)
{
int oldcolormap = Owner->player->fixedcolormap;
if (EffectTics > BLINKTHRESHOLD || (EffectTics & 8))
int Colormap = GetSpecialColormap(BlendColor);
if (Colormap != NOFIXEDCOLORMAP)
{
if (BlendColor == INVERSECOLOR)
if (EffectTics > BLINKTHRESHOLD || (EffectTics & 8))
{
Owner->player->fixedcolormap = INVERSECOLORMAP;
Owner->player->fixedcolormap = Colormap;
}
else if (BlendColor == GOLDCOLOR)
else if (Owner->player->fixedcolormap == Colormap)
{
Owner->player->fixedcolormap = GOLDCOLORMAP;
// only unset if the fixed colormap comes from this item
Owner->player->fixedcolormap = NOFIXEDCOLORMAP;
}
else if (BlendColor == REDCOLOR)
{
Owner->player->fixedcolormap = REDCOLORMAP;
}
else if (BlendColor == GREENCOLOR)
{
Owner->player->fixedcolormap = GREENCOLORMAP;
}
else if (BlendColor == BLUECOLOR)
{
Owner->player->fixedcolormap = BLUECOLORMAP;
}
}
else if ((BlendColor == INVERSECOLOR && Owner->player->fixedcolormap == INVERSECOLORMAP) ||
(BlendColor == GOLDCOLOR && Owner->player->fixedcolormap == GOLDCOLORMAP) ||
(BlendColor == REDCOLOR && Owner->player->fixedcolormap == REDCOLORMAP) ||
(BlendColor == GREENCOLOR && Owner->player->fixedcolormap == GREENCOLORMAP) ||
(BlendColor == BLUECOLOR && Owner->player->fixedcolormap == BLUECOLORMAP))
{
Owner->player->fixedcolormap = NOFIXEDCOLORMAP;
}
}
}
@ -711,7 +686,7 @@ int APowerInvisibility::AlterWeaponSprite (vissprite_t *vis)
if ((vis->alpha < TRANSLUC25 && special1 > 0) || (vis->alpha == 0))
{
vis->alpha = clamp<fixed_t>((OPAQUE - Strength), 0, OPAQUE);
vis->colormap = SpecialColormaps[INVERSECOLORMAP];
vis->colormap = SpecialColormaps[INVERSECOLORMAP].Colormap;
}
return -1; // This item is valid so another one shouldn't reset the translucency
}