add graphics sheets array and num sheets constant

This commit is contained in:
scawful
2024-08-06 19:15:16 -04:00
parent 1c1f8e9c1c
commit 543bc3d204
2 changed files with 11 additions and 2 deletions

View File

@@ -81,7 +81,6 @@ absl::Status Rom::LoadLinkGraphics() {
}
absl::Status Rom::LoadAllGraphicsData() {
constexpr uint32_t kNumGfxSheets = 223;
Bytes sheet;
bool bpp3 = false;
@@ -103,6 +102,10 @@ absl::Status Rom::LoadAllGraphicsData() {
if (bpp3) {
auto converted_sheet = gfx::SnesTo8bppSheet(sheet, 3);
graphics_sheets_[i].Create(core::kTilesheetWidth, core::kTilesheetHeight,
core::kTilesheetDepth, converted_sheet);
graphics_sheets_[i].CreateTexture(renderer_);
if (flags()->kUseBitmapManager) {
graphics_manager_.LoadBitmap(i, converted_sheet, core::kTilesheetWidth,
core::kTilesheetHeight,

View File

@@ -117,6 +117,7 @@ static const std::map<Z3_Version, VersionConstants> kVersionConstantsMap = {
0x67DD0, // kDungeonPalettesGroups
}}};
constexpr uint32_t kNumGfxSheets = 223;
constexpr uint32_t kNormalGfxSpaceStart = 0x87000;
constexpr uint32_t kNormalGfxSpaceEnd = 0xC4200;
constexpr uint32_t kFontSpriteLocation = 0x70000;
@@ -557,9 +558,14 @@ class Rom : public core::ExperimentFlags {
uchar title_[21] = "ROM Not Loaded";
std::string filename_;
// Full contiguous rom space
Bytes rom_data_;
// Full contiguous graphics space
Bytes graphics_buffer_;
Bytes font_gfx_data_;
// All graphics sheets in the game
std::array<gfx::Bitmap, kNumGfxSheets> graphics_sheets_;
Z3_Version version_ = Z3_Version::US;
gfx::BitmapTable graphics_bin_;