X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsetup.c;h=192e2ce67e4d2b5307bdccf257e5ac9a4421563c;hp=1298d9271e8108147d0b1e3fd97f9cf3b5a27169;hb=31dcabc4f4e981a616b0e0d5fda7c32eef1c0596;hpb=bcffcb9d803359d36cad2130f065de3bbf38d7bc diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 1298d927..192e2ce6 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -2934,6 +2934,19 @@ static TreeInfo *createTopTreeInfoNode(TreeInfo *node_first) return ti_new; } +static void setTreeInfoParentNodes(TreeInfo *node, TreeInfo *node_parent) +{ + while (node) + { + if (node->node_group) + setTreeInfoParentNodes(node->node_group, node); + + node->node_parent = node_parent; + + node = node->next; + } +} + // ---------------------------------------------------------------------------- // functions for handling level and custom artwork info cache @@ -4048,10 +4061,15 @@ static void LoadArtworkInfoFromLevelInfoExt(ArtworkDirTree **artwork_node, static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node) { + // move peviously loaded artwork tree into separate sub-tree MoveArtworkInfoIntoSubTree(artwork_node); + // load artwork from level sets into separate sub-trees LoadArtworkInfoFromLevelInfoExt(artwork_node, NULL, leveldir_first_all, TRUE); LoadArtworkInfoFromLevelInfoExt(artwork_node, NULL, leveldir_first_all, FALSE); + + // set all parent links (back links) in complete artwork tree + setTreeInfoParentNodes(*artwork_node, NULL); } void LoadLevelArtworkInfo(void)