/* forward declaration for internal use */
static void UnmapToolButtons();
static void HandleToolButtons(struct GadgetInfo *);
+static int el_act_dir2crm(int, int, int);
static struct GadgetInfo *tool_gadget[NUM_TOOL_BUTTONS];
static int request_gadget_id = -1;
return;
DrawGraphicAnimation(sx, sy, graphic);
+
+ if (CAN_BE_CRUMBLED(Feld[x][y]))
+ DrawLevelFieldCrumbledSand(x, y);
}
void DrawLevelElementAnimationIfNeeded(int x, int y, int element)
return;
DrawGraphicAnimation(sx, sy, graphic);
+
+ if (CAN_BE_CRUMBLED(element))
+ DrawLevelFieldCrumbledSand(x, y);
}
void DrawAllPlayers()
{
if (player_is_moving && GfxElement[jx][jy] != EL_UNDEFINED)
{
+#if 1
+ if (CAN_BE_CRUMBLED(GfxElement[jx][jy]))
+ DrawLevelFieldCrumbledSandDigging(jx, jy, move_dir, player->StepFrame);
+#else
if (GfxElement[jx][jy] == EL_SAND)
DrawLevelFieldCrumbledSandDigging(jx, jy, move_dir, player->StepFrame);
+#endif
else
{
int old_element = GfxElement[jx][jy];
void DrawLevelFieldCrumbledSandDigging(int x, int y, int direction,
int step_frame)
{
+#if 1
+ int graphic1 = el_act_dir2img(GfxElement[x][y], ACTION_DIGGING, direction);
+ int graphic2 = el_act_dir2crm(GfxElement[x][y], ACTION_DIGGING, direction);
+#else
int graphic1 = el_act_dir2img(EL_SAND, ACTION_DIGGING, direction);
int graphic2 = el_act_dir2img(EL_SAND_CRUMBLED, ACTION_DIGGING, direction);
+#endif
int frame1 = getGraphicAnimationFrame(graphic1, step_frame);
int frame2 = getGraphicAnimationFrame(graphic2, step_frame);
int sx = SCREENX(x), sy = SCREENY(y);
if (strlen(label_text) > 0)
{
- int text_width = strlen(label_text) * getFontWidth(font_nr);
- int lxpos = SX + (SXSIZE - text_width) / 2;
+ int lxpos = SX + (SXSIZE - getTextWidth(label_text, font_nr)) / 2;
int lypos = MICROLABEL_YPOS;
DrawText(lxpos, lypos, label_text, font_nr);
if (leveldir_current->name)
{
- int len = strlen(leveldir_current->name);
- int lxpos = SX + (SXSIZE - len * getFontWidth(FONT_TEXT_1)) / 2;
+ int text_width = getTextWidth(leveldir_current->name, FONT_TEXT_1);
+ int lxpos = SX + (SXSIZE - text_width) / 2;
int lypos = SY + 352;
DrawText(lxpos, lypos, leveldir_current->name, FONT_TEXT_1);
return element_info[element].direction_graphic[action][direction];
}
+static int el_act_dir2crm(int element, int action, int direction)
+{
+ element = GFX_ELEMENT(element);
+ direction = MV_DIR_BIT(direction);
+
+ return element_info[element].direction_crumbled[action][direction];
+}
+
int el_act2img(int element, int action)
{
element = GFX_ELEMENT(element);