1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Fix battle absolute obstactes rendering

This commit is contained in:
AlexVinS
2014-07-02 21:38:15 +04:00
parent 7b75b19d1a
commit 082c9a506e
3 changed files with 17 additions and 8 deletions

View File

@ -122,7 +122,13 @@ SDL_Surface * BitmapHandler::loadBitmapFromDir(std::string path, std::string fna
if(ret->format->BytesPerPixel == 1 && setKey)
{
const SDL_Color &c = ret->format->palette->colors[0];
SDL_SetColorKey(ret,SDL_SRCCOLORKEY,SDL_MapRGB(ret->format, c.r, c.g, c.b));
#ifdef VCMI_SDL1
uint32_t key = SDL_MapRGB(ret->format, c.r, c.g, c.b);
#else
uint32_t key = SDL_MapRGBA(ret->format, c.r, c.g, c.b, c.a);
#endif
SDL_SetColorKey(ret,SDL_SRCCOLORKEY,key);
}
}
else