X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgfxutil.h;h=f0468b615531cd0fb113da5d010a08bcbf4dc84a;hb=32ff3cf2d7d7a5ae82f5ca400b320c67e6984ad6;hp=15f8b66f0eaae178720df09dd7e44cdc77ac8961;hpb=a563d2f0efaa980af0f0b39cdf1c9115fed99d00;p=dosdemo diff --git a/src/gfxutil.h b/src/gfxutil.h index 15f8b66..f0468b6 100644 --- a/src/gfxutil.h +++ b/src/gfxutil.h @@ -4,7 +4,9 @@ #include "inttypes.h" #define PACK_RGB16(r, g, b) \ - (((r) << 8) & 0xf800) | (((g) << 3) & 0x7e0) | (((b) >> 3) & 0x1f) + ((((uint16_t)(r) << 8) & 0xf800) | \ + (((uint16_t)(g) << 3) & 0x7e0) | \ + (((uint16_t)(b) >> 3) & 0x1f)) #define UNPACK_R16(c) (((c) >> 8) & 0xf8) #define UNPACK_G16(c) (((c) >> 3) & 0xfc) @@ -20,4 +22,6 @@ void draw_line(int x0, int y0, int x1, int y1, unsigned short color); void blur_grey_horiz(uint16_t *dest, uint16_t *src, int xsz, int ysz, int radius, int scale); void blur_grey_vert(uint16_t *dest, uint16_t *src, int xsz, int ysz, int radius, int scale); +void convimg_rgb24_rgb16(uint16_t *dest, unsigned char *src, int xsz, int ysz); + #endif /* GFXUTIL_H_ */