Changeset 200


Ignore:
Timestamp:
Nov 19, 2003, 6:49:43 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • src/io.c: + Fixed a bug in the mouse coordinates reporting.
Location:
libcaca/trunk/src
Files:
3 edited

Legend:

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

    r199 r200  
    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
  • libcaca/trunk/src/caca.c

    r199 r200  
    9898    SLang_init_tty(-1, 0, 1);
    9999
    100     SLkp_define_keysym("\e[M", 1001);
    101 
    102100    if(SLsmg_init_smg() == -1)
    103101    {
     
    110108    SLsmg_cls();
    111109    SLtt_set_cursor_visibility(0);
    112     SLtt_set_mouse_mode (1, 0);
     110    SLkp_define_keysym("\e[M", 1001);
     111    SLtt_set_mouse_mode(1, 0);
    113112    SLsmg_refresh();
    114113
  • libcaca/trunk/src/io.c

    r199 r200  
    103103            key[5] = _read_key();
    104104
    105             event |= (int)(key[3] - ' ') << 8;
    106             event |= (int)(key[4] - ' ') << 4;
     105            event |= (int)(key[3] - ' ') << 16;
     106            event |= (int)(key[4] - ' ') << 8;
    107107            event |= (int)(key[5] - ' ') << 0;
    108108
Note: See TracChangeset for help on using the changeset viewer.