From 5e13b1b57166f46c5819c468bf42798d2bdab73d Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 11 Apr 2025 00:50:48 -0400 Subject: [PATCH] Remove dungeon.h and overworld.h headers; integrate their structures directly into zelda.h and update include paths in related source files. --- incl/dungeon.h | 78 ----------------------------- incl/overworld.h | 40 --------------- incl/yaze.h | 2 - incl/zelda.h | 90 ++++++++++++++++++++++++++++++++++ src/app/zelda3/dungeon/room.cc | 2 +- src/app/zelda3/dungeon/room.h | 2 +- src/yaze.cc | 1 - 7 files changed, 92 insertions(+), 123 deletions(-) delete mode 100644 incl/dungeon.h delete mode 100644 incl/overworld.h diff --git a/incl/dungeon.h b/incl/dungeon.h deleted file mode 100644 index bb151e59..00000000 --- a/incl/dungeon.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef YAZE_BASE_DUNGEON_H_ -#define YAZE_BASE_DUNGEON_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -typedef struct dungeon_sprite { - const char* name; - uint8_t id; - uint8_t subtype; -} dungeon_sprite; - -typedef enum background2 { - Off, - Parallax, - Dark, - OnTop, - Translucent, - Addition, - Normal, - Transparent, - DarkRoom -} background2; - -typedef struct object_door { - short id; - uint8_t x; - uint8_t y; - uint8_t size; - uint8_t type; - uint8_t layer; -} object_door; - -typedef struct staircase { - uint8_t id; - uint8_t room; - const char* label; -} staircase; - -typedef struct chest { - uint8_t x; - uint8_t y; - uint8_t item; - bool picker; - bool big_chest; -} chest; - -typedef struct chest_data { - uint8_t id; - bool size; -} chest_data; - -typedef struct destination { - uint8_t index; - uint8_t target; - uint8_t target_layer; -} destination; - -typedef struct zelda3_dungeon_room { - background2 bg2; - dungeon_sprite* sprites; - object_door* doors; - staircase* staircases; - chest* chests; - chest_data* chests_in_room; - destination pits; - destination stairs[4]; -} zelda3_dungeon_room; - -#ifdef __cplusplus -} -#endif - -#endif // YAZE_BASE_DUNGEON_H_ diff --git a/incl/overworld.h b/incl/overworld.h deleted file mode 100644 index 22240f45..00000000 --- a/incl/overworld.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef YAZE_OVERWORLD_H -#define YAZE_OVERWORLD_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/** - * @brief Primitive of an overworld map. - */ -typedef struct zelda3_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]; -} zelda3_overworld_map; - -/** - * @brief Primitive of the overworld. - */ -typedef struct zelda3_overworld { - void *impl; // yaze::Overworld* - zelda3_overworld_map **maps; /**< Pointer to the overworld maps. */ -} zelda3_overworld; - -#ifdef __cplusplus -} -#endif - -#endif // YAZE_OVERWORLD_H diff --git a/incl/yaze.h b/incl/yaze.h index 97775412..afc85732 100644 --- a/incl/yaze.h +++ b/incl/yaze.h @@ -8,8 +8,6 @@ extern "C" { #include #include -#include "dungeon.h" -#include "overworld.h" #include "snes.h" #include "zelda.h" diff --git a/incl/zelda.h b/incl/zelda.h index 10ed9a97..26cb46a2 100644 --- a/incl/zelda.h +++ b/incl/zelda.h @@ -6,6 +6,7 @@ extern "C" { #endif #include +#include /** * @brief Different versions of the game supported by yaze. @@ -94,6 +95,95 @@ zelda3_rom* yaze_load_rom(const char* filename); void yaze_unload_rom(zelda3_rom* rom); void yaze_save_rom(zelda3_rom* rom, const char* filename); +/** + * @brief Primitive of an overworld map. + */ +typedef struct zelda3_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]; +} zelda3_overworld_map; + +/** + * @brief Primitive of the overworld. + */ +typedef struct zelda3_overworld { + void *impl; // yaze::Overworld* + zelda3_overworld_map **maps; /**< Pointer to the overworld maps. */ +} zelda3_overworld; + +typedef struct dungeon_sprite { + const char* name; + uint8_t id; + uint8_t subtype; +} dungeon_sprite; + +typedef enum background2 { + Off, + Parallax, + Dark, + OnTop, + Translucent, + Addition, + Normal, + Transparent, + DarkRoom +} background2; + +typedef struct object_door { + short id; + uint8_t x; + uint8_t y; + uint8_t size; + uint8_t type; + uint8_t layer; +} object_door; + +typedef struct staircase { + uint8_t id; + uint8_t room; + const char* label; +} staircase; + +typedef struct chest { + uint8_t x; + uint8_t y; + uint8_t item; + bool picker; + bool big_chest; +} chest; + +typedef struct chest_data { + uint8_t id; + bool size; +} chest_data; + +typedef struct destination { + uint8_t index; + uint8_t target; + uint8_t target_layer; +} destination; + +typedef struct zelda3_dungeon_room { + background2 bg2; + dungeon_sprite* sprites; + object_door* doors; + staircase* staircases; + chest* chests; + chest_data* chests_in_room; + destination pits; + destination stairs[4]; +} zelda3_dungeon_room; + #ifdef __cplusplus } #endif diff --git a/src/app/zelda3/dungeon/room.cc b/src/app/zelda3/dungeon/room.cc index dee4107e..fe6ca4a7 100644 --- a/src/app/zelda3/dungeon/room.cc +++ b/src/app/zelda3/dungeon/room.cc @@ -1,6 +1,6 @@ #include "room.h" -#include +#include #include #include diff --git a/src/app/zelda3/dungeon/room.h b/src/app/zelda3/dungeon/room.h index 6d368ae4..ae123bb1 100644 --- a/src/app/zelda3/dungeon/room.h +++ b/src/app/zelda3/dungeon/room.h @@ -1,7 +1,7 @@ #ifndef YAZE_APP_ZELDA3_DUNGEON_ROOM_H #define YAZE_APP_ZELDA3_DUNGEON_ROOM_H -#include +#include #include #include diff --git a/src/yaze.cc b/src/yaze.cc index ed551900..4bd1c2ef 100644 --- a/src/yaze.cc +++ b/src/yaze.cc @@ -8,7 +8,6 @@ #include "app/core/controller.h" #include "app/rom.h" #include "app/zelda3/overworld/overworld.h" -#include "dungeon.h" #include "util/flag.h" #include "yaze_config.h"