libansilove

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

commit 91705beddbdd3c8a157609e71c8b33cd9a5af9e5
parent c558ad26c32fefdcdf0aa30196fbb09b2c7dcd67
Author: Frederic Cambus <fred@statdns.com>
Date:   Thu, 18 Oct 2018 11:08:28 +0200

Use new ANSILOVE_MODE macros to process options->mode value

Diffstat:
Msrc/loaders/ansi.c | 16++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -47,12 +47,16 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) alSelectFont(&fontData, options->font); // to deal with the bits flag, we declared handy bool types - if (!strcmp(options->mode, "ced")) { - ced = true; - } else if (!strcmp(options->mode, "transparent")) { - transparent = true; - } else if (!strcmp(options->mode, "workbench")) { - workbench = true; + switch (options->mode) { + case ANSILOVE_MODE_CED: + ced = true; + break; + case ANSILOVE_MODE_TRANSPARENT: + transparent = true; + break; + case ANSILOVE_MODE_WORKBENCH: + workbench = true; + break; } // libgd image pointers