Moved components initialisation outside of other components.

This commit is contained in:
Ulysse Cura 2026-08-11 11:22:28 +02:00
parent f13ad03d6e
commit 8a087f64fa
3 changed files with 0 additions and 19 deletions

View File

@ -43,14 +43,7 @@ inline int door_component_init(component_t *component)
}
component_data->hitbox_component_data = hitbox_component->data;
animation_system_data_t *animation_system_data = component_data->animation_system_data;
animation_system_data->nb_frames = 8;
animation_system_data->frame_delay_ms = DOOR_DEFAULT_ANIMATION_SPEED;
if(animation_system_create_frames_clips(animation_system_data)) return EXIT_FAILURE;
component_data->topic_id = 0;
event_bus_subscribe(&game.event_bus, component_data->topic_id, door_component_callback, component->entity);
component_data->state = false;

View File

@ -37,14 +37,7 @@ inline int lever_component_init(component_t *component)
}
component_data->animation_system_data = animation_system->data;
animation_system_data_t *animation_system_data = component_data->animation_system_data;
animation_system_data->nb_frames = 3;
animation_system_data->frame_delay_ms = LEVER_DEFAULT_ANIMATION_SPEED;
if(animation_system_create_frames_clips(animation_system_data)) return EXIT_FAILURE;
component_data->topic_id = 0;
event_bus_subscribe(&game.event_bus, component_data->topic_id, lever_component_callback, component->entity);
component_data->state = false;

View File

@ -38,11 +38,6 @@ inline int player_system_init(component_t *component)
system_data->state = PLAYER_MOVING;
animation_system_data_t *animation_system_data = system_data->animation_system_data;
animation_system_data->loop = true;
animation_system_data->play = true;
return EXIT_SUCCESS;
}