+void ScrollFigure(int init)
+{
+ static long actual_frame_counter;
+ static int oldJX = -1, oldJY = -1;
+
+ if (init)
+ {
+ /*
+ if (PlayerMovPos && oldJX != -1 && oldJY != -1)
+ {
+ if (Feld[lastJX][lastJY] == EL_LEERRAUM)
+ Feld[lastJX][lastJY] = EL_PLAYER_IS_LEAVING;
+ DrawLevelElement(oldJX,oldJY, Feld[oldJX][oldJY]);
+ DrawPlayerField();
+ }
+ */
+
+ if (oldJX != -1 && oldJY != -1)
+ {
+ /*
+ if (Feld[lastJX][lastJY] == EL_LEERRAUM)
+ Feld[lastJX][lastJY] = EL_PLAYER_IS_LEAVING;
+ */
+ DrawLevelElement(oldJX,oldJY, Feld[oldJX][oldJY]);
+ /*
+ DrawLevelElement(lastJX,lastJY, Feld[lastJX][lastJY]);
+ DrawPlayerField();
+ */
+ }
+
+ if (Feld[lastJX][lastJY] == EL_LEERRAUM)
+ Feld[lastJX][lastJY] = EL_PLAYER_IS_LEAVING;
+ DrawLevelElement(lastJX,lastJY, Feld[lastJX][lastJY]);
+ DrawPlayerField();
+
+ oldJX = lastJX;
+ oldJY = lastJY;
+ actual_frame_counter = FrameCounter;
+
+ /*
+ redraw[redraw_x1 + oldJX][redraw_y1 + oldJY] = 1;
+ redraw_tiles++;
+ */
+
+ /*
+ DrawLevelElement(oldJX,oldJY, Feld[oldJX][oldJY]);
+ */
+
+
+ if (PlayerPushing)
+ {
+ int nextJX = JX + (JX - lastJX);
+ int nextJY = JY + (JY - lastJY);
+
+ if (Feld[nextJX][nextJY] == EL_SOKOBAN_FELD_VOLL)
+ DrawLevelElement(nextJX,nextJY, EL_SOKOBAN_FELD_LEER);
+ else
+ DrawLevelElement(nextJX,nextJY, EL_LEERRAUM);
+ }
+
+
+ DrawPlayerField();
+
+ return;
+ }
+ else if (!FrameReached(&actual_frame_counter,1))
+ return;
+
+ PlayerMovPos += (PlayerMovPos > 0 ? -1 : 1) * TILEX/4;
+
+ if (ScreenMovPos)
+ {
+ ScreenMovPos = PlayerMovPos;
+ redraw_mask |= REDRAW_FIELD;
+ }
+
+ if (Feld[oldJX][oldJY] == EL_PLAYER_IS_LEAVING)
+ Feld[oldJX][oldJY] = EL_LEERRAUM;
+
+ DrawLevelElement(oldJX,oldJY, Feld[oldJX][oldJY]);
+ DrawPlayerField();
+
+
+
+ if (Store[oldJX][oldJY])
+ {
+ DrawGraphic(SCROLLX(oldJX),SCROLLY(oldJY),el2gfx(Store[oldJX][oldJY]));
+ DrawGraphicThruMask(SCROLLX(oldJX),SCROLLY(oldJY),
+ el2gfx(Feld[oldJX][oldJY]));
+ }
+ else if (Feld[oldJX][oldJY]==EL_DYNAMIT)
+ DrawDynamite(oldJX,oldJY);
+ else
+ DrawLevelField(oldJX,oldJY);
+
+ if (PlayerPushing)
+ {
+ int nextJX = JX + (JX - lastJX);
+ int nextJY = JY + (JY - lastJY);
+
+ if (PlayerMovPos)
+ {
+ if (Feld[nextJX][nextJY] == EL_SOKOBAN_FELD_VOLL)
+ DrawLevelElement(nextJX,nextJY, EL_SOKOBAN_FELD_LEER);
+ else
+ DrawLevelElement(nextJX,nextJY, EL_LEERRAUM);
+ }
+ else
+ DrawLevelElement(nextJX,nextJY, Feld[nextJX][nextJY]);
+ }
+
+ if (!PlayerMovPos)
+ {
+ lastJX = JX;
+ lastJY = JY;
+
+ oldJX = oldJY = -1;
+ }
+}
+