comparison tools/gfxconv.c @ 1897:699ee626912b

Fix IFF number of planes checking.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 26 Jun 2018 04:29:26 +0300
parents f80b2dc77c30
children a323ca23f449
comparison
equal deleted inserted replaced
1896:f80b2dc77c30 1897:699ee626912b
1359 break; 1359 break;
1360 1360
1361 case DM_IMGFMT_IFF: 1361 case DM_IMGFMT_IFF:
1362 spec->compression = 1; 1362 spec->compression = 1;
1363 spec->nplanes = 0; 1363 spec->nplanes = 0;
1364 for (int n = 0; n < 8; n++) 1364 for (int n = 8; n >= 0;)
1365 { 1365 {
1366 if (image->ncolors & (1 << n)) 1366 if (image->ncolors & (1 << n))
1367 {
1367 spec->nplanes = n; 1368 spec->nplanes = n;
1369 break;
1370 }
1371 else
1372 n--;
1368 } 1373 }
1369 break; 1374 break;
1370 1375
1371 default: 1376 default:
1372 spec->format = spec->paletted ? DM_COLFMT_PALETTE : DM_COLFMT_RGB; 1377 spec->format = spec->paletted ? DM_COLFMT_PALETTE : DM_COLFMT_RGB;