From 3631a962bc4beffa5555747ecc325a9c6fb675f8 Mon Sep 17 00:00:00 2001 From: scawful Date: Tue, 6 Aug 2024 23:46:45 -0400 Subject: [PATCH] move struct snes_palette to base --- src/app/gfx/snes_palette.h | 13 ++----------- src/base/snes_color.h | 12 +++++++++++- src/test/gfx/snes_palette_test.cc | 1 - 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/app/gfx/snes_palette.h b/src/app/gfx/snes_palette.h index 9128c2b1..90250a58 100644 --- a/src/app/gfx/snes_palette.h +++ b/src/app/gfx/snes_palette.h @@ -2,7 +2,6 @@ #define YAZE_APP_GFX_PALETTE_H #include -#include "imgui/imgui.h" #include #include @@ -16,6 +15,8 @@ #include "absl/status/statusor.h" #include "app/core/constants.h" #include "app/gfx/snes_color.h" +#include "base/snes_color.h" +#include "imgui/imgui.h" namespace yaze { namespace app { @@ -88,16 +89,6 @@ constexpr int customAreaSpecificBGASM = 0x140150; // 1 byte, not 0 if enabled constexpr int customAreaSpecificBGEnabled = 0x140140; -/** - * @brief Primitive of a SNES color palette. - */ -struct snes_palette { - uint id; /**< ID of the palette. */ - uint size; /**< Size of the palette. */ - snes_color* colors; /**< Pointer to the colors in the palette. */ -}; -using snes_palette = struct snes_palette; - uint32_t GetPaletteAddress(const std::string& group_name, size_t palette_index, size_t color_index); diff --git a/src/base/snes_color.h b/src/base/snes_color.h index 12d665d2..c47f4e9a 100644 --- a/src/base/snes_color.h +++ b/src/base/snes_color.h @@ -1,7 +1,7 @@ #ifndef YAZE_BASE_SNES_COLOR_H_ #define YAZE_BASE_SNES_COLOR_H_ -#include +#include #ifdef __cplusplus extern "C" { @@ -17,6 +17,16 @@ struct snes_color { }; typedef struct snes_color snes_color; +/** + * @brief Primitive of a SNES color palette. + */ +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. */ +}; +using snes_palette = struct snes_palette; + #ifdef __cplusplus } #endif diff --git a/src/test/gfx/snes_palette_test.cc b/src/test/gfx/snes_palette_test.cc index 3c976098..15ddc5dc 100644 --- a/src/test/gfx/snes_palette_test.cc +++ b/src/test/gfx/snes_palette_test.cc @@ -12,7 +12,6 @@ using ::testing::ElementsAreArray; using yaze::app::gfx::ConvertRGBtoSNES; using yaze::app::gfx::ConvertSNEStoRGB; using yaze::app::gfx::Extract; -using yaze::app::gfx::snes_palette; using yaze::app::gfx::SnesPalette; namespace {