From 79de6ff8b27597f4d258ff52f83f2bca4afac521 Mon Sep 17 00:00:00 2001 From: scawful Date: Wed, 7 Aug 2024 11:22:36 -0400 Subject: [PATCH] add base/sprite.h --- src/base/sprite.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/yaze.h | 1 + 2 files changed, 47 insertions(+) create mode 100644 src/base/sprite.h diff --git a/src/base/sprite.h b/src/base/sprite.h new file mode 100644 index 00000000..18ea7357 --- /dev/null +++ b/src/base/sprite.h @@ -0,0 +1,46 @@ +#ifndef YAZE_BASE_SPRITE_H_ +#define YAZE_BASE_SPRITE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** + * @brief Sprite instruction. + */ + +struct sprite_instruction { + const char* content; /**< Content of the instruction. */ +}; +typedef struct sprite_instruction sprite_instruction; + +/** + * @brief Sprite action. + */ +struct sprite_action { + const char* name; /**< Name of the action. */ + uint8_t id; /**< ID of the action. */ + + sprite_instruction* + instructions; /**< Pointer to the instructions of the action. */ +}; +typedef struct sprite_action sprite_action; + +/** + * @brief Primitive of a sprite. + */ +struct sprite { + const char* name; /**< Name of the sprite. */ + uint8_t id; /**< ID of the sprite. */ + + sprite_action* actions; /**< Pointer to the actions of the sprite. */ +}; +typedef struct sprite sprite; + +#ifdef __cplusplus +} +#endif + +#endif // YAZE_BASE_SPRITE_H_ \ No newline at end of file diff --git a/src/yaze.h b/src/yaze.h index d74c0d45..54df17e9 100644 --- a/src/yaze.h +++ b/src/yaze.h @@ -9,6 +9,7 @@ extern "C" { #include #include "base/snes_color.h" +#include "base/sprite.h" void yaze_initialize(void);