Mercurial > hg > dmlib
diff lib64gfx.h @ 530:5b37a2e427b7
Greatly simplify and also improve the multicolor/hires/lace bitmap->image
conversion functionality. This breaks the API, however, adjust gfxconv and
view64 accordingly.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 22 Nov 2012 15:28:27 +0200 |
parents | 6f141f760c54 |
children | fbfdc9e4fe2b |
line wrap: on
line diff
--- a/lib64gfx.h Thu Nov 22 03:23:05 2012 +0200 +++ b/lib64gfx.h Thu Nov 22 15:28:27 2012 +0200 @@ -53,21 +53,26 @@ // Different supported C64 bitmap "modes" enum { - DM_C64IFMT_HIRES, - DM_C64IFMT_MC, - DM_C64IFMT_HIRES_ILACE, - DM_C64IFMT_MC_ILACE, - DM_C64IFMT_HIRES_FLI, - DM_C64IFMT_MC_FLI, + D64_FMT_HIRES = 0x0000, + D64_FMT_MC = 0x0001, + D64_FMT_ILACE = 0x0002, + D64_FMT_FLI = 0x0004, - DM_C64IFMT_LAST_TYPE + D64_FMT_MODE_MASK = 0x000f, + }; - enum { - DM_C64ILACE_COLOR, - DM_C64ILACE_RES, + D64_FLI_2BANK, + D64_FLI_4BANK, + D64_FLI_8BANK, +}; + +enum +{ + D64_ILACE_COLOR, + D64_ILACE_RES, }; typedef struct @@ -79,9 +84,9 @@ enum { - DM_C64CHR_GLOBAL, // use font-global setting - DM_C64CHR_MULTICOLOR, // character is multicolor - DM_C64CHR_HIRES, + D64_CHR_GLOBAL, // use font-global setting + D64_CHR_MULTICOLOR, // character is multicolor + D64_CHR_HIRES, }; typedef struct @@ -104,9 +109,9 @@ typedef struct { int type, // Image type (DM_C64IFMT_*) + fliType, // FLI type (if FLI used) laceType, // Interlace type (DM_C64ILACE_*) - fliType, // FLI type (if FLI used) - fliLines, // FLI on every # line + laceBank1, laceBank2; Uint8 color[C64_SCR_MAX_BANK][C64_SCR_COLOR_SIZE], @@ -168,9 +173,9 @@ extern DMColor dmC64Palette[C64_NCOLORS]; extern const DMC64ImageFormat dmC64ImageFormats[]; extern const int ndmC64ImageFormats; -extern const char * dmC64ImageTypeNames[]; +char * dmC64GetImageTypeString(char *buf, const size_t len, const int type); int dmC64ConvertCSData(DMImage *img, int xoffs, int yoffs, const Uint8 *inBuf, int width, int height, BOOL multicolor, int *colors); int dmC64ProbeGeneric(const Uint8 *buf, const size_t len, const DMC64ImageFormat **fmt); int dmC64DecodeGenericBMP(DMC64Image *img, const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt);