From e202d65780d53644760d3c3e0cd89dfcb7a0e22f Mon Sep 17 00:00:00 2001 From: scawful Date: Wed, 30 Apr 2025 17:49:09 -0400 Subject: [PATCH] Move GraphicsSheetManager to snes.h --- src/app/rom.h | 17 ----------------- src/app/snes.h | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/app/rom.h b/src/app/rom.h index 198e4ee4..7445d34e 100644 --- a/src/app/rom.h +++ b/src/app/rom.h @@ -225,23 +225,6 @@ class Rom { zelda3_version version_ = zelda3_version::US; }; -class GraphicsSheetManager { - public: - static GraphicsSheetManager& GetInstance() { - static GraphicsSheetManager instance; - return instance; - } - GraphicsSheetManager() = default; - virtual ~GraphicsSheetManager() = default; - std::array& gfx_sheets() { return gfx_sheets_; } - auto gfx_sheet(int i) { return gfx_sheets_[i]; } - auto mutable_gfx_sheet(int i) { return &gfx_sheets_[i]; } - auto mutable_gfx_sheets() { return &gfx_sheets_; } - - private: - std::array gfx_sheets_; -}; - /** * @brief This function iterates over all graphics sheets in the Rom and loads * them into memory. Depending on the sheet's index, it may be uncompressed or diff --git a/src/app/snes.h b/src/app/snes.h index 8354b160..a0ea300b 100644 --- a/src/app/snes.h +++ b/src/app/snes.h @@ -1,10 +1,30 @@ #ifndef YAZE_SNES_H_ #define YAZE_SNES_H_ +#include #include +#include "app/gfx/bitmap.h" + namespace yaze { +class GraphicsSheetManager { + public: + static GraphicsSheetManager& GetInstance() { + static GraphicsSheetManager instance; + return instance; + } + GraphicsSheetManager() = default; + virtual ~GraphicsSheetManager() = default; + std::array& gfx_sheets() { return gfx_sheets_; } + auto gfx_sheet(int i) { return gfx_sheets_[i]; } + auto mutable_gfx_sheet(int i) { return &gfx_sheets_[i]; } + auto mutable_gfx_sheets() { return &gfx_sheets_; } + + private: + std::array gfx_sheets_; +}; + inline uint32_t SnesToPc(uint32_t addr) noexcept { constexpr uint32_t kFastRomRegion = 0x808000; if (addr >= kFastRomRegion) {