From ad60cd3fd3ad80f0675cfb38faefcf6326f198f7 Mon Sep 17 00:00:00 2001 From: scawful Date: Tue, 29 Apr 2025 13:38:20 -0400 Subject: [PATCH] Remove snes.h header file and migrate SNES-related structures to yaze.h for better organization; update includes in snes_color.h and snes_tile.h accordingly. --- incl/snes.h | 58 ---------------------------------------- incl/yaze.h | 45 ++++++++++++++++++++++++++++++- src/app/gfx/snes_color.h | 2 +- src/app/gfx/snes_tile.h | 2 +- 4 files changed, 46 insertions(+), 61 deletions(-) delete mode 100644 incl/snes.h diff --git a/incl/snes.h b/incl/snes.h deleted file mode 100644 index c7d34454..00000000 --- a/incl/snes.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef YAZE_INCL_SNES_TILE_H -#define YAZE_INCL_SNES_TILE_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -/** - * @brief Primitive of 16-bit RGB SNES color. - */ -typedef struct snes_color { - uint16_t red; /**< Red component of the color. */ - uint16_t blue; /**< Blue component of the color. */ - uint16_t green; /**< Green component of the color. */ -} snes_color; - -/** - * @brief Primitive of a SNES color palette. - */ -typedef struct snes_palette { - unsigned int id; /**< ID of the palette. */ - unsigned int size; /**< Size of the palette. */ - snes_color* colors; /**< Pointer to the colors in the palette. */ -} snes_palette; - -typedef struct snes_tile8 { - uint32_t id; - uint32_t palette_id; - uint8_t data[64]; -} snes_tile8; - -typedef struct snes_tile_info { - uint16_t id; - uint8_t palette; - bool priority; - bool vertical_mirror; - bool horizontal_mirror; -} snes_tile_info; - -typedef struct snes_tile16 { - snes_tile_info tiles[4]; -} snes_tile16; - -typedef struct snes_tile32 { - uint16_t t0; - uint16_t t1; - uint16_t t2; - uint16_t t3; -} snes_tile32; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/incl/yaze.h b/incl/yaze.h index afc85732..04f38ea4 100644 --- a/incl/yaze.h +++ b/incl/yaze.h @@ -5,10 +5,10 @@ extern "C" { #endif +#include #include #include -#include "snes.h" #include "zelda.h" typedef struct yaze_project yaze_project; @@ -50,6 +50,49 @@ typedef struct yaze_bitmap { yaze_bitmap yaze_load_bitmap(const char* filename); +/** + * @brief Primitive of 16-bit RGB SNES color. + */ +typedef struct snes_color { + uint16_t red; /**< Red component of the color. */ + uint16_t blue; /**< Blue component of the color. */ + uint16_t green; /**< Green component of the color. */ +} snes_color; + +/** + * @brief Primitive of a SNES color palette. + */ +typedef struct snes_palette { + unsigned int id; /**< ID of the palette. */ + unsigned int size; /**< Size of the palette. */ + snes_color* colors; /**< Pointer to the colors in the palette. */ +} snes_palette; + +typedef struct snes_tile8 { + uint32_t id; + uint32_t palette_id; + uint8_t data[64]; +} snes_tile8; + +typedef struct snes_tile_info { + uint16_t id; + uint8_t palette; + bool priority; + bool vertical_mirror; + bool horizontal_mirror; +} snes_tile_info; + +typedef struct snes_tile16 { + snes_tile_info tiles[4]; +} snes_tile16; + +typedef struct snes_tile32 { + uint16_t t0; + uint16_t t1; + uint16_t t2; + uint16_t t3; +} snes_tile32; + snes_color yaze_get_color_from_paletteset(const zelda3_rom* rom, int palette_set, int palette, int color); diff --git a/src/app/gfx/snes_color.h b/src/app/gfx/snes_color.h index bb3e05ec..35020a55 100644 --- a/src/app/gfx/snes_color.h +++ b/src/app/gfx/snes_color.h @@ -1,7 +1,7 @@ #ifndef YAZE_APP_GFX_SNES_COLOR_H_ #define YAZE_APP_GFX_SNES_COLOR_H_ -#include +#include #include #include diff --git a/src/app/gfx/snes_tile.h b/src/app/gfx/snes_tile.h index 91bca1fb..7137990f 100644 --- a/src/app/gfx/snes_tile.h +++ b/src/app/gfx/snes_tile.h @@ -1,7 +1,7 @@ #ifndef YAZE_APP_GFX_SNES_TILE_H #define YAZE_APP_GFX_SNES_TILE_H -#include +#include #include #include