else if (Feld[x][y + 1] == EL_QUICKSAND_EMPTY)
{
if (!MovDelay[x][y])
+ {
MovDelay[x][y] = TILEY + 1;
+ ResetGfxAnimation(x, y);
+ ResetGfxAnimation(x, y + 1);
+ }
+
if (MovDelay[x][y])
{
+ DrawLevelElement(x, y, EL_QUICKSAND_EMPTYING);
+ DrawLevelElement(x, y + 1, EL_QUICKSAND_FILLING);
+
MovDelay[x][y]--;
if (MovDelay[x][y])
return;
else if (Feld[x][y + 1] == EL_QUICKSAND_FAST_EMPTY)
{
if (!MovDelay[x][y])
+ {
MovDelay[x][y] = TILEY + 1;
+ ResetGfxAnimation(x, y);
+ ResetGfxAnimation(x, y + 1);
+ }
+
if (MovDelay[x][y])
{
+ DrawLevelElement(x, y, EL_QUICKSAND_FAST_EMPTYING);
+ DrawLevelElement(x, y + 1, EL_QUICKSAND_FAST_FILLING);
+
MovDelay[x][y]--;
if (MovDelay[x][y])
return;
DrawLevelElementExt(x, y, 0, 0, Feld[x][y], NO_CUTTING, USE_MASKING);
}
+/* !!! implementation of quicksand is totally broken !!! */
+#define IS_CRUMBLED_TILE(x, y, e) \
+ (GFX_CRUMBLED(e) && (!IN_LEV_FIELD(x, y) || \
+ !IS_MOVING(x, y) || \
+ (e) == EL_QUICKSAND_EMPTYING || \
+ (e) == EL_QUICKSAND_FAST_EMPTYING))
+
static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
{
Bitmap *src_bitmap;
element = TILE_GFX_ELEMENT(x, y);
/* crumble field itself */
+#if 1
+ if (IS_CRUMBLED_TILE(x, y, element))
+#else
if (GFX_CRUMBLED(element) && !IS_MOVING(x, y))
+#endif
{
if (!IN_SCR_FIELD(sx, sy))
return;
BorderElement);
/* check if neighbour field is of same type */
+#if 1
+ if (IS_CRUMBLED_TILE(xx, yy, element))
+ continue;
+#else
if (GFX_CRUMBLED(element) && !IS_MOVING(xx, yy))
continue;
+#endif
if (i == 1 || i == 2)
{
int sxx = sx + xy[i][0];
int syy = sy + xy[i][1];
+#if 1
+ if (!IN_LEV_FIELD(xx, yy) ||
+ !IN_SCR_FIELD(sxx, syy))
+ continue;
+#else
if (!IN_LEV_FIELD(xx, yy) ||
!IN_SCR_FIELD(sxx, syy) ||
IS_MOVING(xx, yy))
continue;
+#endif
if (Feld[xx][yy] == EL_ELEMENT_SNAPPING)
continue;
element = TILE_GFX_ELEMENT(xx, yy);
+#if 1
+ if (!IS_CRUMBLED_TILE(xx, yy, element))
+ continue;
+#else
if (!GFX_CRUMBLED(element))
continue;
+#endif
graphic = el_act2crm(element, ACTION_DEFAULT);
crumbled_border_size = graphic_info[graphic].border_size;
element = getBorderElement(lx, ly);
DrawScreenElement(x, y, element);
+
return;
}
element == EL_DC_MAGIC_WALL_FILLING)
cut_mode = CUT_BELOW;
+#if 0
+ if (lx == 9 && ly == 1)
+ printf("::: %s [%d] [%d, %d] [%d]\n",
+ EL_NAME(TILE_GFX_ELEMENT(lx, ly)),
+ el_act2crm(TILE_GFX_ELEMENT(lx, ly), ACTION_DEFAULT),
+ element_info[EL_QUICKSAND_EMPTYING].graphic[ACTION_DEFAULT],
+ element_info[EL_QUICKSAND_EMPTYING].crumbled[ACTION_DEFAULT],
+ GFX_CRUMBLED(TILE_GFX_ELEMENT(lx, ly)));
+#endif
+
if (cut_mode == CUT_ABOVE)
+#if 1
+ DrawScreenElement(x, y, element);
+#else
DrawScreenElementShifted(x, y, 0, 0, element, NO_CUTTING);
+#endif
else
DrawScreenElement(x, y, EL_EMPTY);
else if (cut_mode == NO_CUTTING)
DrawScreenElementShifted(x, y, 0, MovPos[lx][ly], element, cut_mode);
else
+ {
DrawScreenElementShifted(x, y, 0, MovPos[lx][ly], content, cut_mode);
+#if 1
+ if (cut_mode == CUT_BELOW &&
+ IN_LEV_FIELD(lx, ly + 1) && IN_SCR_FIELD(x, y + 1))
+ DrawLevelElement(lx, ly + 1, element);
+#endif
+ }
+
if (content == EL_ACID)
{
int dir = MovDir[lx][ly];