if (bitmap == NULL)
return;
- if (bitmap->texture)
- SDL_DestroyTexture(bitmap->texture);
- if (bitmap->texture_masked)
- SDL_DestroyTexture(bitmap->texture_masked);
+ SDLFreeBitmapTextures(bitmap);
bitmap->texture = SDLCreateTextureFromSurface(bitmap->surface);
bitmap->texture_masked = SDLCreateTextureFromSurface(bitmap->surface_masked);
}
+void SDLFreeBitmapSurfaces(Bitmap *bitmap)
+{
+ if (bitmap == NULL)
+ return;
+
+ if (bitmap->surface)
+ SDL_FreeSurface(bitmap->surface);
+ if (bitmap->surface_masked)
+ SDL_FreeSurface(bitmap->surface_masked);
+
+ bitmap->surface = NULL;
+ bitmap->surface_masked = NULL;
+}
+
void SDLFreeBitmapTextures(Bitmap *bitmap)
{
if (bitmap == NULL)
bitmap->texture_masked = NULL;
}
+void SDLFreeBitmapPointers(Bitmap *bitmap)
+{
+ SDLFreeBitmapSurfaces(bitmap);
+ SDLFreeBitmapTextures(bitmap);
+}
+
void SDLInitVideoDisplay(void)
{
// set hint to select render driver as specified in setup config file
UpdateScreen_WithoutFrameDelay(NULL);
}
-void SDLFreeBitmapPointers(Bitmap *bitmap)
-{
- if (bitmap->surface)
- SDL_FreeSurface(bitmap->surface);
- if (bitmap->surface_masked)
- SDL_FreeSurface(bitmap->surface_masked);
-
- bitmap->surface = NULL;
- bitmap->surface_masked = NULL;
-
- if (bitmap->texture)
- SDL_DestroyTexture(bitmap->texture);
- if (bitmap->texture_masked)
- SDL_DestroyTexture(bitmap->texture_masked);
-
- bitmap->texture = NULL;
- bitmap->texture_masked = NULL;
-}
-
void SDLBlitSurface(SDL_Surface *src_surface, SDL_Surface *dst_surface,
int src_x, int src_y, int width, int height,
int dst_x, int dst_y)
Bitmap *SDLGetBitmapFromSurface_WithMaskedColor(SDL_Surface *, int, int, int);
Bitmap *SDLGetBitmapFromSurface(SDL_Surface *);
void SDLCreateBitmapTextures(Bitmap *);
+void SDLFreeBitmapSurfaces(Bitmap *);
void SDLFreeBitmapTextures(Bitmap *);
+void SDLFreeBitmapPointers(Bitmap *);
SDL_Surface *SDL_DisplayFormat(SDL_Surface *);
void SDLSetWindowScaling(int);
void SDLInitVideoDisplay(void);
void SDLInitVideoBuffer(boolean);
boolean SDLSetVideoMode(boolean);
-void SDLFreeBitmapPointers(Bitmap *);
void SDLBlitSurface(SDL_Surface *, SDL_Surface *, int, int, int, int, int, int);
void SDLCopyArea(Bitmap *, Bitmap *, int, int, int, int, int, int, int);
void SDLBlitTexture(Bitmap *, int, int, int, int, int, int, int);