X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=inline;f=src%2Ftools.c;h=13ba83016fafe96ae2223c1d6363f80dc0116966;hb=983b7bc7f3493b1522d08d8e7bdecb3bd8e462eb;hp=794de36ea7f860ad80e9e5c06cd3f3767ec9f79b;hpb=fda8c9f42aa13663ad6b2f698da787a7280b9965;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 794de36e..13ba8301 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1552,6 +1552,7 @@ static void DrawMicroLevelLabelExt(int mode) char label_text[MAX_OUTPUT_LINESIZE + 1]; int max_len_label_text; int font_nr = FONT_TEXT_2; + int i; if (mode == MICROLABEL_LEVEL_AUTHOR_HEAD || mode == MICROLABEL_IMPORTED_FROM_HEAD || @@ -1560,8 +1561,26 @@ static void DrawMicroLevelLabelExt(int mode) max_len_label_text = SXSIZE / getFontWidth(font_nr); +#if 1 + + for (i = 0; i < max_len_label_text; i++) + label_text[i] = ' '; + label_text[max_len_label_text] = '\0'; + + if (strlen(label_text) > 0) + { + int lxpos = SX + (SXSIZE - getTextWidth(label_text, font_nr)) / 2; + int lypos = MICROLABEL2_YPOS; + + DrawText(lxpos, lypos, label_text, font_nr); + } + +#else + DrawBackground(SX, MICROLABEL2_YPOS, SXSIZE, getFontHeight(font_nr)); +#endif + strncpy(label_text, (mode == MICROLABEL_LEVEL_NAME ? level.name : mode == MICROLABEL_LEVEL_AUTHOR_HEAD ? "created by" : @@ -1680,9 +1699,11 @@ void DrawMicroLevel(int xpos, int ypos, boolean restart) { int max_label_counter = 23; - if (leveldir_current->imported_from != NULL) + if (leveldir_current->imported_from != NULL && + strlen(leveldir_current->imported_from) > 0) max_label_counter += 14; - if (leveldir_current->imported_by != NULL) + if (leveldir_current->imported_by != NULL && + strlen(leveldir_current->imported_by) > 0) max_label_counter += 14; label_counter = (label_counter + 1) % max_label_counter;