diff --git a/src/game_data/ecs/animation_system.hpp b/src/game_data/ecs/animation_system.hpp index 70ec833..0708184 100644 --- a/src/game_data/ecs/animation_system.hpp +++ b/src/game_data/ecs/animation_system.hpp @@ -11,6 +11,6 @@ typedef struct animation_system_data_t { bool play; bool loop; bool reverse; -} animation_system_data_t; +} __attribute__((packed, aligned(4))) animation_system_data_t; #endif // SPRITE_COMPONENT_H \ No newline at end of file diff --git a/src/game_data/ecs/ecs.hpp b/src/game_data/ecs/ecs.hpp index d210bc0..251f3b6 100644 --- a/src/game_data/ecs/ecs.hpp +++ b/src/game_data/ecs/ecs.hpp @@ -19,12 +19,12 @@ typedef struct component_t { sprite_component_data_t *sprite_component_data; animation_system_data_t *animation_system_data; } component_data; -} component_t; +} __attribute__((packed, aligned(4))) component_t; typedef struct entity_t { uint16_t id; uint32_t nb_component; component_t *components; -} entity_t; +} __attribute__((packed, aligned(4))) entity_t; #endif // ECS_H \ No newline at end of file diff --git a/src/game_data/ecs/sprite_component.hpp b/src/game_data/ecs/sprite_component.hpp index b9826c9..3e7071b 100644 --- a/src/game_data/ecs/sprite_component.hpp +++ b/src/game_data/ecs/sprite_component.hpp @@ -3,6 +3,6 @@ typedef struct sprite_component_data_t { const char *texture_name; -} sprite_component_data_t; +} __attribute__((packed, aligned(4))) sprite_component_data_t; #endif // SPRITE_COMPONENT_H \ No newline at end of file diff --git a/src/game_data/ecs/transform_component.hpp b/src/game_data/ecs/transform_component.hpp index 92b9ca9..7fdeeef 100644 --- a/src/game_data/ecs/transform_component.hpp +++ b/src/game_data/ecs/transform_component.hpp @@ -4,7 +4,7 @@ typedef struct transform_component_data_t { uint32_t x, y; uint32_t w, h; - float speed; -} transform_component_data_t; + uint32_t speed; +} __attribute__((packed, aligned(4))) transform_component_data_t; #endif // TRANSFORM_COMPONENT_H \ No newline at end of file