added wrapper function for creating level set custom artwork tree
authorHolger Schemel <info@artsoft.org>
Mon, 1 Feb 2021 19:39:38 +0000 (20:39 +0100)
committerHolger Schemel <info@artsoft.org>
Mon, 1 Feb 2021 19:39:38 +0000 (20:39 +0100)
src/libgame/setup.c

index 3e044e96b44630cdb556e5a13a874175db06a1c3..1c7d78b660c6ba0215c18f6623460c5e579c3ace 100644 (file)
@@ -3923,9 +3923,9 @@ void LoadArtworkInfo(void)
 #endif
 }
 
-static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node,
-                                        ArtworkDirTree *node_parent,
-                                        LevelDirTree *level_node)
+static void LoadArtworkInfoFromLevelInfoExt(ArtworkDirTree **artwork_node,
+                                           ArtworkDirTree *node_parent,
+                                           LevelDirTree *level_node)
 {
   int type = (*artwork_node)->type;
 
@@ -3994,8 +3994,8 @@ static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node,
       createParentTreeInfoNode(artwork_new);
 
       // recursively step into sub-directory and look for more custom artwork
-      LoadArtworkInfoFromLevelInfo(&artwork_new->node_group, artwork_new,
-                                  level_node->node_group);
+      LoadArtworkInfoFromLevelInfoExt(&artwork_new->node_group, artwork_new,
+                                     level_node->node_group);
 
       // if sub-tree has no custom artwork at all, remove it
       if (artwork_new->node_group->next == NULL)
@@ -4006,6 +4006,11 @@ static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node,
   }
 }
 
+static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node)
+{
+  LoadArtworkInfoFromLevelInfoExt(artwork_node, NULL, leveldir_first_all);
+}
+
 void LoadLevelArtworkInfo(void)
 {
   print_timestamp_init("LoadLevelArtworkInfo");
@@ -4014,11 +4019,11 @@ void LoadLevelArtworkInfo(void)
 
   print_timestamp_time("DrawTimeText");
 
-  LoadArtworkInfoFromLevelInfo(&artwork.gfx_first, NULL, leveldir_first_all);
+  LoadArtworkInfoFromLevelInfo(&artwork.gfx_first);
   print_timestamp_time("LoadArtworkInfoFromLevelInfo (gfx)");
-  LoadArtworkInfoFromLevelInfo(&artwork.snd_first, NULL, leveldir_first_all);
+  LoadArtworkInfoFromLevelInfo(&artwork.snd_first);
   print_timestamp_time("LoadArtworkInfoFromLevelInfo (snd)");
-  LoadArtworkInfoFromLevelInfo(&artwork.mus_first, NULL, leveldir_first_all);
+  LoadArtworkInfoFromLevelInfo(&artwork.mus_first);
   print_timestamp_time("LoadArtworkInfoFromLevelInfo (mus)");
 
   SaveArtworkInfoCache();