Mercurial > hg > dmlib
comparison tools/lib64gfx.c @ 1411:a9afb2ad39cb
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 05 Nov 2017 03:51:48 +0200 |
parents | 7acadc08bc72 |
children | c386d287fa1e |
comparison
equal
deleted
inserted
replaced
1410:c29f1cea4a1c | 1411:a9afb2ad39cb |
---|---|
1373 | 1373 |
1374 // Convert a generic "C64" format bitmap in DMC64Image struct to | 1374 // Convert a generic "C64" format bitmap in DMC64Image struct to |
1375 // a indexed/paletted bitmap image. | 1375 // a indexed/paletted bitmap image. |
1376 int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageFormat *fmt) | 1376 int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageFormat *fmt) |
1377 { | 1377 { |
1378 Uint8 *dp = dst->data; | |
1379 int yc; | |
1380 DMC64GetPixelFunc getPixel; | 1378 DMC64GetPixelFunc getPixel; |
1381 | 1379 |
1382 // Sanity check arguments | 1380 // Sanity check arguments |
1383 if (dst == NULL || src == NULL) | 1381 if (dst == NULL || src == NULL) |
1384 return DMERR_NULLPTR; | 1382 return DMERR_NULLPTR; |
1398 int rwidth = src->width; | 1396 int rwidth = src->width; |
1399 if ((src->type & D64_FMT_ILACE) && src->laceType == D64_ILACE_RES) | 1397 if ((src->type & D64_FMT_ILACE) && src->laceType == D64_ILACE_RES) |
1400 rwidth /= 2; | 1398 rwidth /= 2; |
1401 | 1399 |
1402 // Perform conversion | 1400 // Perform conversion |
1403 for (yc = 0; yc < src->height; yc++) | 1401 Uint8 *dp = dst->data; |
1402 for (int yc = 0; yc < src->height; yc++) | |
1404 { | 1403 { |
1405 Uint8 *d = dp; | 1404 Uint8 *d = dp; |
1406 const int y = yc / 8, yb = yc & 7; | 1405 const int y = yc / 8, yb = yc & 7; |
1407 const int scroffsy = y * src->ch_width; | 1406 const int scroffsy = y * src->ch_width; |
1408 int xc; | 1407 int xc; |