X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsdl.c;h=0759b549fe643dc5ace17a427b8b38f77b6dbd0c;hp=0b2e1c1663064c7886a5cfe46e36f52db794deee;hb=fe4ae2ae6dd24628a3141093d8cddea7b57812e1;hpb=119c080134473a08d0abaae1a7a11b85c3f1e427 diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 0b2e1c16..0759b549 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -317,6 +317,11 @@ void SDLCreateBitmapTextures(Bitmap *bitmap) if (bitmap == NULL) return; + if (bitmap->texture) + SDL_DestroyTexture(bitmap->texture); + if (bitmap->texture_masked) + SDL_DestroyTexture(bitmap->texture_masked); + bitmap->texture = SDLCreateTextureFromSurface(bitmap->surface); bitmap->texture_masked = SDLCreateTextureFromSurface(bitmap->surface_masked); #endif