- return;
- }
-}
-
-#else
-
-static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info,
- struct ListNodeInfo **listnode,
- char *basename)
-{
- char *init_text[] =
- {
- "Loading graphics:",
- "Loading sounds:",
- "Loading music:"
- };
-
- ListNode *node;
- char *filename = getCustomArtworkFilename(basename, artwork_info->type);
-
- if (filename == NULL)
- {
- int error_mode = ERR_WARN;
-
-#if 1
- /* !!! NEW ARTWORK FALLBACK CODE !!! NEARLY UNTESTED !!! */
- /* before failing, try fallback to default artwork */
-#else
- /* we can get away without sounds and music, but not without graphics */
- if (*listnode == NULL && artwork_info->type == ARTWORK_TYPE_GRAPHICS)
- error_mode = ERR_EXIT;
-#endif
-
- Error(error_mode, "cannot find artwork file '%s'", basename);
- return;
- }
-
- /* check if the old and the new artwork file are the same */
- if (*listnode && strcmp((*listnode)->source_filename, filename) == 0)
- {
- /* The old and new artwork are the same (have the same filename and path).
- This usually means that this artwork does not exist in this artwork set
- and a fallback to the existing artwork is done. */
-
-#if 0
- printf("[artwork '%s' already exists (same list entry)]\n", filename);
-#endif
-
- return;
- }
-
- /* delete existing artwork file entry */
- deleteArtworkListEntry(artwork_info, listnode);
-
- /* check if the new artwork file already exists in the list of artworks */
- if ((node = getNodeFromKey(artwork_info->content_list, filename)) != NULL)
- {
-#if 0
- printf("[artwork '%s' already exists (other list entry)]\n", filename);
-#endif
-
- *listnode = (struct ListNodeInfo *)node->content;
- (*listnode)->num_references++;
-
- return;
- }
-
-#if 0
- printf("::: %s: '%s'\n", init_text[artwork_info->type], basename);
-#endif
-
- DrawInitText(init_text[artwork_info->type], 120, FC_GREEN);
- DrawInitText(basename, 150, FC_YELLOW);
-
- if ((*listnode = artwork_info->load_artwork(filename)) != NULL)
- {
-#if 0
- printf("[adding new artwork '%s']\n", filename);
-#endif
-
- (*listnode)->num_references = 1;
- addNodeToList(&artwork_info->content_list, (*listnode)->source_filename,
- *listnode);
- }
- else
- {
- int error_mode = ERR_WARN;
-
-#if 1
- /* we can get away without sounds and music, but not without graphics */
- if (artwork_info->type == ARTWORK_TYPE_GRAPHICS)
- error_mode = ERR_EXIT;
-#endif