Changeset 3303


Ignore:
Timestamp:
11/07/08 05:31:04 (5 years ago)
Author:
bsittler
Message:

fix yet another bug i wrote :( -- be endian-neutral.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca-php/php_caca.c

    r3300 r3303  
    383383                        for (i = 0; i < img->sy; i++) { 
    384384                                for (j = 0; j < img->sx; j++) { 
    385                                         uint8_t *dst = ((uint8_t *) result) + i * pitch + j * sizeof(int); 
    386  
    387                                         dst[3] = 255 - (uint8_t) ((((uint32_t) img->tpixels[i][j]) & 0x7f000000) >> 23); 
    388                                         dst[2] = (((uint32_t) img->tpixels[i][j]) & 0x00ff0000) >> 16; 
    389                                         dst[1] = (((uint32_t) img->tpixels[i][j]) & 0x0000ff00) >> 8; 
    390                                         dst[0] = ((uint32_t) img->tpixels[i][j]) & 0x000000ff; 
     385                                        int *dst = (int *) (((char *) result) + i * pitch + j * sizeof(int)); 
     386 
     387                                        *dst = (((255 - (uint8_t) ((((uint32_t) img->tpixels[i][j]) & 0x7f000000) >> 23)) << 24) 
     388                                                | 
     389                                                (img->tpixels[i][j] & 0x00ffffff)); 
    391390                                } 
    392391                        } 
Note: See TracChangeset for help on using the changeset viewer.