- buildutils: Replace sintable[] use within Duke's sbar_*.cpp with bsin()/bcos().

This commit is contained in:
Mitchell Richters 2020-11-15 15:14:47 +11:00 committed by Christoph Oelckers
parent 0781d627dc
commit 410c2cf41f
2 changed files with 2 additions and 2 deletions

View file

@ -137,7 +137,7 @@ public:
{ {
int s = -8; int s = -8;
if (althud_flashing && p->last_extra > max_player_health) if (althud_flashing && p->last_extra > max_player_health)
s += (sintable[(I_GetBuildTime() << 5) & 2047] / 768); s += bsin(I_GetBuildTime() << 5) / 768;
int intens = clamp(255 - 6 * s, 0, 255); int intens = clamp(255 - 6 * s, 0, 255);
format.Format("%d", p->last_extra); format.Format("%d", p->last_extra);
SBar_DrawString(this, numberFont, format, 25, texty, DI_TEXT_ALIGN_LEFT, CR_UNTRANSLATED, intens / 255., 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

@ -112,7 +112,7 @@ public:
{ {
int s = -8; int s = -8;
if (althud_flashing && p->last_extra > max_player_health) if (althud_flashing && p->last_extra > max_player_health)
s += (sintable[(I_GetBuildTime() << 5) & 2047] / 768); s += bsin(I_GetBuildTime() << 5) / 768;
int intens = clamp(255 - 6 * s, 0, 255); int intens = clamp(255 - 6 * s, 0, 255);
format.Format("%d", p->last_extra); format.Format("%d", p->last_extra);
SBar_DrawString(this, numberFont, format, 26.5, -numberFont->mFont->GetHeight() * scale + 4, DI_TEXT_ALIGN_LEFT, CR_UNTRANSLATED, intens / 255., 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);