projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added wrapper function for creating level set custom artwork tree
[rocksndiamonds.git]
/
src
/
libgame
/
setup.c
diff --git
a/src/libgame/setup.c
b/src/libgame/setup.c
index aca52f7db36ab9fa5ffea8c302a6428d0dfb76e4..1c7d78b660c6ba0215c18f6623460c5e579c3ace 100644
(file)
--- a/
src/libgame/setup.c
+++ b/
src/libgame/setup.c
@@
-1163,6
+1163,16
@@
void pushTreeInfo(TreeInfo **node_first, TreeInfo *node_new)
*node_first = node_new;
}
*node_first = node_new;
}
+void removeTreeInfo(TreeInfo **node_first)
+{
+ TreeInfo *node_old = *node_first;
+
+ *node_first = node_old->next;
+ node_old->next = NULL;
+
+ freeTreeInfo(node_old);
+}
+
int numTreeInfo(TreeInfo *node)
{
int num = 0;
int numTreeInfo(TreeInfo *node)
{
int num = 0;
@@
-2902,7
+2912,7
@@
static TreeInfo *createTopTreeInfoNode(TreeInfo *node_first)
ti_new->parent_link = FALSE;
setString(&ti_new->identifier, node_first->identifier);
ti_new->parent_link = FALSE;
setString(&ti_new->identifier, node_first->identifier);
- setString(&ti_new->name,
"level sets"
);
+ setString(&ti_new->name,
INFOTEXT_LEVEL_DIR
);
setString(&ti_new->name_sorting, ti_new->name);
setString(&ti_new->subdir, STRING_TOP_DIRECTORY);
setString(&ti_new->name_sorting, ti_new->name);
setString(&ti_new->subdir, STRING_TOP_DIRECTORY);
@@
-2911,7
+2921,7
@@
static TreeInfo *createTopTreeInfoNode(TreeInfo *node_first)
ti_new->sort_priority = node_first->sort_priority;;
ti_new->latest_engine = node_first->latest_engine;
ti_new->sort_priority = node_first->sort_priority;;
ti_new->latest_engine = node_first->latest_engine;
- setString(&ti_new->class_desc,
"level sets"
);
+ setString(&ti_new->class_desc,
INFOTEXT_LEVEL_DIR
);
ti_new->node_group = node_first;
ti_new->level_group = TRUE;
ti_new->node_group = node_first;
ti_new->level_group = TRUE;
@@
-3913,9
+3923,9
@@
void LoadArtworkInfo(void)
#endif
}
#endif
}
-static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node,
- ArtworkDirTree *node_parent,
- LevelDirTree *level_node)
+static void LoadArtworkInfoFromLevelInfo
Ext
(ArtworkDirTree **artwork_node,
+
ArtworkDirTree *node_parent,
+
LevelDirTree *level_node)
{
int type = (*artwork_node)->type;
{
int type = (*artwork_node)->type;
@@
-3984,23
+3994,23
@@
static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node,
createParentTreeInfoNode(artwork_new);
// recursively step into sub-directory and look for more custom artwork
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);
+ LoadArtworkInfoFromLevelInfo
Ext
(&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)
// if sub-tree has no custom artwork at all, remove it
if (artwork_new->node_group->next == NULL)
- {
- *artwork_node = artwork_new->next;
- artwork_new->next = NULL;
-
- freeTreeInfo(artwork_new);
- }
+ removeTreeInfo(artwork_node);
}
level_node = level_node->next;
}
}
}
level_node = level_node->next;
}
}
+static void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node)
+{
+ LoadArtworkInfoFromLevelInfoExt(artwork_node, NULL, leveldir_first_all);
+}
+
void LoadLevelArtworkInfo(void)
{
print_timestamp_init("LoadLevelArtworkInfo");
void LoadLevelArtworkInfo(void)
{
print_timestamp_init("LoadLevelArtworkInfo");
@@
-4009,11
+4019,11
@@
void LoadLevelArtworkInfo(void)
print_timestamp_time("DrawTimeText");
print_timestamp_time("DrawTimeText");
- LoadArtworkInfoFromLevelInfo(&artwork.gfx_first
, NULL, leveldir_first_all
);
+ LoadArtworkInfoFromLevelInfo(&artwork.gfx_first);
print_timestamp_time("LoadArtworkInfoFromLevelInfo (gfx)");
print_timestamp_time("LoadArtworkInfoFromLevelInfo (gfx)");
- LoadArtworkInfoFromLevelInfo(&artwork.snd_first
, NULL, leveldir_first_all
);
+ LoadArtworkInfoFromLevelInfo(&artwork.snd_first);
print_timestamp_time("LoadArtworkInfoFromLevelInfo (snd)");
print_timestamp_time("LoadArtworkInfoFromLevelInfo (snd)");
- LoadArtworkInfoFromLevelInfo(&artwork.mus_first
, NULL, leveldir_first_all
);
+ LoadArtworkInfoFromLevelInfo(&artwork.mus_first);
print_timestamp_time("LoadArtworkInfoFromLevelInfo (mus)");
SaveArtworkInfoCache();
print_timestamp_time("LoadArtworkInfoFromLevelInfo (mus)");
SaveArtworkInfoCache();