Ignore:
Timestamp:
Nov 12, 2006, 9:37:58 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • Now that libcaca 0.99.beta10 is out, we can switch to the new API.
File:
1 edited

Legend:

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

    r1299 r1376  
    9797        for(x = 0; x < w; x++)
    9898    {
    99         uint32_t tmp = cucul_getchar(cx->image, x, y + c * cx->height);
    100         cucul_putchar(cx->cv, cx->x + x, cx->y + y, tmp);
     99        uint32_t tmp = cucul_get_char(cx->image, x, y + c * cx->height);
     100        cucul_put_char(cx->cv, cx->x + x, cx->y + y, tmp);
    101101    }
    102102
     
    133133    char buf[2048];
    134134    char hardblank[10];
    135     cucul_buffer_t *b;
    136135    TOIFILE *f;
    137136    unsigned int i, j, size, comment_lines;
     
    250249
    251250    /* Import buffer into canvas */
    252     b = cucul_load_memory(data, i);
    253     cx->image = cucul_import_canvas(b, "utf8");
    254     cucul_free_buffer(b);
     251    cx->image = cucul_create_canvas(0, 0);
     252    cucul_import_memory(cx->image, data, i, "utf8");
    255253    free(data);
    256 
    257     if(!cx->image)
    258     {
    259         free(cx->lookup);
    260         fprintf(stderr, "libcucul could not load data in `%s'\n", path);
    261         return -1;
    262     }
    263254
    264255    /* Remove EOL characters. For now we ignore hardblanks, don’t do any
     
    270261        for(i = cx->max_length; i--;)
    271262        {
    272             ch = cucul_getchar(cx->image, i, j);
     263            ch = cucul_get_char(cx->image, i, j);
    273264
    274265            /* TODO: Replace hardblanks with U+00A0 NO-BREAK SPACE */
    275266            if(ch == cx->hardblank)
    276                 cucul_putchar(cx->image, i, j, ch = ' ');
    277                 //cucul_putchar(cx->image, i, j, ch = 0xa0);
     267                cucul_put_char(cx->image, i, j, ch = ' ');
     268                //cucul_put_char(cx->image, i, j, ch = 0xa0);
    278269
    279270            if(oldch && ch != oldch)
     
    283274            }
    284275            else if(oldch && ch == oldch)
    285                 cucul_putchar(cx->image, i, j, ' ');
     276                cucul_put_char(cx->image, i, j, ' ');
    286277            else if(ch != ' ')
    287278            {
    288279                oldch = ch;
    289                 cucul_putchar(cx->image, i, j, ' ');
    290             }
    291         }
    292     }
    293 
    294     return 0;
    295 }
    296 
     280                cucul_put_char(cx->image, i, j, ' ');
     281            }
     282        }
     283    }
     284
     285    return 0;
     286}
     287
Note: See TracChangeset for help on using the changeset viewer.