From df57066a525140f21a8b712e7276cfba8c87a218 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 20 Feb 2020 02:12:01 +0100 Subject: [PATCH] fixed broken screen blitting if cave is smaller than screen for EM engine --- src/game_em/graphics.c | 4 ++-- src/game_em/main_em.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 */ -- 2.34.1