libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit bf81d9feeeb1fbd0d6a6902b58e8368ce83f1058
parent 165d8ef86b18026c6cb576b71aaf5a394653da26
Author: Frederic Cambus <fred@statdns.com>
Date:   Sun, 17 Nov 2019 23:32:52 +0100

Use XBIN_HEADER_LENGTH and XBIN_PALETTE_LENGTH macros instead of magic numbers.

Diffstat:
Msrc/loaders/xbin.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -70,7 +70,7 @@ ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) } uint32_t colors[16]; - uint32_t offset = 11; + uint32_t offset = XBIN_HEADER_LENGTH; /* palette */ if ((xbin_flags & 1) == 1) { @@ -86,7 +86,7 @@ ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) (ctx->buffer[index + 2] << 2 | ctx->buffer[index + 2] >> 4)); } - offset += 48; + offset += XBIN_PALETTE_LENGTH; } else { for (int i = 0; i < 16; i++) { colors[i] = gdImageColorAllocate(canvas,