Compare commits

..

No commits in common. "d648bcbb9baeda76e38369ce7c9b1092660e5eab" and "34ee7e2a57079f8e5b00af4183d14ed75b35d8b8" have entirely different histories.

3 changed files with 9 additions and 5 deletions

View File

@ -103,10 +103,14 @@ static inline bool condition_is_component_type(elem_t *elem, va_list args)
return ((component_t *)elem->data)->type == va_arg(args, component_type_t);
}
inline component_t *entity_get_component(const entity_t *entity, component_type_t component_type)
inline component_t *entity_get_component(entity_t *entity, component_type_t component_type)
{
elem_t *component_elem = linked_list_get_if(&entity->components, condition_is_component_type, component_type);
if(!component_elem) return NULL;
if(!component_elem)
{
error_printf("Entity with id:%lu doesn't have componant of type : %d", entity->id, component_type);
return NULL;
}
component_t *component = component_elem->data;

View File

@ -53,7 +53,7 @@ int destroy_entity(entity_t *entity);
component_t *entity_new_component(entity_t *entity, component_type_t component_type);
component_t *entity_get_component(const entity_t *entity, component_type_t component_type);
component_t *entity_get_component(entity_t *entity, component_type_t component_type);
int update_entity(entity_t *entity);

View File

@ -97,7 +97,7 @@ void frect_to_rect(const frect_t *frect, rect_t *rect);
*
* @return True if there is an intersection, else false.
*/
#define has_intersection(A, B) SDL_HasRectIntersection(A, B)
#define has_intersection(A, B) SDL_HasIntersection(A, B)
/**
* @brief Verify if there is a intersction between two rectangles. (float)
@ -107,7 +107,7 @@ void frect_to_rect(const frect_t *frect, rect_t *rect);
*
* @return True if there is an intersection, else false.
*/
#define fhas_intersection(A, B) SDL_HasRectIntersectionFloat(A, B)
#define fhas_intersection(A, B) SDL_HasIntersectionF(A, B)
/**
* @brief Verify if there is an intersection between two rectangles and get the intersection rectangle. (int)