Move GraphicsSheetManager to snes.h
This commit is contained in:
@@ -225,23 +225,6 @@ class Rom {
|
|||||||
zelda3_version version_ = zelda3_version::US;
|
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::Bitmap, kNumGfxSheets>& 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::Bitmap, kNumGfxSheets> gfx_sheets_;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This function iterates over all graphics sheets in the Rom and loads
|
* @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
|
* them into memory. Depending on the sheet's index, it may be uncompressed or
|
||||||
|
|||||||
@@ -1,10 +1,30 @@
|
|||||||
#ifndef YAZE_SNES_H_
|
#ifndef YAZE_SNES_H_
|
||||||
#define YAZE_SNES_H_
|
#define YAZE_SNES_H_
|
||||||
|
|
||||||
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include "app/gfx/bitmap.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
|
|
||||||
|
class GraphicsSheetManager {
|
||||||
|
public:
|
||||||
|
static GraphicsSheetManager& GetInstance() {
|
||||||
|
static GraphicsSheetManager instance;
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
GraphicsSheetManager() = default;
|
||||||
|
virtual ~GraphicsSheetManager() = default;
|
||||||
|
std::array<gfx::Bitmap, 223>& 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::Bitmap, 223> gfx_sheets_;
|
||||||
|
};
|
||||||
|
|
||||||
inline uint32_t SnesToPc(uint32_t addr) noexcept {
|
inline uint32_t SnesToPc(uint32_t addr) noexcept {
|
||||||
constexpr uint32_t kFastRomRegion = 0x808000;
|
constexpr uint32_t kFastRomRegion = 0x808000;
|
||||||
if (addr >= kFastRomRegion) {
|
if (addr >= kFastRomRegion) {
|
||||||
|
|||||||
Reference in New Issue
Block a user