diff options
-rw-r--r-- | converter/other/infotopam.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/converter/other/infotopam.c b/converter/other/infotopam.c index 59fcbc75..bf5391b5 100644 --- a/converter/other/infotopam.c +++ b/converter/other/infotopam.c @@ -300,17 +300,16 @@ addBitplane(unsigned char * const icon, Add bitplane to existing icon image -----------------------------------------------------------------------------*/ unsigned int i; - unsigned int j; - - for (i = j = 0; i < bpsize; ++i, j += 8) { - icon[j+0] = (icon[j+0] << 1) | ((buff[i] >> 7) & 0x01); - icon[j+1] = (icon[j+1] << 1) | ((buff[i] >> 6) & 0x01); - icon[j+2] = (icon[j+2] << 1) | ((buff[i] >> 5) & 0x01); - icon[j+3] = (icon[j+3] << 1) | ((buff[i] >> 4) & 0x01); - icon[j+4] = (icon[j+4] << 1) | ((buff[i] >> 3) & 0x01); - icon[j+5] = (icon[j+5] << 1) | ((buff[i] >> 2) & 0x01); - icon[j+6] = (icon[j+6] << 1) | ((buff[i] >> 1) & 0x01); - icon[j+7] = (icon[j+7] << 1) | ((buff[i] >> 0) & 0x01); + + for (i = 0; i < bpsize; ++i) { + icon[(i*8)+0] = (icon[(i*8)+0] << 1) | ((buff[i] >> 7) & 0x01); + icon[(i*8)+1] = (icon[(i*8)+1] << 1) | ((buff[i] >> 6) & 0x01); + icon[(i*8)+2] = (icon[(i*8)+2] << 1) | ((buff[i] >> 5) & 0x01); + icon[(i*8)+3] = (icon[(i*8)+3] << 1) | ((buff[i] >> 4) & 0x01); + icon[(i*8)+4] = (icon[(i*8)+4] << 1) | ((buff[i] >> 3) & 0x01); + icon[(i*8)+5] = (icon[(i*8)+5] << 1) | ((buff[i] >> 2) & 0x01); + icon[(i*8)+6] = (icon[(i*8)+6] << 1) | ((buff[i] >> 1) & 0x01); + icon[(i*8)+7] = (icon[(i*8)+7] << 1) | ((buff[i] >> 0) & 0x01); } } |