X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Flibgame%2Fsdl.c;fp=src%2Flibgame%2Fsdl.c;h=d664eecc01df267ae8a86aff5f04e29cb43abbdc;hb=a3edb6437b8864290bab53bfc3bd1da9595879c1;hp=a19defa37acc5a7f7cc8cc07eeb958db0eafe973;hpb=f7132b81a5b7559991e1048ab8680c65cc4b98c2;p=rocksndiamonds.git diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index a19defa3..d664eecc 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -502,7 +502,7 @@ SDL_Surface *SDLCreateNativeSurface(int width, int height, int depth) return surface; } -Bitmap *SDLGetBitmapFromSurface(SDL_Surface *surface) +Bitmap *SDLGetBitmapFromSurface_WithMaskedColor(SDL_Surface *surface, int r, int g, int b) { int width = surface->w; int height = surface->h; @@ -522,11 +522,16 @@ Bitmap *SDLGetBitmapFromSurface(SDL_Surface *surface) if (!SDLHasAlpha(bitmap->surface_masked) && !SDLHasColorKey(bitmap->surface_masked)) SDL_SetColorKey(bitmap->surface_masked, SET_TRANSPARENT_PIXEL, - SDL_MapRGB(bitmap->surface_masked->format, 0x00, 0x00, 0x00)); + SDL_MapRGB(bitmap->surface_masked->format, r, g, b)); return bitmap; } +Bitmap *SDLGetBitmapFromSurface(SDL_Surface *surface) +{ + return SDLGetBitmapFromSurface_WithMaskedColor(surface, 0x00, 0x00, 0x00); +} + static SDL_Texture *SDLCreateTextureFromSurface(SDL_Surface *surface) { if (program.headless)