mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-09 01:06:07 +02:00
[OpenGL] Fixed BGR/RGB mismatch. Fixed CPalettedBitmap issue.
This commit is contained in:
@ -307,7 +307,7 @@ CPalettedBitmap::~CPalettedBitmap()
|
||||
|
||||
void CPalettedBitmap::textureTransfer()
|
||||
{
|
||||
glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_R8UI, width, height, 0, GL_RED, GL_UNSIGNED_BYTE, buffer);
|
||||
glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_R8UI, width, height, 0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, buffer);
|
||||
palette.loadToVideoRAM();
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user