X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.h;h=a2b75b1415420a136e7c3166515b26d8c41bdba2;hb=c6b89ec21b03182c40ae2eda40d861c09f179daf;hp=5825fc53d9ed022be42e05e4483429c740e4c5a8;hpb=6e9374af7b69e20dbab5b8b3e06a8d4e2ffb1ddd;p=rocksndiamonds.git diff --git a/src/libgame/system.h b/src/libgame/system.h index 5825fc53..a2b75b14 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -205,13 +205,19 @@ #define ALIGN_LEFT (1 << 0) #define ALIGN_RIGHT (1 << 1) #define ALIGN_CENTER (1 << 2) - #define ALIGN_DEFAULT ALIGN_LEFT -#define ALIGNED_XPOS(x,w,a) ((a) == ALIGN_CENTER ? (x) - (w) / 2 : \ - (a) == ALIGN_RIGHT ? (x) - (w) : (x)) -#define ALIGNED_MENU_XPOS(p) ALIGNED_XPOS((p)->x, (p)->width, (p)->align) -#define ALIGNED_MENU_YPOS(p) ((p)->y) +#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) /* values for redraw_mask */ #define REDRAW_NONE (0) @@ -686,6 +692,7 @@ struct GfxInfo int num_fonts; struct FontBitmapInfo *font_bitmap_info; int (*select_font_function)(int); + int (*get_font_from_token_function)(char *); int anim_random_frame; }; @@ -1019,14 +1026,14 @@ struct MenuPosInfo { int x, y; int width, height; - int align; + int align, valign; }; struct TextPosInfo { int x, y; int width, height; - int align; + int align, valign; int chars; int font, font_alt; };