summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ffe5b4f)
* fixed drawing of animated "quicksand.filling" and "quicksand.emptying"
for both EMC and R'n'D graphics engine (heavy workarounds needed due
to massively broken handling of quicksand in R'n'D game engine)
* fixed off-limits access to array in DrawLevelFieldCrumbledSandExt()
+2007-09-17
+ * fixed drawing of animated "quicksand.filling" and "quicksand.emptying"
+ for both EMC and R'n'D graphics engine (heavy workarounds needed due
+ to massively broken handling of quicksand in R'n'D game engine)
+ * fixed off-limits access to array in DrawLevelFieldCrumbledSandExt()
+
2007-09-16
* fixed small bug in toon drawing (introduced when fixing the crash bug)
2007-09-16
* fixed small bug in toon drawing (introduced when fixing the crash bug)
-#define COMPILE_DATE_STRING "2007-09-17 02:41"
+#define COMPILE_DATE_STRING "2007-09-17 23:24"
else if (Feld[x][y + 1] == EL_QUICKSAND_EMPTY)
{
if (!MovDelay[x][y])
else if (Feld[x][y + 1] == EL_QUICKSAND_EMPTY)
{
if (!MovDelay[x][y])
MovDelay[x][y] = TILEY + 1;
MovDelay[x][y] = TILEY + 1;
+ ResetGfxAnimation(x, y);
+ ResetGfxAnimation(x, y + 1);
+ }
+
+ DrawLevelElement(x, y, EL_QUICKSAND_EMPTYING);
+ DrawLevelElement(x, y + 1, EL_QUICKSAND_FILLING);
+
MovDelay[x][y]--;
if (MovDelay[x][y])
return;
MovDelay[x][y]--;
if (MovDelay[x][y])
return;
else if (Feld[x][y + 1] == EL_QUICKSAND_FAST_EMPTY)
{
if (!MovDelay[x][y])
else if (Feld[x][y + 1] == EL_QUICKSAND_FAST_EMPTY)
{
if (!MovDelay[x][y])
MovDelay[x][y] = TILEY + 1;
MovDelay[x][y] = TILEY + 1;
+ ResetGfxAnimation(x, y);
+ ResetGfxAnimation(x, y + 1);
+ }
+
+ DrawLevelElement(x, y, EL_QUICKSAND_FAST_EMPTYING);
+ DrawLevelElement(x, y + 1, EL_QUICKSAND_FAST_FILLING);
+
MovDelay[x][y]--;
if (MovDelay[x][y])
return;
MovDelay[x][y]--;
if (MovDelay[x][y])
return;
DrawLevelElementExt(x, y, 0, 0, Feld[x][y], NO_CUTTING, USE_MASKING);
}
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;
static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
{
Bitmap *src_bitmap;
element = TILE_GFX_ELEMENT(x, y);
/* crumble field itself */
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))
if (GFX_CRUMBLED(element) && !IS_MOVING(x, y))
{
if (!IN_SCR_FIELD(sx, sy))
return;
{
if (!IN_SCR_FIELD(sx, sy))
return;
BorderElement);
/* check if neighbour field is of same type */
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;
if (GFX_CRUMBLED(element) && !IS_MOVING(xx, yy))
continue;
int sxx = sx + xy[i][0];
int syy = sy + xy[i][1];
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;
if (!IN_LEV_FIELD(xx, yy) ||
!IN_SCR_FIELD(sxx, syy) ||
IS_MOVING(xx, yy))
continue;
if (Feld[xx][yy] == EL_ELEMENT_SNAPPING)
continue;
element = TILE_GFX_ELEMENT(xx, yy);
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;
if (!GFX_CRUMBLED(element))
continue;
graphic = el_act2crm(element, ACTION_DEFAULT);
crumbled_border_size = graphic_info[graphic].border_size;
graphic = el_act2crm(element, ACTION_DEFAULT);
crumbled_border_size = graphic_info[graphic].border_size;
element = getBorderElement(lx, ly);
DrawScreenElement(x, y, element);
element = getBorderElement(lx, ly);
DrawScreenElement(x, y, element);
element == EL_DC_MAGIC_WALL_FILLING)
cut_mode = CUT_BELOW;
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 (cut_mode == CUT_ABOVE)
+#if 1
+ DrawScreenElement(x, y, element);
+#else
DrawScreenElementShifted(x, y, 0, 0, element, NO_CUTTING);
DrawScreenElementShifted(x, y, 0, 0, element, NO_CUTTING);
else
DrawScreenElement(x, y, EL_EMPTY);
else
DrawScreenElement(x, y, EL_EMPTY);
else if (cut_mode == NO_CUTTING)
DrawScreenElementShifted(x, y, 0, MovPos[lx][ly], element, cut_mode);
else
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);
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];
if (content == EL_ACID)
{
int dir = MovDir[lx][ly];