X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsdl.c;h=d431aacf29c96c34d73b2a4db489d075608a5640;hp=7fbd38f7de3f072a809ee218f06ea9da7093d153;hb=0a69f419ffadee5822bc103be9e85d378e0d0274;hpb=c20229ab1969aebbf9f34ad76a90662461c8b75d diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 7fbd38f7..d431aacf 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -349,6 +349,22 @@ void SDLCreateBitmapTextures(Bitmap *bitmap) #endif } +void SDLFreeBitmapTextures(Bitmap *bitmap) +{ +#if defined(TARGET_SDL2) + if (bitmap == NULL) + return; + + if (bitmap->texture) + SDL_DestroyTexture(bitmap->texture); + if (bitmap->texture_masked) + SDL_DestroyTexture(bitmap->texture_masked); + + bitmap->texture = NULL; + bitmap->texture_masked = NULL; +#endif +} + void SDLInitVideoDisplay(void) { #if !defined(TARGET_SDL2)