X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsetup.h;h=2f5489d9e482604a845dcca8889923b15cdf0056;hb=5985bdeb8c45af7f98466f3bda30b1913a2fc9cf;hp=38a732f475ec74ac68a1524c27f1919ba2d0a634;hpb=05deb9f50dbf596012b2ab0116b95548d2182410;p=rocksndiamonds.git diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 38a732f4..2f5489d9 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 ? 8 : \ + (ti)->sort_priority >= LEVELCLASS_CLASSICS_START ? 6 : \ + (ti)->sort_priority >= LEVELCLASS_TUTORIAL_START ? 4 : \ + 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);