X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=45d37436a325dec9840a38644e2fba606f3d4208;hb=cd2e7117917e6fda0cffd50acabc71ac4e2672ce;hp=744065cd5923675762f020124912bc5a78a6dd8e;hpb=0ef9c7d4b387b42f40d2f226920e306d588544f7;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 744065cd..45d37436 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1634,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); @@ -1671,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); @@ -1883,6 +1882,8 @@ boolean Request(char *text, unsigned int req_state) SetDrawBackgroundMask(REDRAW_FIELD | REDRAW_DOOR_1); + SetMouseCursor(CURSOR_DEFAULT); + while(result < 0) { if (PendingEvent())