diff options
Diffstat (limited to 'engines/sci/gfx/resource/sci_font.cpp')
-rw-r--r-- | engines/sci/gfx/resource/sci_font.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/engines/sci/gfx/resource/sci_font.cpp b/engines/sci/gfx/resource/sci_font.cpp index f1ae4edb19..adad727324 100644 --- a/engines/sci/gfx/resource/sci_font.cpp +++ b/engines/sci/gfx/resource/sci_font.cpp @@ -38,8 +38,7 @@ extern int font_counter; #define FONT_MAXCHAR_OFFSET 2 static int -calc_char(byte *dest, int total_width, int total_height, byte *src, int size) -{ +calc_char(byte *dest, int total_width, int total_height, byte *src, int size) { int width = src[0]; int height = src[1]; int byte_width = (width + 7) >> 3; @@ -68,8 +67,7 @@ calc_char(byte *dest, int total_width, int total_height, byte *src, int size) gfx_bitmap_font_t * -gfxr_read_font(int id, byte *resource, int size) -{ +gfxr_read_font(int id, byte *resource, int size) { gfx_bitmap_font_t *font = (gfx_bitmap_font_t*)sci_calloc(sizeof(gfx_bitmap_font_t), 1); int chars_nr; int max_width = 0, max_height; @@ -89,7 +87,7 @@ gfxr_read_font(int id, byte *resource, int size) if (chars_nr < 0 || chars_nr > 256 || max_height < 0) { if (chars_nr < 0 || chars_nr > 256) GFXERROR("Font %04x: Invalid number of characters: %d\n", id, - chars_nr); + chars_nr); if (max_height < 0) GFXERROR("Font %04x: Invalid font height: %d\n", id, max_height); gfxr_free_font(font); @@ -98,7 +96,7 @@ gfxr_read_font(int id, byte *resource, int size) if (size < 6 + chars_nr * 2) { GFXERROR("Font %04x: Insufficient space for %d characters in font\n", - id, chars_nr); + id, chars_nr); gfxr_free_font(font); return NULL; } @@ -111,7 +109,7 @@ gfxr_read_font(int id, byte *resource, int size) if (offset >= size) { GFXERROR("Font %04x: Error: Character 0x%02x is at offset 0x%04x (beyond 0x%04x)\n", - id, i, offset, size); + id, i, offset, size); gfxr_free_font(font); return NULL; } @@ -140,7 +138,7 @@ gfxr_read_font(int id, byte *resource, int size) int offset = get_int_16(resource + (i << 1) + 6); if (calc_char(font->data + (font->char_size * i), font->row_size, max_height, - resource + offset, size - offset)) { + resource + offset, size - offset)) { GFXERROR("Problem occured in font %04x, char %d/%d\n", id, i, chars_nr); gfxr_free_font(font); return NULL; |