X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame.c;h=491d4e9b541be0f3ca1ab48423f3ac1e16965719;hb=51da1cb28eb4d3d1383c2c0d89a51c28468fb413;hp=efc81e4e56214c58ac33a36004e828df3303d4e9;hpb=0c8ca57132eb4cfa4a941409e55aabe5c49ebe15;p=rocksndiamonds.git diff --git a/src/game.c b/src/game.c index efc81e4e..491d4e9b 100644 --- a/src/game.c +++ b/src/game.c @@ -2028,6 +2028,14 @@ 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; + + if (element_info[element].use_gfx_element) + game.use_masked_elements = TRUE; + } break; } @@ -3878,7 +3886,9 @@ void InitGame(void) GfxFrame[x][y] = 0; 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; @@ -4479,6 +4489,8 @@ void InitGame(void) if (setup.sound_music) PlayLevelMusic(); } + + SetPlayfieldMouseCursorEnabled(!game.use_mouse_actions); } void UpdateEngineValues(int actual_scroll_x, int actual_scroll_y, @@ -5473,7 +5485,7 @@ void DrawDynamite(int x, int y) else if (game.use_masked_elements) DrawLevelElement(x, y, EL_EMPTY); - frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]); + frame = getGraphicAnimationFrameXY(graphic, x, y); if (Back[x][y] || Store[x][y] || game.use_masked_elements) DrawGraphicThruMask(sx, sy, graphic, frame); @@ -6032,7 +6044,7 @@ static void Explode(int ex, int ey, int phase, int mode) else if (IN_SCR_FIELD(SCREENX(x), SCREENY(y))) { int graphic = el_act2img(GfxElement[x][y], ACTION_EXPLODING); - int frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]); + int frame = getGraphicAnimationFrameXY(graphic, x, y); if (phase == delay) TEST_DrawLevelFieldCrumbled(x, y); @@ -8221,7 +8233,7 @@ static void StartMoving(int x, int y) dir == MV_RIGHT ? IMG_FLAMES_1_RIGHT : dir == MV_UP ? IMG_FLAMES_1_UP : dir == MV_DOWN ? IMG_FLAMES_1_DOWN : IMG_EMPTY); - int frame = getGraphicAnimationFrame(graphic, GfxFrame[x][y]); + int frame = getGraphicAnimationFrameXY(graphic, x, y); GfxAction[x][y] = ACTION_ATTACKING; @@ -14196,7 +14208,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]; @@ -15966,6 +15977,7 @@ static ListNode *SaveEngineSnapshotBuffers(void) SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(GfxFrame)); SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(GfxRandom)); + SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(GfxRandomStatic)); SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(GfxElement)); SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(GfxAction)); SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(GfxDir));