X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsetup.h;h=2f5489d9e482604a845dcca8889923b15cdf0056;hp=7877ccb23246ce42c5fff8d6ba508239359c0144;hb=38142eccb93284bef9c3aeb2d9e81389a21da82a;hpb=f668f77f85a42d0aabbc89f4896bea79d63af0a1 diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 7877ccb2..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);