Skip to content

Commit

Permalink
[Switch] fix transparent object display with latest SDL2
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed May 22, 2021
1 parent 79c059a commit 0b1ca20
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libgame/sdl.c
Expand Up @@ -2655,8 +2655,14 @@ Bitmap *SDLLoadImage(char *filename)
SDL_MapRGB(sdl_image_tmp->format, 0x00, 0x00, 0x00));

/* create native transparent surface for current image */
#if defined(PLATFORM_SWITCH)
if (!SDLHasAlpha(sdl_image_tmp))
new_bitmap->surface_masked = SDL_ConvertSurface(sdl_image_tmp, sdl_image_tmp->format, 0);
else
#else
if ((new_bitmap->surface_masked = SDLGetNativeSurface(sdl_image_tmp)) == NULL)
Error(ERR_EXIT, "SDLGetNativeSurface() failed");
#endif

print_timestamp_time("SDLGetNativeSurface (masked)");

Expand Down

0 comments on commit 0b1ca20

Please sign in to comment.