Skip to content

Commit

Permalink
Blood: Handle branch names in version string
Browse files Browse the repository at this point in the history
Avoid showing them in the HUD, and change the color.
  • Loading branch information
Hendricks266 committed Aug 28, 2023
1 parent c9db8e5 commit 211bf56
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions source/blood/src/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ int gFrameRate;
int gGamma;

char gVersionString[16];
int gVersionPal;

Resource gSysRes;

Expand Down Expand Up @@ -98,7 +99,15 @@ void __dassert(const char * pzExpr, const char * pzFile, int nLine)
void InitVersionString(void)
{
Bstrncpyz(gVersionString, s_buildRev, sizeof(gVersionString));

char * const pHyphen = strchr(gVersionString, '-');
if (pHyphen != nullptr)
pHyphen[0] = '\0';

char * const pBracket = strchr(gVersionString, '[');
if (pBracket != nullptr)
{
pBracket[0] = '\0';
gVersionPal = 9;
}
}
1 change: 1 addition & 0 deletions source/blood/src/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ extern Resource gSysRes;

void InitVersionString(void);
extern char gVersionString[16];
extern int gVersionPal;
2 changes: 1 addition & 1 deletion source/blood/src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,7 @@ void UpdateStatusBar(ClockTicks arg)
TileHGauge(2208, 44, 190, pPlayer->armor[2], 3200);
DrawStatNumber("%3d", pPlayer->armor[2]>>4, 2230, 50, 193, 0, 0);
}
viewDrawText(3, gVersionString, 20, 191, 32, 0, 1, 0);
viewDrawText(3, gVersionString, 20, 191, 32, gVersionPal, 1, 0);

for (int i = 0; i < 6; i++)
{
Expand Down

0 comments on commit 211bf56

Please sign in to comment.