-
Notifications
You must be signed in to change notification settings - Fork 4
/
ui.h
49 lines (34 loc) · 1.22 KB
/
ui.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef NES_UI_H
#define NES_UI_H
#include "sys.h"
struct inputctx {
int mx, my; /* Mouse X/Y */
int buttons; /* Mouse button bitmask (level)*/
int pressed; /* Mouse pressed bitmask (edge) */
int released; /* Mouse released bitmask (edge) */
int have_pointer; /* Pointer present? */
};
#ifndef NES_UI_C
#endif
char *asset (char *name);
char *localasset (char *name);
void dim_to_y (int y);
void dim_background (void);
void run_menu (struct inputctx *input);
int menu_process_key_event (SDL_KeyboardEvent *key);
void open_menu (void);
typedef int alignmode[3];
SDL_Rect drawimage (image_t image, int x, int y, alignmode align_x, alignmode align_y);
int ensure_freetype (void);
image_t sans_label (Uint32 color, unsigned text_height, const char *string);
float approach (float target, float minrate, float rate, float current);
void run_main_menu (struct inputctx *input);
void run_game_browser (struct inputctx *input);
void run_input_menu (struct inputctx *input);
/** Exports **/
#ifndef NES_UI_C
extern void (*menu) (struct inputctx *);
extern float dim_y_target;
extern alignmode left, right, center, top, bottom, baseline;
#endif
#endif