X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsetup.c;h=192e2ce67e4d2b5307bdccf257e5ac9a4421563c;hb=31dcabc4f4e981a616b0e0d5fda7c32eef1c0596;hp=8f98ff010db474365fb4c7fd9500e27a5d35f167;hpb=b47b3780ecbc8260ffd8d3cf1562a32c449e84b7;p=rocksndiamonds.git diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 8f98ff01..192e2ce6 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -2928,12 +2928,25 @@ static TreeInfo *createTopTreeInfoNode(TreeInfo *node_first) TreeInfo *ti_new2 = createParentTreeInfoNode(ti_new); - setString(&ti_new2->name, BACKLINK_TEXT_MAIN); + setString(&ti_new2->name, TREE_BACKLINK_TEXT(type)); setString(&ti_new2->name_sorting, ti_new2->name); 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)