Project

General

Profile

Statistics
| Revision:

root / proj / include / proj_func.h @ 341

History | View | Annotate | Download (2.11 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
/**
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
void update_mouse(struct packet *p);
43

    
44
keys_t* (get_key_presses)(void);
45

    
46
void (shoot_bullet)(const gunner_t *shooter, list_t *bullet_list, const basic_sprite_t *bsp_bullet);
47

    
48
void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list);
49

    
50

    
51

    
52
void update_scale(void);
53

    
54
int16_t* get_mouse_X(void);
55

    
56
int16_t* get_mouse_Y(void);
57

    
58
void build_host_structure(host_info_t *p, gunner_t *host, gunner_t *remote, list_t *bullet_list);
59

    
60
void build_remote_structure(remote_info_t *p, keys_t *keys, double angle);
61

    
62
double get_mouse_angle(gunner_t *p);
63

    
64
/**
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
typedef struct {
80
    /// @brief Time since construction.
81
    int time;
82
    /// @brief Text.
83
    text_t *text;
84
} text_timer_t;
85

    
86
text_timer_t* (timer_ctor)(const font_t *fnt);
87

    
88
void (timer_dtor)(text_timer_t *p);
89

    
90
void (timer_update)(text_timer_t *p);
91

    
92
void (timer_reset)(text_timer_t *p);
93

    
94
/**
95
 * @}
96
 */
97

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