+#if 0
+ printf("-0- T3.P: %d, %d\n",
+ font_info[FONT_TEXT_3].special_graphic[GFX_SPECIAL_ARG_PREVIEW],
+ font_info[FONT_TEXT_3].special_bitmap_id[GFX_SPECIAL_ARG_PREVIEW]);
+
+ printf("-0- T4.M: %d, %d\n",
+ font_info[FONT_TEXT_4].special_graphic[GFX_SPECIAL_ARG_MAIN],
+ font_info[FONT_TEXT_4].special_bitmap_id[GFX_SPECIAL_ARG_MAIN]);
+#endif
+
+#if 1
+ /* correct special font/graphic mapping for cloned fonts
+ (per definition only needed for static configuration) */
+ for (i = 0; font_to_graphic[i].font_nr > -1; i++)
+ {
+ int font_nr = font_to_graphic[i].font_nr;
+ int special = font_to_graphic[i].special;
+ int graphic = font_to_graphic[i].graphic;
+#if 0
+ int base_graphic = font2baseimg(font_nr);
+#endif
+
+ if (special >= 0 && special < NUM_SPECIAL_GFX_ARGS)
+ {
+#if 0
+ boolean base_redefined =
+ getImageListEntryFromImageID(base_graphic)->redefined;
+#endif
+ boolean special_redefined =
+ getImageListEntryFromImageID(graphic)->redefined;
+ boolean special_cloned = (graphic_info[graphic].clone_from != -1);
+
+ if (special_cloned && !special_redefined)
+ {
+ int j;
+
+#if 0
+ printf(":2: %d, %d, %d / %d, %d, %d\n",
+ font_nr, special, graphic,
+ base_redefined, special_redefined, special_cloned);
+#endif
+
+ for (j = 0; font_to_graphic[j].font_nr > -1; j++)
+ {
+ int font_nr2 = font_to_graphic[j].font_nr;
+ int special2 = font_to_graphic[j].special;
+ int graphic2 = font_to_graphic[j].graphic;
+#if 0
+ int base_graphic2 = font2baseimg(font_nr2);
+#endif
+
+ if (graphic2 == graphic_info[graphic].clone_from)
+ {
+#if 0
+ printf(":2.1: %d, %d, %d, %d\n",
+ font_nr2, special2, graphic2, base_graphic2);
+#endif
+
+#if 1
+ font_info[font_nr].special_graphic[special] =
+ font_info[font_nr2].special_graphic[special2];
+ font_info[font_nr].special_bitmap_id[special] =
+ font_info[font_nr2].special_bitmap_id[special2];
+#else
+#if 1
+ font_info[font_nr].special_graphic[special] = graphic2;
+ font_info[font_nr].special_bitmap_id[special] =
+ font_info[font_nr2].special_bitmap_id[special2];
+#else
+ font_info[font_nr].special_graphic[special] = graphic2;
+ font_info[font_nr].special_bitmap_id[special] = num_font_bitmaps;
+ num_font_bitmaps++;
+#endif
+#endif
+ }
+ }
+ }
+ }
+ }
+#endif
+
+ /* reset non-redefined ".active" font graphics if normal font is redefined */
+ /* (this different treatment is needed because normal and active fonts are
+ independently defined ("active" is not a property of font definitions!) */
+ for (i = 0; i < NUM_FONTS; i++)
+ {
+ int font_nr_base = i;
+ int font_nr_active = FONT_ACTIVE(font_nr_base);
+
+ /* check only those fonts with exist as normal and ".active" variant */
+ if (font_nr_base != font_nr_active)
+ {
+ int base_graphic = font_info[font_nr_base].graphic;
+ int active_graphic = font_info[font_nr_active].graphic;
+ boolean base_redefined =
+ getImageListEntryFromImageID(base_graphic)->redefined;
+ boolean active_redefined =
+ getImageListEntryFromImageID(active_graphic)->redefined;
+
+ /* if the base font ("font.menu_1", for example) has been redefined,
+ but not the active font ("font.menu_1.active", for example), do not
+ use an existing (in this case considered obsolete) active font
+ anymore, but use the automatically determined default font */
+ if (base_redefined && !active_redefined)
+ font_info[font_nr_active].graphic = base_graphic;
+
+ /* now also check each "special" font (which may be the same as above) */
+ for (j = 0; j < NUM_SPECIAL_GFX_ARGS; j++)
+ {
+ int base_graphic = font_info[font_nr_base].special_graphic[j];
+ int active_graphic = font_info[font_nr_active].special_graphic[j];
+ boolean base_redefined =
+ getImageListEntryFromImageID(base_graphic)->redefined;
+ boolean active_redefined =
+ getImageListEntryFromImageID(active_graphic)->redefined;
+
+ /* same as above, but check special graphic definitions, for example:
+ redefined "font.menu_1.MAIN" invalidates "font.menu_1.active.MAIN" */
+ if (base_redefined && !active_redefined)
+ {
+ font_info[font_nr_active].special_graphic[j] =
+ font_info[font_nr_base].special_graphic[j];
+ font_info[font_nr_active].special_bitmap_id[j] =
+ font_info[font_nr_base].special_bitmap_id[j];
+ }
+ }
+ }
+ }
+
+#if 0
+ printf("-1- T4.M: %d, %d\n",
+ font_info[FONT_TEXT_4].special_graphic[GFX_SPECIAL_ARG_MAIN],
+ font_info[FONT_TEXT_4].special_bitmap_id[GFX_SPECIAL_ARG_MAIN]);
+
+ font_info[FONT_TEXT_4].special_graphic[GFX_SPECIAL_ARG_MAIN] =
+ IMG_FONT_TEXT_3;
+ font_info[FONT_TEXT_4].special_bitmap_id[GFX_SPECIAL_ARG_MAIN] =
+ FONT_TEXT_3;
+
+#if 0
+ font_info[FONT_TEXT_4].special_graphic[GFX_SPECIAL_ARG_MAIN] =
+ IMG_FONT_TEXT_3_PREVIEW;
+ font_info[FONT_TEXT_4].special_bitmap_id[GFX_SPECIAL_ARG_MAIN] =
+ FONT_TEXT_3;
+#endif
+#endif
+