{
static unsigned int update_screen_delay = 0;
unsigned int update_screen_delay_value = 20; /* (milliseconds) */
+ SDL_Surface *screen = backbuffer->surface;
if (limit_screen_updates &&
!DelayReached(&update_screen_delay, update_screen_delay_value))
}
#endif
+#if USE_FINAL_SCREEN_BITMAP
+ if (gfx.final_screen_bitmap != NULL) // may not be initialized yet
+ {
+ // !!! TEST !!!
+ // draw global animations using bitmaps instead of using textures
+ // to prevent texture scaling artefacts (this is potentially slower)
+
+ BlitBitmap(backbuffer, gfx.final_screen_bitmap, 0, 0,
+ gfx.win_xsize, gfx.win_ysize, 0, 0);
+
+ // copy global animations to render target buffer, if defined
+ if (gfx.draw_global_anim_function != NULL)
+ gfx.draw_global_anim_function();
+
+ screen = gfx.final_screen_bitmap->surface;
+
+ // force full window redraw
+ rect = NULL;
+ }
+#endif
+
#if defined(TARGET_SDL2)
#if USE_RENDERER
- SDL_Surface *screen = backbuffer->surface;
-
if (rect)
{
int bytes_x = screen->pitch / video.width;
// copy backbuffer to render target buffer
SDL_RenderCopy(sdl_renderer, sdl_texture, NULL, NULL);
+#if !USE_FINAL_SCREEN_BITMAP
// copy global animations to render target buffer, if defined
if (gfx.draw_global_anim_function != NULL)
gfx.draw_global_anim_function();
+#endif
// show render target buffer on screen
SDL_RenderPresent(sdl_renderer);
#define FULLSCREEN_STATUS FULLSCREEN_AVAILABLE
#endif
+#define USE_FINAL_SCREEN_BITMAP FALSE
+
#define CURSOR_MAX_WIDTH 32
#define CURSOR_MAX_HEIGHT 32
gfx.background_bitmap_mask = REDRAW_NONE;
ReCreateBitmap(&gfx.background_bitmap, win_xsize, win_ysize, DEFAULT_DEPTH);
+#if USE_FINAL_SCREEN_BITMAP
+ ReCreateBitmap(&gfx.final_screen_bitmap, win_xsize, win_ysize, DEFAULT_DEPTH);
+#endif
}
void InitGfxScrollbufferInfo(int scrollbuffer_width, int scrollbuffer_height)
BLIT_MASKED);
}
+void BlitToScreen(Bitmap *bitmap,
+ int src_x, int src_y, int width, int height,
+ int dst_x, int dst_y)
+{
+ if (bitmap == NULL)
+ return;
+
+#if USE_FINAL_SCREEN_BITMAP
+ BlitBitmap(bitmap, gfx.final_screen_bitmap, src_x, src_y,
+ width, height, dst_x, dst_y);
+#else
+ BlitTexture(bitmap, src_x, src_y, width, height, dst_x, dst_y);
+#endif
+}
+
+void BlitToScreenMasked(Bitmap *bitmap,
+ int src_x, int src_y, int width, int height,
+ int dst_x, int dst_y)
+{
+ if (bitmap == NULL)
+ return;
+
+#if USE_FINAL_SCREEN_BITMAP
+ BlitBitmapMasked(bitmap, gfx.final_screen_bitmap, src_x, src_y,
+ width, height, dst_x, dst_y);
+#else
+ BlitTextureMasked(bitmap, src_x, src_y, width, height, dst_x, dst_y);
+#endif
+}
+
void DrawSimpleBlackLine(Bitmap *bitmap, int from_x, int from_y,
int to_x, int to_y)
{
Bitmap *background_bitmap;
int background_bitmap_mask;
+#if USE_FINAL_SCREEN_BITMAP
+ Bitmap *final_screen_bitmap;
+#endif
+
boolean clipping_enabled;
int clip_x, clip_y;
int clip_width, clip_height;
void BlitBitmapOnBackground(Bitmap *, Bitmap *, int, int, int, int, int, int);
void BlitTexture(Bitmap *, int, int, int, int, int, int);
void BlitTextureMasked(Bitmap *, int, int, int, int, int, int);
+void BlitToScreen(Bitmap *, int, int, int, int, int, int);
+void BlitToScreenMasked(Bitmap *, int, int, int, int, int, int);
void DrawSimpleBlackLine(Bitmap *, int, int, int, int);
void DrawSimpleWhiteLine(Bitmap *, int, int, int, int);
void DrawLines(Bitmap *, struct XY *, int, Pixel);