Ignore:
Timestamp:
Nov 19, 2003, 6:32:10 PM (19 years ago)
Author:
Sam Hocevar
Message:
  • src/io.c: + Renamed sdl_get_key() into sdl_get_event(). + Handle mouse clicks.
  • src/caca.c: + Activate the terminal's mouse handling if supported.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/blit.c

    r198 r199  
    102102    }
    103103
    104     //pitch = (3 * w + 3) / 4 * 4;
    105     pitch = 4 * w;
     104    pitch = (3 * w + 3) / 4 * 4;
     105    //pitch = 4 * w;
    106106
    107107    for(y = y1 > 0 ? y1 : 0; y <= y2 && y <= (int)caca_get_height(); y++)
     
    115115            int fromx = w * (x - x1) / (x2 - x1 + 1);
    116116            int fromy = h * (y - y1) / (y2 - y1 + 1);
    117             //int r = ((unsigned char *)pixels)[3 * fromx + pitch * fromy];
    118             //int g = ((unsigned char *)pixels)[3 * fromx + 1 + pitch * fromy];
    119             //int b = ((unsigned char *)pixels)[3 * fromx + 2 + pitch * fromy];
    120             int b = ((unsigned char *)pixels)[4 * fromx + pitch * fromy];
    121             int g = ((unsigned char *)pixels)[4 * fromx + 1 + pitch * fromy];
    122             int r = ((unsigned char *)pixels)[4 * fromx + 2 + pitch * fromy];
     117            int r = ((unsigned char *)pixels)[3 * fromx + pitch * fromy];
     118            int g = ((unsigned char *)pixels)[3 * fromx + 1 + pitch * fromy];
     119            int b = ((unsigned char *)pixels)[3 * fromx + 2 + pitch * fromy];
     120            //int b = ((unsigned char *)pixels)[4 * fromx + pitch * fromy];
     121            //int g = ((unsigned char *)pixels)[4 * fromx + 1 + pitch * fromy];
     122            //int r = ((unsigned char *)pixels)[4 * fromx + 2 + pitch * fromy];
    123123            int hue, sat, val;
    124124
     
    143143                    hue = 1280 + 256 * (r - g) / delta;
    144144
    145                 hue = (hue + 128 + 8 * _get_dither()) / 256;
     145                hue = (hue + 128 + 16 * _get_dither()) / 256;
    146146
    147147                if(val > (_get_dither() + 40) * 4)
Note: See TracChangeset for help on using the changeset viewer.