From: Holger Schemel Date: Mon, 1 Feb 2021 19:39:38 +0000 (+0100) Subject: added wrapper function for creating level set custom artwork tree X-Git-Tag: 4.2.3.0~35 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=ec334a51f6f1f6fa6df1f70f10201ca2ce1e076f;p=rocksndiamonds.git added wrapper function for creating level set custom artwork tree --- diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 3e044e96..1c7d78b6 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -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();