Ignore:
Timestamp:
Oct 26, 2006, 3:07:58 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Make stdin input line-aware so that we don't have to wait until EOF to display stuff.
  • Reorganise stuff and fix memory leaks.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • toilet/trunk/src/figlet.c

    r1204 r1241  
    2727
    2828#include "toilet.h"
     29#include "render.h"
    2930#include "io.h"
    30 #include "figlet.h"
    3131
    3232#define STD_GLYPHS (127 - 32)
     
    3434
    3535static int feed_figlet(context_t *, uint32_t);
     36static int flush_figlet(context_t *);
    3637static int end_figlet(context_t *);
    3738
     
    4849
    4950    cx->feed = feed_figlet;
     51    cx->flush = flush_figlet;
    5052    cx->end = end_figlet;
    5153
     
    109111}
    110112
     113static int flush_figlet(context_t *cx)
     114{
     115    cx->torender = cx->cv;
     116    cucul_set_canvas_size(cx->torender, cx->w, cx->h);
     117
     118    cx->x = cx->y = 0;
     119    cx->w = cx->h = 0;
     120    cx->cv = cucul_create_canvas(1, 1);
     121
     122    return 0;
     123}
     124
    111125static int end_figlet(context_t *cx)
    112126{
    113127    cucul_free_canvas(cx->image);
     128    cucul_free_canvas(cx->cv);
    114129    free(cx->lookup);
    115130
Note: See TracChangeset for help on using the changeset viewer.