- GfxFrame[x][y]++;
-
- /* reset finished pushing action (not done in ContinueMoving() to allow
- continuous pushing animation for elements with zero push delay) */
- if (GfxAction[x][y] == ACTION_PUSHING && !IS_MOVING(x, y))
- {
- ResetGfxAnimation(x, y);
- DrawLevelField(x, y);
- }
-
-#if DEBUG
- if (IS_BLOCKED(x, y))
- {
- int oldx, oldy;
-
- Blocked2Moving(x, y, &oldx, &oldy);
- if (!IS_MOVING(oldx, oldy))
- {
- printf("GameActions(): (BLOCKED => MOVING) context corrupted!\n");
- printf("GameActions(): BLOCKED: x = %d, y = %d\n", x, y);
- printf("GameActions(): !MOVING: oldx = %d, oldy = %d\n", oldx, oldy);
- printf("GameActions(): This should never happen!\n");
- }
- }
-#endif
- }
-
-#if 0
- debug_print_timestamp(0, "- time for pre-main loop:");
-#endif
-
-#if 0 // -------------------- !!! TEST ONLY !!! --------------------
- SCAN_PLAYFIELD(x, y)
- {
- element = Feld[x][y];
- graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]);
-
-#if 1
- {
-#if 1
- int element2 = element;
- int graphic2 = graphic;
-#else
- int element2 = Feld[x][y];
- int graphic2 = el_act_dir2img(element2, GfxAction[x][y], GfxDir[x][y]);
-#endif
- int last_gfx_frame = GfxFrame[x][y];
-
- if (graphic_info[graphic2].anim_global_sync)
- GfxFrame[x][y] = FrameCounter;
- else if (ANIM_MODE(graphic2) == ANIM_CE_VALUE)
- GfxFrame[x][y] = CustomValue[x][y];
- else if (ANIM_MODE(graphic2) == ANIM_CE_SCORE)
- GfxFrame[x][y] = element_info[element2].collect_score;
- else if (ANIM_MODE(graphic2) == ANIM_CE_DELAY)
- GfxFrame[x][y] = ChangeDelay[x][y];
-
- if (redraw && GfxFrame[x][y] != last_gfx_frame)
- DrawLevelGraphicAnimation(x, y, graphic2);
- }
-#else
- ResetGfxFrame(x, y, TRUE);
-#endif
-
-#if 1
- if (ANIM_MODE(graphic) == ANIM_RANDOM &&
- IS_NEXT_FRAME(GfxFrame[x][y], graphic))
- ResetRandomAnimationValue(x, y);
-#endif
-
-#if 1
- SetRandomAnimationValue(x, y);
-#endif
-
-#if 1
- PlayLevelSoundActionIfLoop(x, y, GfxAction[x][y]);
-#endif
- }
-#endif // -------------------- !!! TEST ONLY !!! --------------------
-
-#if 0
- debug_print_timestamp(0, "- time for TEST loop: -->");
-#endif
-
- SCAN_PLAYFIELD(x, y)
- {
- element = Feld[x][y];
- graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]);
-
- ResetGfxFrame(x, y, TRUE);
-
- if (ANIM_MODE(graphic) == ANIM_RANDOM &&
- IS_NEXT_FRAME(GfxFrame[x][y], graphic))
- ResetRandomAnimationValue(x, y);
-
- SetRandomAnimationValue(x, y);
-
- PlayLevelSoundActionIfLoop(x, y, GfxAction[x][y]);
-
- if (IS_INACTIVE(element))
- {
- if (IS_ANIMATED(graphic))
- DrawLevelGraphicAnimationIfNeeded(x, y, graphic);
-
- continue;
- }
-
- /* this may take place after moving, so 'element' may have changed */
- if (IS_CHANGING(x, y) &&
- (game.engine_version < VERSION_IDENT(3,0,7,1) || !Stop[x][y]))
- {
- int page = element_info[element].event_page_nr[CE_DELAY];
-
-#if 1
- HandleElementChange(x, y, page);
-#else
- if (CAN_CHANGE(element))
- HandleElementChange(x, y, page);
-
- if (HAS_ACTION(element))
- ExecuteCustomElementAction(x, y, element, page);
-#endif
-
- element = Feld[x][y];
- graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]);
- }
-
-#if 0 // ---------------------------------------------------------------------
-
- if (!IS_MOVING(x, y) && (CAN_FALL(element) || CAN_MOVE(element)))
- {
- StartMoving(x, y);
-
- element = Feld[x][y];
- graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]);
-
- if (IS_ANIMATED(graphic) &&
- !IS_MOVING(x, y) &&
- !Stop[x][y])
- DrawLevelGraphicAnimationIfNeeded(x, y, graphic);
-
- if (IS_GEM(element) || element == EL_SP_INFOTRON)
- DrawTwinkleOnField(x, y);
- }
- else if (IS_MOVING(x, y))
- ContinueMoving(x, y);
- else
- {
- switch (element)
- {
- case EL_ACID:
- case EL_EXIT_OPEN:
- case EL_EM_EXIT_OPEN:
- case EL_SP_EXIT_OPEN:
- case EL_STEEL_EXIT_OPEN:
- case EL_EM_STEEL_EXIT_OPEN:
- case EL_SP_TERMINAL:
- case EL_SP_TERMINAL_ACTIVE:
- case EL_EXTRA_TIME:
- case EL_SHIELD_NORMAL:
- case EL_SHIELD_DEADLY:
- if (IS_ANIMATED(graphic))
- DrawLevelGraphicAnimationIfNeeded(x, y, graphic);
- break;
-
- case EL_DYNAMITE_ACTIVE:
- case EL_EM_DYNAMITE_ACTIVE:
- case EL_DYNABOMB_PLAYER_1_ACTIVE:
- case EL_DYNABOMB_PLAYER_2_ACTIVE:
- case EL_DYNABOMB_PLAYER_3_ACTIVE:
- case EL_DYNABOMB_PLAYER_4_ACTIVE:
- case EL_SP_DISK_RED_ACTIVE:
- CheckDynamite(x, y);
- break;
-
- case EL_AMOEBA_GROWING:
- AmoebeWaechst(x, y);
- break;
-
- case EL_AMOEBA_SHRINKING:
- AmoebaDisappearing(x, y);
- break;
-
-#if !USE_NEW_AMOEBA_CODE
- case EL_AMOEBA_WET:
- case EL_AMOEBA_DRY:
- case EL_AMOEBA_FULL:
- case EL_BD_AMOEBA:
- case EL_EMC_DRIPPER:
- AmoebeAbleger(x, y);
- break;
-#endif