Ignore:
Timestamp:
Oct 29, 2006, 1:53:46 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • Use the LSB of alpha and blue components to encode additional flags such as bold or underline. No higher level support for these yet, but at least everything is consistent.
  • Created cucul_set_attr_ansi() and cucul_set_attr_argb() which are bound to replace cucul_set_color() and cucul_set_truecolor().
File:
1 edited

Legend:

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

    r1231 r1254  
    8787
    8888    curchar = cv->chars + x + y * cv->width;
    89     curattr = cv->attr + x + y * cv->width;
    90     attr = (cv->bgcolor << 16) | cv->fgcolor;
     89    curattr = cv->attrs + x + y * cv->width;
     90    attr = cv->curattr;
    9191
    9292    /* When overwriting the right part of a fullwidth character,
     
    254254int cucul_clear_canvas(cucul_canvas_t *cv)
    255255{
    256     uint32_t color = (cv->bgcolor << 16) | cv->fgcolor;
     256    uint32_t attr = cv->curattr;
    257257    unsigned int n;
    258258
     
    260260    {
    261261        cv->chars[n] = (uint32_t)' ';
    262         cv->attr[n] = color;
     262        cv->attrs[n] = attr;
    263263    }
    264264
     
    326326
    327327                dst->chars[dstix + i] = src->chars[srcix + i];
    328                 dst->attr[dstix + i] = src->attr[srcix + i];
     328                dst->attrs[dstix + i] = src->attrs[srcix + i];
    329329            }
    330330        }
    331331        else
    332332        {
    333             memcpy(dst->chars + dstix, src->chars + srcix, (stride) * 4);
    334             memcpy(dst->attr + dstix, src->attr + srcix, (stride) * 4);
     333            memcpy(dst->chars + dstix, src->chars + srcix, stride * 4);
     334            memcpy(dst->attrs + dstix, src->attrs + srcix, stride * 4);
    335335        }
    336336
     
    393393
    394394        free(cv->allchars[f]);
    395         free(cv->allattr[f]);
     395        free(cv->allattrs[f]);
    396396    }
    397397    free(cv->allchars);
    398     free(cv->allattr);
     398    free(cv->allattrs);
    399399
    400400    memcpy(cv, new, sizeof(cucul_canvas_t));
Note: See TracChangeset for help on using the changeset viewer.