mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +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(); | ||||
| 		fullSize.x = surf->w; | ||||
| 		fullSize.y = surf->h; | ||||
|  | ||||
| 		optimizeSurface(); | ||||
| 	} | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -90,7 +90,7 @@ SDL_Surface * CSDL_Ext::newSurface(const Point & dimensions, SDL_Surface * mod) | ||||
| 	if (mod->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)); | ||||
| 	} | ||||
| 	return ret; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user