From f9179297703b99995099942fb11f1810129ac195 Mon Sep 17 00:00:00 2001 From: scawful Date: Wed, 13 Nov 2024 09:16:54 -0500 Subject: [PATCH] Enhance overworld structures by adding new fields to z3_overworld_map and z3_overworld; improve map and sprite management --- src/incl/overworld.h | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/src/incl/overworld.h b/src/incl/overworld.h index f8597a88..4ced9222 100644 --- a/src/incl/overworld.h +++ b/src/incl/overworld.h @@ -7,28 +7,41 @@ extern "C" { #include -typedef struct z3_overworld z3_overworld; -typedef struct z3_overworld_map z3_overworld_map; +#include "incl/sprite.h" /** * @brief Primitive of an overworld map. */ -struct z3_overworld_map { - uint8_t id; /**< ID of the overworld map. */ - uint8_t* tile32_data; /**< Pointer to the 32x32 tile data. */ - uint8_t* tile16_data; /**< Pointer to the 16x16 tile data. */ -}; +typedef struct z3_overworld_map { + uint8_t id; /**< ID of the overworld map. */ + uint8_t parent_id; + uint8_t quadrant_id; + uint8_t world_id; + uint8_t game_state; + uint8_t area_graphics; + uint8_t area_palette; + + uint8_t sprite_graphics[3]; + uint8_t sprite_palette[3]; + uint8_t area_music[4]; + uint8_t static_graphics[16]; +} z3_overworld_map; /** * @brief Primitive of the overworld. */ -struct z3_overworld { - z3_overworld_map** maps; /**< Pointer to the overworld maps. */ - void* impl; // yaze::app::Overworld* -}; +typedef struct z3_overworld { + void *impl; // yaze::app::Overworld* + + uint8_t *tile32_data; /**< Pointer to the 32x32 tile data. */ + uint8_t *tile16_data; /**< Pointer to the 16x16 tile data. */ + + z3_sprite **sprites; /**< Pointer to the sprites per map. */ + z3_overworld_map **maps; /**< Pointer to the overworld maps. */ +} z3_overworld; #ifdef __cplusplus } #endif -#endif // YAZE_OVERWORLD_H +#endif // YAZE_OVERWORLD_H