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
{
51 typedef struct ui_t ui_t
;
53 int x
; /* cursor position */
56 int vx
; /* viewport offset (scrolling) */
59 int flingx
; /* desired viewport offset (for scrolling) */
62 int dragging
; /* dragging with touch/middle button */
63 int pushing
; /* holding the button/finger down */
65 int unit
; /* selected unit */
66 int house
; /* selected building */
67 int flag
; /* selected flag */
68 int builder
;/* building to build */
69 int setflag
;/* flag to place */
70 int stat
; /* selected stat */
76 uiHoverMajor hover_top
;
83 int no_mouse
; /* for touch devices */
84 int log_width
; /* can't rely on DEFINES */
87 int freq
; /* just a counter, always ++ */
105 extern int find_unit(Uint32 x
, Uint32 y
);
106 extern int find_house(Uint32 x
, Uint32 y
);
111 extern SDL_Rect minimap
;
112 extern SDL_Rect buildbox
;
113 extern SDL_Rect selbox
;
114 extern SDL_Rect pinbox
;
115 extern SDL_Rect hintbox
;
117 extern SDL_Rect unitpin
;
118 extern SDL_Rect plusbtn
;
120 extern SDL_Rect top_pane
;
121 extern SDL_Rect ui_pane
;
122 extern SDL_Rect game_map
;
126 extern void init_ui(SDL_Renderer
*renderer
, int w
, int h
);
128 extern void reset_ui();
130 extern void track_mouse();
131 extern void track_mouse_map();
132 extern void track_mouse_ui();