Hello community, here is the log from the commit of package libansilove for openSUSE:Factory checked in at 2020-01-21 21:03:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libansilove (Old) and /work/SRC/openSUSE:Factory/.libansilove.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libansilove" Tue Jan 21 21:03:17 2020 rev:4 rq:766092 version:1.1.9 Changes: -------- --- /work/SRC/openSUSE:Factory/libansilove/libansilove.changes 2019-12-27 13:49:15.768483715 +0100 +++ /work/SRC/openSUSE:Factory/.libansilove.new.26092/libansilove.changes 2020-01-21 21:04:00.844951003 +0100 @@ -1,0 +2,21 @@ +Mon Jan 20 20:19:12 UTC 2020 - Martin Hauke <[email protected]> + +- Update to version 1.1.9 + * Remove unneeded gdImageColorAllocate calls in the ADF and IDF + loaders + * Reset background24 to 0 when encountering blink attribute in + an SGR sequence, fixing the remaining rendering bugs for 24-bit + ANSI artworks + +------------------------------------------------------------------- +Sun Jan 19 10:07:04 UTC 2020 - Martin Hauke <[email protected]> + +- Update to version 1.1.8 + * Properly reset pcboard buffer when CLS is encountered + * Use memcmp() instead of testing each character one by one in + the PCB loader + * Do not use background and foreground variables to handle 24-bit + ANSI colors + * Various improvements in the IDF loader + +------------------------------------------------------------------- Old: ---- libansilove-1.1.7.tar.gz New: ---- libansilove-1.1.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libansilove.spec ++++++ --- /var/tmp/diff_new_pack.wwUw4y/_old 2020-01-21 21:04:02.128951602 +0100 +++ /var/tmp/diff_new_pack.wwUw4y/_new 2020-01-21 21:04:02.140951608 +0100 @@ -1,7 +1,7 @@ # # spec file for package libansilove # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2019, Martin Hauke <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -20,7 +20,7 @@ %global sover 1 %global libname %{name}%{sover} Name: libansilove -Version: 1.1.7 +Version: 1.1.9 Release: 0 Summary: Library for converting ANSI, ASCII, and other formats to PNG License: BSD-2-Clause ++++++ libansilove-1.1.7.tar.gz -> libansilove-1.1.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/.travis.yml new/libansilove-1.1.9/.travis.yml --- old/libansilove-1.1.7/.travis.yml 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/.travis.yml 2020-01-20 16:08:36.000000000 +0100 @@ -31,7 +31,7 @@ coverity_scan: project: name: "ansilove/libansilove" - version: 1.1.7 + version: 1.1.9 description: "Library for converting ANSI, ASCII, and other formats to PNG" notification_email: [email protected] build_command_prepend: cmake . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/CMakeLists.txt new/libansilove-1.1.9/CMakeLists.txt --- old/libansilove-1.1.7/CMakeLists.txt 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/CMakeLists.txt 2020-01-20 16:08:36.000000000 +0100 @@ -2,7 +2,7 @@ set(LIB_VERSION_MAJOR 1) set(LIB_VERSION_MINOR 1) -set(LIB_VERSION_PATCH 7) +set(LIB_VERSION_PATCH 9) set(LIB_VERSION_STRING ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH}) project (ansilove C) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/ChangeLog new/libansilove-1.1.9/ChangeLog --- old/libansilove-1.1.7/ChangeLog 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/ChangeLog 2020-01-20 16:08:36.000000000 +0100 @@ -1,3 +1,21 @@ +libansilove 1.1.9 (2020-01-20) + +- Remove unneeded gdImageColorAllocate calls in the ADF and IDF loaders +- Reset background24 to 0 when encountering blink attribute in an SGR sequence, + fixing the remaining rendering bugs for 24-bit ANSI artworks + + + +libansilove 1.1.8 (2020-01-18) + +- Use OpenBSD style(9) for function prototypes and declarations +- Properly reset pcboard buffer when CLS is encountered +- Use memcmp() instead of testing each character one by one in the PCB loader +- Do not use background and foreground variables to handle 24-bit ANSI colors +- Various improvements in the IDF loader + + + libansilove 1.1.7 (2019-12-19) - Rename the alSelectFont() function to select_font() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/LICENSE new/libansilove-1.1.9/LICENSE --- old/libansilove-1.1.7/LICENSE 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/LICENSE 2020-01-20 16:08:36.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2011-2019, Stefan Vogt, Brian Cassidy, and Frederic Cambus +Copyright (c) 2011-2020, Stefan Vogt, Brian Cassidy, and Frederic Cambus All rights reserved. Redistribution and use in source and binary forms, with or without diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/TODO new/libansilove-1.1.9/TODO --- old/libansilove-1.1.7/TODO 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/TODO 2020-01-20 16:08:36.000000000 +0100 @@ -1,4 +1,3 @@ -- Fix rendering bugs in the PabloDraw 24-bit ANSI sequences handling - Allow enabling DOS aspect ratio + retina at the same time - Wrap lines longer than 80 columns - Complete the manual page for the library diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/example/example.c new/libansilove-1.1.9/example/example.c --- old/libansilove-1.1.7/example/example.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/example/example.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,6 +1,7 @@ #include <ansilove.h> -int main() { +int main() +{ struct ansilove_ctx ctx; struct ansilove_options options; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/include/ansilove.h new/libansilove-1.1.9/include/ansilove.h --- old/libansilove-1.1.7/include/ansilove.h 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/include/ansilove.h 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * ansilove.h - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. @@ -20,11 +20,11 @@ #define ANSILOVE_EXTERN __attribute__((visibility("default"))) /* Version number */ -#define ANSILOVE_VERSION "1.1.7" +#define ANSILOVE_VERSION "1.1.9" #define ANSILOVE_VERSION_MAJOR 1 #define ANSILOVE_VERSION_MINOR 1 -#define ANSILOVE_VERSION_PATCH 7 +#define ANSILOVE_VERSION_PATCH 9 /* Error codes */ #define ANSILOVE_INVALID_PARAM 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/libansilove.3 new/libansilove-1.1.9/libansilove.3 --- old/libansilove-1.1.7/libansilove.3 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/libansilove.3 2020-01-20 16:08:36.000000000 +0100 @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2011-2019, Stefan Vogt, Brian Cassidy, and Frederic Cambus +.\" Copyright (c) 2011-2020, Stefan Vogt, Brian Cassidy, and Frederic Cambus .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 15 2019 $ +.Dd $Mdocdate: January 17 2020 $ .Dt LIBANSILOVE 1 .Os .Sh NAME diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/clean.c new/libansilove-1.1.9/src/clean.c --- old/libansilove-1.1.7/src/clean.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/clean.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * clean.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/config.h new/libansilove-1.1.9/src/config.h --- old/libansilove-1.1.7/src/config.h 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/config.h 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * config.h - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/drawchar.c new/libansilove-1.1.9/src/drawchar.c --- old/libansilove-1.1.7/src/drawchar.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/drawchar.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * drawchar.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/drawchar.h new/libansilove-1.1.9/src/drawchar.h --- old/libansilove-1.1.7/src/drawchar.h 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/drawchar.h 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * drawchar.h - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. @@ -16,8 +16,7 @@ #include <gd.h> #include <sys/types.h> -void drawchar(gdImagePtr im, const uint8_t *font_data, uint32_t bits, - uint32_t height, uint32_t column, uint32_t row, - uint32_t background, uint32_t foreground, uint8_t character); +void drawchar(gdImagePtr, const uint8_t *, uint32_t, uint32_t, uint32_t, + uint32_t, uint32_t, uint32_t, uint8_t); #endif /* DRAWCHAR_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/error.c new/libansilove-1.1.9/src/error.c --- old/libansilove-1.1.7/src/error.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/error.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * error.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/fonts.c new/libansilove-1.1.9/src/fonts.c --- old/libansilove-1.1.7/src/fonts.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/fonts.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * fonts.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/fonts.h new/libansilove-1.1.9/src/fonts.h --- old/libansilove-1.1.7/src/fonts.h 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/fonts.h 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * fonts.h - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. @@ -23,7 +23,7 @@ bool isAmigaFont; }; -void select_font(struct fontStruct *fontData, int font); +void select_font(struct fontStruct *, int); extern const uint8_t font_pc_80x25[4096]; extern const uint8_t font_pc_80x50[2048]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/init.c new/libansilove-1.1.9/src/init.c --- old/libansilove-1.1.7/src/init.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/init.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * init.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/loaders/ansi.c new/libansilove-1.1.9/src/loaders/ansi.c --- old/libansilove-1.1.7/src/loaders/ansi.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/loaders/ansi.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * ansi.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. @@ -96,6 +96,7 @@ /* default color values */ uint32_t background = 0, foreground = 7; + uint32_t background24 = 0, foreground24 = 0; /* text attributes */ bool bold = false, blink = false, invert = false; @@ -300,7 +301,9 @@ if (seqValue == 0) { background = 0; + background24 = 0; foreground = 7; + foreground24 = 0; bold = false; blink = false; invert = false; @@ -311,14 +314,15 @@ foreground += 8; } bold = true; + foreground24 = 0; } - if (seqValue == 5) - { + if (seqValue == 5) { if (!workbench && options->icecolors) background += 8; blink = true; + background24 = 0; } if (seqValue == 7) @@ -329,6 +333,7 @@ if (seqValue > 29 && seqValue < 38) { foreground = seqValue - 30; + foreground24 = 0; if (bold) foreground += 8; @@ -336,6 +341,7 @@ if (seqValue > 39 && seqValue < 48) { background = seqValue - 40; + background24 = 0; if (blink && options->icecolors) background += 8; @@ -387,10 +393,10 @@ switch (seqValue) { case 0: - background = (color_R << 16) | (color_G << 8) | (color_B); + background24 = (color_R << 16) | (color_G << 8) | (color_B); break; case 1: - foreground = (color_R << 16) | (color_G << 8) | (color_B); + foreground24 = (color_R << 16) | (color_G << 8) | (color_B); break; } @@ -432,10 +438,16 @@ if (invert) { ansi_buffer[structIndex].background = foreground % 8; ansi_buffer[structIndex].foreground = background + (foreground & 8); - } - else { - ansi_buffer[structIndex].background = background; - ansi_buffer[structIndex].foreground = foreground; + } else { + if (background24) + ansi_buffer[structIndex].background = background24; + else + ansi_buffer[structIndex].background = background; + + if (foreground24) + ansi_buffer[structIndex].foreground = foreground24; + else + ansi_buffer[structIndex].foreground = foreground; } ansi_buffer[structIndex].character = current_character; ansi_buffer[structIndex].column = column; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/loaders/artworx.c new/libansilove-1.1.9/src/loaders/artworx.c --- old/libansilove-1.1.7/src/loaders/artworx.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/loaders/artworx.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * artworx.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. @@ -58,8 +58,6 @@ (ctx->buffer[index + 2] << 2 | ctx->buffer[index + 2] >> 4)); } - gdImageColorAllocate(canvas, 0, 0, 0); - /* process ADF */ uint32_t column = 0, row = 0; uint32_t character, attribute, foreground, background; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/loaders/binary.c new/libansilove-1.1.9/src/loaders/binary.c --- old/libansilove-1.1.7/src/loaders/binary.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/loaders/binary.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * binary.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/loaders/icedraw.c new/libansilove-1.1.9/src/loaders/icedraw.c --- old/libansilove-1.1.7/src/loaders/icedraw.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/loaders/icedraw.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * icedraw.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. @@ -18,7 +18,9 @@ #include "drawchar.h" #include "output.h" -#define IDF_HEADER_LENGTH 4144 /* 4096 + 48 */ +#define IDF_HEADER_LENGTH 12 +#define IDF_FONT_LENGTH 4096 +#define IDF_PALETTE_LENGTH 48 int ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options) @@ -30,40 +32,34 @@ return -1; } - if (ctx->length < IDF_HEADER_LENGTH) { + if (ctx->length < IDF_HEADER_LENGTH + IDF_FONT_LENGTH + IDF_PALETTE_LENGTH) { ctx->error = ANSILOVE_FORMAT_ERROR; return -1; } /* Get number of columns, 16-bit endian unsigned short */ - uint32_t x2 = (ctx->buffer[9] << 8) + ctx->buffer[8]; + uint32_t x2 = (ctx->buffer[9] << 8) + ctx->buffer[8] + 1; /* libgd image pointers */ gdImagePtr canvas; - uint32_t loop = 12; + uint32_t loop = IDF_HEADER_LENGTH; uint32_t index; uint32_t colors[16]; /* process IDF */ - uint32_t idf_sequence_length, idf_sequence_loop, i = 0; + uint32_t idf_sequence_length, i = 0; /* dynamically allocated memory buffer for IDF data */ uint8_t *ptr, *idf_buffer; idf_buffer = malloc(2); - uint16_t idf_data, idf_data_length; - - while (loop < ctx->length - IDF_HEADER_LENGTH) { - memcpy(&idf_data, ctx->buffer+loop, 2); - + while (loop < ctx->length - IDF_FONT_LENGTH - IDF_PALETTE_LENGTH) { /* RLE compressed data */ - if (idf_data == 1) { - memcpy(&idf_data_length, ctx->buffer+loop+2, 2); - - idf_sequence_length = idf_data_length & 255; + if (ctx->buffer[loop] == 1) { + idf_sequence_length = ctx->buffer[loop+2]; - for (idf_sequence_loop = 0; idf_sequence_loop < idf_sequence_length; idf_sequence_loop++) + while (idf_sequence_length--) { /* reallocate IDF buffer memory */ ptr = realloc(idf_buffer, i + 2); @@ -100,7 +96,7 @@ } /* create IDF instance */ - canvas = gdImageCreate((x2 + 1) * 8, i / 2 / 80 * 16); + canvas = gdImageCreate(x2 * 8, i / 2 / 80 * 16); /* error output */ if (!canvas) { @@ -108,11 +104,10 @@ free(idf_buffer); return -1; } - gdImageColorAllocate(canvas, 0, 0, 0); /* process IDF palette */ for (loop = 0; loop < 16; loop++) { - index = (loop * 3) + ctx->length - 48; + index = (loop * 3) + ctx->length - IDF_PALETTE_LENGTH; colors[loop] = gdImageColorAllocate(canvas, (ctx->buffer[index] << 2 | ctx->buffer[index] >> 4), (ctx->buffer[index + 1] << 2 | ctx->buffer[index + 1] >> 4), @@ -124,7 +119,7 @@ uint32_t character, attribute, foreground, background; for (loop = 0; loop < i; loop += 2) { - if (column == x2 + 1) { + if (column == x2) { column = 0; row++; } @@ -135,7 +130,7 @@ background = (attribute & 240) >> 4; foreground = attribute & 15; - drawchar(canvas, ctx->buffer+(ctx->length - IDF_HEADER_LENGTH), + drawchar(canvas, ctx->buffer+(ctx->length - IDF_FONT_LENGTH - IDF_PALETTE_LENGTH), 8, 16, column, row, colors[background], colors[foreground], character); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/loaders/pcboard.c new/libansilove-1.1.9/src/loaders/pcboard.c --- old/libansilove-1.1.7/src/loaders/pcboard.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/loaders/pcboard.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * pcboard.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. @@ -13,6 +13,7 @@ #include <gd.h> #include <stdint.h> #include <stdlib.h> +#include <string.h> #include "ansilove.h" #include "config.h" #include "drawchar.h" @@ -92,8 +93,7 @@ loop += 3; } - if (*cursor == 'C' && ctx->buffer[loop+2] == 'L' - && ctx->buffer[loop+3] == 'S') { + if (!memcmp(cursor, "CLS", 3)) { /* erase display */ column = 0; row = 0; @@ -101,11 +101,13 @@ columnMax = 0; rowMax = 0; + /* reset pcboard buffer */ + structIndex = 0; + loop += 4; } - if (*cursor == 'P' && ctx->buffer[loop+2] == 'O' - && ctx->buffer[loop+3] == 'S' && ctx->buffer[loop+4] == ':') { + if (!memcmp(cursor, "POS:", 4)) { /* cursor position */ if (ctx->buffer[loop+6] == '@') { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/loaders/tundra.c new/libansilove-1.1.9/src/loaders/tundra.c --- old/libansilove-1.1.7/src/loaders/tundra.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/loaders/tundra.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * tundra.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/loaders/xbin.c new/libansilove-1.1.9/src/loaders/xbin.c --- old/libansilove-1.1.7/src/loaders/xbin.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/loaders/xbin.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * xbin.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/loadfile.c new/libansilove-1.1.9/src/loadfile.c --- old/libansilove-1.1.7/src/loadfile.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/loadfile.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * loadfile.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/output.c new/libansilove-1.1.9/src/output.c --- old/libansilove-1.1.7/src/output.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/output.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * output.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/output.h new/libansilove-1.1.9/src/output.h --- old/libansilove-1.1.7/src/output.h 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/output.h 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * output.h - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libansilove-1.1.7/src/savefile.c new/libansilove-1.1.9/src/savefile.c --- old/libansilove-1.1.7/src/savefile.c 2019-12-19 17:22:59.000000000 +0100 +++ new/libansilove-1.1.9/src/savefile.c 2020-01-20 16:08:36.000000000 +0100 @@ -1,9 +1,9 @@ /* * savefile.c - * libansilove 1.1.7 + * libansilove 1.1.9 * https://www.ansilove.org * - * Copyright (c) 2011-2019 Stefan Vogt, Brian Cassidy, and Frederic Cambus + * Copyright (c) 2011-2020 Stefan Vogt, Brian Cassidy, and Frederic Cambus * All rights reserved. * * libansilove is licensed under the BSD 2-Clause License.
