mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Fix bugs caused by image optimization procedure
This commit is contained in:
parent
29c040fa69
commit
931017f58b
@ -263,6 +263,13 @@ void SDLImageShared::optimizeSurface()
|
||||
SDL_SetSurfaceBlendMode(surf, SDL_BLENDMODE_NONE);
|
||||
SDL_BlitSurface(surf, &rectSDL, newSurface, nullptr);
|
||||
|
||||
if (SDL_HasColorKey(surf))
|
||||
{
|
||||
uint32_t colorKey;
|
||||
SDL_GetColorKey(surf, &colorKey);
|
||||
SDL_SetColorKey(newSurface, SDL_TRUE, colorKey);
|
||||
}
|
||||
|
||||
SDL_FreeSurface(surf);
|
||||
surf = newSurface;
|
||||
|
||||
@ -359,7 +366,7 @@ void SDLImageIndexed::playerColored(PlayerColor player)
|
||||
bool SDLImageShared::isTransparent(const Point & coords) const
|
||||
{
|
||||
if (surf)
|
||||
return CSDL_Ext::isTransparent(surf, coords.x, coords.y);
|
||||
return CSDL_Ext::isTransparent(surf, coords.x - margins.x, coords.y - margins.y);
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user