Revision 237
now loading bullet sprite only once
proj_func.c | ||
---|---|---|
10 | 10 |
#include "utils.h" |
11 | 11 |
#include "ent.h" |
12 | 12 |
#include "fast_math.h" |
13 |
#include "bullet.h" |
|
14 | 13 |
|
15 | 14 |
#include "kbc_macros.h" |
16 | 15 |
|
... | ... | |
66 | 65 |
} |
67 | 66 |
} |
68 | 67 |
|
69 |
void (shoot_bullet)(const gunner_t *shooter, list_t *bullet_list) { |
|
68 |
void (shoot_bullet)(const gunner_t *shooter, list_t *bullet_list, const basic_sprite_t *bsp_bullet) {
|
|
70 | 69 |
double angle = gunner_get_angle(shooter); |
71 | 70 |
double vx = -BULLET_SPEED * fm_sin(angle); |
72 | 71 |
double vy = -BULLET_SPEED * fm_cos(angle); |
73 |
bullet_t *bullet = bullet_ctor(shooter, get_bullet(), gunner_get_x(shooter), gunner_get_y(shooter), vx, vy);
|
|
72 |
bullet_t *bullet = bullet_ctor(shooter, bsp_bullet, gunner_get_x(shooter), gunner_get_y(shooter), vx, vy);
|
|
74 | 73 |
list_insert(bullet_list, list_end(bullet_list), bullet); |
75 | 74 |
} |
76 | 75 |
|
Also available in: Unified diff