- fixed the number pulsing on Duke's and RR's HUD.

This commit is contained in:
Christoph Oelckers 2020-08-30 22:52:50 +02:00
parent 98557947da
commit 00d35bc42c
2 changed files with 8 additions and 8 deletions

View file

@ -133,11 +133,10 @@ public:
{
int s = -8;
if (althud_flashing && p->last_extra > max_player_health)
s += (sintable[(gameclock << 5) & 2047] >> 10);
int intens = clamp(255 - 4 * s, 0, 255);
auto pe = PalEntry(255, intens, intens, intens);
s += (sintable[(gameclock << 6) & 2047] >> 10);
int intens = clamp(255 - 6 * s, 0, 255);
format.Format("%d", p->last_extra);
SBar_DrawString(this, &numberFont, format, 25, texty, DI_TEXT_ALIGN_LEFT, CR_UNTRANSLATED, 1, 0, 0, 1, 1);
SBar_DrawString(this, &numberFont, format, 25, texty, DI_TEXT_ALIGN_LEFT, CR_UNTRANSLATED, intens / 255., 0, 0, 1, 1);
}
//

View file

@ -106,15 +106,16 @@ public:
imgScale = baseScale / img->GetDisplayHeight();
DrawGraphic(img, 2, -2, DI_ITEM_LEFT_BOTTOM, 1, 0, 0, imgScale, imgScale);
int gameclock = I_GetBuildTime();
if (!althud_flashing || p->last_extra > (max_player_health >> 2) || (gameclock & 32) || (sprite[p->i].pal == 1 && p->last_extra < 2))
{
int s = -8;
if (althud_flashing && p->last_extra > max_player_health)
s += (sintable[(gameclock << 5) & 2047] >> 10);
int intens = clamp(255 - 4 * s, 0, 255);
auto pe = PalEntry(255, intens, intens, intens);
s += (sintable[(gameclock << 6) & 2047] >> 10);
int intens = clamp(255 - 6 * s, 0, 255);
format.Format("%d", p->last_extra);
SBar_DrawString(this, &numberFont, format, 26.5, -numberFont.mFont->GetHeight() * scale + 4, DI_TEXT_ALIGN_LEFT, CR_UNTRANSLATED, 1, 0, 0, scale, scale);
SBar_DrawString(this, &numberFont, format, 26.5, -numberFont.mFont->GetHeight() * scale + 4, DI_TEXT_ALIGN_LEFT, CR_UNTRANSLATED, intens / 255., 0, 0, scale, scale);
}
//