fixed broken screen blitting if cave is smaller than screen for EM engine
authorHolger Schemel <info@artsoft.org>
Thu, 20 Feb 2020 01:12:01 +0000 (02:12 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 19 May 2020 16:19:59 +0000 (18:19 +0200)
src/game_em/graphics.c
src/game_em/main_em.h

index 43c5e4b22cb715e311858766d3d0642c6e90900c..c03267a1e7e84fa9ab9fda27a34e70376306adda 100644 (file)
@@ -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 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)
   {
 
   if (x < xoffset && y < yoffset)
   {
index ab135ec00b2f39826b98db474e4e60648d795c75..cdb9325cad4d1be58da3494c85191f42e0faa993 100644 (file)
@@ -48,8 +48,8 @@ extern int                    TILESIZE_VAR;
 
 extern int                     SCR_FIELDX, SCR_FIELDY;
 
 
 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 */
 
 
 /* often used screen positions */