X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsdl.c;h=d431aacf29c96c34d73b2a4db489d075608a5640;hp=996621532c1f895bba022559d670b750605536ae;hb=0a69f419ffadee5822bc103be9e85d378e0d0274;hpb=0d69b68e9fe75ce7414b0effaa954292056309a2 diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 99662153..d431aacf 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -144,9 +144,9 @@ static void UpdateScreen(SDL_Rect *rect) #else // TARGET_SDL if (rect) - SDL_UpdateRects(backbuffer->surface, 1, rect); + SDL_UpdateRects(screen, 1, rect); else - SDL_UpdateRect(backbuffer->surface, 0, 0, 0, 0); + SDL_UpdateRect(screen, 0, 0, 0, 0); #endif } @@ -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)