Compare commits

..

No commits in common. "f88901058f180d17ef93e465f2fdd2f5ddbdd8c5" and "54ae7038b850221bfed2ef5e2fdf192d24bc59f0" have entirely different histories.

3 changed files with 28 additions and 24 deletions

View File

@ -20,12 +20,16 @@ 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,37 +3,32 @@
#include <gint/defs/types.h>
/**
* @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
*/
/* 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 */
typedef struct elem_t {
void *data;
struct elem_t *prev;
struct elem_t *next;
} elem_t;
/**
* @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.
*/
/* 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. */
typedef void (*deleter_t)(void *data);
/**
* @brief A type for condition used for function like linked_list_remove_if
/* condition_t: 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
@ -237,4 +232,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,9 +12,14 @@ 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))