MOHAWK: Change bitmaps to use RGB palettes.
Thanks to clone2727 for reviewing this patch.
This commit is contained in:
parent
e21d6e0d11
commit
accab0e00f
3 changed files with 14 additions and 33 deletions
|
@ -73,9 +73,9 @@ void MohawkSurface::convertToTrueColor() {
|
|||
for (uint16 i = 0; i < _surface->h; i++) {
|
||||
for (uint16 j = 0; j < _surface->w; j++) {
|
||||
byte palIndex = *((byte *)_surface->pixels + i * _surface->pitch + j);
|
||||
byte r = _palette[palIndex * 4];
|
||||
byte g = _palette[palIndex * 4 + 1];
|
||||
byte b = _palette[palIndex * 4 + 2];
|
||||
byte r = _palette[palIndex * 3 + 0];
|
||||
byte g = _palette[palIndex * 3 + 1];
|
||||
byte b = _palette[palIndex * 3 + 2];
|
||||
if (pixelFormat.bytesPerPixel == 2)
|
||||
*((uint16 *)surface->getBasePtr(j, i)) = pixelFormat.RGBToColor(r, g, b);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue