Allows the user to edit graphics sheets from the game or view prototype graphics. More...
#include <graphics_editor.h>
Public Member Functions | |
GraphicsEditor () | |
absl::Status | Update () override |
absl::Status | Undo () override |
absl::Status | Redo () override |
absl::Status | Cut () override |
absl::Status | Copy () override |
absl::Status | Paste () override |
absl::Status | Find () override |
Public Member Functions inherited from yaze::app::SharedRom | |
SharedRom ()=default | |
virtual | ~SharedRom ()=default |
std::shared_ptr< Rom > | shared_rom () |
auto | rom () |
Public Member Functions inherited from yaze::app::editor::Editor | |
Editor ()=default | |
virtual | ~Editor ()=default |
EditorType | type () const |
Private Types | |
enum class | GfxEditMode { kSelect , kPencil , kFill } |
Private Member Functions | |
absl::Status | UpdateGfxEdit () |
absl::Status | UpdateGfxSheetList () |
absl::Status | UpdateGfxTabView () |
absl::Status | UpdatePaletteColumn () |
void | DrawGfxEditToolset () |
absl::Status | UpdateLinkGfxView () |
absl::Status | UpdateScadView () |
absl::Status | DrawCgxImport () |
absl::Status | DrawScrImport () |
absl::Status | DrawFileImport () |
absl::Status | DrawObjImport () |
absl::Status | DrawTilemapImport () |
absl::Status | DrawToolset () |
absl::Status | DrawPaletteControls () |
absl::Status | DrawClipboardImport () |
absl::Status | DrawExperimentalFeatures () |
absl::Status | DrawMemoryEditor () |
absl::Status | DecompressImportData (int size) |
absl::Status | DecompressSuperDonkey () |
Additional Inherited Members | |
Static Public Attributes inherited from yaze::app::SharedRom | |
static std::shared_ptr< Rom > | shared_rom_ = nullptr |
Protected Attributes inherited from yaze::app::editor::Editor | |
EditorType | type_ |
EditorContext | context_ |
Allows the user to edit graphics sheets from the game or view prototype graphics.
The GraphicsEditor class is responsible for providing functionality to edit graphics sheets from the game or view prototype graphics of Link to the Past from the CGX, SCR, and OBJ formats. It provides various methods to update different components of the graphics editor, such as the graphics edit tab, link graphics view, and prototype graphics viewer. It also includes import functions for different file formats, as well as other utility functions for drawing toolsets, palette controls, clipboard imports, experimental features, and memory editor.
Definition at line 58 of file graphics_editor.h.
|
strongprivate |
Enumerator | |
---|---|
kSelect | |
kPencil | |
kFill |
Definition at line 72 of file graphics_editor.h.
|
inline |
Definition at line 60 of file graphics_editor.h.
References yaze::app::editor::kGraphics, and yaze::app::editor::Editor::type_.
|
overridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 43 of file graphics_editor.cc.
References asset_browser_, CLEAR_AND_RETURN_STATUS, yaze::app::gui::GfxSheetAssetBrowser::Draw(), END_TAB_ITEM, yaze::app::gui::GfxSheetAssetBrowser::Initialize(), yaze::app::gui::GfxSheetAssetBrowser::Initialized, yaze::app::SharedRom::rom(), status_, TAB_ITEM, UpdateGfxEdit(), UpdateLinkGfxView(), and UpdateScadView().
Referenced by yaze::app::editor::EditorManager::ManageActiveEditors().
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 64 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 65 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 66 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 67 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 68 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 69 of file graphics_editor.h.
|
private |
Definition at line 60 of file graphics_editor.cc.
References DrawGfxEditToolset(), yaze::app::editor::kGfxEditTableFlags, NEXT_COLUMN, yaze::app::SharedRom::rom(), status_, UpdateGfxSheetList(), UpdateGfxTabView(), and UpdatePaletteColumn().
Referenced by Update().
|
private |
Definition at line 175 of file graphics_editor.cc.
References current_sheet_, yaze::app::gui::Canvas::draw_list(), yaze::app::gui::Canvas::DrawBackground(), yaze::app::gui::Canvas::DrawContextMenu(), yaze::app::gui::Canvas::DrawGrid(), yaze::app::gui::Canvas::DrawOverlay(), graphics_bin_canvas_, yaze::app::kNumGfxSheets, open_sheets_, yaze::app::SharedRom::rom(), sheet_scale_, and yaze::app::gui::Canvas::zero_point().
Referenced by UpdateGfxEdit().
|
private |
Definition at line 248 of file graphics_editor.cc.
References yaze::app::gfx::Bitmap::at(), child_window_sheets_, current_color_, current_scale_, current_sheet_, current_sheet_canvas_, yaze::app::gui::Canvas::DrawTileOnBitmap(), yaze::app::core::Renderer::GetInstance(), ICON_MD_ADD, open_sheets_, release_queue_, yaze::app::SharedRom::rom(), tile_size_, yaze::app::core::Renderer::UpdateBitmap(), and yaze::app::gui::Canvas::UpdateColorPainter().
Referenced by UpdateGfxEdit().
|
private |
Definition at line 344 of file graphics_editor.cc.
References current_sheet_, edit_palette_group_name_index_, edit_palette_index_, edit_palette_sub_index_, yaze::app::core::Renderer::GetInstance(), yaze::app::gui::InputHex(), open_sheets_, refresh_graphics_, RETURN_IF_ERROR, yaze::app::SharedRom::rom(), yaze::app::gui::SelectablePalettePipeline(), yaze::app::gui::TextWithSeparators(), and yaze::app::core::Renderer::UpdateBitmap().
Referenced by UpdateGfxEdit().
|
private |
Definition at line 91 of file graphics_editor.cc.
References yaze::app::core::CopyImageToClipboard(), current_color_, current_scale_, current_sheet_, yaze::app::core::GetImageFromClipboard(), yaze::app::core::Renderer::GetInstance(), gfx_edit_mode_, HOVER_HINT, ICON_MD_CONTENT_COPY, ICON_MD_CONTENT_PASTE, ICON_MD_DRAW, ICON_MD_FORMAT_COLOR_FILL, ICON_MD_SELECT_ALL, ICON_MD_ZOOM_IN, ICON_MD_ZOOM_OUT, yaze::app::gui::InputHexByte(), kFill, kPencil, kSelect, yaze::app::SharedRom::rom(), tile_size_, and yaze::app::core::Renderer::UpdateBitmap().
Referenced by UpdateGfxEdit().
|
private |
Definition at line 374 of file graphics_editor.cc.
References yaze::app::gui::Canvas::DrawBackground(), yaze::app::gui::Canvas::DrawBitmap(), yaze::app::gui::Canvas::DrawContextMenu(), yaze::app::gui::Canvas::DrawGrid(), yaze::app::gui::Canvas::DrawOverlay(), END_TAB_ITEM, yaze::app::editor::kGfxEditTableFlags, yaze::app::gfx::kTilesheetHeight, link_canvas_, NEXT_COLUMN, RETURN_IF_ERROR, yaze::app::SharedRom::rom(), and TAB_ITEM.
Referenced by Update().
|
private |
Definition at line 422 of file graphics_editor.cc.
References BEGIN_TABLE, bin_bitmap_, yaze::app::gui::BitmapCanvasPipeline(), cgx_bitmap_, cgx_loaded_, col_file_, DrawCgxImport(), DrawClipboardImport(), DrawExperimentalFeatures(), DrawFileImport(), DrawMemoryEditor(), DrawPaletteControls(), DrawScrImport(), DrawToolset(), END_TAB_ITEM, END_TABLE, gfx_loaded_, import_canvas_, NEXT_COLUMN, open_memory_editor_, RETURN_IF_ERROR, scr_bitmap_, scr_canvas_, scr_loaded_, SETUP_COLUMN, status_, super_donkey_, TAB_ITEM, and TABLE_HEADERS.
Referenced by Update().
|
private |
Definition at line 514 of file graphics_editor.cc.
References yaze::app::gfx::Bitmap::ApplyPalette(), cgx_bitmap_, cgx_data_, cgx_file_name_, cgx_file_path_, cgx_loaded_, col_file_, yaze::app::gfx::Bitmap::Create(), current_bpp_, decoded_cgx_, decoded_col_, extra_cgx_data_, yaze::app::gui::FileDialogPipeline(), yaze::app::core::Renderer::GetInstance(), is_open_, yaze::app::gfx::scad_format::LoadCgx(), yaze::app::core::Renderer::RenderBitmap(), status_, and yaze::app::gui::TextWithSeparators().
Referenced by UpdateScadView().
|
private |
Definition at line 550 of file graphics_editor.cc.
References yaze::app::gfx::Bitmap::ApplyPalette(), yaze::app::gfx::Bitmap::Create(), current_bpp_, decoded_cgx_, decoded_col_, decoded_scr_data_, yaze::app::gfx::scad_format::DrawScrWithCgx(), yaze::app::gui::FileDialogPipeline(), yaze::app::core::Renderer::GetInstance(), is_open_, yaze::app::gfx::scad_format::LoadScr(), yaze::app::core::Renderer::RenderBitmap(), scr_bitmap_, scr_data_, scr_file_name_, scr_file_path_, scr_loaded_, scr_mod_value_, and status_.
Referenced by UpdateScadView().
|
private |
Definition at line 678 of file graphics_editor.cc.
References bin_size_, current_offset_, DecompressImportData(), file_path_, yaze::app::gui::FileDialogPipeline(), yaze::app::gui::InputHex(), is_open_, yaze::app::Rom::LoadFromFile(), RETURN_IF_ERROR, status_, temp_rom_, and yaze::app::gui::TextWithSeparators().
Referenced by UpdateScadView().
|
private |
Definition at line 636 of file graphics_editor.cc.
References file_path_, yaze::app::gui::FileDialogPipeline(), is_open_, yaze::app::Rom::LoadFromFile(), obj_file_path_, status_, temp_rom_, and yaze::app::gui::TextWithSeparators().
|
private |
Definition at line 654 of file graphics_editor.cc.
References yaze::app::Rom::data(), yaze::app::gfx::lc_lz2::DecompressV2(), yaze::app::gui::FileDialogPipeline(), is_open_, yaze::app::gfx::lc_lz2::kNintendoMode1, yaze::app::Rom::LoadFromFile(), status_, yaze::app::gui::TextWithSeparators(), tilemap_file_path_, tilemap_loaded_, and tilemap_rom_.
|
private |
Definition at line 487 of file graphics_editor.cc.
References ICON_MD_MEMORY, open_memory_editor_, and TEXT_COLUMN.
Referenced by UpdateScadView().
|
private |
Definition at line 585 of file graphics_editor.cc.
References yaze::app::gfx::PaletteGroup::clear(), col_file_, col_file_name_, col_file_palette_, col_file_palette_group_, col_file_path_, yaze::app::gfx::CreatePaletteGroupFromColFile(), current_palette_, current_palette_index_, yaze::app::Rom::data(), yaze::app::gfx::scad_format::DecodeColFile(), decoded_col_, yaze::app::gui::FileDialogPipeline(), yaze::app::gfx::GetColFileData(), yaze::app::gui::InputHex(), is_open_, yaze::app::Rom::LoadFromFile(), refresh_graphics_, yaze::app::SharedRom::rom(), yaze::app::gui::SelectablePalettePipeline(), yaze::app::gfx::PaletteGroup::size(), yaze::app::gfx::SnesPalette::size(), status_, temp_rom_, and yaze::app::gui::TextWithSeparators().
Referenced by UpdateScadView().
|
private |
Definition at line 710 of file graphics_editor.cc.
References clipboard_offset_, clipboard_size_, DecompressImportData(), yaze::app::gui::InputHex(), yaze::app::Rom::is_loaded(), is_open_, yaze::app::Rom::LoadFromBytes(), num_sheets_to_load_, open_memory_editor_, status_, temp_rom_, and yaze::app::gui::TextWithSeparators().
Referenced by UpdateScadView().
|
private |
Definition at line 740 of file graphics_editor.cc.
References DecompressSuperDonkey(), file_path_, RETURN_IF_ERROR, and yaze::app::gui::TextWithSeparators().
Referenced by UpdateScadView().
|
private |
Definition at line 757 of file graphics_editor.cc.
References yaze::app::Rom::data(), is_open_, yaze::app::Rom::size(), and temp_rom_.
Referenced by UpdateScadView().
|
private |
Definition at line 766 of file graphics_editor.cc.
References yaze::app::gfx::Bitmap::ApplyPalette(), ASSIGN_OR_RETURN, bin_bitmap_, col_file_, col_file_palette_, yaze::app::gfx::Bitmap::Create(), current_offset_, current_palette_, yaze::app::Rom::data(), yaze::app::gfx::lc_lz2::DecompressV2(), yaze::app::core::Renderer::GetInstance(), gfx_loaded_, import_data_, yaze::app::gfx::kTilesheetDepth, yaze::app::gfx::kTilesheetWidth, yaze::app::core::Renderer::RenderBitmap(), yaze::app::SharedRom::rom(), yaze::app::gfx::SnesTo8bppSheet(), status_, temp_rom_, and z3_rom_palette_.
Referenced by DrawClipboardImport(), and DrawFileImport().
|
private |
Definition at line 790 of file graphics_editor.cc.
References ASSIGN_OR_RETURN, col_file_, col_file_palette_group_, current_palette_, current_palette_index_, yaze::app::Rom::data(), yaze::app::gfx::lc_lz2::DecompressV2(), yaze::app::core::Renderer::GetInstance(), gfx_sheets_, yaze::app::editor::kSuperDonkeySprites, yaze::app::editor::kSuperDonkeyTiles, yaze::app::gfx::kTilesheetDepth, yaze::app::gfx::kTilesheetHeight, yaze::app::gfx::kTilesheetWidth, num_sheets_to_load_, yaze::app::core::Renderer::RenderBitmap(), yaze::app::SharedRom::rom(), yaze::app::gfx::SnesTo8bppSheet(), status_, super_donkey_, temp_rom_, and z3_rom_palette_.
Referenced by DrawExperimentalFeatures().
|
private |
Definition at line 109 of file graphics_editor.h.
Referenced by DrawGfxEditToolset(), and UpdateGfxTabView().
|
private |
Definition at line 110 of file graphics_editor.h.
Referenced by DrawGfxEditToolset(), UpdateGfxSheetList(), UpdateGfxTabView(), and UpdatePaletteColumn().
|
private |
Definition at line 111 of file graphics_editor.h.
Referenced by DrawGfxEditToolset(), and UpdateGfxTabView().
|
private |
Definition at line 112 of file graphics_editor.h.
Referenced by UpdateGfxSheetList(), UpdateGfxTabView(), and UpdatePaletteColumn().
|
private |
Definition at line 113 of file graphics_editor.h.
Referenced by UpdateGfxTabView().
|
private |
Definition at line 114 of file graphics_editor.h.
Referenced by UpdateGfxTabView().
|
private |
Definition at line 115 of file graphics_editor.h.
Referenced by UpdatePaletteColumn().
|
private |
Definition at line 116 of file graphics_editor.h.
|
private |
Definition at line 117 of file graphics_editor.h.
Referenced by UpdatePaletteColumn().
|
private |
Definition at line 118 of file graphics_editor.h.
Referenced by UpdatePaletteColumn().
|
private |
Definition at line 119 of file graphics_editor.h.
Referenced by UpdateGfxSheetList().
|
private |
Definition at line 120 of file graphics_editor.h.
Referenced by DrawGfxEditToolset(), and UpdateGfxTabView().
|
private |
Definition at line 123 of file graphics_editor.h.
Referenced by DecompressImportData(), DecompressSuperDonkey(), and DrawPaletteControls().
|
private |
Definition at line 124 of file graphics_editor.h.
Referenced by DecompressImportData(), and DrawFileImport().
|
private |
Definition at line 125 of file graphics_editor.h.
|
private |
Definition at line 126 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and DrawPaletteControls().
|
private |
Definition at line 127 of file graphics_editor.h.
Referenced by DrawCgxImport(), and DrawScrImport().
|
private |
Definition at line 128 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 130 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and DrawClipboardImport().
|
private |
Definition at line 131 of file graphics_editor.h.
Referenced by DrawFileImport().
|
private |
Definition at line 132 of file graphics_editor.h.
Referenced by DrawClipboardImport().
|
private |
Definition at line 133 of file graphics_editor.h.
Referenced by DrawClipboardImport().
|
private |
Definition at line 135 of file graphics_editor.h.
Referenced by DrawPaletteControls(), and UpdatePaletteColumn().
|
private |
Definition at line 136 of file graphics_editor.h.
Referenced by DrawClipboardImport(), DrawToolset(), and UpdateScadView().
|
private |
Definition at line 137 of file graphics_editor.h.
Referenced by DecompressImportData(), and UpdateScadView().
|
private |
Definition at line 138 of file graphics_editor.h.
Referenced by DrawCgxImport(), DrawClipboardImport(), DrawFileImport(), DrawMemoryEditor(), DrawObjImport(), DrawPaletteControls(), DrawScrImport(), and DrawTilemapImport().
|
private |
Definition at line 139 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and UpdateScadView().
|
private |
Definition at line 140 of file graphics_editor.h.
Referenced by DecompressImportData(), DecompressSuperDonkey(), DrawCgxImport(), DrawPaletteControls(), and UpdateScadView().
|
private |
Definition at line 141 of file graphics_editor.h.
Referenced by DrawCgxImport(), and UpdateScadView().
|
private |
Definition at line 142 of file graphics_editor.h.
Referenced by DrawScrImport(), and UpdateScadView().
|
private |
Definition at line 143 of file graphics_editor.h.
|
private |
Definition at line 144 of file graphics_editor.h.
Referenced by DrawTilemapImport().
|
private |
Definition at line 146 of file graphics_editor.h.
Referenced by DrawExperimentalFeatures(), DrawFileImport(), and DrawObjImport().
|
private |
Definition at line 147 of file graphics_editor.h.
Referenced by DrawPaletteControls().
|
private |
Definition at line 148 of file graphics_editor.h.
Referenced by DrawPaletteControls().
|
private |
Definition at line 149 of file graphics_editor.h.
Referenced by DrawCgxImport().
|
private |
Definition at line 150 of file graphics_editor.h.
Referenced by DrawCgxImport().
|
private |
Definition at line 151 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 152 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 153 of file graphics_editor.h.
Referenced by DrawObjImport().
|
private |
Definition at line 154 of file graphics_editor.h.
Referenced by DrawTilemapImport().
|
private |
Definition at line 155 of file graphics_editor.h.
|
private |
Definition at line 157 of file graphics_editor.h.
Referenced by Update().
|
private |
Definition at line 159 of file graphics_editor.h.
Referenced by DrawGfxEditToolset().
|
private |
Definition at line 161 of file graphics_editor.h.
Referenced by DecompressImportData(), DecompressSuperDonkey(), DrawClipboardImport(), DrawFileImport(), DrawMemoryEditor(), DrawObjImport(), and DrawPaletteControls().
|
private |
Definition at line 162 of file graphics_editor.h.
Referenced by DrawTilemapImport().
|
private |
Definition at line 163 of file graphics_editor.h.
|
private |
Definition at line 164 of file graphics_editor.h.
|
private |
Definition at line 165 of file graphics_editor.h.
|
private |
Definition at line 166 of file graphics_editor.h.
|
private |
Definition at line 167 of file graphics_editor.h.
Referenced by DecompressImportData().
|
private |
Definition at line 168 of file graphics_editor.h.
|
private |
Definition at line 169 of file graphics_editor.h.
Referenced by DrawCgxImport(), and DrawScrImport().
|
private |
Definition at line 170 of file graphics_editor.h.
Referenced by DrawCgxImport().
|
private |
Definition at line 171 of file graphics_editor.h.
Referenced by DrawCgxImport().
|
private |
Definition at line 172 of file graphics_editor.h.
Referenced by DrawCgxImport(), DrawPaletteControls(), and DrawScrImport().
|
private |
Definition at line 173 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 174 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 175 of file graphics_editor.h.
Referenced by DrawCgxImport(), and UpdateScadView().
|
private |
Definition at line 176 of file graphics_editor.h.
Referenced by DrawScrImport(), and UpdateScadView().
|
private |
Definition at line 177 of file graphics_editor.h.
Referenced by DecompressImportData(), and UpdateScadView().
|
private |
Definition at line 178 of file graphics_editor.h.
|
private |
Definition at line 179 of file graphics_editor.h.
Referenced by DecompressSuperDonkey().
|
private |
Definition at line 181 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and DrawPaletteControls().
|
private |
Definition at line 182 of file graphics_editor.h.
Referenced by DecompressImportData(), and DecompressSuperDonkey().
|
private |
Definition at line 183 of file graphics_editor.h.
Referenced by DecompressImportData(), and DrawPaletteControls().
|
private |
Definition at line 184 of file graphics_editor.h.
|
private |
Definition at line 185 of file graphics_editor.h.
Referenced by UpdateScadView().
|
private |
Definition at line 186 of file graphics_editor.h.
Referenced by UpdateScadView().
|
private |
Definition at line 187 of file graphics_editor.h.
|
private |
Definition at line 188 of file graphics_editor.h.
Referenced by UpdateGfxSheetList().
|
private |
Definition at line 189 of file graphics_editor.h.
Referenced by UpdateGfxTabView().
|
private |
Definition at line 191 of file graphics_editor.h.
Referenced by UpdateLinkGfxView().
|
private |
Definition at line 195 of file graphics_editor.h.
Referenced by DecompressImportData(), DecompressSuperDonkey(), DrawCgxImport(), DrawClipboardImport(), DrawFileImport(), DrawObjImport(), DrawPaletteControls(), DrawScrImport(), DrawTilemapImport(), Update(), UpdateGfxEdit(), and UpdateScadView().