libansilove

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

commit 3a49ecfe733033784d578b6865ca8ac06398daab
parent e6f8e93a0b82d6a13175b0e4e3c692b0d7870695
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 23 Sep 2020 09:23:49 +0200

Revert "Always update number of columns and lines used", it's causing issues.

This reverts commit 90a9ade33f6002dc792962b412f77db8994dfd69.

Diffstat:
Msrc/loaders/ansi.c | 14+++++++-------
Msrc/loaders/pcboard.c | 8++++----
2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -402,6 +402,13 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } break; default: + /* record number of columns and lines used */ + if (column > columnMax) + columnMax = column; + + if (row > rowMax) + rowMax = row; + /* write current character in ansiChar structure */ if (!fontData.isAmigaFont || (current_character != 12 && current_character != 13)) { /* reallocate structure array memory */ @@ -438,13 +445,6 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } } - /* record number of columns and lines used */ - if (column > columnMax) - columnMax = column; - - if (row > rowMax) - rowMax = row; - loop++; } diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c @@ -114,6 +114,10 @@ ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options) break; default: + /* record number of lines used */ + if (row > rowMax) + rowMax = row; + /* reallocate structure array memory */ ptr = realloc(pcboard_buffer, (structIndex + 1) * sizeof (struct pcbChar)); if (ptr == NULL) { @@ -134,10 +138,6 @@ ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options) structIndex++; } - /* record number of lines used */ - if (row > rowMax) - rowMax = row; - loop++; } rowMax++;