return TRUE;
}
+SDL_Surface *SDLCreateNativeSurface(int width, int height, int depth)
+{
+ if (program.headless)
+ return NULL;
+
+ SDL_Surface *surface = SDL_CreateRGBSurface(SURFACE_FLAGS, width, height, depth, 0,0,0, 0);
+
+ if (surface == NULL)
+ Fail("SDL_CreateRGBSurface() failed: %s", SDL_GetError());
+
+ SDLSetNativeSurface(&surface);
+
+ return surface;
+}
+
static SDL_Texture *SDLCreateTextureFromSurface(SDL_Surface *surface)
{
if (program.headless)
UpdateScreen_WithoutFrameDelay(NULL);
}
-void SDLCreateBitmapContent(Bitmap *bitmap, int width, int height,
- int depth)
-{
- if (program.headless)
- return;
-
- SDL_Surface *surface =
- SDL_CreateRGBSurface(SURFACE_FLAGS, width, height, depth, 0,0,0, 0);
-
- if (surface == NULL)
- Fail("SDL_CreateRGBSurface() failed: %s", SDL_GetError());
-
- SDLSetNativeSurface(&surface);
-
- bitmap->surface = surface;
-}
-
void SDLFreeBitmapPointers(Bitmap *bitmap)
{
if (bitmap->surface)
const char *SDLGetRendererName(void);
boolean SDLSetNativeSurface(SDL_Surface **);
SDL_Surface *SDLGetNativeSurface(SDL_Surface *);
+SDL_Surface *SDLCreateNativeSurface(int, int, int);
void SDLCreateBitmapTextures(Bitmap *);
void SDLFreeBitmapTextures(Bitmap *);
void SDLInitVideoDisplay(void);
void SDLInitVideoBuffer(boolean);
boolean SDLSetVideoMode(boolean);
-void SDLCreateBitmapContent(Bitmap *, int, int, int);
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);
int real_height = MAX(1, height); // prevent zero bitmap height
int real_depth = GetRealDepth(depth);
- SDLCreateBitmapContent(new_bitmap, real_width, real_height, real_depth);
+ new_bitmap->surface = SDLCreateNativeSurface(real_width, real_height, real_depth);
new_bitmap->width = real_width;
new_bitmap->height = real_height;