Compare commits

..

2 Commits

Author SHA1 Message Date
Ulysse Cura f88901058f Started to clean comments 2025-08-07 19:31:41 +02:00
Ulysse Cura 9d095a93a8 Oops 2025-08-07 19:31:29 +02:00
3 changed files with 24 additions and 28 deletions

View File

@ -20,16 +20,12 @@ set(SOURCES
src/ecs/sprite_component.c
src/ecs/animation_system.c
src/ecs/player_system.c
src/ecs/enemy_system.c
)
# fx-CG-50-only assets
set(ASSETS_cg
assets-cg/player-sheets/player_idle_sheet.png
assets-cg/player-sheets/player_run_sheet.png
assets-cg/enemy-sheets/enemy_idle_sheet.png
assets-cg/enemy-sheets/enemy_run_sheet.png
)
fxconv_declare_assets(${ASSETS_cg} WITH_METADATA)

View File

@ -3,32 +3,37 @@
#include <gint/defs/types.h>
/* elem_t: Element struct for linked lists
This struct is the base for storing data.
@data Raw pointer to any type of data
@prev Pointer to the prev element in the linked list
@next Pointer to the next element in the linked list */
/**
* @brief Element struct for linked lists.
* This struct is the base for storing data.
*
* @param data Raw pointer to any type of data
* @param prev Pointer to the prev element in the linked list
* @param next Pointer to the next element in the linked list
*/
typedef struct elem_t {
void *data;
struct elem_t *prev;
struct elem_t *next;
} elem_t;
/* deleter_t: A type for deleters used during the destruction of data stored in elements
During the initialisation of linked lists you can pass in argument a deleter.
It is used during the destruction of an element.
You can pass NULL to the initialisation to use the default deleter (kfree(elem->data)).
Your deleter_t function declaration must look like this :
void name_of_your_deleter(void *data);
Then do what you need to destroy your data (don't forget to free the data itself...).
You should always define your function with "inline" if it's no too long. */
/**
* @brief A type for deleters used during the destruction of data stored in elements.
*
* During the initialisation of linked lists you can pass in argument a deleter.
* It is used during the destruction of an element.
* You can pass NULL to the initialisation to use the default deleter (kfree(elem->data)).
* Your deleter_t function declaration must look like this :
*
* @example void name_of_your_deleter(void *data);
*
* Then do what you need to destroy your data (don't forget to free the data itself...).
* You should always define your function with "inline" if it's no too long.
*/
typedef void (*deleter_t)(void *data);
/* condition_t: A type for condition used for function like linked_list_remove_if
/**
* @brief A type for condition used for function like linked_list_remove_if
For function like linked_list_remove_if you need a condition.
It have two argument which are "elem_t *" and "va_list", that is because it passes the element on the actual index
@ -232,4 +237,4 @@ void linked_list_remove_if(linked_list_t *linked_list, const condition_t conditi
@... Argument to pass to the condition */
void linked_list_for_each(const linked_list_t *linked_list, const action_t action, ...);
#endif // LINKED_LIST_H
#endif // LINKED_LIST_H

View File

@ -12,14 +12,9 @@ typedef struct builtin_texture_t {
extern bopti_image_t img_player_idle_sheet;
extern bopti_image_t img_player_run_sheet;
extern bopti_image_t img_enemy_idle_sheet;
extern bopti_image_t img_enemy_run_sheet;
static struct builtin_texture_t builtin_textures[] = {
{"player_idle_sheet", &img_player_idle_sheet},
{"player_run_sheet", &img_player_run_sheet},
{"enemy_idle_sheet", &img_enemy_idle_sheet},
{"enemy_run_sheet", &img_enemy_run_sheet},
};
#define BUILTIN_TEXTURE_COUNT (sizeof(builtin_textures) / sizeof(builtin_texture_t))