Changeset 678 for libcaca


Ignore:
Timestamp:
Mar 23, 2006, 3:07:32 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • Made cucul_putchar32() an internal-only function.
  • Changed the line, box, ellipsis etc. prototypes so that they use an UTF-8 string instead of a single character as their last argument.
Location:
libcaca/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cucul/box.c

    r672 r678  
    3434 * \param x2 X coordinate of the lower-right corner of the box.
    3535 * \param y2 Y coordinate of the lower-right corner of the box.
    36  * \param c Character to draw the box outline with.
     36 * \param str UTF-8 string containing the character to use to draw the box.
    3737 * \return void
    3838 */
    39 void cucul_draw_box(cucul_t *qq, int x1, int y1, int x2, int y2, char c)
     39void cucul_draw_box(cucul_t *qq, int x1, int y1, int x2, int y2,
     40                    char const *str)
    4041{
    41     cucul_draw_line(qq, x1, y1, x1, y2, c);
    42     cucul_draw_line(qq, x1, y2, x2, y2, c);
    43     cucul_draw_line(qq, x2, y2, x2, y1, c);
    44     cucul_draw_line(qq, x2, y1, x1, y1, c);
     42    cucul_draw_line(qq, x1, y1, x1, y2, str);
     43    cucul_draw_line(qq, x1, y2, x2, y2, str);
     44    cucul_draw_line(qq, x2, y2, x2, y1, str);
     45    cucul_draw_line(qq, x2, y1, x1, y1, str);
    4546}
    4647
     
    7980    if(y1 >= 0)
    8081        for(x = x1 < 0 ? 1 : x1 + 1; x < x2 && x < xmax; x++)
    81             cucul_putchar(qq, x, y1, '-');
     82            _cucul_putchar32(qq, x, y1, (uint32_t)'-');
    8283
    8384    if(y2 <= ymax)
    8485        for(x = x1 < 0 ? 1 : x1 + 1; x < x2 && x < xmax; x++)
    85             cucul_putchar(qq, x, y2, '-');
     86            _cucul_putchar32(qq, x, y2, (uint32_t)'-');
    8687
    8788    if(x1 >= 0)
    8889        for(y = y1 < 0 ? 1 : y1 + 1; y < y2 && y < ymax; y++)
    89             cucul_putchar(qq, x1, y, '|');
     90            _cucul_putchar32(qq, x1, y, (uint32_t)'|');
    9091
    9192    if(x2 <= xmax)
    9293        for(y = y1 < 0 ? 1 : y1 + 1; y < y2 && y < ymax; y++)
    93             cucul_putchar(qq, x2, y, '|');
     94            _cucul_putchar32(qq, x2, y, (uint32_t)'|');
    9495
    9596    /* Draw corners */
    9697    if(x1 >= 0 && y1 >= 0)
    97         cucul_putchar(qq, x1, y1, ',');
     98        _cucul_putchar32(qq, x1, y1, (uint32_t)',');
    9899
    99100    if(x1 >= 0 && y2 <= ymax)
    100         cucul_putchar(qq, x1, y2, '`');
     101        _cucul_putchar32(qq, x1, y2, (uint32_t)'`');
    101102
    102103    if(x2 <= xmax && y1 >= 0)
    103         cucul_putchar(qq, x2, y1, '.');
     104        _cucul_putchar32(qq, x2, y1, (uint32_t)'.');
    104105
    105106    if(x2 <= xmax && y2 <= ymax)
    106         cucul_putchar(qq, x2, y2, '\'');
     107        _cucul_putchar32(qq, x2, y2, (uint32_t)'\'');
    107108}
    108109
     
    114115 * \param x2 X coordinate of the lower-right corner of the box.
    115116 * \param y2 Y coordinate of the lower-right corner of the box.
    116  * \param c Character to fill the box with.
     117 * \param str UTF-8 string containing the character to fill the box with.
    117118 * \return void
    118119 */
    119 void cucul_fill_box(cucul_t *qq, int x1, int y1, int x2, int y2, char c)
     120void cucul_fill_box(cucul_t *qq, int x1, int y1, int x2, int y2,
     121                    char const *str)
    120122{
    121123    int x, y, xmax, ymax;
     124    uint32_t c;
    122125
    123126    if(x1 > x2)
     
    144147    if(y2 > ymax) y2 = ymax;
    145148
     149    c = _cucul_utf8_to_utf32(str);
     150
    146151    for(y = y1; y <= y2; y++)
    147152        for(x = x1; x <= x2; x++)
    148             cucul_putchar(qq, x, y, c);
     153            _cucul_putchar32(qq, x, y, c);
    149154}
    150155
  • libcaca/trunk/cucul/canvas.c

    r672 r678  
    103103
    104104    if((unsigned char)c < 0x20 || (unsigned char)c > 0x7f)
    105         c = 0x20;
    106 
    107     qq->chars[x + y * qq->width] = c;
    108     qq->attr[x + y * qq->width] = (qq->bgcolor << 4) | qq->fgcolor;
    109 }
    110 
    111 /** \brief Print a Unicode character.
    112  *
    113  *  FIXME: do we really want this function?
    114  *
    115  *  This function prints a Unicode character (native-endian, 32 bits UCS-4,
    116  *  also known as UTF-32) at the given coordinates, using the default
    117  *  foreground and background values. If the coordinates are outside the
    118  *  screen boundaries, nothing is printed. If the character is an invalid
    119  *  Unicode character, it is replaced with a space.
    120  *
    121  *  \param x X coordinate.
    122  *  \param y Y coordinate.
    123  *  \param c The character to print.
    124  */
    125 void cucul_putchar32(cucul_t *qq, int x, int y, unsigned long int c)
    126 {
    127     if(x < 0 || x >= (int)qq->width ||
    128        y < 0 || y >= (int)qq->height)
    129         return;
    130 
    131     if(c < 0x20 || c > 0x7f)
    132105        c = 0x20;
    133106
     
    314287}
    315288
     289/*
     290 * XXX: The following functions are not exported
     291 */
     292
     293void _cucul_putchar32(cucul_t *qq, int x, int y, uint32_t c)
     294{
     295    if(x < 0 || x >= (int)qq->width ||
     296       y < 0 || y >= (int)qq->height)
     297        return;
     298
     299    qq->chars[x + y * qq->width] = c;
     300    qq->attr[x + y * qq->width] = (qq->bgcolor << 4) | qq->fgcolor;
     301}
     302
  • libcaca/trunk/cucul/conic.c

    r672 r678  
    2828#include "cucul_internals.h"
    2929
    30 static void ellipsepoints(cucul_t *, int, int, int, int, char);
     30static void ellipsepoints(cucul_t *, int, int, int, int, uint32_t);
    3131
    3232/**
     
    3939 * \return void
    4040 */
    41 void cucul_draw_circle(cucul_t *qq, int x, int y, int r, char c)
     41void cucul_draw_circle(cucul_t *qq, int x, int y, int r, char const *str)
    4242{
    4343    int test, dx, dy;
     44    uint32_t c = _cucul_utf8_to_utf32(str);
    4445
    4546    /* Optimized Bresenham. Kick ass. */
     
    6364 * \return void
    6465 */
    65 void cucul_fill_ellipse(cucul_t *qq, int xo, int yo, int a, int b, char c)
     66void cucul_fill_ellipse(cucul_t *qq, int xo, int yo, int a, int b,
     67                        char const *str)
    6668{
    6769    int d2;
     
    7981        {
    8082            d1 += b*b*(2*x*1) + a*a*(-2*y+2);
    81             cucul_draw_line(qq, xo - x, yo - y, xo + x, yo - y, c);
    82             cucul_draw_line(qq, xo - x, yo + y, xo + x, yo + y, c);
     83            cucul_draw_line(qq, xo - x, yo - y, xo + x, yo - y, str);
     84            cucul_draw_line(qq, xo - x, yo + y, xo + x, yo + y, str);
    8385            y--;
    8486        }
     
    8688    }
    8789
    88     cucul_draw_line(qq, xo - x, yo - y, xo + x, yo - y, c);
    89     cucul_draw_line(qq, xo - x, yo + y, xo + x, yo + y, c);
     90    cucul_draw_line(qq, xo - x, yo - y, xo + x, yo - y, str);
     91    cucul_draw_line(qq, xo - x, yo + y, xo + x, yo + y, str);
    9092
    9193    d2 = b*b*(x+0.5)*(x+0.5) + a*a*(y-1)*(y-1) - a*a*b*b;
     
    103105
    104106        y--;
    105         cucul_draw_line(qq, xo - x, yo - y, xo + x, yo - y, c);
    106         cucul_draw_line(qq, xo - x, yo + y, xo + x, yo + y, c);
     107        cucul_draw_line(qq, xo - x, yo - y, xo + x, yo - y, str);
     108        cucul_draw_line(qq, xo - x, yo + y, xo + x, yo + y, str);
    107109    }
    108110}
     
    118120 * \return void
    119121 */
    120 void cucul_draw_ellipse(cucul_t *qq, int xo, int yo, int a, int b, char c)
     122void cucul_draw_ellipse(cucul_t *qq, int xo, int yo, int a, int b,
     123                        char const *str)
    121124{
    122125    int d2;
     
    124127    int y = b;
    125128    int d1 = b*b - (a*a*b) + (a*a/4);
     129    uint32_t c = _cucul_utf8_to_utf32(str);
    126130
    127131    ellipsepoints(qq, xo, yo, x, y, c);
     
    212216}
    213217
    214 static void ellipsepoints(cucul_t *qq, int xo, int yo, int x, int y, char c)
     218static void ellipsepoints(cucul_t *qq, int xo, int yo, int x, int y, uint32_t c)
    215219{
    216220    uint8_t b = 0;
     
    226230
    227231    if((b & (0x1|0x4)) == (0x1|0x4))
    228         cucul_putchar(qq, xo + x, yo + y, c);
     232        _cucul_putchar32(qq, xo + x, yo + y, c);
    229233
    230234    if((b & (0x2|0x4)) == (0x2|0x4))
    231         cucul_putchar(qq, xo - x, yo + y, c);
     235        _cucul_putchar32(qq, xo - x, yo + y, c);
    232236
    233237    if((b & (0x1|0x8)) == (0x1|0x8))
    234         cucul_putchar(qq, xo + x, yo - y, c);
     238        _cucul_putchar32(qq, xo + x, yo - y, c);
    235239
    236240    if((b & (0x2|0x8)) == (0x2|0x8))
    237         cucul_putchar(qq, xo - x, yo - y, c);
    238 }
    239 
     241        _cucul_putchar32(qq, xo - x, yo - y, c);
     242}
     243
  • libcaca/trunk/cucul/cucul.h

    r677 r678  
    163163 *
    164164 *  @{ */
    165 void cucul_draw_line(cucul_t *, int, int, int, int, char);
    166 void cucul_draw_polyline(cucul_t *, int const x[], int const y[], int, char);
     165void cucul_draw_line(cucul_t *, int, int, int, int, char const *);
     166void cucul_draw_polyline(cucul_t *, int const x[], int const y[], int, char const *);
    167167void cucul_draw_thin_line(cucul_t *, int, int, int, int);
    168168void cucul_draw_thin_polyline(cucul_t *, int const x[], int const y[], int);
    169169
    170 void cucul_draw_circle(cucul_t *, int, int, int, char);
    171 void cucul_draw_ellipse(cucul_t *, int, int, int, int, char);
     170void cucul_draw_circle(cucul_t *, int, int, int, char const *);
     171void cucul_draw_ellipse(cucul_t *, int, int, int, int, char const *);
    172172void cucul_draw_thin_ellipse(cucul_t *, int, int, int, int);
    173 void cucul_fill_ellipse(cucul_t *, int, int, int, int, char);
    174 
    175 void cucul_draw_box(cucul_t *, int, int, int, int, char);
     173void cucul_fill_ellipse(cucul_t *, int, int, int, int, char const *);
     174
     175void cucul_draw_box(cucul_t *, int, int, int, int, char const *);
    176176void cucul_draw_thin_box(cucul_t *, int, int, int, int);
    177 void cucul_fill_box(cucul_t *, int, int, int, int, char);
    178 
    179 void cucul_draw_triangle(cucul_t *, int, int, int, int, int, int, char);
     177void cucul_fill_box(cucul_t *, int, int, int, int, char const *);
     178
     179void cucul_draw_triangle(cucul_t *, int, int, int, int, int, int, char const *);
    180180void cucul_draw_thin_triangle(cucul_t *, int, int, int, int, int, int);
    181 void cucul_fill_triangle(cucul_t *, int, int, int, int, int, int, char);
     181void cucul_fill_triangle(cucul_t *, int, int, int, int, int, int, char const *);
    182182/*  @} */
    183183
  • libcaca/trunk/cucul/cucul_internals.h

    r672 r678  
    5050};
    5151
    52 /* Initialisation functions */
     52/* Bitmap functions */
    5353extern int _cucul_init_bitmap(void);
    5454extern int _cucul_end_bitmap(void);
     55
     56/* Canvas functions */
    5557extern void _cucul_set_size(cucul_t *, unsigned int, unsigned int);
     58extern void _cucul_putchar32(cucul_t *qq, int x, int y, uint32_t c);
    5659
    5760/* Charset functions */
  • libcaca/trunk/cucul/line.c

    r672 r678  
    3333    int x1, y1;
    3434    int x2, y2;
    35     char c;
     35    uint32_t c;
    3636    void (*draw) (cucul_t *, struct line*);
    3737};
     
    5050 * \param x2 X coordinate of the second point.
    5151 * \param y2 Y coordinate of the second point.
    52  * \param c Character to draw the line with.
    53  * \return void
    54  */
    55 void cucul_draw_line(cucul_t *qq, int x1, int y1, int x2, int y2, char c)
     52 * \param str UTF-8 string containing the character to use to draw the line.
     53 * \return void
     54 */
     55void cucul_draw_line(cucul_t *qq, int x1, int y1, int x2, int y2,
     56                     char const *str)
    5657{
    5758    struct line s;
     
    6061    s.x2 = x2;
    6162    s.y2 = y2;
    62     s.c = c;
     63    s.c = _cucul_utf8_to_utf32(str);
    6364    s.draw = draw_solid_line;
    6465    clip_line(qq, &s);
     
    7475 * \param y Array of Y coordinates. Must have \p n + 1 elements.
    7576 * \param n Number of lines to draw.
    76  * \param c Character to draw the lines with.
    77  * \return void
    78  */
    79 void cucul_draw_polyline(cucul_t *qq, int const x[], int const y[], int n, char c)
     77 * \param str UTF-8 string containing the character to use to draw the lines.
     78 * \return void
     79 */
     80void cucul_draw_polyline(cucul_t *qq, int const x[], int const y[], int n,
     81                         char const *str)
    8082{
    8183    int i;
    8284    struct line s;
    83     s.c = c;
     85    s.c = _cucul_utf8_to_utf32(str);
    8486    s.draw = draw_solid_line;
    8587
     
    255257        for(; dx>=0; dx--)
    256258        {
    257             cucul_putchar(qq, x1, y1, s->c);
     259            _cucul_putchar32(qq, x1, y1, s->c);
    258260            if(delta > 0)
    259261            {
     
    277279        for(; dy >= 0; dy--)
    278280        {
    279             cucul_putchar(qq, x1, y1, s->c);
     281            _cucul_putchar32(qq, x1, y1, s->c);
    280282            if(delta > 0)
    281283            {
     
    302304static void draw_thin_line(cucul_t *qq, struct line* s)
    303305{
    304     char *charmapx, *charmapy;
     306    uint32_t charmapx[2], charmapy[2];
    305307    int x1, y1, x2, y2;
    306308    int dx, dy;
     
    309311    if(s->x2 >= s->x1)
    310312    {
    311         if(s->y1 > s->y2)
    312             charmapx = ",'";
    313         else
    314             charmapx = "`.";
     313        charmapx[0] = (s->y1 > s->y2) ? (uint32_t)',' : (uint32_t)'`';
     314        charmapx[1] = (s->y1 > s->y2) ? (uint32_t)'\'' : (uint32_t)'.';
    315315        x1 = s->x1; y1 = s->y1; x2 = s->x2; y2 = s->y2;
    316316    }
    317317    else
    318318    {
    319         if(s->y1 > s->y2)
    320             charmapx = "`.";
    321         else
    322             charmapx = ",'";
     319        charmapx[0] = (s->y1 > s->y2) ? (uint32_t)'`' : (uint32_t)'.';
     320        charmapx[1] = (s->y1 > s->y2) ? (uint32_t)',' : (uint32_t)'\'';
    323321        x2 = s->x1; y2 = s->y1; x1 = s->x2; y1 = s->y2;
    324322    }
     
    329327    if(y1 > y2)
    330328    {
    331         charmapy = ",'";
     329        charmapy[0] = (uint32_t)',';
     330        charmapy[1] = (uint32_t)'\'';
    332331        yinc = -1;
    333332    }
     
    335334    {
    336335        yinc = 1;
    337         charmapy = "`.";
     336        charmapy[0] = (uint32_t)'`';
     337        charmapy[1] = (uint32_t)'.';
    338338    }
    339339
     
    349349            if(delta > 0)
    350350            {
    351                 cucul_putchar(qq, x1, y1, charmapy[1]);
     351                _cucul_putchar32(qq, x1, y1, charmapy[1]);
    352352                x1++;
    353353                y1 += yinc;
     
    358358            {
    359359                if(prev)
    360                     cucul_putchar(qq, x1, y1, charmapy[0]);
     360                    _cucul_putchar32(qq, x1, y1, charmapy[0]);
    361361                else
    362                     cucul_putchar(qq, x1, y1, '-');
     362                    _cucul_putchar32(qq, x1, y1, (uint32_t)'-');
    363363                x1++;
    364364                delta += dpr;
     
    377377            if(delta > 0)
    378378            {
    379                 cucul_putchar(qq, x1, y1, charmapx[0]);
    380                 cucul_putchar(qq, x1 + 1, y1, charmapx[1]);
     379                _cucul_putchar32(qq, x1, y1, charmapx[0]);
     380                _cucul_putchar32(qq, x1 + 1, y1, charmapx[1]);
    381381                x1++;
    382382                y1 += yinc;
     
    385385            else
    386386            {
    387                 cucul_putchar(qq, x1, y1, '|');
     387                _cucul_putchar32(qq, x1, y1, (uint32_t)'|');
    388388                y1 += yinc;
    389389                delta += dpr;
  • libcaca/trunk/cucul/triangle.c

    r672 r678  
    3939 * \return void
    4040 */
    41 void cucul_draw_triangle(cucul_t *qq, int x1, int y1, int x2, int y2, int x3, int y3, char c)
     41void cucul_draw_triangle(cucul_t *qq, int x1, int y1, int x2, int y2,
     42                         int x3, int y3, char const *str)
    4243{
    43     cucul_draw_line(qq, x1, y1, x2, y2, c);
    44     cucul_draw_line(qq, x2, y2, x3, y3, c);
    45     cucul_draw_line(qq, x3, y3, x1, y1, c);
     44    cucul_draw_line(qq, x1, y1, x2, y2, str);
     45    cucul_draw_line(qq, x2, y2, x3, y3, str);
     46    cucul_draw_line(qq, x3, y3, x1, y1, str);
    4647}
    4748
     
    5758 * \return void
    5859 */
    59 void cucul_draw_thin_triangle(cucul_t *qq, int x1, int y1, int x2, int y2, int x3, int y3)
     60void cucul_draw_thin_triangle(cucul_t *qq, int x1, int y1, int x2, int y2,
     61                              int x3, int y3)
    6062{
    6163    cucul_draw_thin_line(qq, x1, y1, x2, y2);
     
    7678 * \return void
    7779 */
    78 void cucul_fill_triangle(cucul_t *qq, int x1, int y1, int x2, int y2, int x3, int y3, char c)
     80void cucul_fill_triangle(cucul_t *qq, int x1, int y1, int x2, int y2,
     81                         int x3, int y3, char const *str)
    7982{
    8083    int x, y, xa, xb, xmax, ymax;
     84    uint32_t c;
    8185
    8286    /* Bubble-sort y1 <= y2 <= y3 */
    8387    if(y1 > y2)
    8488    {
    85         cucul_fill_triangle(qq, x2, y2, x1, y1, x3, y3, c);
     89        cucul_fill_triangle(qq, x2, y2, x1, y1, x3, y3, str);
    8690        return;
    8791    }
     
    8993    if(y2 > y3)
    9094    {
    91         cucul_fill_triangle(qq, x1, y1, x3, y3, x2, y2, c);
     95        cucul_fill_triangle(qq, x1, y1, x3, y3, x2, y2, str);
    9296        return;
    9397    }
     
    100104    xmax = qq->width - 1;
    101105    ymax = qq->height - 1;
     106
     107    c = _cucul_utf8_to_utf32(str);
    102108
    103109    /* Rasterize our triangle */
     
    131137
    132138        for(x = xa; x <= xb; x++)
    133             cucul_putchar(qq, x, y, c);
     139            _cucul_putchar32(qq, x, y, c);
    134140    }
    135141}
  • libcaca/trunk/src/cacaview.c

    r677 r678  
    430430{
    431431    cucul_set_color(qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
    432     cucul_draw_line(qq, 0, 0, ww - 1, 0, ' ');
    433     cucul_draw_line(qq, 0, wh - 2, ww - 1, wh - 2, '-');
     432    cucul_draw_line(qq, 0, 0, ww - 1, 0, " ");
     433    cucul_draw_line(qq, 0, wh - 2, ww - 1, wh - 2, "-");
    434434    cucul_putstr(qq, 0, 0, "q:Quit  np:Next/Prev  +-x:Zoom  gG:Gamma  "
    435435                           "hjkl:Move  d:Dither  a:Antialias");
     
    440440
    441441    cucul_set_color(qq, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
    442     cucul_draw_line(qq, 0, wh - 1, ww - 1, wh - 1, ' ');
     442    cucul_draw_line(qq, 0, wh - 1, ww - 1, wh - 1, " ");
    443443}
    444444
  • libcaca/trunk/test/demo.c

    r677 r678  
    242242    j = 15 + sin(0.03*i) * 8;
    243243    cucul_set_color(qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLACK);
    244     cucul_fill_ellipse(qq, xo, yo, j, j / 2, '#');
     244    cucul_fill_ellipse(qq, xo, yo, j, j / 2, "#");
    245245    cucul_set_color(qq, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
    246     cucul_draw_ellipse(qq, xo, yo, j, j / 2, '#');
     246    cucul_draw_ellipse(qq, xo, yo, j, j / 2, "#");
    247247
    248248    /* Draw the pyramid */
     
    260260
    261261    cucul_set_color(qq, CUCUL_COLOR_GREEN, CUCUL_COLOR_BLACK);
    262     cucul_fill_triangle(qq, xo, yo, xb, yb, xa, ya, '%');
     262    cucul_fill_triangle(qq, xo, yo, xb, yb, xa, ya, "%");
    263263    cucul_set_color(qq, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
    264264    cucul_draw_thin_triangle(qq, xo, yo, xb, yb, xa, ya);
    265265
    266266    cucul_set_color(qq, CUCUL_COLOR_RED, CUCUL_COLOR_BLACK);
    267     cucul_fill_triangle(qq, xa, ya, xb, yb, xc, yc, '#');
     267    cucul_fill_triangle(qq, xa, ya, xb, yb, xc, yc, "#");
    268268    cucul_set_color(qq, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
    269269    cucul_draw_thin_triangle(qq, xa, ya, xb, yb, xc, yc);
    270270
    271271    cucul_set_color(qq, CUCUL_COLOR_BLUE, CUCUL_COLOR_BLACK);
    272     cucul_fill_triangle(qq, xo, yo, xb, yb, xc, yc, '%');
     272    cucul_fill_triangle(qq, xo, yo, xb, yb, xc, yc, "%");
    273273    cucul_set_color(qq, CUCUL_COLOR_YELLOW, CUCUL_COLOR_BLACK);
    274274    cucul_draw_thin_triangle(qq, xo, yo, xb, yb, xc, yc);
     
    374374        cucul_draw_thin_line(qq, xa, ya, xb, yb);
    375375    else
    376         cucul_draw_line(qq, xa, ya, xb, yb, '#');
     376        cucul_draw_line(qq, xa, ya, xb, yb, "#");
    377377}
    378378
     
    395395
    396396    cucul_set_color(qq, cucul_rand(0, 15), cucul_rand(0, 15));
    397     cucul_fill_box(qq, xa, ya, xb, yb, '#');
     397    cucul_fill_box(qq, xa, ya, xb, yb, "#");
    398398
    399399    cucul_set_color(qq, cucul_rand(0, 15), CUCUL_COLOR_BLACK);
     
    401401        cucul_draw_thin_box(qq, xa, ya, xb, yb);
    402402    else if(outline == 1)
    403         cucul_draw_box(qq, xa, ya, xb, yb, '#');
     403        cucul_draw_box(qq, xa, ya, xb, yb, "#");
    404404}
    405405
     
    426426
    427427    cucul_set_color(qq, cucul_rand(0, 15), cucul_rand(0, 15));
    428     cucul_fill_ellipse(qq, x, y, a, b, '#');
     428    cucul_fill_ellipse(qq, x, y, a, b, "#");
    429429
    430430    cucul_set_color(qq, cucul_rand(0, 15), CUCUL_COLOR_BLACK);
     
    432432        cucul_draw_thin_ellipse(qq, x, y, a, b);
    433433    else if(outline == 1)
    434         cucul_draw_ellipse(qq, x, y, a, b, '#');
     434        cucul_draw_ellipse(qq, x, y, a, b, "#");
    435435}
    436436
     
    456456
    457457    cucul_set_color(qq, cucul_rand(0, 15), cucul_rand(0, 15));
    458     cucul_fill_triangle(qq, xa, ya, xb, yb, xc, yc, '#');
     458    cucul_fill_triangle(qq, xa, ya, xb, yb, xc, yc, "#");
    459459
    460460    cucul_set_color(qq, cucul_rand(0, 15), CUCUL_COLOR_BLACK);
     
    462462        cucul_draw_thin_triangle(qq, xa, ya, xb, yb, xc, yc);
    463463    else if(outline == 1)
    464         cucul_draw_triangle(qq, xa, ya, xb, yb, xc, yc, '#');
     464        cucul_draw_triangle(qq, xa, ya, xb, yb, xc, yc, "#");
    465465}
    466466
  • libcaca/trunk/test/event.c

    r677 r678  
    4141
    4242    cucul_set_color(qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
    43     cucul_draw_line(qq, 0, 0, cucul_get_width(qq) - 1, 0, ' ');
     43    cucul_draw_line(qq, 0, 0, cucul_get_width(qq) - 1, 0, " ");
    4444
    45     cucul_draw_line(qq, 0, h, cucul_get_width(qq) - 1, h, ' ');
     45    cucul_draw_line(qq, 0, h, cucul_get_width(qq) - 1, h, " ");
    4646    cucul_putstr(qq, 0, h, "type \"quit\" to exit");
    4747
     
    8585        /* Print current event */
    8686        cucul_set_color(qq, CUCUL_COLOR_WHITE, CUCUL_COLOR_BLUE);
    87         cucul_draw_line(qq, 0, 0, cucul_get_width(qq) - 1, 0, ' ');
     87        cucul_draw_line(qq, 0, 0, cucul_get_width(qq) - 1, 0, " ");
    8888        print_event(0, 0, events[0]);
    8989
    90         cucul_draw_line(qq, 0, h, cucul_get_width(qq) - 1, h, ' ');
     90        cucul_draw_line(qq, 0, h, cucul_get_width(qq) - 1, h, " ");
    9191        cucul_printf(qq, 0, h, "type \"quit\" to exit: %s", quit_string[quit]);
    9292
  • libcaca/trunk/test/export.c

    r677 r678  
    9292
    9393    cucul_set_color(qq, CUCUL_COLOR_BLACK, CUCUL_COLOR_WHITE);
    94     cucul_fill_ellipse(qq, WIDTH / 2, HEIGHT / 2, WIDTH / 4, HEIGHT / 4, ' ');
     94    cucul_fill_ellipse(qq, WIDTH / 2, HEIGHT / 2, WIDTH / 4, HEIGHT / 4, " ");
    9595    cucul_putstr(qq, WIDTH / 2 - 5, HEIGHT / 2 - 2, "(\") \\o/ <&>");
    9696    cucul_putstr(qq, WIDTH / 2 - 7, HEIGHT / 2 + 2, "äβç ░▒▓█▓▒░ ΔЗҒ");
  • libcaca/trunk/test/spritedit.c

    r677 r678  
    101101        yb = ya + 1 + cucul_get_sprite_height(qq, sprite, frame);
    102102        cucul_set_color(qq, CUCUL_COLOR_BLACK, CUCUL_COLOR_BLACK);
    103         cucul_fill_box(qq, 57 + xa, 10 + ya, 57 + xb, 10 + yb, ' ');
     103        cucul_fill_box(qq, 57 + xa, 10 + ya, 57 + xb, 10 + yb, " ");
    104104        cucul_set_color(qq, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
    105105        cucul_draw_thin_box(qq, 57 + xa, 10 + ya, 57 + xb, 10 + yb);
Note: See TracChangeset for help on using the changeset viewer.