{ EP_PASSABLE, "pass" },
{ -1, NULL }
};
-static int value_access_type = 0;
static struct ValueTextInfo options_access_layer[] =
{
{ EP_ACCESSIBLE_UNDER, "under" },
{ -1, NULL }
};
-static int value_access_layer = 0;
static struct ValueTextInfo options_walk_to_action[] =
{
{ EP_PUSHABLE, "pushable" },
{ -1, NULL }
};
-static int value_walk_to_action = 0;
static struct ValueTextInfo options_move_pattern[] =
{
{ EP_CAN_SMASH_EVERYTHING, "everything" },
{ -1, NULL }
};
-static int value_smash_targets = 0;
static struct ValueTextInfo options_deadliness[] =
{
{ EP_DONT_TOUCH, "touching" },
{ -1, NULL }
};
-static int value_deadliness = 0;
static struct ValueTextInfo options_consistency[] =
{
{ EP_INDESTRUCTIBLE, "indestructible" },
{ -1, NULL }
};
-static int value_consistency = 0;
static struct ValueTextInfo options_time_units[] =
{
{ CE_PUSHED_BY_PLAYER, "pushed" },
{ -1, NULL }
};
-static int value_change_player_action = 0;
static struct ValueTextInfo options_change_collide_action[] =
{
{ CE_SMASHED, "when smashed" },
{ -1, NULL }
};
-static int value_change_collide_action = 0;
static struct ValueTextInfo options_change_other_action[] =
{
{ CE_OTHER_GETS_COLLECTED, "player collects" },
{ -1, NULL }
};
-static int value_change_other_action = 0;
static struct ValueTextInfo options_change_power[] =
{
GADGET_ID_CUSTOM_ACCESS_TYPE,
-1,
options_access_type,
- &value_access_type,
+ &custom_element.access_type,
"player can", NULL, "type of access to this field"
},
{
GADGET_ID_CUSTOM_ACCESS_LAYER,
-1,
options_access_layer,
- &value_access_layer,
+ &custom_element.access_layer,
NULL, NULL, "layer of access for this field"
},
{
GADGET_ID_CUSTOM_WALK_TO_ACTION,
-1,
options_walk_to_action,
- &value_walk_to_action,
+ &custom_element.walk_to_action,
NULL, NULL, "diggable/collectible/pushable"
},
{
GADGET_ID_CUSTOM_SMASH_TARGETS,
-1,
options_smash_targets,
- &value_smash_targets,
+ &custom_element.smash_targets,
"can smash", NULL, "elements that can be smashed"
},
{
GADGET_ID_CUSTOM_DEADLINESS,
-1,
options_deadliness,
- &value_deadliness,
+ &custom_element.deadliness,
"deadly when", NULL, "deadliness of element"
},
{
GADGET_ID_CUSTOM_CONSISTENCY,
-1,
options_consistency,
- &value_consistency,
+ &custom_element.consistency,
NULL, "explodes to:", "consistency/destructibility"
},
GADGET_ID_CHANGE_PLAYER_ACTION,
-1,
options_change_player_action,
- &value_change_player_action,
+ &custom_element.change_player_action,
NULL, "by player", "type of player contact"
},
{
GADGET_ID_CHANGE_COLLIDE_ACTION,
-1,
options_change_collide_action,
- &value_change_collide_action,
+ &custom_element.change_collide_action,
NULL, NULL, "change after impact or smash"
},
{
GADGET_ID_CHANGE_OTHER_ACTION,
-1,
options_change_other_action,
- &value_change_other_action,
+ &custom_element.change_other_action,
NULL, "element:", "type of other element action"
},
{
}
};
-static boolean can_explode_by_fire = FALSE;
-static boolean can_explode_smashed = FALSE;
-static boolean can_explode_impact = FALSE;
-
static struct
{
int x, y;
{
ED_SETTINGS_XPOS(1), ED_SETTINGS_YPOS(13),
GADGET_ID_CUSTOM_EXPLODE_FIRE,
- &can_explode_by_fire,
+ &custom_element.can_explode_by_fire,
"by fire", "element can explode by fire/explosion"
},
{
ED_SETTINGS_XPOS(7), ED_SETTINGS_YPOS(13),
GADGET_ID_CUSTOM_EXPLODE_SMASH,
- &can_explode_smashed,
+ &custom_element.can_explode_smashed,
"smashed", "element can explode when smashed"
},
{
ED_SETTINGS_XPOS(13), ED_SETTINGS_YPOS(13),
GADGET_ID_CUSTOM_EXPLODE_IMPACT,
- &can_explode_impact,
+ &custom_element.can_explode_impact,
"impact", "element can explode on impact"
},
/* ---------- element settings: configure (custom elements) ------------- */
/* set accessible layer selectbox help value */
- value_access_type =
+ custom_element.access_type =
(IS_WALKABLE(element) ? EP_WALKABLE :
IS_PASSABLE(element) ? EP_PASSABLE :
- value_access_type);
- value_access_layer =
+ custom_element.access_type);
+ custom_element.access_layer =
(IS_ACCESSIBLE_OVER(element) ? EP_ACCESSIBLE_OVER :
IS_ACCESSIBLE_INSIDE(element) ? EP_ACCESSIBLE_INSIDE :
IS_ACCESSIBLE_UNDER(element) ? EP_ACCESSIBLE_UNDER :
- value_access_layer);
+ custom_element.access_layer);
custom_element_properties[EP_ACCESSIBLE] =
(IS_ACCESSIBLE_OVER(element) ||
IS_ACCESSIBLE_INSIDE(element) ||
IS_ACCESSIBLE_UNDER(element));
/* set walk-to-object action selectbox help value */
- value_walk_to_action =
+ custom_element.walk_to_action =
(IS_DIGGABLE(element) ? EP_DIGGABLE :
IS_COLLECTIBLE(element) ? EP_COLLECTIBLE :
IS_PUSHABLE(element) ? EP_PUSHABLE :
- value_walk_to_action);
+ custom_element.walk_to_action);
custom_element_properties[EP_WALK_TO_OBJECT] =
(IS_DIGGABLE(element) ||
IS_COLLECTIBLE(element) ||
IS_PUSHABLE(element));
/* set smash targets selectbox help value */
- value_smash_targets =
+ custom_element.smash_targets =
(CAN_SMASH_EVERYTHING(element) ? EP_CAN_SMASH_EVERYTHING :
CAN_SMASH_ENEMIES(element) ? EP_CAN_SMASH_ENEMIES :
CAN_SMASH_PLAYER(element) ? EP_CAN_SMASH_PLAYER :
- value_smash_targets);
+ custom_element.smash_targets);
custom_element_properties[EP_CAN_SMASH] =
(CAN_SMASH_EVERYTHING(element) ||
CAN_SMASH_ENEMIES(element) ||
CAN_SMASH_PLAYER(element));
/* set deadliness selectbox help value */
- value_deadliness =
+ custom_element.deadliness =
(DONT_TOUCH(element) ? EP_DONT_TOUCH :
DONT_COLLIDE_WITH(element) ? EP_DONT_COLLIDE_WITH :
DONT_RUN_INTO(element) ? EP_DONT_RUN_INTO :
- value_deadliness);
+ custom_element.deadliness);
custom_element_properties[EP_DEADLY] =
(DONT_TOUCH(element) ||
DONT_COLLIDE_WITH(element) ||
DONT_RUN_INTO(element));
/* set consistency selectbox help value */
- value_consistency =
+ custom_element.consistency =
(IS_INDESTRUCTIBLE(element) ? EP_INDESTRUCTIBLE :
CAN_EXPLODE(element) ? EP_CAN_EXPLODE :
- value_consistency);
+ custom_element.consistency);
custom_element_properties[EP_EXPLODE_RESULT] =
(IS_INDESTRUCTIBLE(element) ||
CAN_EXPLODE(element));
/* special case: sub-settings dependent from main setting */
- if (CAN_EXPLODE(element))
- {
- can_explode_by_fire = CAN_EXPLODE_BY_FIRE(element);
- can_explode_smashed = CAN_EXPLODE_SMASHED(element);
- can_explode_impact = CAN_EXPLODE_IMPACT(element);
- };
+ if (CAN_EXPLODE_BY_FIRE(element))
+ custom_element.can_explode_by_fire = TRUE;
+ if (CAN_EXPLODE_SMASHED(element))
+ custom_element.can_explode_smashed = TRUE;
+ if (CAN_EXPLODE_IMPACT(element))
+ custom_element.can_explode_impact = TRUE;
/* ---------- element settings: advanced (custom elements) --------------- */
/* set change by player selectbox help value */
- value_change_player_action =
+ custom_element.change_player_action =
(HAS_CHANGE_EVENT(element, CE_PUSHED_BY_PLAYER) ? CE_PUSHED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_PRESSED_BY_PLAYER) ? CE_PRESSED_BY_PLAYER :
HAS_CHANGE_EVENT(element, CE_TOUCHED_BY_PLAYER) ? CE_TOUCHED_BY_PLAYER :
- value_change_player_action);
+ custom_element.change_player_action);
/* set change by collision selectbox help value */
- value_change_collide_action =
+ custom_element.change_collide_action =
(HAS_CHANGE_EVENT(element, CE_SMASHED) ? CE_SMASHED :
HAS_CHANGE_EVENT(element, CE_IMPACT) ? CE_IMPACT :
HAS_CHANGE_EVENT(element, CE_COLLISION) ? CE_COLLISION :
- value_change_collide_action);
+ custom_element.change_collide_action);
/* set change by other element action selectbox help value */
- value_change_other_action =
+ custom_element.change_other_action =
(HAS_CHANGE_EVENT(element, CE_OTHER_GETS_COLLECTED) ? CE_OTHER_GETS_COLLECTED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_PUSHED) ? CE_OTHER_GETS_PUSHED :
HAS_CHANGE_EVENT(element, CE_OTHER_GETS_PRESSED) ? CE_OTHER_GETS_PRESSED :
HAS_CHANGE_EVENT(element, CE_OTHER_IS_EXPLODING) ? CE_OTHER_IS_EXPLODING :
HAS_CHANGE_EVENT(element, CE_OTHER_IS_CHANGING) ? CE_OTHER_IS_CHANGING :
HAS_CHANGE_EVENT(element, CE_OTHER_IS_TOUCHING) ? CE_OTHER_IS_TOUCHING :
- value_change_other_action);
+ custom_element.change_other_action);
}
static void CopyCustomElementPropertiesToGame(int element)
{
int i;
+ int access_type_and_layer;
element_info[properties_element] = custom_element;
custom_element_properties[EP_PASSABLE_OVER] = FALSE;
custom_element_properties[EP_PASSABLE_INSIDE] = FALSE;
custom_element_properties[EP_PASSABLE_UNDER] = FALSE;
- custom_element_properties[((value_access_type == EP_WALKABLE ?
- EP_WALKABLE_OVER : EP_PASSABLE_OVER) +
- (value_access_layer - EP_ACCESSIBLE_OVER))] =
+ access_type_and_layer = ((custom_element.access_type == EP_WALKABLE ?
+ EP_WALKABLE_OVER : EP_PASSABLE_OVER) +
+ (custom_element.access_layer - EP_ACCESSIBLE_OVER));
+ custom_element_properties[access_type_and_layer] =
custom_element_properties[EP_ACCESSIBLE];
/* set walk-to-object property from checkbox and selectbox */
custom_element_properties[EP_DIGGABLE] = FALSE;
custom_element_properties[EP_COLLECTIBLE] = FALSE;
custom_element_properties[EP_PUSHABLE] = FALSE;
- custom_element_properties[value_walk_to_action] =
+ custom_element_properties[custom_element.walk_to_action] =
custom_element_properties[EP_WALK_TO_OBJECT];
/* set smash property from checkbox and selectbox */
custom_element_properties[EP_CAN_SMASH_PLAYER] = FALSE;
custom_element_properties[EP_CAN_SMASH_ENEMIES] = FALSE;
custom_element_properties[EP_CAN_SMASH_EVERYTHING] = FALSE;
- custom_element_properties[value_smash_targets] =
+ custom_element_properties[custom_element.smash_targets] =
custom_element_properties[EP_CAN_SMASH];
/* set deadliness property from checkbox and selectbox */
custom_element_properties[EP_DONT_RUN_INTO] = FALSE;
custom_element_properties[EP_DONT_COLLIDE_WITH] = FALSE;
custom_element_properties[EP_DONT_TOUCH] = FALSE;
- custom_element_properties[value_deadliness] =
+ custom_element_properties[custom_element.deadliness] =
custom_element_properties[EP_DEADLY];
/* set consistency property from checkbox and selectbox */
custom_element_properties[EP_CAN_EXPLODE_BY_FIRE] = FALSE;
custom_element_properties[EP_CAN_EXPLODE_SMASHED] = FALSE;
custom_element_properties[EP_CAN_EXPLODE_IMPACT] = FALSE;
- custom_element_properties[value_consistency] =
+ custom_element_properties[custom_element.consistency] =
custom_element_properties[EP_EXPLODE_RESULT];
/* special case: sub-settings dependent from main setting */
if (custom_element_properties[EP_CAN_EXPLODE])
{
- custom_element_properties[EP_CAN_EXPLODE_BY_FIRE] = can_explode_by_fire;
- custom_element_properties[EP_CAN_EXPLODE_SMASHED] = can_explode_smashed;
- custom_element_properties[EP_CAN_EXPLODE_IMPACT] = can_explode_impact;
+ custom_element_properties[EP_CAN_EXPLODE_BY_FIRE] =
+ custom_element.can_explode_by_fire;
+ custom_element_properties[EP_CAN_EXPLODE_SMASHED] =
+ custom_element.can_explode_smashed;
+ custom_element_properties[EP_CAN_EXPLODE_IMPACT] =
+ custom_element.can_explode_impact;
}
/* ---------- element settings: advanced (custom elements) --------------- */
custom_element_change_events[CE_TOUCHED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_PRESSED_BY_PLAYER] = FALSE;
custom_element_change_events[CE_PUSHED_BY_PLAYER] = FALSE;
- custom_element_change_events[value_change_player_action] =
+ custom_element_change_events[custom_element.change_player_action] =
custom_element_change_events[CE_BY_PLAYER];
/* set collision change event from checkbox and selectbox */
custom_element_change_events[CE_COLLISION] = FALSE;
custom_element_change_events[CE_IMPACT] = FALSE;
custom_element_change_events[CE_SMASHED] = FALSE;
- custom_element_change_events[value_change_collide_action] =
+ custom_element_change_events[custom_element.change_collide_action] =
custom_element_change_events[CE_BY_COLLISION];
/* set other element action change event from checkbox and selectbox */
custom_element_change_events[CE_OTHER_GETS_PRESSED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_PUSHED] = FALSE;
custom_element_change_events[CE_OTHER_GETS_COLLECTED] = FALSE;
- custom_element_change_events[value_change_other_action] =
+ custom_element_change_events[custom_element.change_other_action] =
custom_element_change_events[CE_BY_OTHER];
for (i=0; i < NUM_ELEMENT_PROPERTIES; i++)
int gd_y = gd->y + gd_gi->height - 1;
Pixel tab_color = GetPixel(gd->bitmap, gd_x, gd_y);
int id_first = ED_TEXTBUTTON_ID_PROPERTIES_INFO;
-#if 1
int id_last = ED_TEXTBUTTON_ID_PROPERTIES_CONFIG;
-#else
- int id_last = ED_TEXTBUTTON_ID_PROPERTIES_INFO;
-#endif
int i;
-#if 0
- /* draw additional "configure" tabulator for configurable elements */
- if (checkPropertiesConfig())
- id_last = ED_TEXTBUTTON_ID_PROPERTIES_CONFIG;
-#endif
-
/* draw additional "advanced" tabulator for custom elements */
if (IS_CUSTOM_ELEMENT(properties_element))
id_last = ED_TEXTBUTTON_ID_PROPERTIES_ADVANCED;
!IS_CUSTOM_ELEMENT(properties_element))
edit_mode_properties = ED_MODE_PROPERTIES_CONFIG;
-#if 0
- if (edit_mode_properties == ED_MODE_PROPERTIES_CONFIG &&
- !checkPropertiesConfig())
- edit_mode_properties = ED_MODE_PROPERTIES_INFO;
-#endif
-
if (IS_CUSTOM_ELEMENT(properties_element))
CopyCustomElementPropertiesToEditor(properties_element);
static void TestIfPlayerTouchesCustomElement(int, int);
static void TestIfElementTouchesCustomElement(int, int);
-static boolean CheckTriggeredElementChange(int, int);
+static boolean CheckTriggeredElementChange(int, int, int, int);
static boolean CheckElementChange(int, int, int, int);
static void ChangeElementNow(int, int, int);
break;
}
- CheckTriggeredElementChange(element, CE_OTHER_IS_EXPLODING);
+ CheckTriggeredElementChange(x, y, element, CE_OTHER_IS_EXPLODING);
}
void SplashAcid(int x, int y)
int direction = MovDir[x][y];
int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0);
- int horiz_move = (dx != 0);
int newx = x + dx, newy = y + dy;
int nextx = newx + dx, nexty = newy + dy;
-#if 1
+ int horiz_move = (dx != 0);
int sign = (horiz_move ? dx : dy);
int step = sign * element_info[element].move_stepsize;
-#else
- int step = (horiz_move ? dx : dy) * MOVE_STEPSIZE_NORMAL;
-#endif
boolean pushed = Pushed[x][y];
-#if 1
- if (CAN_FALL(element) && horiz_move &&
- y < lev_fieldy - 1 && IS_BELT_ACTIVE(Feld[x][y + 1]))
- step = sign * MOVE_STEPSIZE_NORMAL / 2;
- else if (element == EL_SPRING && horiz_move)
- step = sign * MOVE_STEPSIZE_NORMAL * 2;
-#else
- if (element == EL_AMOEBA_DROP || element == EL_AMOEBA_DROPPING)
- step /= 2;
- else if (element == EL_QUICKSAND_FILLING ||
- element == EL_QUICKSAND_EMPTYING)
- step /= 4;
- else if (element == EL_MAGIC_WALL_FILLING ||
- element == EL_BD_MAGIC_WALL_FILLING ||
- element == EL_MAGIC_WALL_EMPTYING ||
- element == EL_BD_MAGIC_WALL_EMPTYING)
- step /= 2;
- else if (CAN_FALL(element) && horiz_move &&
- y < lev_fieldy-1 && IS_BELT_ACTIVE(Feld[x][y+1]))
- step /= 2;
- else if (element == EL_SPRING && horiz_move)
- step *= 2;
- else if (IS_CUSTOM_ELEMENT(element))
- step = SIGN(step) * element_info[element].move_stepsize;
-
-#if OLD_GAME_BEHAVIOUR
- else if (CAN_FALL(element) && horiz_move && !IS_SP_ELEMENT(element))
- step*=2;
-#endif
-#endif
+ /* special values for move stepsize for spring and things on conveyor belt */
+ if (horiz_move)
+ {
+ if (CAN_FALL(element) &&
+ y < lev_fieldy - 1 && IS_BELT_ACTIVE(Feld[x][y + 1]))
+ step = sign * MOVE_STEPSIZE_NORMAL / 2;
+ else if (element == EL_SPRING)
+ step = sign * MOVE_STEPSIZE_NORMAL * 2;
+ }
MovPos[x][y] += step;
if (element == EL_MOLE)
{
- int i;
- static int xy[4][2] =
- {
- { 0, -1 },
- { -1, 0 },
- { +1, 0 },
- { 0, +1 }
- };
-
Feld[x][y] = EL_SAND;
- DrawLevelField(x, y);
- for(i=0; i<4; i++)
- {
- int xx, yy;
-
- xx = x + xy[i][0];
- yy = y + xy[i][1];
-
- if (IN_LEV_FIELD(xx, yy) && Feld[xx][yy] == EL_SAND)
- DrawLevelField(xx, yy); /* for "crumbled sand" */
- }
+ DrawLevelFieldCrumbledSandNeighbours(x, y);
}
-
- if (element == EL_QUICKSAND_FILLING)
+ else if (element == EL_QUICKSAND_FILLING)
{
element = Feld[newx][newy] = get_next_element(element);
Store[newx][newy] = Store[x][y];
DrawLevelField(x, y);
if (CAN_BE_CRUMBLED(Feld[x][y]))
- {
- int sx = SCREENX(x), sy = SCREENY(y);
- static int xy[4][2] =
- {
- { 0, -1 },
- { -1, 0 },
- { +1, 0 },
- { 0, +1 }
- };
- int i;
-
- for(i=0; i<4; i++)
- {
- int xx = x + xy[i][0];
- int yy = y + xy[i][1];
- int sxx = sx + xy[i][0];
- int syy = sy + xy[i][1];
-
- if (!IN_LEV_FIELD(xx, yy) ||
- !IN_SCR_FIELD(sxx, syy) ||
- !CAN_BE_CRUMBLED(Feld[xx][yy]) ||
- IS_MOVING(xx, yy))
- continue;
-
- DrawLevelField(xx, yy);
- }
- }
+ DrawLevelFieldCrumbledSandNeighbours(x, y);
}
static void ChangeElementNow(int x, int y, int element)
{
struct ElementChangeInfo *change = &element_info[element].change;
- CheckTriggeredElementChange(Feld[x][y], CE_OTHER_IS_CHANGING);
+ CheckTriggeredElementChange(x, y, Feld[x][y], CE_OTHER_IS_CHANGING);
if (change->explode)
{
}
}
-static boolean CheckTriggeredElementChange(int trigger_element,
+static boolean CheckTriggeredElementChange(int lx, int ly, int trigger_element,
int trigger_event)
{
int i, x, y;
for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
{
+ if (x == lx && y == ly) /* do not change trigger element itself */
+ continue;
+
if (Feld[x][y] == i)
{
ChangeDelay[x][y] = 1;
if (center_is_player)
{
- CheckTriggeredElementChange(Feld[xx][yy], CE_OTHER_GETS_TOUCHED);
+ CheckTriggeredElementChange(xx, yy, Feld[xx][yy], CE_OTHER_GETS_TOUCHED);
CheckElementChange(xx, yy, Feld[xx][yy], CE_TOUCHED_BY_PLAYER);
}
else if (IS_PLAYER(xx, yy))
{
- CheckTriggeredElementChange(Feld[x][y], CE_OTHER_GETS_TOUCHED);
+ CheckTriggeredElementChange(x, y, Feld[x][y], CE_OTHER_GETS_TOUCHED);
CheckElementChange(x, y, Feld[x][y], CE_TOUCHED_BY_PLAYER);
break;
RaiseScoreElement(element);
PlaySoundLevelElementAction(x, y, element, ACTION_COLLECTING);
- CheckTriggeredElementChange(element, CE_OTHER_GETS_COLLECTED);
+ CheckTriggeredElementChange(x, y, element, CE_OTHER_GETS_COLLECTED);
break;
}
if (game.engine_version < RELEASE_IDENT(2,2,0,7))
player->push_delay_value = GET_NEW_PUSH_DELAY(element);
- CheckTriggeredElementChange(element, CE_OTHER_GETS_PUSHED);
+ CheckTriggeredElementChange(x, y, element, CE_OTHER_GETS_PUSHED);
CheckElementChange(x, y, element, CE_PUSHED_BY_PLAYER);
break;
}
else
{
- CheckTriggeredElementChange(element, CE_OTHER_GETS_PRESSED);
+ CheckTriggeredElementChange(x, y, element, CE_OTHER_GETS_PRESSED);
CheckElementChange(x, y, element, CE_PRESSED_BY_PLAYER);
}
MarkTileDirty(x, y);
}
-#if 0
-void DrawOldGraphicExt(DrawBuffer *dst_bitmap, int x, int y, int graphic)
-{
- Bitmap *src_bitmap;
- int src_x, src_y;
-
- getOldGraphicSource(graphic, &src_bitmap, &src_x, &src_y);
- BlitBitmap(src_bitmap, dst_bitmap, src_x, src_y, TILEX, TILEY, x, y);
-}
-#endif
-
void DrawGraphicExt(DrawBuffer *dst_bitmap, int x, int y, int graphic,
int frame)
{
-#if 1
Bitmap *src_bitmap;
int src_x, src_y;
getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
-#else
- Bitmap *src_bitmap = graphic_info[graphic].bitmap;
- int src_x = graphic_info[graphic].src_x;
- int src_y = graphic_info[graphic].src_y;
- int offset_x = graphic_info[graphic].offset_x;
- int offset_y = graphic_info[graphic].offset_y;
-
- src_x += frame * offset_x;
- src_y += frame * offset_y;
-#endif
-
BlitBitmap(src_bitmap, dst_bitmap, src_x, src_y, TILEX, TILEY, x, y);
}
frame = graphic_info[graphic].anim_frames - 1;
}
}
-#if 0
- else if (IS_AMOEBOID(element) || element == EL_AMOEBA_DROPPING)
- {
- graphic = (element == EL_BD_AMOEBA ? IMG_BD_AMOEBA_PART1 :
- element == EL_AMOEBA_WET ? IMG_AMOEBA_WET_PART1 :
- element == EL_AMOEBA_DRY ? IMG_AMOEBA_DRY_PART1 :
- element == EL_AMOEBA_FULL ? IMG_AMOEBA_FULL_PART1 :
- IMG_AMOEBA_DEAD_PART1);
-
- graphic += (x + 2 * y + 4) % 4;
- }
-#endif
-
-#if 0
- if (IS_AMOEBOID(element) || element == EL_AMOEBA_DROPPING)
- {
- if (Feld[lx][ly] == EL_AMOEBA_DROPPING)
- printf("---> %d -> %d / %d [%d]\n",
- element, graphic, frame, GfxRandom[lx][ly]);
- }
-#endif
if (dx || dy)
DrawGraphicShifted(x, y, dx, dy, graphic, frame, cut_mode, mask_mode);
DrawLevelElementExt(x, y, dx, dy, element, cut_mode, NO_MASKING);
}
-#if 0
-void DrawOldScreenElementThruMask(int x, int y, int element)
-{
- DrawOldScreenElementExt(x, y, 0, 0, element, NO_CUTTING, USE_MASKING);
-}
-
-void DrawScreenElementThruMask(int x, int y, int element)
-{
- DrawScreenElementExt(x, y, 0, 0, element, NO_CUTTING, USE_MASKING);
-}
-#endif
-
void DrawLevelElementThruMask(int x, int y, int element)
{
DrawLevelElementExt(x, y, 0, 0, element, NO_CUTTING, USE_MASKING);
int xx = x + xy[i][0];
int yy = y + xy[i][1];
- element = (IN_LEV_FIELD(xx, yy) ? Feld[xx][yy] : EL_STEELWALL);
+ element = (IN_LEV_FIELD(xx, yy) ? Feld[xx][yy] : BorderElement);
/* check if neighbour field is of same type */
if (CAN_BE_CRUMBLED(element) && !IS_MOVING(xx, yy))
DrawLevelFieldCrumbledSandExt(x, y, graphic2, frame2);
}
+void DrawLevelFieldCrumbledSandNeighbours(int x, int y)
+{
+ int sx = SCREENX(x), sy = SCREENY(y);
+ static int xy[4][2] =
+ {
+ { 0, -1 },
+ { -1, 0 },
+ { +1, 0 },
+ { 0, +1 }
+ };
+ int i;
+
+ for(i=0; i<4; i++)
+ {
+ int xx = x + xy[i][0];
+ int yy = y + xy[i][1];
+ int sxx = sx + xy[i][0];
+ int syy = sy + xy[i][1];
+
+ if (!IN_LEV_FIELD(xx, yy) ||
+ !IN_SCR_FIELD(sxx, syy) ||
+ !CAN_BE_CRUMBLED(Feld[xx][yy]) ||
+ IS_MOVING(xx, yy))
+ continue;
+
+ DrawLevelField(xx, yy);
+ }
+}
+
static int getBorderElement(int x, int y)
{
int border[7][2] =
int src_x = mini_startx + graphic_info[graphic].src_x / 8;
int src_y = mini_starty + graphic_info[graphic].src_y / 8;
-#if 0
- if (src_x + MICRO_TILEX > src_bitmap->width ||
- src_y + MICRO_TILEY > src_bitmap->height)
- {
- /* graphic of desired size seems not to be contained in this image;
- dirty workaround: get it from the middle of the normal sized image */
-
- getGraphicSource(graphic, 0, &src_bitmap, &src_x, &src_y);
- src_x += (TILEX / 2 - MICRO_TILEX / 2);
- src_y += (TILEY / 2 - MICRO_TILEY / 2);
- }
-#endif
-
*bitmap = src_bitmap;
*x = src_x;
*y = src_y;