mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-10 22:31:40 +02:00
Try to crop borders for images that are not from pre-optimized def
This commit is contained in:
@@ -139,6 +139,8 @@ SDLImageShared::SDLImageShared(const ImagePath & filename, int preScaleFactor)
|
|||||||
savePalette();
|
savePalette();
|
||||||
fullSize.x = surf->w;
|
fullSize.x = surf->w;
|
||||||
fullSize.y = surf->h;
|
fullSize.y = surf->h;
|
||||||
|
|
||||||
|
optimizeSurface();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -90,7 +90,7 @@ SDL_Surface * CSDL_Ext::newSurface(const Point & dimensions, SDL_Surface * mod)
|
|||||||
if (mod->format->palette)
|
if (mod->format->palette)
|
||||||
{
|
{
|
||||||
assert(ret->format->palette);
|
assert(ret->format->palette);
|
||||||
assert(ret->format->palette->ncolors == mod->format->palette->ncolors);
|
assert(ret->format->palette->ncolors >= mod->format->palette->ncolors);
|
||||||
memcpy(ret->format->palette->colors, mod->format->palette->colors, mod->format->palette->ncolors * sizeof(SDL_Color));
|
memcpy(ret->format->palette->colors, mod->format->palette->colors, mod->format->palette->ncolors * sizeof(SDL_Color));
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user