X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsystem.c;h=20ea20bed03553ee0e76107830f8dc3031045e41;hp=7a6618eb9176dc7b08b8de21a9a5891c50c0e25b;hb=2f188e42574d95e8eb63e9137535a2867b482b89;hpb=695b9e3d2e2ee94c93d2e804aa3c23dd34f68a25 diff --git a/src/libgame/system.c b/src/libgame/system.c index 7a6618eb..20ea20be 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -491,8 +491,34 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap, if (DrawingDeactivated(dst_x, dst_y, width, height)) return; - sysCopyArea(src_bitmap, dst_bitmap, src_x, src_y, width, height, - dst_x, dst_y, BLIT_OPAQUE); +#if 0 + /* !!! APPARENTLY THIS HAS BEEN FIXED IN SDL 1.2.12 !!! */ +#if defined(TARGET_SDL) && defined(PLATFORM_WIN32) + if (src_bitmap == dst_bitmap) + { + /* !!! THIS IS A BUG (IN THE SDL LIBRARY?) AND SHOULD BE FIXED !!! */ + + /* needed when blitting directly to same bitmap -- should not be needed with + recent SDL libraries, but apparently does not work in 1.2.11 directly */ + + static Bitmap *tmp_bitmap = NULL; + + if (tmp_bitmap == NULL) + tmp_bitmap = CreateBitmap(MAX(FXSIZE, WIN_XSIZE), + MAX(FYSIZE, WIN_YSIZE), DEFAULT_DEPTH); + + sysCopyArea(src_bitmap, tmp_bitmap, + src_x, src_y, width, height, dst_x, dst_y, BLIT_OPAQUE); + sysCopyArea(tmp_bitmap, dst_bitmap, + src_x, src_y, width, height, dst_x, dst_y, BLIT_OPAQUE); + + return; + } +#endif +#endif + + sysCopyArea(src_bitmap, dst_bitmap, + src_x, src_y, width, height, dst_x, dst_y, BLIT_OPAQUE); } void FadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,