rnd-20070131-1-src
[rocksndiamonds.git] / src / tools.c
index d68819823f2fdeb5db4eceb610aa22db4f848226..ca1970ca630ecf369b94df76cf858eee1e717049 100644 (file)
@@ -1778,7 +1778,7 @@ static void DrawPreviewLevelExt(int from_x, int from_y)
 #define MICROLABEL_IMPORTED_BY_HEAD    6
 #define MICROLABEL_IMPORTED_BY         7
 
-static int getMaxTextLength(struct MenuPosInfo *pos, int font_nr)
+static int getMaxTextLength(struct TextPosInfo *pos, int font_nr)
 {
   int max_text_width = SXSIZE;
   int font_width = getFontWidth(font_nr);
@@ -1795,7 +1795,7 @@ static int getMaxTextLength(struct MenuPosInfo *pos, int font_nr)
 
 static void DrawPreviewLevelLabelExt(int mode)
 {
-  struct MenuPosInfo *pos = &menu.main.text.level_info_2;
+  struct TextPosInfo *pos = &menu.main.text.level_info_2;
   char label_text[MAX_OUTPUT_LINESIZE + 1];
   int max_len_label_text;
   int font_nr = FONT_TEXT_2;
@@ -1812,6 +1812,11 @@ static void DrawPreviewLevelLabelExt(int mode)
   max_len_label_text = SXSIZE / getFontWidth(font_nr);
 #endif
 
+#if 1
+  if (pos->chars != -1)
+    max_len_label_text = pos->chars;
+#endif
+
   for (i = 0; i < max_len_label_text; i++)
     label_text[i] = ' ';
   label_text[max_len_label_text] = '\0';
@@ -1898,7 +1903,7 @@ void DrawPreviewLevel(boolean restart)
 
     if (leveldir_current->name)
     {
-      struct MenuPosInfo *pos = &menu.main.text.level_info_1;
+      struct TextPosInfo *pos = &menu.main.text.level_info_1;
       char label_text[MAX_OUTPUT_LINESIZE + 1];
       int font_nr = FONT_TEXT_1;
 #if 1
@@ -1911,6 +1916,11 @@ void DrawPreviewLevel(boolean restart)
       int lxpos, lypos;
 #endif
 
+#if 1
+      if (pos->chars != -1)
+       max_len_label_text = pos->chars;
+#endif
+
       strncpy(label_text, leveldir_current->name, max_len_label_text);
       label_text[max_len_label_text] = '\0';