From: Holger Schemel Date: Tue, 2 Feb 2021 00:25:16 +0000 (+0100) Subject: added separate custom artwork sub-tree for dedicated custom artwork X-Git-Tag: 4.2.3.0~33 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=eba9b49866465497a474dabe972b2b604617da30;p=rocksndiamonds.git added separate custom artwork sub-tree for dedicated custom artwork --- diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 23579d27..b24ac103 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -3923,6 +3923,29 @@ void LoadArtworkInfo(void) #endif } +static void MoveArtworkInfoIntoSubTree(ArtworkDirTree **artwork_node) +{ + ArtworkDirTree *artwork_new = newTreeInfo(); + char *top_node_name = "dedicated custom artwork"; + + setTreeInfoToDefaults(artwork_new, (*artwork_node)->type); + + artwork_new->level_group = TRUE; + + setString(&artwork_new->identifier, top_node_name); + setString(&artwork_new->name, top_node_name); + setString(&artwork_new->name_sorting, top_node_name); + + // create node to link back to current custom artwork directory + createParentTreeInfoNode(artwork_new); + + // move existing custom artwork tree into newly created sub-tree + artwork_new->node_group->next = *artwork_node; + + // change custom artwork tree to contain only newly created node + *artwork_node = artwork_new; +} + static void LoadArtworkInfoFromLevelInfoExt(ArtworkDirTree **artwork_node, ArtworkDirTree *node_parent, LevelDirTree *level_node, @@ -4025,6 +4048,8 @@ static void LoadArtworkInfoFromLevelInfoExt(ArtworkDirTree **artwork_node, static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node) { + MoveArtworkInfoIntoSubTree(artwork_node); + LoadArtworkInfoFromLevelInfoExt(artwork_node, NULL, leveldir_first_all, TRUE); LoadArtworkInfoFromLevelInfoExt(artwork_node, NULL, leveldir_first_all, FALSE); }