1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00

[OpenGL] Fixed BGR/RGB mismatch. Fixed CPalettedBitmap issue.

This commit is contained in:
Michał W. Urbańczyk
2013-03-04 14:35:10 +00:00
parent ed0c40533f
commit 672cf5bcb5
2 changed files with 3 additions and 3 deletions

View File

@ -31,11 +31,11 @@ CImage * CImage::makeBySDL(void* data, size_t fileSize, const char* fileExt)
}
else if (ret->format->BytesPerPixel == 3)
{
img = new CBitmap32(ret->w, ret->h, (ColorRGB*)ret->pixels);
img = new CBitmap32(ret->w, ret->h, (ColorRGB*)ret->pixels, ret->format->Rmask == 0x00FF0000);
}
else if (ret->format->BytesPerPixel == 4)
{
img = new CBitmap32(ret->w, ret->h, (ColorRGBA*)ret->pixels);
img = new CBitmap32(ret->w, ret->h, (ColorRGBA*)ret->pixels, ret->format->Rmask == 0x00FF0000);
}
SDL_FreeSurface(ret);