root / proj / include / proj_func.h @ 230
History | View | Annotate | Download (1.42 KB)
1 | 156 | up20180655 | #ifndef PROJ_FUNC_H_INCLUDED
|
---|---|---|---|
2 | #define PROJ_FUNC_H_INCLUDED
|
||
3 | |||
4 | 192 | up20180642 | #include "ent.h" |
5 | 167 | up20180655 | |
6 | 200 | up20180655 | #include <stdint.h> |
7 | |||
8 | 156 | up20180655 | /**
|
9 | * @brief Cleans up all memory, unsubscribes interrupts.
|
||
10 | * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
|
||
11 | * @see {_ERRORS_H_::errors}
|
||
12 | */
|
||
13 | int cleanup(void); |
||
14 | |||
15 | 184 | up20180655 | void update_key_presses(void); |
16 | |||
17 | 167 | up20180655 | /**
|
18 | * @brief Updates movement variables.
|
||
19 | */
|
||
20 | 222 | up20180655 | void update_movement(const map_t *map, gunner_t *p); |
21 | 167 | up20180655 | |
22 | 200 | up20180655 | typedef struct keys { |
23 | uint8_t w_pressed : 1;
|
||
24 | uint8_t a_pressed : 1;
|
||
25 | uint8_t s_pressed : 1;
|
||
26 | uint8_t d_pressed : 1;
|
||
27 | uint8_t ctrl_pressed : 1;
|
||
28 | uint8_t plus_pressed : 1;
|
||
29 | uint8_t minus_pressed : 1;
|
||
30 | } keys_t; |
||
31 | |||
32 | 171 | up20180655 | void update_mouse_position(struct packet *p); |
33 | |||
34 | 200 | up20180655 | void update_scale(void); |
35 | |||
36 | 171 | up20180655 | int32_t get_mouse_X(void);
|
37 | |||
38 | int32_t get_mouse_Y(void);
|
||
39 | |||
40 | 167 | up20180655 | /**
|
41 | * @brief
|
||
42 | * @param
|
||
43 | * @param
|
||
44 | * @param
|
||
45 | * @return Angle
|
||
46 | */
|
||
47 | 201 | up20180642 | double get_mouse_angle(gunner_t *p);
|
48 | 167 | up20180655 | |
49 | /**
|
||
50 | * @brief Get horizontal movement direction.
|
||
51 | * @return Horizontal movement direction (-1 -> heading LEFT; 0 -> not moving horizontally; 1 -> heading RIGHT)
|
||
52 | */
|
||
53 | int get_hor_movement(void); |
||
54 | |||
55 | /**
|
||
56 | * @brief Get vertical movement direction.
|
||
57 | * @return Vertical movement direction (-1 -> heading UP; 0 -> not moving vertically; 1 -> heading DOWN)
|
||
58 | */
|
||
59 | int get_ver_movement(void); |
||
60 | |||
61 | 156 | up20180655 | #endif /* end of include guard: PROJ_FUNC_H_INCLUDED */ |