+
+ if (player->GfxPos)
+ {
+ if (player->MovDir == MV_LEFT || player->MovDir == MV_RIGHT)
+ sxx = player->GfxPos;
+ else
+ syy = player->GfxPos;
+ }
+
+ if (!setup.soft_scrolling && ScreenMovPos)
+ sxx = syy = 0;
+
+#if 0
+ if (player->Frame)
+ printf("-> %d\n", player->Frame);
+#endif
+
+ DrawGraphicShiftedThruMask(sx, sy, sxx, syy, graphic, frame, NO_CUTTING);
+
+ if (SHIELD_ON(player))
+ {
+ int graphic = (player->shield_deadly_time_left ? IMG_SHIELD_DEADLY_ACTIVE :
+ IMG_SHIELD_NORMAL_ACTIVE);
+ int frame = getGraphicAnimationFrame(graphic, -1);
+
+ DrawGraphicShiftedThruMask(sx, sy, sxx, syy, graphic, frame, NO_CUTTING);
+ }
+
+#if 0
+ if (player->Pushing && player->GfxPos)
+#else
+ if (player->Pushing && player_is_moving)
+#endif
+ {
+ int px = SCREENX(next_jx), py = SCREENY(next_jy);
+
+ if ((sxx || syy) &&
+ (element == EL_SOKOBAN_FIELD_EMPTY ||
+ Feld[next_jx][next_jy] == EL_SOKOBAN_FIELD_FULL))
+ DrawGraphicShiftedThruMask(px, py, sxx, syy, IMG_SOKOBAN_OBJECT, 0,
+ NO_CUTTING);
+ else
+ {
+ int element = Feld[next_jx][next_jy];
+ int graphic = el2img(element);
+#if 1
+ int frame = 0;
+#endif
+
+ if ((sxx || syy) && IS_PUSHABLE(element))
+ {
+ graphic = el_act_dir2img(element, ACTION_MOVING, player->MovDir);
+#if 1
+ frame = getGraphicAnimationFrame(graphic, player->GfxPos);
+
+ frame = getGraphicAnimationFrame(graphic, player->Frame);
+#endif
+
+#if 0
+ printf("-> %d [%d]\n", player->Frame, player->GfxPos);
+#endif
+
+#if 0
+ /* !!! FIX !!! */
+ if (player->MovDir == MV_LEFT)
+ frame = 3 - frame;
+#endif
+
+#if 0
+ frame = (player->GfxPos / (TILEX / 4));
+
+ if (player->MovDir == MV_RIGHT)
+ frame = (frame + 4) % 4;
+#endif
+ }
+
+ DrawGraphicShifted(px, py, sxx, syy, graphic, frame,
+ NO_CUTTING, NO_MASKING);
+ }
+ }
+
+ /* draw things in front of player (active dynamite or dynabombs) */
+
+ if (IS_ACTIVE_BOMB(element))
+ {
+ graphic = el2img(element);
+
+#if 0
+ if (element == EL_DYNAMITE_ACTIVE)
+ {
+ if ((frame = (96 - MovDelay[jx][jy]) / 12) > 6)
+ frame = 6;
+ }
+ else
+ {
+ if ((frame = ((96 - MovDelay[jx][jy]) / 6) % 8) > 3)
+ frame = 7 - frame;
+ }
+#else
+
+#if 0
+ frame = getGraphicAnimationFrame(graphic, 96 - MovDelay[jx][jy]);
+#else
+ frame = getGraphicAnimationFrame(graphic, GfxFrame[jx][jy]);
+#endif
+
+#endif
+
+ if (game.emulation == EMU_SUPAPLEX)
+ DrawGraphic(sx, sy, IMG_SP_DISK_RED, frame);
+ else
+ DrawGraphicThruMask(sx, sy, graphic, frame);
+ }
+
+ if (player_is_moving && last_element == EL_EXPLOSION)
+ {
+ int stored = Store[last_jx][last_jy];
+ int graphic = (game.emulation != EMU_SUPAPLEX ? IMG_EXPLOSION :
+ stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON :
+ IMG_SP_EXPLOSION);
+ int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2);
+ int phase = ExplodePhase[last_jx][last_jy] - 1;
+ int frame = getGraphicAnimationFrame(graphic, phase - delay);
+
+ if (phase >= delay)
+ DrawGraphicThruMask(SCREENX(last_jx), SCREENY(last_jy), graphic, frame);
+ }
+
+ /* draw elements that stay over the player */
+ /* handle the field the player is leaving ... */
+ if (player_is_moving && IS_OVER_PLAYER(last_element))
+ DrawLevelField(last_jx, last_jy);
+
+ /* ... and the field the player is entering */
+ if (IS_OVER_PLAYER(element))
+ DrawLevelField(jx, jy);
+
+ if (setup.direct_draw)
+ {
+ int dest_x = SX + SCREENX(MIN(jx, last_jx)) * TILEX;
+ int dest_y = SY + SCREENY(MIN(jy, last_jy)) * TILEY;
+ int x_size = TILEX * (1 + ABS(jx - last_jx));
+ int y_size = TILEY * (1 + ABS(jy - last_jy));
+
+ BlitBitmap(drawto_field, window,
+ dest_x, dest_y, x_size, y_size, dest_x, dest_y);
+ SetDrawtoField(DRAW_DIRECT);
+ }
+
+ MarkTileDirty(sx,sy);