Project

General

Profile

Statistics
| Revision:

root / proj / include / proj_func.h @ 340

History | View | Annotate | Download (1.73 KB)

1
#ifndef PROJ_FUNC_H_INCLUDED
2
#define PROJ_FUNC_H_INCLUDED
3

    
4
/**
5
 * @defgroup proj_func proj_func
6
 * @brief Project helper functions.
7
 *
8
 * @{
9
 */
10

    
11
#include "ent.h"
12
#include "text.h"
13
#include "proj_structures.h"
14

    
15
#include <stdint.h>
16

    
17
/**
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
void update_key_presses(void);
25

    
26
/**
27
 * @brief Updates movement variables.
28
 */
29
void update_movement(map_t *map, gunner_t *p, keys_t *keys, list_t *shooter_list);
30

    
31
void update_mouse(struct packet *p);
32

    
33
keys_t* (get_key_presses)(void);
34

    
35
void (shoot_bullet)(const gunner_t *shooter, list_t *bullet_list, const basic_sprite_t *bsp_bullet);
36

    
37
void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list);
38

    
39

    
40

    
41
void update_scale(void);
42

    
43
int16_t* get_mouse_X(void);
44

    
45
int16_t* get_mouse_Y(void);
46

    
47
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
double get_mouse_angle(gunner_t *p);
52

    
53
/**
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
typedef struct {
69
    /// @brief Time since construction.
70
    int time;
71
    /// @brief Text.
72
    text_t *text;
73
} text_timer_t;
74

    
75
text_timer_t* (timer_ctor)(const font_t *fnt);
76

    
77
void (timer_dtor)(text_timer_t *p);
78

    
79
void (timer_update)(text_timer_t *p);
80

    
81
void (timer_reset)(text_timer_t *p);
82

    
83
/**
84
 * @}
85
 */
86

    
87
#endif /* end of include guard: PROJ_FUNC_H_INCLUDED */