rnd-20050523-1-src
[rocksndiamonds.git] / src / tools.c
index 794de36ea7f860ad80e9e5c06cd3f3767ec9f79b..13ba83016fafe96ae2223c1d6363f80dc0116966 100644 (file)
@@ -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;