ALL: format code

This commit is contained in:
Pawel Kolodziejski 2011-05-16 09:51:06 +02:00
parent 259eb97cb0
commit 20e222cdf5
4 changed files with 31 additions and 35 deletions

View file

@ -357,16 +357,13 @@ void BitmapData::convertToColorFormat(int num, int format){
//red = red << 3 | red >> 2; //red = red << 3 | red >> 2;
green = (pixel >> 5) & 0x1f; green = (pixel >> 5) & 0x1f;
green = green << 1 | green >> 1; green = green << 1 | green >> 1;
red = (pixel) & 0x1f; red = (pixel) & 0x1f;
to[0] = (red << 3) | green >> 3; to[0] = (red << 3) | green >> 3;
to[1] = (green << 5) | blue; to[1] = (green << 5) | blue;
} }
} }
_colorFormat = BM_RGB565; _colorFormat = BM_RGB565;
} }
} else if (_colorFormat == BM_RGBA) { } else if (_colorFormat == BM_RGBA) {
if (format == BM_RGB565) { // RGBA->565 if (format == BM_RGB565) { // RGBA->565
char* tempStore = _data[num]; char* tempStore = _data[num];
@ -376,7 +373,6 @@ void BitmapData::convertToColorFormat(int num, int format){
red = (tempStore[j] >> 3) & 0x1f; red = (tempStore[j] >> 3) & 0x1f;
green = (tempStore[j + 1] >> 2) & 0x3f; green = (tempStore[j + 1] >> 2) & 0x3f;
blue = (tempStore[j + 2] >> 3) &0x1f; blue = (tempStore[j + 2] >> 3) &0x1f;
*to = (red << 11) | (green << 5) | blue; *to = (red << 11) | (green << 5) | blue;
} }
delete[] tempStore; delete[] tempStore;