diff options
author | Aaron Giles <aaron@aarongiles.com> | 2008-03-01 08:41:56 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2008-03-01 08:41:56 +0000 |
commit | b8a64773fddd8b7573950258c584532eedcb76e3 (patch) | |
tree | 07ca9d999e8c18be47b6e6fde8031272599d2ed0 /src/build | |
parent | 2fba8bdb8a1be8acf018565ac92a2804679dca81 (diff) |
Added macros to define device functions. Updated existing devices
to use the macros.
Added the concept of device classes. Devices specify their class
in their get_info function. Classes can be used to walk through
devices at a more general level than their type. Functions have
been added to iterate through devices by class just as you can
by type.
Removed some unused fields from device_config.
Diffstat (limited to 'src/build')
-rw-r--r-- | src/build/png2bdc.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/src/build/png2bdc.c b/src/build/png2bdc.c index bf942a55e34..7c53e54cfb1 100644 --- a/src/build/png2bdc.c +++ b/src/build/png2bdc.c @@ -344,28 +344,32 @@ static int bitmap_to_chars(bitmap_t *bitmap, render_font *font) break; } - /* print info */ -// printf(" Character %X - width = %d\n", chstart, colend - colstart + 1); - - /* allocate a bitmap */ - ch->bitmap = bitmap_alloc(colend - colstart + 1, font->height, BITMAP_FORMAT_ARGB32); - if (ch->bitmap == NULL) + // skip char which code is already registered + if (ch->width <= 0) { - fprintf(stderr, "Error allocating character bitmap (%dx%d)\n", colend - colstart + 1, font->height); - continue; - } + /* print info */ +// printf(" Character %X - width = %d\n", chstart, colend - colstart + 1); + + /* allocate a bitmap */ + ch->bitmap = bitmap_alloc(colend - colstart + 1, font->height, BITMAP_FORMAT_ARGB32); + if (ch->bitmap == NULL) + { + fprintf(stderr, "Error allocating character bitmap (%dx%d)\n", colend - colstart + 1, font->height); + continue; + } - /* plot the character */ - for (y = rowstart; y <= rowend; y++) - for (x = colstart; x <= colend; x++) - *BITMAP_ADDR32(ch->bitmap, y - rowstart, x - colstart) = pixel_is_set(bitmap, y, x) ? 0xffffffff : 0x00000000; - - /* set the character parameters */ - ch->width = colend - colstart + 1; - ch->xoffs = 0; - ch->yoffs = font->yoffs; - ch->bmwidth = ch->bitmap->width; - ch->bmheight = ch->bitmap->height; + /* plot the character */ + for (y = rowstart; y <= rowend; y++) + for (x = colstart; x <= colend; x++) + *BITMAP_ADDR32(ch->bitmap, y - rowstart, x - colstart) = pixel_is_set(bitmap, y, x) ? 0xffffffff : 0x00000000; + + /* set the character parameters */ + ch->width = colend - colstart + 1; + ch->xoffs = 0; + ch->yoffs = font->yoffs; + ch->bmwidth = ch->bitmap->width; + ch->bmheight = ch->bitmap->height; + } /* next character */ chstart++; |