X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftools.c;h=9b5873b5cc3a920c636bb21ec8bab50e7b76fec6;hb=ad8306cba93c058f00e21871a290302ce728d6b8;hp=97853144b22e327fa06080fe9c3097fc6758e7f8;hpb=4386c0ac1665619412148f1eb907f6d366a70d7d;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 97853144..9b5873b5 100644 --- a/src/tools.c +++ b/src/tools.c @@ -504,6 +504,9 @@ inline void DrawLevelGraphicAnimationIfNeeded(int x, int y, int graphic) return; DrawGraphicAnimation(sx, sy, graphic); + + if (CAN_BE_CRUMBLED(Feld[x][y])) + DrawLevelFieldCrumbledSand(x, y); } void DrawLevelElementAnimationIfNeeded(int x, int y, int element) @@ -520,6 +523,9 @@ void DrawLevelElementAnimationIfNeeded(int x, int y, int element) return; DrawGraphicAnimation(sx, sy, graphic); + + if (CAN_BE_CRUMBLED(element)) + DrawLevelFieldCrumbledSand(x, y); } void DrawAllPlayers() @@ -1628,8 +1634,7 @@ static void DrawMicroLevelLabelExt(int mode) 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); @@ -1665,8 +1670,8 @@ void DrawMicroLevel(int xpos, int ypos, boolean restart) 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);