+/* sort priorities of level series (also used as level series classes) */
+#define LEVELCLASS_TUTORIAL_START 10
+#define LEVELCLASS_TUTORIAL_END 99
+#define LEVELCLASS_CLASSICS_START 100
+#define LEVELCLASS_CLASSICS_END 199
+#define LEVELCLASS_CONTRIBUTION_START 200
+#define LEVELCLASS_CONTRIBUTION_END 299
+#define LEVELCLASS_USER_START 300
+#define LEVELCLASS_USER_END 399
+
+#define LEVELCLASS_TUTORIAL LEVELCLASS_TUTORIAL_START
+#define LEVELCLASS_CLASSICS LEVELCLASS_CLASSICS_START
+#define LEVELCLASS_CONTRIBUTION LEVELCLASS_CONTRIBUTION_START
+#define LEVELCLASS_USER LEVELCLASS_USER_START
+#define LEVELCLASS_UNDEFINED 999
+
+#define IS_LEVELCLASS_TUTORIAL(n) \
+ (leveldir[n].sort_priority >= LEVELCLASS_TUTORIAL_START && \
+ leveldir[n].sort_priority <= LEVELCLASS_TUTORIAL_END)
+#define IS_LEVELCLASS_CLASSICS(n) \
+ (leveldir[n].sort_priority >= LEVELCLASS_CLASSICS_START && \
+ leveldir[n].sort_priority <= LEVELCLASS_CLASSICS_END)
+#define IS_LEVELCLASS_CONTRIBUTION(n) \
+ (leveldir[n].sort_priority >= LEVELCLASS_CONTRIBUTION_START && \
+ leveldir[n].sort_priority <= LEVELCLASS_CONTRIBUTION_END)
+#define IS_LEVELCLASS_USER(n) \
+ (leveldir[n].sort_priority >= LEVELCLASS_USER_START && \
+ leveldir[n].sort_priority <= LEVELCLASS_USER_END)
+
+#define LEVELCLASS(n) (IS_LEVELCLASS_TUTORIAL(n) ? LEVELCLASS_TUTORIAL : \
+ IS_LEVELCLASS_CLASSICS(n) ? LEVELCLASS_CLASSICS : \
+ IS_LEVELCLASS_CONTRIBUTION(n) ? LEVELCLASS_CONTRIBUTION : \
+ IS_LEVELCLASS_USER(n) ? LEVELCLASS_USER : \
+ LEVELCLASS_UNDEFINED)
+
+#define LEVELCOLOR(n) (IS_LEVELCLASS_TUTORIAL(n) ? FC_BLUE : \
+ IS_LEVELCLASS_CLASSICS(n) ? FC_YELLOW : \
+ IS_LEVELCLASS_CONTRIBUTION(n) ? FC_GREEN : \
+ IS_LEVELCLASS_USER(n) ? FC_RED : FC_BLUE)
+