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.

This commit is contained in:
scawful
2025-04-29 13:38:20 -04:00
parent 114084ef95
commit ad60cd3fd3
4 changed files with 46 additions and 61 deletions

View File

@@ -1,58 +0,0 @@
#ifndef YAZE_INCL_SNES_TILE_H
#define YAZE_INCL_SNES_TILE_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
#include <stdint.h>
/**
* @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

View File

@@ -5,10 +5,10 @@
extern "C" { extern "C" {
#endif #endif
#include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "snes.h"
#include "zelda.h" #include "zelda.h"
typedef struct yaze_project yaze_project; typedef struct yaze_project yaze_project;
@@ -50,6 +50,49 @@ typedef struct yaze_bitmap {
yaze_bitmap yaze_load_bitmap(const char* filename); 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, snes_color yaze_get_color_from_paletteset(const zelda3_rom* rom,
int palette_set, int palette, int palette_set, int palette,
int color); int color);

View File

@@ -1,7 +1,7 @@
#ifndef YAZE_APP_GFX_SNES_COLOR_H_ #ifndef YAZE_APP_GFX_SNES_COLOR_H_
#define YAZE_APP_GFX_SNES_COLOR_H_ #define YAZE_APP_GFX_SNES_COLOR_H_
#include <snes.h> #include <yaze.h>
#include <cstdint> #include <cstdint>
#include <vector> #include <vector>

View File

@@ -1,7 +1,7 @@
#ifndef YAZE_APP_GFX_SNES_TILE_H #ifndef YAZE_APP_GFX_SNES_TILE_H
#define YAZE_APP_GFX_SNES_TILE_H #define YAZE_APP_GFX_SNES_TILE_H
#include <snes.h> #include <yaze.h>
#include <array> #include <array>
#include <cstdint> #include <cstdint>