reseting the ship exhaust plumes when going back to main menu.

This commit is contained in:
Juan Lopez
2023-09-08 23:15:20 +02:00
parent a6784cc19f
commit 83a0992081
3 changed files with 20 additions and 3 deletions
+2
View File
@@ -515,6 +515,8 @@ static void objects_unpack_imp(Object **dest_array, int len, Object *src) {
void main_menu_init(void) {
g.is_attract_mode = false;
ships_reset_exhaust_plumes();
main_menu = mem_bump(sizeof(menu_t));
background = image_get_texture("wipeout/textures/wipeout1.tim");
+16 -3
View File
@@ -143,6 +143,11 @@ void ships_update(void) {
}
}
void ships_reset_exhaust_plumes(void) {
for (int i = 0; i < len(g.ships); i++) {
ship_reset_exhaust_plume(&g.ships[i]);
}
}
void ships_draw(void) {
@@ -389,6 +394,17 @@ void ship_init_exhaust_plume(ship_t *self) {
}
}
void ship_reset_exhaust_plume(ship_t* self)
{
for (int i = 0; i < 3; i++) {
if (self->exhaust_plume[i].v != NULL) {
self->exhaust_plume[i].v->z = self->exhaust_plume[i].initial.z;
self->exhaust_plume[i].v->x = self->exhaust_plume[i].initial.x;
self->exhaust_plume[i].v->y = self->exhaust_plume[i].initial.y;
}
}
}
void ship_draw(ship_t *self) {
object_draw(self->model, &self->mat);
@@ -1001,6 +1017,3 @@ void ship_collide_with_ship(ship_t *self, ship_t *other) {
flags_add(self->flags, SHIP_COLL);
flags_add(other->flags, SHIP_COLL);
}
+2
View File
@@ -150,9 +150,11 @@ void ships_load(void);
void ships_init(section_t *section);
void ships_draw(void);
void ships_update(void);
void ships_reset_exhaust_plumes(void);
void ship_init(ship_t *self, section_t *section, int pilot, int position);
void ship_init_exhaust_plume(ship_t *self);
void ship_reset_exhaust_plume(ship_t *self);
void ship_draw(ship_t *self);
void ship_draw_shadow(ship_t *self);
void ship_update(ship_t *self);