Fixed some typos, set components functions to inline and added "hitbox activated" param to hitbox component.

This commit is contained in:
Ulysse Cura 2026-08-04 01:57:01 +02:00
parent 357839cc71
commit 85c2777b90
7 changed files with 12 additions and 7 deletions

@ -1 +1 @@
Subproject commit dc0a1f36568146b8b9dd86fd2e7634464280179b
Subproject commit af462380762093bee9e471799c7ce31732a4b248

View File

@ -1,6 +1,7 @@
#ifndef ANIMATION_SYSTEM_H
#define ANIMATION_SYSTEM_H
#include <stdbool.h>
#include "ecs.h"
#include "sprite_component.h"

View File

@ -1,6 +1,7 @@
#ifndef HITBOX_COMPONENT_H
#define HITBOX_COMPONENT_H
#include <stdbool.h>
#include "ecs.h"
#include "transform_component.h"
#include "vector2d.h"
@ -10,6 +11,7 @@ typedef struct hitbox_component_data_t {
fvector2d_t position;
fvector2d_t scale;
frect_t bounds;
bool activated;
} hitbox_component_data_t;
int hitbox_component_init(component_t *component);

View File

@ -22,6 +22,8 @@ int hitbox_component_init(component_t *component)
.y = 1.0f
};
component_data->activated = true;
return EXIT_SUCCESS;
}

View File

@ -7,7 +7,7 @@
#include "transform_component.h"
// No args
int player_system_init(component_t *component)
inline int player_system_init(component_t *component)
{
player_system_data_t *system_data = component->component_data;
@ -126,7 +126,7 @@ static inline int player_system_set_animation_and_speed(player_system_data_t *sy
return EXIT_SUCCESS;
}
int player_system_update(component_t *component)
inline int player_system_update(component_t *component)
{
player_system_data_t *system_data = component->component_data;
@ -137,7 +137,7 @@ int player_system_update(component_t *component)
return EXIT_SUCCESS;
}
int player_system_destroy(component_t *component)
inline int player_system_destroy(component_t *component)
{
player_system_data_t *component_data = component->component_data;

View File

@ -5,7 +5,7 @@
#include "game.h"
// Arg : const char *name
int sprite_component_init(component_t *component)
inline int sprite_component_init(component_t *component)
{
sprite_component_data_t *component_data = component->component_data;

View File

@ -25,7 +25,7 @@ int transform_component_init(component_t *component)
return EXIT_SUCCESS;
}
int transform_component_update(component_t *component)
inline int transform_component_update(component_t *component)
{
transform_component_data_t *component_data = component->component_data;
@ -39,7 +39,7 @@ int transform_component_update(component_t *component)
#include "display.h"
#include "errors.h"
int transform_component_draw(component_t *component)
inline int transform_component_draw(component_t *component)
{
transform_component_data_t *component_data = component->component_data;