Refactor DungeonEditor to use std::array for gfx sheets

This commit is contained in:
scawful
2024-08-13 21:57:00 -04:00
parent 4aabb3d0b4
commit b9622c880c
2 changed files with 3 additions and 4 deletions

View File

@@ -109,7 +109,7 @@ absl::Status DungeonEditor::Initialize() {
ASSIGN_OR_RETURN(current_palette_group_,
gfx::CreatePaletteGroupFromLargePalette(full_palette_));
graphics_bin_ = *rom()->mutable_bitmap_manager();
graphics_bin_ = rom()->gfx_sheets();
// Create a vector of pointers to the current block bitmaps
for (int block : rooms_[current_room_id_].blocks()) {
room_gfx_sheets_.emplace_back(&graphics_bin_[block]);

View File

@@ -1,8 +1,6 @@
#ifndef YAZE_APP_EDITOR_DUNGEONEDITOR_H
#define YAZE_APP_EDITOR_DUNGEONEDITOR_H
#include "imgui/imgui.h"
#include "app/core/common.h"
#include "app/core/labeling.h"
#include "app/editor/graphics/gfx_group_editor.h"
@@ -11,6 +9,7 @@
#include "app/gui/canvas.h"
#include "app/gui/icons.h"
#include "app/rom.h"
#include "imgui/imgui.h"
#include "zelda3/dungeon/room.h"
#include "zelda3/dungeon/room_entrance.h"
#include "zelda3/dungeon/room_object.h"
@@ -120,7 +119,7 @@ class DungeonEditor : public Editor,
gui::Canvas object_canvas_;
gfx::Bitmap room_gfx_bmp_;
gfx::BitmapManager graphics_bin_;
std::array<gfx::Bitmap, kNumGfxSheets> graphics_bin_;
std::vector<gfx::Bitmap*> room_gfx_sheets_;
std::vector<zelda3::dungeon::Room> rooms_;