Project

General

Profile

Statistics
| Revision:

root / proj / include / proj_func.h @ 340

History | View | Annotate | Download (1.73 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 231 up20180655
void update_mouse(struct packet *p);
32 171 up20180655
33 231 up20180655
keys_t* (get_key_presses)(void);
34
35 237 up20180642
void (shoot_bullet)(const gunner_t *shooter, list_t *bullet_list, const basic_sprite_t *bsp_bullet);
36 231 up20180655
37 236 up20180642
void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list);
38 231 up20180655
39 246 up20180655
40 340 up20180642
41 200 up20180655
void update_scale(void);
42
43 321 up20180642
int16_t* get_mouse_X(void);
44 171 up20180655
45 321 up20180642
int16_t* get_mouse_Y(void);
46 171 up20180655
47 320 up20180655
void build_host_structure(host_info_t *p, gunner_t *host, gunner_t *remote, list_t *bullet_list);
48
49
void build_remote_structure(remote_info_t *p, keys_t *keys, double angle);
50
51 201 up20180642
double get_mouse_angle(gunner_t *p);
52 167 up20180655
53 340 up20180642
/**
54
 * @}
55
 */
56
57
/**
58
 * @defgroup text_timer_t text_timer_t
59
 * @ingroup proj_func
60
 * @brief Text timer.
61
 *
62
 * @{
63
 */
64
65
/**
66
 * @brief Text timer.
67
 */
68 339 up20180642
typedef struct {
69 340 up20180642
    /// @brief Time since construction.
70 250 up20180655
    int time;
71 340 up20180642
    /// @brief Text.
72 250 up20180655
    text_t *text;
73
} text_timer_t;
74
75
text_timer_t* (timer_ctor)(const font_t *fnt);
76
77 340 up20180642
void (timer_dtor)(text_timer_t *p);
78
79 250 up20180655
void (timer_update)(text_timer_t *p);
80
81 251 up20180655
void (timer_reset)(text_timer_t *p);
82
83 340 up20180642
/**
84
 * @}
85
 */
86 250 up20180655
87 156 up20180655
#endif /* end of include guard: PROJ_FUNC_H_INCLUDED */