6 #define PANE_WIDTH (128+10)
8 #define MINIMAP_PADDING 1
12 #define SDL_InBounds(X, Y, RECT) \
13 ((X) >= (RECT)->x && (X) <= (RECT)->x + (RECT)->w && \
14 (Y) >= (RECT)->y && (Y) <= (RECT)->y + (RECT)->h)
17 typedef enum uiHoverMajor
{
23 typedef enum uiHoverMinor
{
56 typedef struct ui_t ui_t
;
58 int x
; /* cursor position */
61 int vx
; /* viewport offset (scrolling) */
64 int flingx
; /* desired viewport offset (for scrolling) */
67 int dragging
; /* dragging with touch/middle button */
68 int pushing
; /* holding the button/finger down */
70 int unit
; /* selected unit */
71 int house
; /* selected building */
72 int flag
; /* selected flag */
73 int builder
;/* building to build */
74 int setflag
;/* flag to place */
75 int stat
; /* selected stat */
77 int unittab
;/* selected unit tab */
78 int housetab
;/* selected house tab */
83 uiHoverMajor hover_top
;
90 int no_mouse
; /* for touch devices */
91 int log_width
; /* can't rely on DEFINES */
94 int freq
; /* just a counter, always ++ */
112 extern int find_unit(Uint32 x
, Uint32 y
);
113 extern int find_house(Uint32 x
, Uint32 y
);
118 extern SDL_Rect minimap
;
119 extern SDL_Rect buildbox
;
120 extern SDL_Rect selbox
;
121 extern SDL_Rect pinbox
;
122 extern SDL_Rect hintbox
;
124 extern SDL_Rect tabicon
;
125 extern SDL_Rect unitpin
;
126 extern SDL_Rect flagicon
;
127 extern SDL_Rect plusbtn
;
129 extern SDL_Rect top_pane
;
130 extern SDL_Rect ui_pane
;
131 extern SDL_Rect game_map
;
135 extern void init_ui(SDL_Renderer
*renderer
, int w
, int h
);
137 extern void reset_ui();
139 extern void track_mouse();
140 extern void track_mouse_map();
141 extern void track_mouse_ui();