34 bool SurfaceImageHelper::mEnableAlphaCache =
false;
36 Image *SurfaceImageHelper::loadSurface(SDL_Surface *
const tmpImage)
38 return _SDLload(tmpImage);
41 Image *SurfaceImageHelper::createTextSurface(SDL_Surface *
const tmpImage,
50 bool hasAlpha =
false;
51 uint8_t *alphaChannel =
nullptr;
52 SDL_Surface *image = SDLDuplicateSurface(tmpImage);
54 img =
new Image(image, hasAlpha, alphaChannel);
59 SDL_Surface* SurfaceImageHelper::SDLDuplicateSurface(SDL_Surface *
const
62 if (!tmpImage || !tmpImage->format)
68 Image *SurfaceImageHelper::_SDLload(SDL_Surface *tmpImage)
const
73 SDL_Surface *image = convertTo32Bit(tmpImage);
74 return new Image(image,
false,
nullptr);
77 int SurfaceImageHelper::combineSurface(SDL_Surface *
restrict const src,
82 SDL_SetSurfaceBlendMode(src, SDL_BLENDMODE_BLEND);
83 SDL_BlitSurface(src, srcrect, dst, dstrect);
#define MSDL_ConvertSurface(src, fmt, flags)