Ignore:
Timestamp:
Apr 6, 2006, 3:41:56 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • Store colour information on 32 bits, for future 12-bit colour support.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver_slang.c

    r689 r724  
    203203{
    204204    int x, y;
    205     uint8_t *attr = kk->qq->attr;
     205    uint32_t *attr = kk->qq->attr;
    206206    uint32_t *chars = kk->qq->chars;
    207207    for(y = 0; y < (int)kk->qq->height; y++)
     
    213213
    214214#if defined(OPTIMISE_SLANG_PALETTE)
    215             uint8_t fgcolor = *attr & 0xf;
    216             uint8_t bgcolor = *attr >> 4;
     215            uint8_t fgcolor = _cucul_rgba32_to_ansi4fg(*attr);
     216            uint8_t bgcolor = _cucul_rgba32_to_ansi4bg(*attr);
    217217
    218218            /* If foreground == background, just don't use this colour
     
    220220            if(fgcolor != bgcolor)
    221221            {
    222                 SLsmg_set_color(slang_assoc[*attr++]);
     222                SLsmg_set_color(slang_assoc[_cucul_rgba32_to_ansi8(*attr++)]);
    223223                slang_write_utf32(c);
    224224            }
     
    237237            }
    238238#else
    239             SLsmg_set_color(*attr++);
     239            SLsmg_set_color(_cucul_rgba32_to_ansi8(*attr++));
    240240            slang_write_utf32(c);
    241241#endif
Note: See TracChangeset for help on using the changeset viewer.