increased cave buffer offset (and adjusted graphics and amoeba logic)
[rocksndiamonds.git] / src / game_em / graphics.c
index 0f763382d5b333d2ae273c300e920df477a863f4..3d9649800fc49f31e9da3dce82c8a02750c561e1 100644 (file)
@@ -5,10 +5,15 @@
 
 #include "main_em.h"
 
-#define MIN_SCREEN_XPOS                1
-#define MIN_SCREEN_YPOS                1
-#define MAX_SCREEN_XPOS                MAX(1, lev.width  - (SCR_FIELDX - 1))
-#define MAX_SCREEN_YPOS                MAX(1, lev.height - (SCR_FIELDY - 1))
+#define MIN_SCREEN_XPOS_RAW    0
+#define MIN_SCREEN_YPOS_RAW    0
+#define MAX_SCREEN_XPOS_RAW    MAX(0, lev.width  - SCR_FIELDX)
+#define MAX_SCREEN_YPOS_RAW    MAX(0, lev.height - SCR_FIELDY)
+
+#define MIN_SCREEN_XPOS                (MIN_SCREEN_XPOS_RAW + CAVE_BUFFER_XOFFSET)
+#define MIN_SCREEN_YPOS                (MIN_SCREEN_YPOS_RAW + CAVE_BUFFER_YOFFSET)
+#define MAX_SCREEN_XPOS                (MAX_SCREEN_XPOS_RAW + CAVE_BUFFER_XOFFSET)
+#define MAX_SCREEN_YPOS                (MAX_SCREEN_YPOS_RAW + CAVE_BUFFER_YOFFSET)
 
 #define MIN_SCREEN_X           (MIN_SCREEN_XPOS * TILEX)
 #define MIN_SCREEN_Y           (MIN_SCREEN_YPOS * TILEY)
@@ -300,8 +305,8 @@ static void animscreen(void)
   };
 
   if (!game.use_native_emc_graphics_engine)
-    for (y = 2; y < EM_MAX_CAVE_HEIGHT - 2; y++)
-      for (x = 2; x < EM_MAX_CAVE_WIDTH - 2; x++)
+    for (y = 2; y < CAVE_BUFFER_HEIGHT - 2; y++)
+      for (x = 2; x < CAVE_BUFFER_WIDTH - 2; x++)
        SetGfxAnimation_EM(&graphic_info_em_object[lev.draw[x][y]][frame],
                           lev.draw[x][y], 7 - frame, x - 2, y - 2);
 
@@ -326,8 +331,8 @@ static void animscreen(void)
          int yy = y + xy[i][1];
          int tile_next;
 
-         if (xx < 0 || xx >= EM_MAX_CAVE_WIDTH ||
-             yy < 0 || yy >= EM_MAX_CAVE_HEIGHT)
+         if (xx < 0 || xx >= CAVE_BUFFER_WIDTH ||
+             yy < 0 || yy >= CAVE_BUFFER_HEIGHT)
            continue;
 
          tile_next = lev.draw[xx][yy];