removed obsolete special functions to add new level or artwork set to tree
authorHolger Schemel <info@artsoft.org>
Sun, 13 Jan 2019 12:17:55 +0000 (13:17 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 13 Jan 2019 12:17:55 +0000 (13:17 +0100)
src/libgame/setup.c
src/libgame/setup.h

index 7818b7322eaa7a79faf4648d5a9ad85eb891b7a7..69eecdb54140b75ef1422a42c7739aecee79c294 100644 (file)
@@ -3860,90 +3860,6 @@ void LoadLevelArtworkInfo(void)
   print_timestamp_done("LoadLevelArtworkInfo");
 }
 
-static boolean AddUserLevelSetToLevelInfoExt(char *level_subdir_new)
-{
-  // get level info tree node of first (original) user level set
-  char *level_subdir_old = getLoginName();
-  LevelDirTree *leveldir_old = getTreeInfoFromIdentifier(leveldir_first,
-                                                        level_subdir_old);
-  if (leveldir_old == NULL)            // should not happen
-    return FALSE;
-
-  int draw_deactivation_mask = GetDrawDeactivationMask();
-
-  // override draw deactivation mask (temporarily disable drawing)
-  SetDrawDeactivationMask(REDRAW_ALL);
-
-  // load new level set config and add it next to first user level set
-  LoadLevelInfoFromLevelConf(&leveldir_old->next, NULL,
-                            leveldir_old->basepath, level_subdir_new);
-
-  // set draw deactivation mask to previous value
-  SetDrawDeactivationMask(draw_deactivation_mask);
-
-  // get level info tree node of newly added user level set
-  LevelDirTree *leveldir_new = getTreeInfoFromIdentifier(leveldir_first,
-                                                        level_subdir_new);
-  if (leveldir_new == NULL)            // should not happen
-    return FALSE;
-
-  // correct top link and parent node link of newly created tree node
-  leveldir_new->node_top    = leveldir_old->node_top;
-  leveldir_new->node_parent = leveldir_old->node_parent;
-
-  // sort level info tree to adjust position of newly added level set
-  sortTreeInfo(&leveldir_first);
-
-  return TRUE;
-}
-
-void AddUserLevelSetToLevelInfo(char *level_subdir_new)
-{
-  if (!AddUserLevelSetToLevelInfoExt(level_subdir_new))
-    Error(ERR_EXIT, "internal level set structure corrupted -- aborting");
-}
-
-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");
-}
-
 static boolean AddUserTreeSetToTreeInfoExt(char *tree_subdir_new, int type)
 {
   TreeInfo **tree_node_first, *tree_node_old, *tree_node_new;
@@ -4015,6 +3931,11 @@ void AddUserTreeSetToTreeInfo(char *tree_subdir_new, int type)
     Error(ERR_EXIT, "internal tree set structure corrupted -- aborting");
 }
 
+void AddUserLevelSetToLevelInfo(char *level_subdir_new)
+{
+  AddUserTreeSetToTreeInfo(level_subdir_new, TREE_TYPE_LEVEL_DIR);
+}
+
 char *getArtworkIdentifierForUserLevelSet(int type)
 {
   char *classic_artwork_set = getClassicArtworkSet(type);
index 7740c2cb628318750bec61959cc9d1e17b404638..581ebb1722e643a59989443b9c5579b47228fa95 100644 (file)
@@ -330,7 +330,6 @@ char *getArtworkIdentifierForUserLevelSet(int);
 TreeInfo *getArtworkTreeInfoForUserLevelSet(int);
 boolean checkIfCustomArtworkExistsForCurrentLevelSet(void);
 void AddUserLevelSetToLevelInfo(char *);
-void AddUserArtworkSetToArtworkInfo(char *, int);
 void AddUserTreeSetToTreeInfo(char *, int);
 boolean UpdateUserLevelSet(char *, char *, char *, int);
 boolean CreateUserLevelSet(char *, char *, char *, int, boolean);