Skip to content

Commit

Permalink
workaround freeze
Browse files Browse the repository at this point in the history
  • Loading branch information
histat committed Jan 25, 2022
1 parent 65b3b3d commit 87bd815
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -720,13 +720,21 @@ namespace UI {

void renderBar(CommonTexType type, const vec2 &pos, const vec2 &size, float value, uint32 fgColor = 0xFFFFFFFF, uint32 bgColor = 0x80000000, uint32 brColor1 = 0xFF4C504C, uint32 brColor2 = 0xFF748474, uint32 fgColor2 = 0) {
MeshBuilder *mesh = game->getMesh();

#ifdef _OS_DC
if (brColor1 != 0 || brColor2 != 0)
mesh->addDynFrame(pos - 2.0f, size + 4.0f, brColor1, brColor2);
if (bgColor != 0)
mesh->addDynBar(whiteSprite, pos - 1.0f, size + 2.0f, bgColor);
if ((fgColor != 0 || fgColor2 != 0) && value > 0.0f)
mesh->addDynBar(whiteSprite, pos, vec2(size.x * value, size.y), fgColor, fgColor2);
#else
if (brColor1 != 0 || brColor2 != 0)
mesh->addDynFrame(pos - 2.0f, size + 4.0f, brColor1, brColor2);
if (bgColor != 0)
mesh->addDynBar(whiteSprite, pos - 1.0f, size + 2.0f, bgColor);
if ((fgColor != 0 || fgColor2 != 0) && value > 0.0f)
mesh->addDynBar(CommonTex[type], pos, vec2(size.x * value, size.y), fgColor, fgColor2);
#endif
}

void renderHelp() {
Expand Down

0 comments on commit 87bd815

Please sign in to comment.