diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2009-04-19 14:50:21 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2009-04-19 14:50:21 +0000 |
commit | 1331989e7dcecfeb68097f13e9b62ad6bc49fbf8 (patch) | |
tree | 1ffd35ee28cdda1d5271478b9f01d5686fde7b71 | |
parent | b96a10b156b3ca30041ab4ad7e98df666d1263cc (diff) | |
download | libnsbmp-1331989e7dcecfeb68097f13e9b62ad6bc49fbf8.tar.gz libnsbmp-1331989e7dcecfeb68097f13e9b62ad6bc49fbf8.tar.bz2 |
Fix palette endianness of 16bpp and higher BMPs.
All BMP test suite images now display correctly on PowerPC (AmigaOS 4)
except g04rle.bmp which is crashing in bmp_decode_rle()
svn path=/trunk/libnsbmp/; revision=7135
-rw-r--r-- | src/libnsbmp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libnsbmp.c b/src/libnsbmp.c index 178422d..fead34e 100644 --- a/src/libnsbmp.c +++ b/src/libnsbmp.c @@ -731,6 +731,7 @@ static bmp_result bmp_decode_rgb24(bmp_image *bmp, uint8_t **start, int bytes) { if (bmp->opaque) scanline[x] |= (0xff << 24); data += skip; + scanline[x] = read_uint32((uint8_t *)&scanline[x],0); } } else { for (x = 0; x < bmp->width; x++) { @@ -740,6 +741,7 @@ static bmp_result bmp_decode_rgb24(bmp_image *bmp, uint8_t **start, int bytes) { if (bmp->opaque) scanline[x] |= (0xff << 24); data += skip; + scanline[x] = read_uint32((uint8_t *)&scanline[x],0); } } } @@ -808,6 +810,7 @@ static bmp_result bmp_decode_rgb16(bmp_image *bmp, uint8_t **start, int bytes) { scanline[x] |= (0xff << 24); } data += 2; + scanline[x] = read_uint32((uint8_t *)&scanline[x],0); } } else { for (x = 0; x < bmp->width; x++) { @@ -823,6 +826,7 @@ static bmp_result bmp_decode_rgb16(bmp_image *bmp, uint8_t **start, int bytes) { if (bmp->opaque) scanline[x] |= (0xff << 24); data += 2; + scanline[x] = read_uint32((uint8_t *)&scanline[x],0); } } } |