Project

General

Profile

Statistics
| Revision:

root / proj / include / proj_func.h @ 267

History | View | Annotate | Download (1.84 KB)

1
#ifndef PROJ_FUNC_H_INCLUDED
2
#define PROJ_FUNC_H_INCLUDED
3

    
4
#include "ent.h"
5
#include "font.h"
6

    
7
#include <stdint.h>
8

    
9
/**
10
 * @brief Cleans up all memory, unsubscribes interrupts.
11
 * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
12
 * @see {_ERRORS_H_::errors}
13
 */
14
int cleanup(void);
15

    
16
typedef struct keys {
17
    uint8_t w_pressed       : 1;
18
    uint8_t a_pressed       : 1;
19
    uint8_t s_pressed       : 1;
20
    uint8_t d_pressed       : 1;
21
    uint8_t ctrl_pressed    : 1;
22
    uint8_t plus_pressed    : 1;
23
    uint8_t minus_pressed   : 1;
24
    uint8_t lb_pressed      : 1;
25
} keys_t;
26

    
27
void update_key_presses(void);
28

    
29
/**
30
 * @brief Updates movement variables.
31
 */
32
void update_movement(const map_t *map, gunner_t *p, keys_t *keys, list_t *shooter_list);
33

    
34
void update_mouse(struct packet *p);
35

    
36
keys_t* (get_key_presses)(void);
37

    
38
void (shoot_bullet)(const gunner_t *shooter, list_t *bullet_list, const basic_sprite_t *bsp_bullet);
39

    
40
void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list);
41

    
42
void (get_random_spawn)(const map_t *map, gunner_t *p);
43

    
44
void update_scale(void);
45

    
46
int32_t* get_mouse_X(void);
47

    
48
int32_t* get_mouse_Y(void);
49

    
50
/**
51
 * @brief
52
 * @param
53
 * @param
54
 * @param
55
 * @return Angle
56
 */
57
double get_mouse_angle(gunner_t *p);
58

    
59
typedef struct menu menu_t;
60

    
61
menu_t* (menu_ctor)(const font_t *fnt);
62

    
63
int (menu_update_state)(menu_t *menu, int click);
64

    
65
void (menu_draw)(menu_t *menu);
66

    
67
void (menu_dtor)(menu_t *p);
68

    
69
typedef struct timer {
70
    int time;
71
    text_t *text;
72
    char *array;
73
} text_timer_t;
74

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

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

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

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

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