From: Holger Schemel Date: Fri, 26 Nov 2021 23:03:17 +0000 (+0100) Subject: added basic support for additional empty space elements in game engine X-Git-Tag: 4.3.1.0~10 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=1e23125074b86c5eb1254037a81a3e9062152b7f;p=rocksndiamonds.git added basic support for additional empty space elements in game engine --- diff --git a/src/game.c b/src/game.c index d4c04025..8ac26161 100644 --- a/src/game.c +++ b/src/game.c @@ -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]; diff --git a/src/main.c b/src/main.c index 4ef296f2..47bd787f 100644 --- a/src/main.c +++ b/src/main.c @@ -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]; diff --git a/src/main.h b/src/main.h index 72c16441..5ff5558a 100644 --- a/src/main.h +++ b/src/main.h @@ -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]; diff --git a/src/tools.c b/src/tools.c index bf79b048..a3e53068 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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);