Changeset 1242 for toilet


Ignore:
Timestamp:
Oct 26, 2006, 3:14:37 PM (13 years ago)
Author:
Sam Hocevar
Message:
  • Factor code from renderers to main render.c functions.
Location:
toilet/trunk/src
Files:
5 edited

Legend:

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

    r1241 r1242  
    4444        return -1;
    4545
    46     cx->x = cx->y = 0;
    47     cx->w = cx->h = 0;
    48     cx->cv = cucul_create_canvas(1, 1);
    49 
    5046    cx->feed = feed_figlet;
    5147    cx->flush = flush_figlet;
     
    126122{
    127123    cucul_free_canvas(cx->image);
    128     cucul_free_canvas(cx->cv);
    129124    free(cx->lookup);
    130125
  • toilet/trunk/src/mono9.c

    r1241 r1242  
    4141    cx->onechar = cucul_create_canvas(1, 1);
    4242    cucul_set_color(cx->onechar, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
    43 
    44     cx->x = cx->y = 0;
    45     cx->w = cx->h = 0;
    46     cx->cv = cucul_create_canvas(1, 1);
    4743
    4844    cx->feed = feed_big;
     
    128124{
    129125    cucul_free_canvas(cx->onechar);
    130     cucul_free_canvas(cx->cv);
    131126    free(cx->buf);
    132127    cucul_free_font(cx->f);
  • toilet/trunk/src/render.c

    r1241 r1242  
    3232int render_init(context_t *cx)
    3333{
     34    cx->x = cx->y = 0;
     35    cx->w = cx->h = 0;
     36    cx->lines = 0;
     37    cx->cv = cucul_create_canvas(0, 0);
     38
    3439    if(!strcasecmp(cx->font, "mono9"))
    3540        return init_big(cx);
     
    115120{
    116121    cx->end(cx);
     122    cucul_free_canvas(cx->cv);
    117123
    118124    return 0;
  • toilet/trunk/src/term.c

    r1241 r1242  
    3535    cx->ew = 16;
    3636    cx->eh = 2;
    37     cx->x = cx->y = 0;
    38     cx->w = cx->h = 0;
    39     cx->cv = cucul_create_canvas(cx->ew, cx->eh);
    4037
    4138    cx->feed = feed_tiny;
     
    107104static int end_tiny(context_t *cx)
    108105{
    109     cucul_free_canvas(cx->cv);
    110 
    111106    return 0;
    112107}
  • toilet/trunk/src/toilet.h

    r1241 r1242  
    2626    cucul_canvas_t *cv;
    2727    cucul_canvas_t *torender;
    28     unsigned int w, h, ew, eh, x, y;
     28    unsigned int w, h, ew, eh, x, y, lines;
    2929
    3030    /* Render methods */
Note: See TracChangeset for help on using the changeset viewer.