+ /* correct special font/graphic mapping for cloned fonts for downwards
+ compatibility of PREVIEW fonts -- this is only needed for implicit
+ redefinition of special font by redefined base font, and only if other
+ fonts are cloned from this special font (like in the "Zelda" level set) */
+ 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 (IS_SPECIAL_GFX_ARG(special))
+ {
+ boolean special_redefined =
+ getImageListEntryFromImageID(graphic)->redefined;
+ boolean special_cloned = (graphic_info[graphic].clone_from != -1);
+
+ if (special_cloned && !special_redefined)
+ {
+ int j;
+
+ 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 (IS_SPECIAL_GFX_ARG(special2) &&
+ graphic2 == graphic_info[graphic].clone_from)
+ {
+ 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];
+ }
+ }
+ }
+ }
+ }
+
+ /* 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];
+ }
+ }
+ }
+ }
+