X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsetup.h;h=8ec6b4d8dc14fd616eea7c3ee8ff06564ded463e;hb=17f6f3b42db10ad8c384ba5ebd1e6a7ecbfbe494;hp=38a732f475ec74ac68a1524c27f1919ba2d0a634;hpb=05deb9f50dbf596012b2ab0116b95548d2182410;p=rocksndiamonds.git diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 38a732f4..8ec6b4d8 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -227,6 +227,28 @@ typedef struct hashtable SetupFileHash; IS_ARTWORKCLASS_LEVEL(n) ? ARTWORKCLASS_LEVEL : \ ARTWORKCLASS_UNDEFINED) +#define TREE_SORTING_DIR(ti) \ + (((ti)->parent_link ? 0 : \ + (ti)->in_user_dir ? 4 : \ + (ti)->sort_priority >= LEVELCLASS_CLASSICS_START ? 3 : \ + (ti)->sort_priority >= LEVELCLASS_TUTORIAL_START ? 2 : \ + 1) * 2 + \ + ((ti)->level_group ? 0 : 1)) + +#define TREE_COLOR_DIR(ti, active) \ + ((active) ? FC_YELLOW : \ + TREE_SORTING(ti) / 2 == 4 ? FC_GREEN : \ + TREE_SORTING(ti) / 2 == 2 ? FC_BLUE : \ + FC_RED) + +#define TREE_SORTING(ti) \ + (TREE_TYPE_IS_DIR((ti)->type) ? TREE_SORTING_DIR(ti) : \ + (ti)->sort_priority) + +#define TREE_COLOR(ti, active) \ + (TREE_TYPE_IS_DIR((ti)->type) ? TREE_COLOR_DIR(ti, active) : \ + (ti)->color) + char *getUserGraphicsDir(void); char *getUserSoundsDir(void); @@ -262,6 +284,7 @@ void InitLevelSetupDirectory(char *); TreeInfo *newTreeInfo(void); TreeInfo *newTreeInfo_setDefaults(int); void pushTreeInfo(TreeInfo **, TreeInfo *); +void removeTreeInfo(TreeInfo **); int numTreeInfo(TreeInfo *); boolean validLevelSeries(TreeInfo *); TreeInfo *getFirstValidTreeInfoEntry(TreeInfo *); @@ -343,6 +366,8 @@ void AddTreeSetToTreeInfo(TreeInfo *, char *, char *, int); boolean UpdateUserLevelSet(char *, char *, char *, int); boolean CreateUserLevelSet(char *, char *, char *, int, boolean); +void UpdateLastPlayedLevels_TreeInfo(void); + void LoadLevelSetup_LastSeries(void); void SaveLevelSetup_LastSeries(void); void SaveLevelSetup_LastSeries_Deactivate(void);