ALL: format code
This commit is contained in:
parent
259eb97cb0
commit
20e222cdf5
4 changed files with 31 additions and 35 deletions
|
@ -357,16 +357,13 @@ void BitmapData::convertToColorFormat(int num, int format){
|
|||
//red = red << 3 | red >> 2;
|
||||
green = (pixel >> 5) & 0x1f;
|
||||
green = green << 1 | green >> 1;
|
||||
|
||||
red = (pixel) & 0x1f;
|
||||
|
||||
to[0] = (red << 3) | green >> 3;
|
||||
to[1] = (green << 5) | blue;
|
||||
}
|
||||
}
|
||||
_colorFormat = BM_RGB565;
|
||||
}
|
||||
|
||||
} else if (_colorFormat == BM_RGBA) {
|
||||
if (format == BM_RGB565) { // RGBA->565
|
||||
char* tempStore = _data[num];
|
||||
|
@ -376,7 +373,6 @@ void BitmapData::convertToColorFormat(int num, int format){
|
|||
red = (tempStore[j] >> 3) & 0x1f;
|
||||
green = (tempStore[j + 1] >> 2) & 0x3f;
|
||||
blue = (tempStore[j + 2] >> 3) &0x1f;
|
||||
|
||||
*to = (red << 11) | (green << 5) | blue;
|
||||
}
|
||||
delete[] tempStore;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue