diff options
| author | Steven Fuller <relnev@icculus.org> | 2001-12-07 03:11:04 +0000 |
|---|---|---|
| committer | Patryk Obara <dreamer.tan@gmail.com> | 2019-08-20 02:22:37 +0200 |
| commit | aa61006034cea1c70250356ecb9ed240ff754b1f (patch) | |
| tree | f0e84414ce9319c97395d712fec3b693e989d9f8 | |
| parent | e196a237d4920fe4cc26da0c8088ea4823a5b3ea (diff) | |
work around the Regular Edition menu font size.
| -rw-r--r-- | src/menus.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/menus.c b/src/menus.c index fb588f2..09628aa 100644 --- a/src/menus.c +++ b/src/menus.c @@ -280,6 +280,7 @@ typedef struct AVPIndexedFont int ascii; /* ascii code for initial character */ int height; /* height per character */ + int numchars; int FontWidth[256]; } AVPIndexedFont; @@ -332,9 +333,16 @@ static void LoadMenuFont() unsigned char *srcPtr = image->buf; int c; + if ((image->w != 30) || ((image->h % 33) != 0)) { + fprintf(stderr, "ERROR: I am going to give up now, because I don't like your font!\n"); + fprintf(stderr, "Font Size: %d x %d\n", image->w, image->h); + exit(EXIT_FAILURE); + } + + IntroFont_Light.numchars = image->h / 33; IntroFont_Light.FontWidth[32] = 5; - for (c=33; c<255; c++) { + for (c=33; c<(32+IntroFont_Light.numchars); c++) { int x,y; int y1 = 1+(c-32)*33; @@ -755,7 +763,7 @@ Determine area used by text , so we can draw it centrally if(wordWidth> area->right-sx) break; while(*textPtr && *textPtr==' ') { - *textPtr++; + textPtr++; } } } |
