From: Holger Schemel Date: Tue, 20 Apr 2010 15:35:39 +0000 (+0200) Subject: rnd-20100420-1-src X-Git-Tag: 3.3.0.0^2~6 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=76c6cf34f934b80bcd42ed1f0940c6c56ac1c209;p=rocksndiamonds.git rnd-20100420-1-src --- diff --git a/src/conftime.h b/src/conftime.h index e5f38b5c..bd403855 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2010-04-19 01:09" +#define COMPILE_DATE_STRING "2010-04-20 17:35" diff --git a/src/game_sp/DDScrollBuffer.c b/src/game_sp/DDScrollBuffer.c index eeecf2a7..e8bd2fbc 100644 --- a/src/game_sp/DDScrollBuffer.c +++ b/src/game_sp/DDScrollBuffer.c @@ -253,8 +253,6 @@ void BlitScreenToBitmap_SP(Bitmap *target_bitmap) #if 1 if (ExplosionShakeMurphy != 0) { - printf("::: ExplosionShakeMurphy\n"); - px += TILEX / 2 - GetSimpleRandom(TILEX + 1); py += TILEY / 2 - GetSimpleRandom(TILEX + 1); } diff --git a/src/libgame/system.c b/src/libgame/system.c index bccb5fdd..e67cbaeb 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -527,19 +527,23 @@ static boolean ValidClippedRectangle(Bitmap *bitmap, int *x, int *y, if (*x < 0) { - *x = 0; *width += *x; + *x = 0; } else if (*x + *width > bitmap->width) + { *width = bitmap->width - *x; + } if (*y < 0) { - *y = 0; *height += *y; + *y = 0; } else if (*y + *height > bitmap->height) + { *height = bitmap->height - *y; + } return TRUE; } @@ -548,6 +552,9 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap, int src_x, int src_y, int width, int height, int dst_x, int dst_y) { + int dst_x_unclipped = dst_x; + int dst_y_unclipped = dst_y; + if (DrawingDeactivated(dst_x, dst_y, width, height)) return; @@ -555,6 +562,11 @@ void BlitBitmap(Bitmap *src_bitmap, Bitmap *dst_bitmap, if (!ValidClippedRectangle(src_bitmap, &src_x, &src_y, &width, &height) || !ValidClippedRectangle(dst_bitmap, &dst_x, &dst_y, &width, &height)) return; + + /* source x/y might need adjustment if destination x/y was clipped top/left */ + src_x += dst_x - dst_x_unclipped; + src_y += dst_y - dst_y_unclipped; + #else /* skip if rectangle starts outside bitmap */ if (src_x >= src_bitmap->width ||