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 3255b4280abc8bc74978e66cd36df44bb07fea33..fefe353d0e1194cd12a2349fdcda8981961c8895 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 3f4ea31df2099d85dd489185883c8192c7e2c849..0e2667550a803a168f1d092c4f569b8125456265 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 b66da1d20e2ba4a116ba1692766e218d9d69c331..935d602069b8c46b660aac71ac2f977333d1c016 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];