Changeset 814


Ignore:
Timestamp:
Apr 18, 2006, 6:04:01 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Renamed cucul_clear() to cucul_clear_canvas() and added an argument to choose the background colour.
Location:
libcaca/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/cpp/cucul++.cpp

    r813 r814  
    9090}
    9191
    92 void    Cucul::clear ()
    93 {
    94     cucul_clear(cv);
     92void    Cucul::clear ( unsigned char bg )
     93{
     94    cucul_clear_canvas(cv, bg);
    9595}
    9696
  • libcaca/trunk/cpp/cucul++.h

    r811 r814  
    6868    void putchar (int x, int y, char ch);
    6969    void putstr (int x, int y, char *str);
    70     void        clear ();
     70    void        clear (unsigned char bg);
    7171    void        blit ( int, int, Cucul* c1, Cucul* c2);
    7272    void        invert ();
  • libcaca/trunk/cucul/canvas.c

    r811 r814  
    155155/** \brief Clear the canvas.
    156156 *
    157  *  This function clears the canvas using a black background.
    158  */
    159 void cucul_clear(cucul_canvas_t *cv)
     157 *  This function clears the canvas using the given background colour.
     158 *
     159 *  \param cv The canvas to clear.
     160 *  \param bg The background colour to use.
     161 */
     162void cucul_clear_canvas(cucul_canvas_t *cv, unsigned char bg)
    160163{
    161164    uint16_t oldfg = cv->fgcolor;
     
    163166    int y = cv->height;
    164167
    165     cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
     168    cucul_set_color(cv, CUCUL_COLOR_DEFAULT, bg);
    166169
    167170    /* We could use SLsmg_cls() etc., but drawing empty lines is much faster */
  • libcaca/trunk/cucul/cucul.h

    r813 r814  
    105105void cucul_putstr(cucul_canvas_t *, int, int, char const *);
    106106void cucul_printf(cucul_canvas_t *, int, int, char const *, ...);
    107 void cucul_clear(cucul_canvas_t *);
     107void cucul_clear_canvas(cucul_canvas_t *, unsigned char);
    108108void cucul_blit(cucul_canvas_t *, int, int, cucul_canvas_t const *, cucul_canvas_t const *);
    109109/*  @} */
  • libcaca/trunk/src/cacaview.c

    r813 r814  
    322322        }
    323323
    324         cucul_clear(cv);
     324        cucul_clear_canvas(cv, CUCUL_COLOR_BLACK);
    325325
    326326        if(!items)
  • libcaca/trunk/src/img2irc.c

    r813 r814  
    5454
    5555    cucul_set_canvas_size(cv, cols, lines);
    56     cucul_clear(cv);
     56    cucul_clear_canvas(cv, CUCUL_COLOR_TRANSPARENT);
    5757    cucul_dither_bitmap(cv, 0, 0, cols - 1, lines - 1, i->dither, i->pixels);
    5858
  • libcaca/trunk/test/colors.c

    r813 r814  
    3636        return 1;
    3737
    38     cucul_clear(cv);
     38    cucul_clear_canvas(cv, CUCUL_COLOR_BLACK);
    3939    for(i = 0; i < 16; i++)
    4040    {
  • libcaca/trunk/test/demo.c

    r813 r814  
    143143
    144144                if(demo)
    145                     cucul_clear(cv);
     145                    cucul_clear_canvas(cv, CUCUL_COLOR_BLACK);
    146146            }
    147147            else if(ev.type & CACA_EVENT_MOUSE_MOTION)
     
    197197    int yo = cucul_get_canvas_height(cv) - 2;
    198198
    199     cucul_clear(cv);
     199    cucul_clear_canvas(cv, CUCUL_COLOR_BLACK);
    200200    cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
    201201    cucul_draw_thin_box(cv, 1, 1, xo, yo);
     
    237237    i++;
    238238
    239     cucul_clear(cv);
     239    cucul_clear_canvas(cv, CUCUL_COLOR_BLACK);
    240240
    241241    /* Draw the sun */
     
    350350    char buf[BUFSIZ];
    351351
    352     cucul_clear(cv);
     352    cucul_clear_canvas(cv, CUCUL_COLOR_BLACK);
    353353    for(i = 0; i < 16; i++)
    354354    {
  • libcaca/trunk/test/event.c

    r813 r814  
    8282        while(ret);
    8383
    84         cucul_clear(cv);
     84        cucul_clear_canvas(cv, CUCUL_COLOR_BLACK);
    8585
    8686        /* Print current event */
  • libcaca/trunk/test/gamma.c

    r813 r814  
    9191
    9292        /* Draw something on the mask */
    93         cucul_clear(mask);
     93        cucul_clear_canvas(mask, CUCUL_COLOR_BLACK);
    9494        cucul_set_color(mask, CUCUL_COLOR_WHITE, CUCUL_COLOR_WHITE);
    9595        cucul_fill_ellipse(mask, (1.0 + sin(0.05 * (float)x))
  • libcaca/trunk/test/spritedit.c

    r813 r814  
    101101
    102102
    103         cucul_clear(cv);
     103        cucul_clear_canvas(cv, CUCUL_COLOR_BLACK);
    104104
    105105        cucul_set_color(cv, CUCUL_COLOR_LIGHTGRAY, CUCUL_COLOR_BLACK);
Note: See TracChangeset for help on using the changeset viewer.