1
0
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:
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

@ -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();
}

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);