Revision 345
reorganizing
proj_func.h | ||
---|---|---|
21 | 21 |
*/ |
22 | 22 |
int cleanup(void); |
23 | 23 |
|
24 |
/** |
|
25 |
* @brief Update key presses. |
|
26 |
*/ |
|
24 | 27 |
void update_key_presses(void); |
28 |
/** |
|
29 |
* @brief Get key presses. |
|
30 |
* @return keys_t containing key presses |
|
31 |
*/ |
|
32 |
keys_t* (get_key_presses)(void); |
|
25 | 33 |
|
26 | 34 |
/** |
35 |
* @brief Update mouse. |
|
36 |
*/ |
|
37 |
void update_mouse(struct packet *p); |
|
38 |
/** |
|
39 |
* @brief Get pointer to mouse X-position. |
|
40 |
* @return Pointer to mouse X-position. |
|
41 |
*/ |
|
42 |
int16_t* get_mouse_X(void); |
|
43 |
/** |
|
44 |
* @brief Get pointer to mouse Y-position. |
|
45 |
* @return Pointer to mouse Y-position. |
|
46 |
*/ |
|
47 |
int16_t* get_mouse_Y(void); |
|
48 |
/** |
|
49 |
* @brief Get cursor angle relative to a gunner in the screen. |
|
50 |
* @param p Pointer to gunner |
|
51 |
* @return Angle of the mouse relative to the gunner |
|
52 |
*/ |
|
53 |
double get_mouse_angle(gunner_t *p); |
|
54 |
|
|
55 |
/** |
|
27 | 56 |
* @brief Updates movement variables. |
28 | 57 |
*/ |
29 | 58 |
void update_movement(map_t *map, gunner_t *p, keys_t *keys, list_t *shooter_list); |
... | ... | |
39 | 68 |
*/ |
40 | 69 |
void (get_random_spawn)(const map_t *map, gunner_t *p, list_t *l); |
41 | 70 |
|
42 |
void update_mouse(struct packet *p); |
|
71 |
/** |
|
72 |
* @brief Update scale if the keys were pressed to change scale. |
|
73 |
*/ |
|
74 |
void update_scale(void); |
|
43 | 75 |
|
44 |
keys_t* (get_key_presses)(void); |
|
45 |
|
|
76 |
/** |
|
77 |
* @brief Shoot a bullet. |
|
78 |
* @param shooter Pointer to gunner that shot the bullet |
|
79 |
* @param bullet_list List of the bullets in the map |
|
80 |
* @param bsp_bullet Basic sprite that will be used to render the bullet |
|
81 |
*/ |
|
46 | 82 |
void (shoot_bullet)(const gunner_t *shooter, list_t *bullet_list, const basic_sprite_t *bsp_bullet); |
47 |
|
|
83 |
/** |
|
84 |
* @brief Update game state. |
|
85 |
* |
|
86 |
* This includes moving bullets accordingly, processing damages, collisions of |
|
87 |
* bullets with walls, melee damage for the gunners that have autonomous melee. |
|
88 |
* @param map Pointer to map |
|
89 |
* @param shooter_list List of shooters |
|
90 |
* @param bullet_list List of bullets in the map |
|
91 |
*/ |
|
48 | 92 |
void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list); |
49 | 93 |
|
50 |
|
|
51 |
|
|
52 |
void update_scale(void); |
|
53 |
|
|
54 |
int16_t* get_mouse_X(void); |
|
55 |
|
|
56 |
int16_t* get_mouse_Y(void); |
|
57 |
|
|
94 |
/** |
|
95 |
* @brief Wrapper to easen filling of the host_info_t. |
|
96 |
* @param p Host info to fill |
|
97 |
* @param host Host gunner |
|
98 |
* @param remote Remote gunner |
|
99 |
*/ |
|
58 | 100 |
void build_host_structure(host_info_t *p, gunner_t *host, gunner_t *remote); |
59 |
|
|
101 |
/** |
|
102 |
* @brief Wrapper to easen filling of the remote_info_t. |
|
103 |
* @param p Remote info to fill |
|
104 |
* @param keys Key presses of remote |
|
105 |
* @param angle Mouse angle of remote |
|
106 |
*/ |
|
60 | 107 |
void build_remote_structure(remote_info_t *p, keys_t *keys, double angle); |
61 | 108 |
|
62 |
double get_mouse_angle(gunner_t *p); |
|
63 | 109 |
|
110 |
|
|
64 | 111 |
/** |
65 | 112 |
* @} |
66 | 113 |
*/ |
... | ... | |
82 | 129 |
/// @brief Text. |
83 | 130 |
text_t *text; |
84 | 131 |
} text_timer_t; |
132 |
/** |
|
133 |
* @brief Construct timer |
|
134 |
* @param fnt Font used to render timer text |
|
135 |
* @return Pointer to constructed timer, or NULL if failed |
|
136 |
*/ |
|
137 |
text_timer_t* (text_timer_ctor)(const font_t *fnt); |
|
138 |
/** |
|
139 |
* @brief Destruct timer. |
|
140 |
* @param p Pointer to timer to be destructed |
|
141 |
*/ |
|
142 |
void (text_timer_dtor)(text_timer_t *p); |
|
143 |
/** |
|
144 |
* @brief Update timer, by incrementing the number of seconds. |
|
145 |
* @param p Pointer to timer |
|
146 |
*/ |
|
147 |
void (text_timer_update)(text_timer_t *p); |
|
148 |
/** |
|
149 |
* @brief Reset timer to 0. |
|
150 |
* @param p Pointer to timer |
|
151 |
*/ |
|
152 |
void (text_timer_reset)(text_timer_t *p); |
|
85 | 153 |
|
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 | 154 |
/** |
95 | 155 |
* @} |
96 | 156 |
*/ |
Also available in: Unified diff