Mercurial > hg > dmlib
diff tools/libgfx.h @ 2086:aedadff9e116
Implement dmGetBits() to the DMBitStreamContext API. Also improve error handling.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 13 Dec 2018 15:54:09 +0200 |
parents | 41df24d1dfb6 |
children | 614b161c0aa5 |
line wrap: on
line diff
--- a/tools/libgfx.h Tue Dec 11 15:17:40 2018 +0200 +++ b/tools/libgfx.h Thu Dec 13 15:54:09 2018 +0200 @@ -152,16 +152,21 @@ { void *handle; - BOOL (*putByte)(struct _DMBitStreamContext *ctx, Uint8 val); + int (*putByte)(struct _DMBitStreamContext *ctx); + int (*getByte)(struct _DMBitStreamContext *ctx); - int outBuf, outBitCount, outByteCount; + unsigned int + outBuf, outBitCount, outByteCount, + inBuf, inBitCount, inByteCount; } DMBitStreamContext; void dmInitBitStreamContext(DMBitStreamContext *ctx); int dmFlushBitStream(DMBitStreamContext *ctx); -BOOL dmPutBits(DMBitStreamContext *ctx, const int val, const int n); -int dmInitBitStreamFILE(DMBitStreamContext *ctx, DMResource *fp); +int dmInitBitStreamRes(DMBitStreamContext *ctx, DMResource *fp); + +int dmPutBits(DMBitStreamContext *ctx, const unsigned int val, const unsigned int n); +int dmGetBits(DMBitStreamContext *ctx, unsigned int *val, const unsigned int n); #ifdef __cplusplus