X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fgfxutil.h;h=d4f06c60a1ba351290078b42d2daec5bbc98b557;hp=b46f81344c7182de327813cffc6076e7832ccb67;hb=b49854e0980a030cc8338a7f4ee779ecde1aae38;hpb=57bd2dc519c47f434e3e5acf998fb9c72448cbce diff --git a/src/gfxutil.h b/src/gfxutil.h index b46f813..d4f06c6 100644 --- a/src/gfxutil.h +++ b/src/gfxutil.h @@ -3,6 +3,7 @@ #include "inttypes.h" + #define PACK_RGB16(r, g, b) \ ((((uint16_t)(r) << 8) & 0xf800) | \ (((uint16_t)(g) << 3) & 0x7e0) | \ @@ -12,23 +13,37 @@ #define UNPACK_G16(c) (((c) >> 3) & 0xfc) #define UNPACK_B16(c) (((c) << 3) & 0xf8) + +#ifdef BUILD_BIGENDIAN + +#define PACK_RGB32(r, g, b) \ + ((((r) & 0xff) << 8) | (((g) & 0xff) << 16) | (((b) & 0xff) << 24) | 0xff) + +#define UNPACK_R32(c) (((c) >> 8) & 0xff) +#define UNPACK_G32(c) (((c) >> 16) & 0xff) +#define UNPACK_B32(c) (((c) >> 24) & 0xff) + +#else /* LITTLE_ENDIAN */ + #define PACK_RGB32(r, g, b) \ - ((((r) & 0xff) << 16) | (((g) & 0xff) << 8) | ((b) & 0xff)) + ((((r) & 0xff) << 16) | (((g) & 0xff) << 8) | ((b) & 0xff) | 0xff000000) #define UNPACK_R32(c) (((c) >> 16) & 0xff) #define UNPACK_G32(c) (((c) >> 8) & 0xff) #define UNPACK_B32(c) ((c) & 0xff) +#endif int clip_line(int *x0, int *y0, int *x1, int *y1, int xmin, int ymin, int xmax, int ymax); void draw_line(int x0, int y0, int x1, int y1, unsigned short color); /* scale in 24.8 fixed point */ -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 blur_horiz(uint16_t *dest, uint16_t *src, int xsz, int ysz, int radius, int scale); +void blur_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); -void blitfb(uint16_t *dest, uint16_t *src, int xsz, int ysz, int pitch_pix); -void blitfb_key(uint16_t *dest, uint16_t *src, int xsz, int ysz, int pitch_pix, uint16_t key); +void blitfb(uint16_t *dest, uint16_t *src, int width, int height, int pitch_pix); +void blit(uint16_t *dest, int destwidth, uint16_t *src, int xsz, int ysz, int pitch_pix); +void blit_key(uint16_t *dest, int destwidth, uint16_t *src, int xsz, int ysz, int pitch_pix, uint16_t key); #endif /* GFXUTIL_H_ */