libansilove

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

commit 2d159f9008ceef2aac7620c86ae81d18da252315
parent 1948efd16cf21400a4867e7ac837a2db973e30f1
Author: Frederic Cambus <fred@statdns.com>
Date:   Mon,  2 Jul 2018 20:58:40 +0200

Simplify the preprocessing pass in the Tundra loader

Diffstat:
Msrc/loaders/tundra.c | 14++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/loaders/tundra.c b/src/loaders/tundra.c @@ -49,7 +49,7 @@ int ansilove_tundra(struct input *inputFile, struct output *outputFile) row++; } - cursor = character = inputFile->buffer[loop]; + cursor = inputFile->buffer[loop]; switch(cursor) { case TUNDRA_POSITION: @@ -65,27 +65,21 @@ int ansilove_tundra(struct input *inputFile, struct output *outputFile) break; case TUNDRA_COLOR_BACKGROUND: - character = inputFile->buffer[loop + 1]; - loop += 5; + column++; break; case TUNDRA_COLOR_FOREGROUND: - character = inputFile->buffer[loop + 1]; - loop += 5; + column++; break; case TUNDRA_COLOR_BOTH: - character = inputFile->buffer[loop + 1]; - loop += 9; + column++; break; } - if (character != 1 && character != 2 && character != 4 && character != 6) - column++; - loop++; }