From 8a087f64fa7e924c1e88e25dc0c9aa332896d2b2 Mon Sep 17 00:00:00 2001 From: Ulysse Cura Date: Tue, 11 Aug 2026 11:22:28 +0200 Subject: [PATCH] Moved components initialisation outside of other components. --- src/components/door_component.c | 7 ------- src/components/lever_component.c | 7 ------- src/components/player_system.c | 5 ----- 3 files changed, 19 deletions(-) diff --git a/src/components/door_component.c b/src/components/door_component.c index eb50e9c..0fddc4c 100644 --- a/src/components/door_component.c +++ b/src/components/door_component.c @@ -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; diff --git a/src/components/lever_component.c b/src/components/lever_component.c index 6787cbb..de42f66 100644 --- a/src/components/lever_component.c +++ b/src/components/lever_component.c @@ -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; diff --git a/src/components/player_system.c b/src/components/player_system.c index fc73f2e..09a39f8 100644 --- a/src/components/player_system.c +++ b/src/components/player_system.c @@ -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; }