-#endif
-
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_EXIT_OPEN;
- DrawNewLevelField(x, y);
- }
- }
-}
-
-void AusgangstuerBlinken(int x, int y)
-{
-#if 0
- DrawGraphicAnimation(x, y, GFX_AUSGANG_AUF, 4, 4, ANIM_PINGPONG);
-#else
- DrawNewGraphicAnimation(x, y, IMG_EXIT_OPEN);
-#endif
-}
-
-void OpenSwitchgate(int x, int y)
-{
- int delay = 6;
-
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 5 * delay;
-
- if (MovDelay[x][y]) /* wait some time before next frame */
- {
- int phase;
-
- MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
-#if 0
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_SWITCHGATE_OPEN - phase);
-#else
- {
- int frame = getNewGraphicAnimationFrame(IMG_SWITCHGATE_OPENING,
- 29 - MovDelay[x][y]);
-
- DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_OPENING, frame);
- }
-#endif
-
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_SWITCHGATE_OPEN;
- DrawNewLevelField(x, y);
- }
- }
-}
-
-void CloseSwitchgate(int x, int y)
-{
- int delay = 6;
-
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 5 * delay;
-
- if (MovDelay[x][y]) /* wait some time before next frame */
- {
- int phase;
-
- MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
-#if 0
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_SWITCHGATE_CLOSED + phase);
-#else
- {
- int frame = getNewGraphicAnimationFrame(IMG_SWITCHGATE_CLOSING,
- 29 - MovDelay[x][y]);
-
- DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_SWITCHGATE_CLOSING, frame);
- }
-#endif
-
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_SWITCHGATE_CLOSED;
- DrawNewLevelField(x, y);
- }
- }
-}
-
-void OpenTimegate(int x, int y)
-{
- int delay = 6;
-
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 5 * delay;
-
- if (MovDelay[x][y]) /* wait some time before next frame */
- {
- int phase;
-
- MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
-#if 0
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_TIMEGATE_OPEN - phase);
-#else
- {
- int frame = getNewGraphicAnimationFrame(IMG_TIMEGATE_OPENING,
- 29 - MovDelay[x][y]);
-
- DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_OPENING, frame);
- }
-#endif
-
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_TIMEGATE_OPEN;
- DrawNewLevelField(x, y);
- }
- }
-}
-
-void CloseTimegate(int x, int y)
-{
- int delay = 6;
-
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 5 * delay;
-
- if (MovDelay[x][y]) /* wait some time before next frame */
- {
- int phase;
-
- MovDelay[x][y]--;
- phase = MovDelay[x][y] / delay;
- if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
-#if 0
- DrawGraphic(SCREENX(x), SCREENY(y), GFX_TIMEGATE_CLOSED + phase);
-#else
- {
- int frame = getNewGraphicAnimationFrame(IMG_TIMEGATE_CLOSING,
- 29 - MovDelay[x][y]);
-
- DrawNewGraphic(SCREENX(x), SCREENY(y), IMG_TIMEGATE_CLOSING, frame);
- }
-#endif
-
- if (!MovDelay[x][y])
- {
- Feld[x][y] = EL_TIMEGATE_CLOSED;
- DrawNewLevelField(x, y);
- }
- }
-}
-
-static void CloseAllOpenTimegates()
-{
- int x, y;
-
- for (y=0; y<lev_fieldy; y++)
- {
- for (x=0; x<lev_fieldx; x++)
- {
- int element = Feld[x][y];
-
- if (element == EL_TIMEGATE_OPEN || element == EL_TIMEGATE_OPENING)
- {
- Feld[x][y] = EL_TIMEGATE_CLOSING;
- PlaySoundLevel(x, y, SND_TIMEGATE_CLOSING);
- }
- }
- }
-}
-
-void EdelsteinFunkeln(int x, int y)
-{
- if (!IN_SCR_FIELD(SCREENX(x), SCREENY(y)) || IS_MOVING(x, y))
- return;
-
- if (Feld[x][y] == EL_BD_DIAMOND)
-#if 0
- DrawGraphicAnimation(x, y, GFX_EDELSTEIN_BD, 4, 4, ANIM_REVERSE);
-#else
- DrawNewGraphicAnimation(x, y, IMG_BD_DIAMOND);
-#endif
- else
- {
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 11 * !SimpleRND(500);
-
- if (MovDelay[x][y]) /* wait some time before next frame */
- {
- MovDelay[x][y]--;
-
- if (setup.direct_draw && MovDelay[x][y])
- SetDrawtoField(DRAW_BUFFERED);
-
-#if 0
- DrawGraphic(SCREENX(x), SCREENY(y), el2gfx(Feld[x][y]));
-#else
- DrawNewGraphic(SCREENX(x), SCREENY(y), el2img(Feld[x][y]), 0);
-#endif
-
- if (MovDelay[x][y])
- {
- int phase = (MovDelay[x][y]-1)/2;
-
- if (phase > 2)
- phase = 4-phase;
-
-#if 0
- DrawGraphicThruMask(SCREENX(x), SCREENY(y), GFX_FUNKELN_WEISS + phase);
-#else
- {
- int frame = getNewGraphicAnimationFrame(IMG_TWINKLE_WHITE,
- 10 - MovDelay[x][y]);
-
- DrawNewGraphicThruMask(SCREENX(x), SCREENY(y), IMG_TWINKLE_WHITE,
- frame);
- }
-#endif
-
- if (setup.direct_draw)
- {
- int dest_x, dest_y;
-
- dest_x = FX + SCREENX(x) * TILEX;
- dest_y = FY + SCREENY(y) * TILEY;
-
- BlitBitmap(drawto_field, window,
- dest_x, dest_y, TILEX, TILEY, dest_x, dest_y);
- SetDrawtoField(DRAW_DIRECT);
- }
- }
- }
- }
-}
-
-void MauerWaechst(int x, int y)
-{
- int delay = 6;
-
- if (!MovDelay[x][y]) /* next animation frame */
- MovDelay[x][y] = 3 * delay;
-
- if (MovDelay[x][y]) /* wait some time before next frame */
- {
- int phase;
-
- MovDelay[x][y]--;
- phase = 2 - MovDelay[x][y] / delay;
-#if 0
- if (!(MovDelay[x][y]%delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- DrawGraphic(SCREENX(x), SCREENY(y),
- (MovDir[x][y] == MV_LEFT ? GFX_MAUER_LEFT :
- MovDir[x][y] == MV_RIGHT ? GFX_MAUER_RIGHT :
- MovDir[x][y] == MV_UP ? GFX_MAUER_UP :
- GFX_MAUER_DOWN ) + phase);
-#else
- if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
- {
- int graphic = el_dir2img(Feld[x][y], MovDir[x][y]);
- int frame = getNewGraphicAnimationFrame(graphic, 17 - MovDelay[x][y]);
-
- DrawNewGraphic(SCREENX(x), SCREENY(y), graphic, frame);
- }
-#endif