added playfield array "Last[][]" to store tile from last game frame
authorHolger Schemel <info@artsoft.org>
Wed, 10 Oct 2018 19:27:50 +0000 (21:27 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 10 Oct 2018 19:27:50 +0000 (21:27 +0200)
src/game.c
src/main.c
src/main.h

index 3255b42..fefe353 100644 (file)
@@ -3595,7 +3595,7 @@ void InitGame(void)
 
   SCAN_PLAYFIELD(x, y)
   {
-    Feld[x][y] = level.field[x][y];
+    Feld[x][y] = Last[x][y] = level.field[x][y];
     MovPos[x][y] = MovDir[x][y] = MovDelay[x][y] = 0;
     ChangeDelay[x][y] = 0;
     ChangePage[x][y] = -1;
@@ -11733,6 +11733,8 @@ void GameActions_RND(void)
 
   SCAN_PLAYFIELD(x, y)
   {
+    Last[x][y] = Feld[x][y];
+
     ChangeCount[x][y] = 0;
     ChangeEvent[x][y] = -1;
 
index 3f4ea31..0e26675 100644 (file)
@@ -42,6 +42,7 @@ SDL_Thread           *server_thread;
 int                    key_joystick_mapping = 0;
 
 short                  Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short                  Last[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 short                  MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
index b66da1d..935d602 100644 (file)
@@ -3552,6 +3552,7 @@ extern SDL_Thread        *server_thread;
 extern int                     key_joystick_mapping;
 
 extern short                   Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short                   Last[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short                   MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short                   MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern short                   MovDelay[MAX_LEV_FIELDX][MAX_LEV_FIELDY];