comparison gui/util/bitmap.c @ 33119:8835e684a41d

Move common pixel shifting statement Since both branches of the condition perform it, do it right before. Besides, use more compact notation.
author ib
date Mon, 04 Apr 2011 14:06:08 +0000
parents ae464a957cd0
children e1403616342f
comparison
equal deleted inserted replaced
33118:ae464a957cd0 33119:8835e684a41d
235 return 0; 235 return 0;
236 } else { 236 } else {
237 buf = (uint32_t *)in->Image; 237 buf = (uint32_t *)in->Image;
238 238
239 for (i = 0; i < out->Width * out->Height; i++) { 239 for (i = 0; i < out->Width * out->Height; i++) {
240 tmp >>= 1;
241
240 if (buf[i] != transparent) 242 if (buf[i] != transparent)
241 tmp = (tmp >> 1) | 0x80; 243 tmp |= 0x80;
242 else { 244 else {
243 tmp = tmp >> 1;
244 buf[i] = 0; 245 buf[i] = 0;
245 shaped = 1; 246 shaped = 1;
246 } 247 }
247 248
248 if (b++ == 7) { 249 if (b++ == 7) {