+// values for special drawing styles (currently only for crumbled graphics)
+#define STYLE_NONE 0
+#define STYLE_ACCURATE_BORDERS (1 << 0)
+#define STYLE_INNER_CORNERS (1 << 1)
+#define STYLE_REVERSE (1 << 2)
+
+// values for special event handling style (used for global animation)
+#define STYLE_PASSTHROUGH (1 << 3)
+#define STYLE_MULTIPLE_ACTIONS (1 << 4)
+
+#define STYLE_DEFAULT STYLE_NONE
+
+// values for special global animation events
+#define ANIM_EVENT_UNDEFINED -1
+#define ANIM_EVENT_NONE 0
+#define ANIM_EVENT_SELF (1 << 16)
+#define ANIM_EVENT_ANY (1 << 17)
+#define ANIM_EVENT_CLICK (1 << 18)
+#define ANIM_EVENT_INIT (1 << 19)
+#define ANIM_EVENT_START (1 << 20)
+#define ANIM_EVENT_END (1 << 21)
+#define ANIM_EVENT_POST (1 << 22)
+
+// anim number: bits 0-7
+// part number: bits 8-15
+#define ANIM_EVENT_ANIM_BIT 0
+#define ANIM_EVENT_PART_BIT 8
+
+#define ANIM_EVENT_ANIM_MASK (0xff << ANIM_EVENT_ANIM_BIT)
+#define ANIM_EVENT_PART_MASK (0xff << ANIM_EVENT_PART_BIT)
+
+#define ANIM_EVENT_DEFAULT ANIM_EVENT_NONE
+
+// values for special global animation event actions
+#define ANIM_EVENT_ACTION_NONE -1
+
+// values for fade mode
+#define FADE_TYPE_NONE 0
+#define FADE_TYPE_FADE_IN (1 << 0)
+#define FADE_TYPE_FADE_OUT (1 << 1)
+#define FADE_TYPE_TRANSFORM (1 << 2)
+#define FADE_TYPE_CROSSFADE (1 << 3)
+#define FADE_TYPE_MELT (1 << 4)
+#define FADE_TYPE_CURTAIN (1 << 5)
+#define FADE_TYPE_SKIP (1 << 6)
+
+#define FADE_MODE_NONE (FADE_TYPE_NONE)
+#define FADE_MODE_FADE_IN (FADE_TYPE_FADE_IN)
+#define FADE_MODE_FADE_OUT (FADE_TYPE_FADE_OUT)
+#define FADE_MODE_FADE (FADE_TYPE_FADE_IN | FADE_TYPE_FADE_OUT)
+#define FADE_MODE_TRANSFORM (FADE_TYPE_TRANSFORM | FADE_TYPE_FADE_IN)
+#define FADE_MODE_CROSSFADE (FADE_MODE_TRANSFORM | FADE_TYPE_CROSSFADE)
+#define FADE_MODE_MELT (FADE_MODE_TRANSFORM | FADE_TYPE_MELT)
+#define FADE_MODE_CURTAIN (FADE_MODE_TRANSFORM | FADE_TYPE_CURTAIN)
+#define FADE_MODE_SKIP_FADE_IN (FADE_TYPE_SKIP | FADE_TYPE_FADE_IN)
+#define FADE_MODE_SKIP_FADE_OUT (FADE_TYPE_SKIP | FADE_TYPE_FADE_OUT)
+
+#define FADE_MODE_DEFAULT FADE_MODE_FADE
+
+// values for toon positions
+#define POS_UNDEFINED -1
+#define POS_LEFT 0
+#define POS_RIGHT 1
+#define POS_TOP 2
+#define POS_UPPER 3
+#define POS_MIDDLE 4
+#define POS_LOWER 5
+#define POS_BOTTOM 6
+#define POS_ANY 7
+#define POS_LAST 8
+
+// values for text alignment
+#define ALIGN_LEFT (1 << 0)
+#define ALIGN_RIGHT (1 << 1)
+#define ALIGN_CENTER (1 << 2)
+#define ALIGN_DEFAULT ALIGN_LEFT
+
+#define VALIGN_TOP (1 << 0)
+#define VALIGN_BOTTOM (1 << 1)
+#define VALIGN_MIDDLE (1 << 2)
+#define VALIGN_DEFAULT VALIGN_TOP
+
+#define ALIGNED_XPOS(x,w,a) ((a) == ALIGN_CENTER ? (x) - (w) / 2 : \
+ (a) == ALIGN_RIGHT ? (x) - (w) : (x))
+#define ALIGNED_YPOS(y,h,v) ((v) == VALIGN_MIDDLE ? (y) - (h) / 2 : \
+ (v) == VALIGN_BOTTOM ? (y) - (h) : (y))
+#define ALIGNED_TEXT_XPOS(p) ALIGNED_XPOS((p)->x, (p)->width, (p)->align)
+#define ALIGNED_TEXT_YPOS(p) ALIGNED_YPOS((p)->y, (p)->height, (p)->valign)
+#define ALIGNED_VP_XPOS(p) ALIGNED_TEXT_XPOS(p)
+#define ALIGNED_VP_YPOS(p) ALIGNED_TEXT_YPOS(p)
+
+// values for redraw_mask