Use PR_RIGHT for interim version info in main menu

This used some constants counting numbers of characters
(LEN_INTERIM_COMMIT and LEN_BRANCH_NAME) and even an SDL_arraysize,
all multiplied by 8, to get the length of the displayed text.
Now it just uses the new PR_RIGHT flag of font::print.

I did also force the 8x8 font for all the interim information, since
the date kinda overlapped with the menu options... And all of these
lines only show up in interim versions anyway, except for the version
number - which is left in the interface font for consistency with the
rest of the menu in non-interim versions. The inconsistency in interim
versions doesn't really matter all that much I think, it's just some
technical/debug info.
This commit is contained in:
Dav999-v 2023-01-17 04:47:17 +01:00 committed by Misa Elizabeth Kai
parent da6be09993
commit c82e1f2902
3 changed files with 4 additions and 8 deletions

View File

@ -9,12 +9,10 @@ extern "C"
#endif
extern const char* INTERIM_COMMIT;
extern const int LEN_INTERIM_COMMIT;
extern const char* COMMIT_DATE;
extern const char* BRANCH_NAME;
extern const int LEN_BRANCH_NAME;
#ifdef __cplusplus
} /* extern "C" */

View File

@ -1,7 +1,5 @@
const char* INTERIM_COMMIT = "@INTERIM_COMMIT@";
const int LEN_INTERIM_COMMIT = sizeof("@INTERIM_COMMIT@") - 1;
const char* COMMIT_DATE = "@COMMIT_DATE@";
const char* BRANCH_NAME = "@BRANCH_NAME@";
const int LEN_BRANCH_NAME = sizeof("@BRANCH_NAME@") - 1;

View File

@ -173,11 +173,11 @@ static void menurender(void)
font::print(PR_RIGHT, 264, temp+35, loc::gettext("MAKE AND PLAY EDITION"), tr, tg, tb);
#endif
#ifdef INTERIM_VERSION_EXISTS
graphics.Print( 310 - (10*8), 200, COMMIT_DATE, tr/2, tg/2, tb/2);
graphics.Print( 310 - LEN_INTERIM_COMMIT * 8, 210, INTERIM_COMMIT, tr/2, tg/2, tb/2);
graphics.Print( 310 - LEN_BRANCH_NAME * 8, 220, BRANCH_NAME, tr/2, tg/2, tb/2);
font::print(PR_RIGHT | PR_FONT_8X8, 310, 200, COMMIT_DATE, tr/2, tg/2, tb/2);
font::print(PR_RIGHT | PR_FONT_8X8, 310, 210, INTERIM_COMMIT, tr/2, tg/2, tb/2);
font::print(PR_RIGHT | PR_FONT_8X8, 310, 220, BRANCH_NAME, tr/2, tg/2, tb/2);
#endif
graphics.Print( 310 - (SDL_arraysize(RELEASE_VERSION) - 1) * 8, 230, RELEASE_VERSION, tr/2, tg/2, tb/2);
font::print(PR_RIGHT, 310, 230, RELEASE_VERSION, tr/2, tg/2, tb/2);
if(music.mmmmmm){
graphics.Print( 10, 230, loc::gettext("[MMMMMM Mod Installed]"), tr/2, tg/2, tb/2);