increased cave buffer offset (and adjusted graphics and amoeba logic)
authorHolger Schemel <info@artsoft.org>
Wed, 29 Jan 2020 18:50:51 +0000 (19:50 +0100)
committerHolger Schemel <info@artsoft.org>
Tue, 19 May 2020 16:12:57 +0000 (18:12 +0200)
src/game_em/emerald.h
src/game_em/graphics.c
src/game_em/logic.c

index 26032ff428c3486bdc6681c0a4618171e887a2ac..9dc949fb1e83bbf9958cc8aa17c4c25361fed458 100644 (file)
@@ -56,8 +56,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #define CAVE_HEIGHT                    (MAX_PLAYFIELD_HEIGHT + 2)
 
 /* with border for Zborder elements (surrounding the visible playfield) */
-#define CAVE_BUFFER_XOFFSET            1
-#define CAVE_BUFFER_YOFFSET            1
+#define CAVE_BUFFER_XOFFSET            4
+#define CAVE_BUFFER_YOFFSET            2
 #define CAVE_BUFFER_WIDTH              (CAVE_WIDTH  + 2 * CAVE_BUFFER_XOFFSET)
 #define CAVE_BUFFER_HEIGHT             (CAVE_HEIGHT + 2 * CAVE_BUFFER_YOFFSET)
 
index 548b24db1c7e29680e687fa64fa1b9673665e04d..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)
index df027b63801af736538c29a95be9efd6956b3225..8bd29b3c4f9753145da0bf491c7721c1716298c5 100644 (file)
@@ -6334,8 +6334,8 @@ void logic_3(void)
 
   for (count = lev.amoeba_time; count--;)
   {
-    x = (random >> 10) % (CAVE_BUFFER_WIDTH - 2);
-    y = (random >> 20) % (CAVE_BUFFER_HEIGHT - 2);
+    x = CAVE_BUFFER_XOFFSET - 1 + (random >> 10) % CAVE_WIDTH;
+    y = CAVE_BUFFER_YOFFSET - 1 + (random >> 20) % CAVE_HEIGHT;
 
     Lamoeba(x, y);