From 2b1192dec8b3b489d3a1f549db6cdf1e81a704cd Mon Sep 17 00:00:00 2001 From: Zsolt Vasvari Date: Sun, 24 Feb 2008 23:24:29 +0000 Subject: - Backs out BITMAP8 removal from most places. - I still left drawgfx.c as is, the only piece of code that used any of the functions in drawgfx was s2636.c -- everything else uses 8-bit bitmaps as a replacement for a two dimensional array --- src/lib/util/bitmap.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lib/util/bitmap.c') diff --git a/src/lib/util/bitmap.c b/src/lib/util/bitmap.c index 69454a3cba4..3c4dec454a5 100644 --- a/src/lib/util/bitmap.c +++ b/src/lib/util/bitmap.c @@ -183,6 +183,12 @@ void bitmap_fill(bitmap_t *dest, const rectangle *cliprect, UINT32 color) /* based on the bpp go from there */ switch (dest->bpp) { + case 8: + /* 8bpp always uses memset */ + for (y = fill.min_y; y <= fill.max_y; y++) + memset(BITMAP_ADDR8(dest, y, fill.min_x), (UINT8)color, fill.max_x + 1 - fill.min_x); + break; + case 16: /* 16bpp can use memset if the bytes are equal */ if ((UINT8)(color >> 8) == (UINT8)color) @@ -237,6 +243,9 @@ int bitmap_format_to_bpp(bitmap_format format) /* choose a depth for the format */ switch (format) { + case BITMAP_FORMAT_INDEXED8: + return 8; + case BITMAP_FORMAT_INDEXED16: case BITMAP_FORMAT_RGB15: case BITMAP_FORMAT_YUY16: -- cgit v1.2.3-70-g09d2