Ignore:
Timestamp:
Oct 29, 2006, 1:53:46 AM (14 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/caca/driver_gl.c

    r1233 r1254  
    215215    for(y = 0; y < dp->drv.p->height; y += dp->drv.p->font_height)
    216216    {
    217         uint32_t *attr = dp->cv->attr + line * dp->cv->width;
     217        uint32_t *attrs = dp->cv->attrs + line * dp->cv->width;
    218218
    219219        /* FIXME: optimise using stride */
    220220        for(x = 0; x < dp->drv.p->width; x += dp->drv.p->font_width)
    221221        {
    222             uint16_t bg = _cucul_argb32_to_rgb12bg(*attr++);
     222            uint16_t bg = _cucul_attr_to_rgb12bg(*attrs++);
    223223
    224224            glColor4b(((bg & 0xf00) >> 8) * 8,
     
    245245    for(y = 0; y < dp->drv.p->height; y += dp->drv.p->font_height, line++)
    246246    {
    247         uint32_t *attr = dp->cv->attr + line * dp->cv->width;
     247        uint32_t *attrs = dp->cv->attrs + line * dp->cv->width;
    248248        uint32_t *chars = dp->cv->chars + line * dp->cv->width;
    249249
    250         for(x = 0; x < dp->drv.p->width; x += dp->drv.p->font_width, attr++)
     250        for(x = 0; x < dp->drv.p->width; x += dp->drv.p->font_width, attrs++)
    251251        {
    252252            uint32_t ch = *chars++;
     
    272272                                        - (uint32_t)dp->drv.p->blocks[i]]);
    273273
    274                 fg = _cucul_argb32_to_rgb12fg(*attr);
     274                fg = _cucul_attr_to_rgb12fg(*attrs);
    275275                glColor3b(((fg & 0xf00) >> 8) * 8,
    276276                          ((fg & 0x0f0) >> 4) * 8,
     
    292292            if(fullwidth)
    293293            {
    294                 chars++; attr++; x += dp->drv.p->font_width;
     294                chars++; attrs++; x += dp->drv.p->font_width;
    295295            }
    296296        }
Note: See TracChangeset for help on using the changeset viewer.