Mercurial > hg > dmlib
changeset 1644:9d9a0e852b3d
Reorder some functions.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 30 May 2018 00:56:32 +0300 |
parents | 1834a477e0e2 |
children | 262300a0359b |
files | tools/lib64gfx.c tools/lib64gfx.h |
diffstat | 2 files changed, 22 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/lib64gfx.c Mon May 28 19:58:08 2018 +0300 +++ b/tools/lib64gfx.c Wed May 30 00:56:32 2018 +0300 @@ -12,6 +12,20 @@ #define BUF_SIZE_GROW (4*1024) +char * dmC64GetImageTypeString(char *buf, const size_t len, const int type, const BOOL lng) +{ + snprintf(buf, len, + "%s%s%s%s", + (type & D64_FMT_MC) ? (lng ? "MultiColor " : "MC ") : "HiRes ", + (type & D64_FMT_ILACE) ? (lng ? "Interlaced " : "ILace ") : "", + (type & D64_FMT_FLI) ? "FLI " : "", + (type & D64_FMT_CHAR) ? "CHAR" : "" + ); + + return buf; +} + + void dmC64ImageDump(FILE *fh, const DMC64Image *img, const DMC64ImageFormat *fmt) { char typeStr[64]; @@ -62,20 +76,6 @@ } -char * dmC64GetImageTypeString(char *buf, const size_t len, const int type, const BOOL lng) -{ - snprintf(buf, len, - "%s%s%s%s", - (type & D64_FMT_MC) ? (lng ? "MultiColor " : "MC ") : "HiRes ", - (type & D64_FMT_ILACE) ? (lng ? "Interlaced " : "ILace ") : "", - (type & D64_FMT_FLI) ? "FLI " : "", - (type & D64_FMT_CHAR) ? "CHAR" : "" - ); - - return buf; -} - - BOOL dmCompareAddr16(const Uint8 *buf, const size_t offs, const Uint16 addr) { return buf[offs ] == DM_GET_ADDR_LO(addr) &&
--- a/tools/lib64gfx.h Mon May 28 19:58:08 2018 +0300 +++ b/tools/lib64gfx.h Wed May 30 00:56:32 2018 +0300 @@ -228,28 +228,28 @@ // // Miscellaneous functions // +char * dmC64GetImageTypeString(char *buf, const size_t len, const int type, const BOOL lng); void dmC64ImageDump(FILE *fh, const DMC64Image *img, const DMC64ImageFormat *fmt); -char * dmC64GetImageTypeString(char *buf, const size_t len, const int type, const BOOL lng); void dmSetDefaultC64Palette(DMImage *img); +BOOL dmCompareAddr16(const Uint8 *buf, const size_t offs, const Uint16 addr); int dmC64ImageGetNumBanks(const DMC64ImageFormat *fmt); -int dmC64ConvertCSDataToImage(DMImage *img, int xoffs, int yoffs, const Uint8 *inBuf, int width, int height, BOOL multicolor, int *colors); -BOOL dmCompareAddr16(const Uint8 *buf, const size_t offs, const Uint16 addr); -int dmC64SanityCheckEncDecOp(const int i, const DMC64EncDecOp *op, const DMC64Image *img); -BOOL dmC64GetOpSize(const DMC64EncDecOp *op, const DMC64ImageFormat *fmt, size_t *size); - +// C64 bitmap image allocation/freeing int dmC64MemBlockAlloc(DMC64MemBlock *blk, const size_t size); int dmC64MemBlockCopy(DMC64MemBlock *dst, const DMC64MemBlock *src); void dmC64MemBlockFree(DMC64MemBlock *blk); - -// C64 bitmap image allocation/freeing DMC64Image *dmC64ImageAlloc(const DMC64ImageFormat *fmt); void dmC64ImageFree(DMC64Image *img); // Encoding and decoding of formats and images +int dmC64ConvertCSDataToImage(DMImage *img, int xoffs, int yoffs, const Uint8 *inBuf, int width, int height, BOOL multicolor, int *colors); + +int dmC64SanityCheckEncDecOp(const int i, const DMC64EncDecOp *op, const DMC64Image *img); +BOOL dmC64GetOpSize(const DMC64EncDecOp *op, const DMC64ImageFormat *fmt, size_t *size); + int dmC64ProbeBMP(const Uint8 *buf, const size_t len, const DMC64ImageFormat **fmt); int dmC64DecodeGenericBMP(DMC64Image *img, const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt);