+static boolean AddUserArtworkSetToArtworkInfoExt(char *artwork_subdir_new,
+ int type)
+{
+ // get artwork info tree node of first artwork set
+ TreeInfo *artwork_first_node = ARTWORK_FIRST_NODE(artwork, type);
+ char *artwork_user_dir = USER_ARTWORK_DIRECTORY(type);
+
+ int draw_deactivation_mask = GetDrawDeactivationMask();
+
+ // override draw deactivation mask (temporarily disable drawing)
+ SetDrawDeactivationMask(REDRAW_ALL);
+
+ // load new artwork set config and add it next to first artwork set
+ LoadArtworkInfoFromArtworkConf(&artwork_first_node->next, NULL,
+ artwork_user_dir, artwork_subdir_new, type);
+
+ // set draw deactivation mask to previous value
+ SetDrawDeactivationMask(draw_deactivation_mask);
+
+ // get artwork info tree node of newly added artwork set
+ LevelDirTree *artwork_new = getTreeInfoFromIdentifier(artwork_first_node,
+ artwork_subdir_new);
+ if (artwork_new == NULL) // should not happen
+ return FALSE;
+
+ // correct top link and parent node link of newly created tree node
+ artwork_new->node_top = artwork_first_node->node_top;
+ artwork_new->node_parent = artwork_first_node->node_parent;
+
+ // sort artwork info tree to adjust position of newly added artwork set
+ sortTreeInfo(&artwork_first_node);
+
+ return TRUE;
+}
+
+void AddUserArtworkSetToArtworkInfo(char *artwork_subdir_new, int type)
+{
+ if (!AddUserArtworkSetToArtworkInfoExt(artwork_subdir_new, type))
+ Error(ERR_EXIT, "internal artwork set structure corrupted -- aborting");
+}
+