# HG changeset patch # User Matti Hamalainen # Date 1560466607 -10800 # Node ID 455a3849b8ac70f195ca68d0a455e164467d1e4b # Parent 9f3fb4004c209965c5066b05d1eac5a2587ba790 Comments and cosmetics. diff -r 9f3fb4004c20 -r 455a3849b8ac tools/64vw.c --- a/tools/64vw.c Fri Jun 14 00:42:36 2019 +0300 +++ b/tools/64vw.c Fri Jun 14 01:56:47 2019 +0300 @@ -193,7 +193,8 @@ } -int dmReadC64Image(const char *filename, const DMC64ImageFormat *forced, const DMC64ImageFormat **fmt, DMC64Image **cimage) +int dmReadC64Image(const char *filename, const DMC64ImageFormat *forced, + const DMC64ImageFormat **fmt, DMC64Image **cimage) { Uint8 *dataBuf = NULL; size_t dataSize; diff -r 9f3fb4004c20 -r 455a3849b8ac tools/libgfx.c --- a/tools/libgfx.c Fri Jun 14 00:42:36 2019 +0300 +++ b/tools/libgfx.c Fri Jun 14 01:56:47 2019 +0300 @@ -275,7 +275,7 @@ } -static int dmPaletteReadData(DMResource *fp, DMPalette *pal, int ncolors) +static int dmPaletteReadData(DMResource *fp, DMPalette *pal, const int ncolors) { if (pal->ncolors < ncolors) return DMERR_INVALID_ARGS; @@ -297,7 +297,8 @@ } -static int dmPaletteWriteData(DMResource *fp, const DMPalette *pal, const int ncolors, const int npad) +static int dmPaletteWriteData(DMResource *fp, const DMPalette *pal, + const int ncolors, const int npad) { int i; diff -r 9f3fb4004c20 -r 455a3849b8ac tools/libgfx.h --- a/tools/libgfx.h Fri Jun 14 00:42:36 2019 +0300 +++ b/tools/libgfx.h Fri Jun 14 01:56:47 2019 +0300 @@ -113,10 +113,11 @@ typedef struct { - char *fext; - char *name; + char *fext; // Typical filename extension + char *name; // Format name / description int fmtid; // DM_IMGFMT_* int flags; // DM_FMT_* and DM_PIXFMT_* flags + int (*probe)(const Uint8 *buf, const size_t len); int (*read)(DMResource *fp, DMImage **pimg); int (*write)(DMResource *fp, const DMImage *pimg, const DMImageWriteSpec *spec); @@ -164,6 +165,9 @@ int dmWriteIFFImage(DMResource *fp, const DMImage *img, const DMImageWriteSpec *spec); +// +// Simplistic bitstream reading and writing +// typedef struct _DMBitStreamContext { void *handle;