root / proj / include / proj_func.h @ 343
History | View | Annotate | Download (2.09 KB)
1 | 156 | up20180655 | #ifndef PROJ_FUNC_H_INCLUDED
|
---|---|---|---|
2 | #define PROJ_FUNC_H_INCLUDED
|
||
3 | |||
4 | 340 | up20180642 | /**
|
5 | * @defgroup proj_func proj_func
|
||
6 | * @brief Project helper functions.
|
||
7 | *
|
||
8 | * @{
|
||
9 | */
|
||
10 | |||
11 | 192 | up20180642 | #include "ent.h" |
12 | 333 | up20180642 | #include "text.h" |
13 | 311 | up20180655 | #include "proj_structures.h" |
14 | 167 | up20180655 | |
15 | 200 | up20180655 | #include <stdint.h> |
16 | |||
17 | 156 | up20180655 | /**
|
18 | * @brief Cleans up all memory, unsubscribes interrupts.
|
||
19 | * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
||
20 | * @see {_ERRORS_H_::errors}
|
||
21 | */
|
||
22 | int cleanup(void); |
||
23 | |||
24 | 240 | up20180655 | void update_key_presses(void); |
25 | |||
26 | /**
|
||
27 | * @brief Updates movement variables.
|
||
28 | */
|
||
29 | 307 | up20180642 | void update_movement(map_t *map, gunner_t *p, keys_t *keys, list_t *shooter_list);
|
30 | 240 | up20180655 | |
31 | 341 | up20180642 | /**
|
32 | * @brief Get random spawn (actually, position) for new gunner.
|
||
33 | *
|
||
34 | * The new position cannot collide with the map, nor with any of the gunners
|
||
35 | * already in the list.
|
||
36 | * @param map Pointer to map
|
||
37 | * @param p Pointer to new gunner
|
||
38 | * @param l List of gunners that already exist
|
||
39 | */
|
||
40 | void (get_random_spawn)(const map_t *map, gunner_t *p, list_t *l); |
||
41 | |||
42 | 231 | up20180655 | void update_mouse(struct packet *p); |
43 | 171 | up20180655 | |
44 | 231 | up20180655 | keys_t* (get_key_presses)(void);
|
45 | |||
46 | 237 | up20180642 | void (shoot_bullet)(const gunner_t *shooter, list_t *bullet_list, const basic_sprite_t *bsp_bullet); |
47 | 231 | up20180655 | |
48 | 236 | up20180642 | void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list); |
49 | 231 | up20180655 | |
50 | 246 | up20180655 | |
51 | 340 | up20180642 | |
52 | 200 | up20180655 | void update_scale(void); |
53 | |||
54 | 321 | up20180642 | int16_t* get_mouse_X(void);
|
55 | 171 | up20180655 | |
56 | 321 | up20180642 | int16_t* get_mouse_Y(void);
|
57 | 171 | up20180655 | |
58 | 342 | up20180655 | void build_host_structure(host_info_t *p, gunner_t *host, gunner_t *remote);
|
59 | 320 | up20180655 | |
60 | void build_remote_structure(remote_info_t *p, keys_t *keys, double angle); |
||
61 | |||
62 | 201 | up20180642 | double get_mouse_angle(gunner_t *p);
|
63 | 167 | up20180655 | |
64 | 340 | up20180642 | /**
|
65 | * @}
|
||
66 | */
|
||
67 | |||
68 | /**
|
||
69 | * @defgroup text_timer_t text_timer_t
|
||
70 | * @ingroup proj_func
|
||
71 | * @brief Text timer.
|
||
72 | *
|
||
73 | * @{
|
||
74 | */
|
||
75 | |||
76 | /**
|
||
77 | * @brief Text timer.
|
||
78 | */
|
||
79 | 339 | up20180642 | typedef struct { |
80 | 340 | up20180642 | /// @brief Time since construction.
|
81 | 250 | up20180655 | int time;
|
82 | 340 | up20180642 | /// @brief Text.
|
83 | 250 | up20180655 | text_t *text; |
84 | } text_timer_t; |
||
85 | |||
86 | text_timer_t* (timer_ctor)(const font_t *fnt);
|
||
87 | |||
88 | 340 | up20180642 | void (timer_dtor)(text_timer_t *p);
|
89 | |||
90 | 250 | up20180655 | void (timer_update)(text_timer_t *p);
|
91 | |||
92 | 251 | up20180655 | void (timer_reset)(text_timer_t *p);
|
93 | |||
94 | 340 | up20180642 | /**
|
95 | * @}
|
||
96 | */
|
||
97 | 250 | up20180655 | |
98 | 156 | up20180655 | #endif /* end of include guard: PROJ_FUNC_H_INCLUDED */ |