Ignore:
Timestamp:
Apr 6, 2006, 3:41:56 PM (15 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_gl.c

    r700 r724  
    246246    for(y = 0; y < kk->drv.p->height; y += kk->drv.p->font_height)
    247247    {
    248         uint8_t *attr = kk->qq->attr + line * kk->qq->width;
     248        uint32_t *attr = kk->qq->attr + line * kk->qq->width;
    249249
    250250        for(x = 0; x < kk->drv.p->width; x += kk->drv.p->font_width)
    251251        {
    252252            glDisable(GL_TEXTURE_2D);
    253             glColor4bv(gl_bgpal[attr[0] >> 4]);
     253            glColor4bv(gl_bgpal[_cucul_rgba32_to_ansi4bg(*attr++)]);
    254254            glBegin(GL_QUADS);
    255255                glVertex2f(x, y);
     
    259259                glVertex2f(x, y + kk->drv.p->font_height);
    260260            glEnd();
    261 
    262             attr++;
    263261        }
    264262
     
    274272    for(y = 0; y < kk->drv.p->height; y += kk->drv.p->font_height)
    275273    {
    276         uint8_t *attr = kk->qq->attr + line * kk->qq->width;
     274        uint32_t *attr = kk->qq->attr + line * kk->qq->width;
    277275        uint32_t *chars = kk->qq->chars + line * kk->qq->width;
    278276
     
    284282            {
    285283                glBindTexture(GL_TEXTURE_2D, kk->drv.p->id[c - 32]);
    286                 glColor4bv(gl_bgpal[attr[0] & 0xf]);
     284                glColor4bv(gl_bgpal[_cucul_rgba32_to_ansi4fg(*attr)]);
    287285                glBegin(GL_QUADS);
    288286                    glTexCoord2f(0, kk->drv.p->sh);
Note: See TracChangeset for help on using the changeset viewer.