From: Holger Schemel Date: Thu, 20 Feb 2020 01:12:01 +0000 (+0100) Subject: fixed broken screen blitting if cave is smaller than screen for EM engine X-Git-Tag: 4.2.0.0~86 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=df57066a525140f21a8b712e7276cfba8c87a218 fixed broken screen blitting if cave is smaller than screen for EM engine --- diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index 43c5e4b2..c03267a1 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -75,8 +75,8 @@ void BlitScreenToBitmap_EM(Bitmap *target_bitmap) int sysize = (full_ysize < ysize ? full_ysize : ysize); int xxsize = MAX_BUF_XSIZE * TILEX - x; int yysize = MAX_BUF_YSIZE * TILEY - y; - int xoffset = 2 * TILEX; - int yoffset = 2 * TILEY; + int xoffset = 2 * CAVE_BUFFER_XOFFSET * TILEX; + int yoffset = 2 * CAVE_BUFFER_YOFFSET * TILEY; if (x < xoffset && y < yoffset) { diff --git a/src/game_em/main_em.h b/src/game_em/main_em.h index ab135ec0..cdb9325c 100644 --- a/src/game_em/main_em.h +++ b/src/game_em/main_em.h @@ -48,8 +48,8 @@ extern int TILESIZE_VAR; extern int SCR_FIELDX, SCR_FIELDY; -#define MAX_BUF_XSIZE (SCR_FIELDX + 2) -#define MAX_BUF_YSIZE (SCR_FIELDY + 2) +#define MAX_BUF_XSIZE (SCR_FIELDX + 2 * CAVE_BUFFER_XOFFSET) +#define MAX_BUF_YSIZE (SCR_FIELDY + 2 * CAVE_BUFFER_YOFFSET) /* often used screen positions */