added basic support for additional empty space elements in game engine
authorHolger Schemel <info@artsoft.org>
Fri, 26 Nov 2021 23:03:17 +0000 (00:03 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 22 Jan 2022 16:58:29 +0000 (17:58 +0100)
src/game.c
src/main.c
src/main.h
src/tools.c

index d4c0402560342f08c47abe16dcef0883906d35f3..8ac2616131b19c07bf66ea9e47abaec49a95bb8a 100644 (file)
@@ -2028,6 +2028,11 @@ static void InitField(int x, int y, boolean init_game)
 
        InitField(x, y, init_game);
       }
+      else if (IS_EMPTY_ELEMENT(element))
+      {
+       GfxElementEmpty[x][y] = element;
+       Tile[x][y] = EL_EMPTY;
+      }
 
       break;
   }
@@ -3880,6 +3885,7 @@ void InitGame(void)
     GfxRandom[x][y] = INIT_GFX_RANDOM();
     GfxRandomStatic[x][y] = INIT_GFX_RANDOM();
     GfxElement[x][y] = EL_UNDEFINED;
+    GfxElementEmpty[x][y] = EL_EMPTY;
     GfxAction[x][y] = ACTION_DEFAULT;
     GfxDir[x][y] = MV_NONE;
     GfxRedraw[x][y] = GFX_REDRAW_NONE;
@@ -14199,7 +14205,6 @@ static int DigField(struct PlayerInfo *player,
       return MP_NO_ACTION;
     }
   }
-
   if (IS_TUBE(Back[jx][jy]) && game.engine_version >= VERSION_IDENT(2,2,0,0))
     old_element = Back[jx][jy];
 
index 4ef296f299673572ab459559f0eafef3e1fe057f..47bd787f03a2ac097018b929f61dfa877730c5db 100644 (file)
@@ -69,6 +69,7 @@ int                   GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 int                    GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 int                    GfxRandomStatic[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 int                    GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+int                    GfxElementEmpty[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 int                    GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 int                    GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 int                    GfxRedraw[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
index 72c164416c948c9cb3353addb9416b926c8a100e..5ff5558a5696dde185ebf84fe9ee526c0093b87b 100644 (file)
@@ -3760,6 +3760,7 @@ extern int                        GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern int                     GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern int                     GfxRandomStatic[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern int                     GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern int                     GfxElementEmpty[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern int                     GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern int                     GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
 extern int                     GfxRedraw[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
index bf79b048d344368bf064bbc992bf98a18c4cf301..a3e5306835f7082e83a21f22c3dc053f13f5257d 100644 (file)
@@ -1996,6 +1996,9 @@ void DrawScreenElementExt(int x, int y, int dx, int dy, int element,
   int graphic;
   int frame;
 
+  if (element == EL_EMPTY)
+    element = GfxElementEmpty[lx][ly];
+
   if (IN_LEV_FIELD(lx, ly))
   {
     SetRandomAnimationValue(lx, ly);