libansilove

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

commit eb5b9829d587f5aa28ef005b3f5a5c39e292982f
parent b7fa0f5eeeed8e6276f96a90d60fa63f3ec0e04a
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 23 Sep 2020 13:49:00 +0200

Wrap lines longer than 80 columns in the Artworx loader.

Diffstat:
Msrc/loaders/artworx.c | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/loaders/artworx.c b/src/loaders/artworx.c @@ -42,7 +42,9 @@ ansilove_artworx(struct ansilove_ctx *ctx, struct ansilove_options *options) gdImagePtr canvas; /* create ADF instance */ - canvas = gdImageCreate(640, (ctx->length - ADF_HEADER_LENGTH) / 2 / 80 * 16); + canvas = + gdImageCreate(640, (ctx->length - ADF_HEADER_LENGTH) / 2 / 80 * 16); + if (!canvas) { ctx->error = ANSILOVE_GD_ERROR; return -1; @@ -53,7 +55,8 @@ ansilove_artworx(struct ansilove_ctx *ctx, struct ansilove_options *options) /* process ADF palette */ for (loop = 0; loop < 16; loop++) { index = (adf_colors[loop] * 3) + 1; - gdImageColorAllocate(canvas, ctx->buffer[index] << 2 | ctx->buffer[index] >> 4, + gdImageColorAllocate(canvas, + ctx->buffer[index] << 2 | ctx->buffer[index] >> 4, ctx->buffer[index + 1] << 2 | ctx->buffer[index + 1] >> 4, ctx->buffer[index + 2] << 2 | ctx->buffer[index + 2] >> 4); } @@ -83,7 +86,8 @@ ansilove_artworx(struct ansilove_ctx *ctx, struct ansilove_options *options) background = (attribute & 240) >> 4; foreground = attribute & 15; - drawchar(canvas, ctx->buffer+193, 8, 16, column, row, background, foreground, character); + drawchar(canvas, ctx->buffer+193, 8, 16, column, row, + background, foreground, character); column++;