diff options
author | 2008-02-24 23:24:29 +0000 | |
---|---|---|
committer | 2008-02-24 23:24:29 +0000 | |
commit | 2b1192dec8b3b489d3a1f549db6cdf1e81a704cd (patch) | |
tree | 31b68a3ada34c9b5763d3c8979a3d528bbd35074 /src/lib/util/bitmap.c | |
parent | ee93a9155103cb019aea2c50d3fc5f112062ab50 (diff) |
- 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
Diffstat (limited to 'src/lib/util/bitmap.c')
-rw-r--r-- | src/lib/util/bitmap.c | 9 |
1 files changed, 9 insertions, 0 deletions
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: |