root / proj / include / proj_func.h @ 284
History | View | Annotate | Download (1.84 KB)
1 | 156 | up20180655 | #ifndef PROJ_FUNC_H_INCLUDED
|
---|---|---|---|
2 | #define PROJ_FUNC_H_INCLUDED
|
||
3 | |||
4 | 192 | up20180642 | #include "ent.h" |
5 | 250 | up20180655 | #include "font.h" |
6 | 167 | up20180655 | |
7 | 200 | up20180655 | #include <stdint.h> |
8 | |||
9 | 156 | up20180655 | /**
|
10 | * @brief Cleans up all memory, unsubscribes interrupts.
|
||
11 | * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
||
12 | * @see {_ERRORS_H_::errors}
|
||
13 | */
|
||
14 | int cleanup(void); |
||
15 | |||
16 | 200 | up20180655 | typedef struct keys { |
17 | uint8_t w_pressed : 1;
|
||
18 | uint8_t a_pressed : 1;
|
||
19 | uint8_t s_pressed : 1;
|
||
20 | uint8_t d_pressed : 1;
|
||
21 | uint8_t ctrl_pressed : 1;
|
||
22 | uint8_t plus_pressed : 1;
|
||
23 | uint8_t minus_pressed : 1;
|
||
24 | 231 | up20180655 | uint8_t lb_pressed : 1;
|
25 | 200 | up20180655 | } keys_t; |
26 | |||
27 | 240 | up20180655 | void update_key_presses(void); |
28 | |||
29 | /**
|
||
30 | * @brief Updates movement variables.
|
||
31 | */
|
||
32 | 246 | up20180655 | void update_movement(const map_t *map, gunner_t *p, keys_t *keys, list_t *shooter_list); |
33 | 240 | up20180655 | |
34 | 231 | up20180655 | void update_mouse(struct packet *p); |
35 | 171 | up20180655 | |
36 | 231 | up20180655 | keys_t* (get_key_presses)(void);
|
37 | |||
38 | 237 | up20180642 | void (shoot_bullet)(const gunner_t *shooter, list_t *bullet_list, const basic_sprite_t *bsp_bullet); |
39 | 231 | up20180655 | |
40 | 236 | up20180642 | void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list); |
41 | 231 | up20180655 | |
42 | 246 | up20180655 | void (get_random_spawn)(const map_t *map, gunner_t *p); |
43 | |||
44 | 200 | up20180655 | void update_scale(void); |
45 | |||
46 | 250 | up20180655 | int32_t* get_mouse_X(void);
|
47 | 171 | up20180655 | |
48 | 250 | up20180655 | int32_t* get_mouse_Y(void);
|
49 | 171 | up20180655 | |
50 | 167 | up20180655 | /**
|
51 | * @brief
|
||
52 | * @param
|
||
53 | * @param
|
||
54 | * @param
|
||
55 | * @return Angle
|
||
56 | */
|
||
57 | 201 | up20180642 | double get_mouse_angle(gunner_t *p);
|
58 | 167 | up20180655 | |
59 | 251 | up20180655 | typedef struct menu menu_t; |
60 | |||
61 | menu_t* (menu_ctor)(const font_t *fnt);
|
||
62 | |||
63 | int (menu_update_state)(menu_t *menu, int click); |
||
64 | |||
65 | void (menu_draw)(menu_t *menu);
|
||
66 | |||
67 | void (menu_dtor)(menu_t *p);
|
||
68 | |||
69 | 250 | up20180655 | typedef struct timer { |
70 | int time;
|
||
71 | text_t *text; |
||
72 | char *array;
|
||
73 | } text_timer_t; |
||
74 | |||
75 | text_timer_t* (timer_ctor)(const font_t *fnt);
|
||
76 | |||
77 | void (timer_update)(text_timer_t *p);
|
||
78 | |||
79 | 251 | up20180655 | void (timer_reset)(text_timer_t *p);
|
80 | |||
81 | 250 | up20180655 | void (timer_dtor)(text_timer_t *p);
|
82 | |||
83 | 156 | up20180655 | #endif /* end of include guard: PROJ_FUNC_H_INCLUDED */ |