Mercurial > hg > dmlib
changeset 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 | 50dbfc10f49f |
files | tools/gfxconv.c |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/gfxconv.c Tue Jun 26 03:13:38 2018 +0300 +++ b/tools/gfxconv.c Tue Jun 26 04:29:26 2018 +0300 @@ -1361,10 +1361,15 @@ case DM_IMGFMT_IFF: spec->compression = 1; spec->nplanes = 0; - for (int n = 0; n < 8; n++) + for (int n = 8; n >= 0;) { if (image->ncolors & (1 << n)) + { spec->nplanes = n; + break; + } + else + n--; } break;