Mercurial > hg > dmlib
comparison tools/libgfx.c @ 2016:7114ea4c3c42
Cleanup.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 31 Aug 2018 17:31:54 +0300 |
parents | 5790b52c339e |
children | e809e323fdde |
comparison
equal
deleted
inserted
replaced
2015:c5a88bb4ee3f | 2016:7114ea4c3c42 |
---|---|
948 | 948 |
949 // Create PCX header | 949 // Create PCX header |
950 dmMemset(&hdr, 0, sizeof(hdr)); | 950 dmMemset(&hdr, 0, sizeof(hdr)); |
951 if (spec.paletted) | 951 if (spec.paletted) |
952 { | 952 { |
953 for (int i = 0; i < (img->ncolors > DMPCX_PAL_COLORS ? DMPCX_PAL_COLORS : img->ncolors); i++) | 953 const int ncolors = img->ncolors > DMPCX_PAL_COLORS ? DMPCX_PAL_COLORS : img->ncolors; |
954 for (int i = 0; i < ncolors; i++) | |
954 { | 955 { |
955 hdr.colorMap[i].r = img->pal[i].r; | 956 hdr.colorMap[i].r = img->pal[i].r; |
956 hdr.colorMap[i].g = img->pal[i].g; | 957 hdr.colorMap[i].g = img->pal[i].g; |
957 hdr.colorMap[i].b = img->pal[i].b; | 958 hdr.colorMap[i].b = img->pal[i].b; |
958 } | 959 } |