Mercurial > hg > dmlib
changeset 514:c9b9f912acfb
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 19 Nov 2012 16:14:07 +0200 |
parents | 486067f39bc1 |
children | a896c1153e4e |
files | lib64gfx.c |
diffstat | 1 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/lib64gfx.c Mon Nov 19 16:10:37 2012 +0200 +++ b/lib64gfx.c Mon Nov 19 16:14:07 2012 +0200 @@ -8,6 +8,9 @@ */ #include "lib64gfx.h" +#define BUF_SIZE_INITIAL (16*1024) +#define BUF_SIZE_GROW (4*1024) + const char *dmC64ImageTypeNames[DM_C64IFMT_LAST_TYPE] = { @@ -53,6 +56,12 @@ +static BOOL dmCompareAddr16(const Uint8 *buf, const size_t offs, const Uint16 addr) +{ + return (buf[offs] == (addr & 0xff)) && (buf[offs + 1] == ((addr >> 8) & 0xff)); +} + + int dmC64ConvertCSData(DMImage *img, int xoffs, int yoffs, const Uint8 *buf, int width, int height, BOOL multicolor, int *colors) @@ -116,12 +125,6 @@ } -static BOOL dmCompareAddr16(const Uint8 *buf, const size_t offs, const Uint16 addr) -{ - return (buf[offs] == (addr & 0xff)) && (buf[offs + 1] == ((addr >> 8) & 0xff)); -} - - static int fmtProbeDrazPaint20Packed(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) { const char *ident = (const char *) buf + 2; @@ -636,8 +639,6 @@ } -#define BUF_SIZE_INITIAL (16*1024) -#define BUF_SIZE_GROW (8*1024) int dmReadDataFile(FILE *inFile, const char *filename, Uint8 **pbuf, size_t *pbufSize) {