Set color bitmasks when saving a Bitmap to a file

This commit is contained in:
Inori 2019-09-07 11:06:23 -04:00 committed by Inori
parent 5cee380992
commit 7641bbe59f

View file

@ -926,7 +926,7 @@ void Bitmap::saveToFile(const char *filename)
GUARD_MEGA;
SDL_Surface *surf = SDL_CreateRGBSurface(0, width(), height(),p->format->BitsPerPixel, 0,0,0,0);
SDL_Surface *surf = SDL_CreateRGBSurface(0, width(), height(),p->format->BitsPerPixel, p->format->Rmask,p->format->Gmask,p->format->Bmask,p->format->Amask);
if (!surf)
throw new Exception(Exception::SDLError, "Failed to save bitmap: %s", SDL_GetError());