Mercurial > hg > dmlib
changeset 104:7160c1d71ade
Few nasty bugs fixed in TSFONT loading.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 03 Oct 2012 08:30:32 +0300 |
parents | d97accc86365 |
children | d5d27f262227 |
files | dmtext_bm.c |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/dmtext_bm.c Wed Oct 03 08:28:29 2012 +0300 +++ b/dmtext_bm.c Wed Oct 03 08:30:32 2012 +0300 @@ -234,7 +234,7 @@ nglyphs = dmfgetc(res); // Maximum glyph number - maxglyph = 255; + maxglyph = 256; } else { @@ -274,10 +274,8 @@ // Setup palette for 8bpp fonts for (n = 0; n < DMFONT_NPALETTE; n++) { - pal[n].r = n * 16; - pal[n].g = n * 16; - pal[n].b = n * 16; - pal[n].unused = n > 0 ? n * 16 : 0; + pal[n].r = pal[n].g = pal[n].b = 0; + pal[n].unused = n > 0 ? 255 : 0; } if (tsfont) @@ -315,7 +313,7 @@ height < DMFONT_MIN_HEIGHT || width > DMFONT_MAX_WIDTH || height > DMFONT_MAX_HEIGHT || - index > maxglyph) + index >= maxglyph) return DMERR_INVALID_DATA; // Allocate bitmap