Changeset 3469 for libcaca


Ignore:
Timestamp:
May 18, 2009, 3:02:43 PM (11 years ago)
Author:
Pascal Terjan
Message:

Only redraw empty rectangles in slang driver

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver/slang.c

    r2962 r3469  
    223223    uint32_t const *cvchars = (uint32_t const *)caca_get_canvas_chars(dp->cv);
    224224    uint32_t const *cvattrs = (uint32_t const *)caca_get_canvas_attrs(dp->cv);
    225     int width = caca_get_canvas_width(dp->cv);
    226     int height = caca_get_canvas_height(dp->cv);
    227225    int x, y;
    228 
    229     for(y = 0; y < (int)height; y++)
     226    int xmin, ymin, xmax, ymax;
     227
     228    caca_get_dirty_rectangle(dp->cv, &xmin, &ymin, &xmax, &ymax);
     229    if(xmin > xmax || ymin > ymax)
     230        return;
     231
     232    for(y = ymin; y <= ymax; y++)
    230233    {
    231234        SLsmg_gotorc(y, 0);
    232         for(x = width; x--; )
     235        for(x = xmax; x >= xmin; x--)
    233236        {
    234237            uint32_t ch = *cvchars++;
Note: See TracChangeset for help on using the changeset viewer.