Don't hardcode offset of interim commit print

Apparently, the amount of digits in a commit hash that git will output
varies depending on how many objects are in the repository that the hash
gets pulled from. The more objects, the more digits needed to avoid a
hash collision.

Sources:
    https://stackoverflow.com/q/18134627/#comment26560283_18134919
    https://stackoverflow.com/a/21015031/

So that means we'll have to dynamically account for the length of the
commit hash in order to get it properly right-aligned with the rest of
the text.
This commit is contained in:
Misa 2020-11-20 19:13:28 -08:00 committed by Ethan Lee
parent 3f76f5164b
commit ce203812ad
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ void menurender()
graphics.Print( 310 - (10*8), 210, COMMIT_DATE, tr/2, tg/2, tb/2);
#endif
#ifdef INTERIM_COMMIT
graphics.Print( 310 - (8*8), 220, INTERIM_COMMIT, tr/2, tg/2, tb/2);
graphics.Print( 310 - SDL_strlen(INTERIM_COMMIT) * 8, 220, INTERIM_COMMIT, tr/2, tg/2, tb/2);
#endif
graphics.Print( 310 - (4*8), 230, "v2.3", tr/2, tg/2, tb/2);