diff options
-rw-r--r-- | util.c | 24 | ||||
-rw-r--r-- | util.h | 1 |
2 files changed, 24 insertions, 1 deletions
@@ -43,6 +43,28 @@ void Centre(int y, const char *p) mvaddstr(y, COLS / 2 - l / 2, p); } +void CentreSkipSpaces(int y, const char *p) +{ + size_t l = strlen(p); + int x; + + x = COLS / 2 - l / 2; + + while(*p) + { + if (*p == ' ') + { + x++; + } + else + { + mvaddch(y, x++, *p); + } + + p++; + } +} + const char *CardName(Card c) { static char buff[32]; @@ -194,7 +216,7 @@ void WinScreen() } } - Centre(11, "PRESS SPACE"); + CentreSkipSpaces(11, "PRESS SPACE"); refresh(); } @@ -31,6 +31,7 @@ void Fatal(const char *p); void Centre(int y, const char *p); +void CentreSkipSpaces(int y, const char *p); const char *CardName(Card c); void DrawCard(int y, int x, int face_down, Card c); double DRand(); |