Allows the user to edit graphics sheets from the game or view prototype graphics. More...
#include <graphics_editor.h>

Public Member Functions | |
| GraphicsEditor (Rom *rom=nullptr) | |
| void | Initialize () override |
| absl::Status | Load () override |
| absl::Status | Save () override |
| absl::Status | Update () override |
| absl::Status | Cut () override |
| absl::Status | Copy () override |
| absl::Status | Paste () override |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| absl::Status | Find () override |
| void | set_rom (Rom *rom) |
| void | SetGameData (zelda3::GameData *game_data) override |
| void | NextSheet () |
| void | PrevSheet () |
| Rom * | rom () const |
Public Member Functions inherited from yaze::editor::Editor | |
| Editor ()=default | |
| virtual | ~Editor ()=default |
| void | SetDependencies (const EditorDependencies &deps) |
| virtual absl::Status | Clear () |
| EditorType | type () const |
| bool * | active () |
| void | set_active (bool active) |
| void | toggle_active () |
| virtual bool | IsRomLoaded () const |
| virtual std::string | GetRomStatus () const |
| Rom * | rom () const |
| zelda3::GameData * | game_data () const |
| EditorContext | context () const |
| bool | HasContext () const |
Private Member Functions | |
| void | HandleEditorShortcuts () |
| void | DrawPrototypeViewer () |
| absl::Status | DrawCgxImport () |
| absl::Status | DrawScrImport () |
| absl::Status | DrawFileImport () |
| absl::Status | DrawObjImport () |
| absl::Status | DrawTilemapImport () |
| absl::Status | DrawPaletteControls () |
| absl::Status | DrawClipboardImport () |
| absl::Status | DrawExperimentalFeatures () |
| absl::Status | DrawMemoryEditor () |
| absl::Status | DecompressImportData (int size) |
| absl::Status | DecompressSuperDonkey () |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::Editor | |
| std::string | MakePanelTitle (const std::string &base_title) const |
| std::string | MakePanelId (const std::string &base_id) const |
| template<typename T > | |
| absl::StatusOr< T > | SafeRomAccess (std::function< T()> accessor, const std::string &operation="") const |
Protected Attributes inherited from yaze::editor::Editor | |
| bool | active_ = false |
| EditorType | type_ |
| EditorDependencies | dependencies_ |
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 63 of file graphics_editor.h.
|
inlineexplicit |
Definition at line 65 of file graphics_editor.h.
References yaze::editor::kGraphics, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 47 of file graphics_editor.cc.
References yaze::editor::Editor::dependencies_, DrawPrototypeViewer(), game_data_, gfx_group_panel_, link_sprite_panel_, palette_controls_panel_, paletteset_panel_, yaze::editor::EditorDependencies::panel_manager, pixel_editor_panel_, polyhedral_panel_, rom_, sheet_browser_panel_, state_, and status_.

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 128 of file graphics_editor.cc.
References yaze::gfx::Arena::CREATE, yaze::editor::Editor::game_data(), yaze::gfx::Arena::Get(), yaze::gfx::Arena::gfx_sheets(), yaze::zelda3::kNumGfxSheets, LOG_INFO, polyhedral_panel_, yaze::gfx::Arena::QueueTextureCommand(), RETURN_IF_ERROR, rom(), and rom_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 196 of file graphics_editor.cc.
References yaze::gfx::Bpp8SnesToIndexed(), yaze::editor::GraphicsEditorState::ClearModifiedSheets(), yaze::Rom::data(), yaze::editor::Editor::game_data(), yaze::gfx::Arena::Get(), yaze::zelda3::GetGraphicsAddress(), yaze::gfx::Arena::gfx_sheets(), yaze::editor::GraphicsEditorState::HasUnsavedChanges(), yaze::gfx::HyruleMagicCompress(), yaze::Rom::is_loaded(), yaze::zelda3::kNumGfxSheets, LOG_INFO, yaze::editor::GraphicsEditorState::modified_sheets, rom_, yaze::Rom::size(), state_, and yaze::Rom::WriteByte().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 273 of file graphics_editor.cc.
References CLEAR_AND_RETURN_STATUS, HandleEditorShortcuts(), and status_.

|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 73 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 74 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 75 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 76 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 77 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 78 of file graphics_editor.h.
|
inline |
|
inlineoverridevirtual |
Reimplemented from yaze::editor::Editor.
Definition at line 84 of file graphics_editor.h.
References yaze::editor::Editor::game_data(), game_data_, and palette_controls_panel_.

| void yaze::editor::GraphicsEditor::NextSheet | ( | ) |
Definition at line 731 of file graphics_editor.cc.
References yaze::editor::GraphicsEditorState::current_sheet_id, yaze::zelda3::kNumGfxSheets, and state_.
Referenced by HandleEditorShortcuts().
| void yaze::editor::GraphicsEditor::PrevSheet | ( | ) |
Definition at line 737 of file graphics_editor.cc.
References yaze::editor::GraphicsEditorState::current_sheet_id, and state_.
Referenced by HandleEditorShortcuts().
|
inline |
Definition at line 96 of file graphics_editor.h.
References rom_.
Referenced by DecompressImportData(), DrawPaletteControls(), Load(), and set_rom().
|
private |
Definition at line 284 of file graphics_editor.cc.
References yaze::editor::kEraser, yaze::editor::kEyedropper, yaze::editor::kFill, yaze::editor::kLine, yaze::editor::kPencil, yaze::editor::kRectangle, yaze::editor::kSelect, NextSheet(), PrevSheet(), yaze::editor::GraphicsEditorState::SetTool(), yaze::editor::GraphicsEditorState::show_grid, state_, yaze::editor::GraphicsEditorState::ZoomIn(), and yaze::editor::GraphicsEditorState::ZoomOut().
Referenced by Update().
|
private |
Definition at line 337 of file graphics_editor.cc.
References BEGIN_TABLE, bin_bitmap_, yaze::gui::BitmapCanvasPipeline(), cgx_bitmap_, cgx_loaded_, col_file_, DrawCgxImport(), DrawClipboardImport(), DrawExperimentalFeatures(), DrawFileImport(), DrawMemoryEditor(), DrawPaletteControls(), DrawScrImport(), END_TABLE, gfx_loaded_, gfx_sheets_, import_canvas_, NEXT_COLUMN, num_sheets_to_load_, open_memory_editor_, scr_bitmap_, scr_canvas_, scr_loaded_, SETUP_COLUMN, status_, super_donkey_, and TABLE_HEADERS.
Referenced by Initialize().
|
private |
Definition at line 399 of file graphics_editor.cc.
References cgx_bitmap_, cgx_data_, cgx_file_name_, cgx_file_path_, cgx_loaded_, col_file_, yaze::gfx::Bitmap::Create(), current_bpp_, decoded_cgx_, decoded_col_, extra_cgx_data_, yaze::gfx::Arena::Get(), is_open_, yaze::gfx::LoadCgx(), yaze::gfx::Arena::QueueTextureCommand(), yaze::gfx::Bitmap::SetPalette(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), status_, yaze::gui::TextWithSeparators(), and yaze::gfx::Arena::UPDATE.
Referenced by DrawPrototypeViewer().
|
private |
Definition at line 433 of file graphics_editor.cc.
References yaze::gfx::Bitmap::Create(), current_bpp_, decoded_cgx_, decoded_col_, decoded_scr_data_, yaze::gfx::DrawScrWithCgx(), yaze::gfx::Arena::Get(), is_open_, yaze::gfx::LoadScr(), yaze::gfx::Arena::QueueTextureCommand(), scr_bitmap_, scr_data_, scr_file_name_, scr_file_path_, scr_loaded_, scr_mod_value_, yaze::gfx::Bitmap::SetPalette(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), status_, and yaze::gfx::Arena::UPDATE.
Referenced by DrawPrototypeViewer().
|
private |
Definition at line 553 of file graphics_editor.cc.
References bin_size_, current_offset_, DecompressImportData(), file_path_, HOVER_HINT, yaze::gui::InputHex(), is_open_, yaze::Rom::LoadFromFile(), RETURN_IF_ERROR, yaze::util::FileDialogWrapper::ShowOpenFileDialog(), status_, temp_rom_, and yaze::gui::TextWithSeparators().
Referenced by DrawPrototypeViewer().
|
private |
Definition at line 511 of file graphics_editor.cc.
References HOVER_HINT, is_open_, yaze::Rom::LoadFromFile(), obj_file_path_, obj_loaded_, yaze::util::FileDialogWrapper::ShowOpenFileDialog(), status_, temp_rom_, and yaze::gui::TextWithSeparators().

|
private |
Definition at line 529 of file graphics_editor.cc.
References yaze::Rom::data(), yaze::gfx::lc_lz2::DecompressV2(), HOVER_HINT, is_open_, yaze::gfx::lc_lz2::kNintendoMode1, yaze::Rom::LoadFromFile(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), yaze::Rom::size(), status_, yaze::gui::TextWithSeparators(), tilemap_file_path_, tilemap_loaded_, and tilemap_rom_.
|
private |
Definition at line 464 of file graphics_editor.cc.
References yaze::gfx::PaletteGroup::clear(), col_file_, col_file_name_, col_file_palette_, col_file_palette_group_, col_file_path_, yaze::gfx::CreatePaletteGroupFromColFile(), current_palette_, current_palette_index_, yaze::gfx::DecodeColFile(), decoded_col_, yaze::gfx::GetColFileData(), HOVER_HINT, yaze::gui::InputHex(), is_open_, yaze::Rom::LoadFromFile(), yaze::Rom::mutable_data(), refresh_graphics_, rom(), yaze::gui::SelectablePalettePipeline(), yaze::util::FileDialogWrapper::ShowOpenFileDialog(), yaze::gfx::SnesPalette::size(), yaze::gfx::PaletteGroup::size(), status_, temp_rom_, and yaze::gui::TextWithSeparators().
Referenced by DrawPrototypeViewer().
|
private |
Definition at line 585 of file graphics_editor.cc.
References clipboard_offset_, clipboard_size_, DecompressImportData(), yaze::gui::InputHex(), yaze::Rom::is_loaded(), is_open_, yaze::Rom::LoadFromData(), num_sheets_to_load_, open_memory_editor_, status_, temp_rom_, and yaze::gui::TextWithSeparators().
Referenced by DrawPrototypeViewer().
|
private |
Definition at line 615 of file graphics_editor.cc.
References DecompressSuperDonkey(), file_path_, RETURN_IF_ERROR, and yaze::gui::TextWithSeparators().
Referenced by DrawPrototypeViewer().

|
private |
Definition at line 631 of file graphics_editor.cc.
References yaze::gui::MemoryEditorWidget::DrawWindow(), is_open_, yaze::Rom::mutable_data(), yaze::Rom::size(), and temp_rom_.
Referenced by DrawPrototypeViewer().

|
private |
Definition at line 641 of file graphics_editor.cc.
References ASSIGN_OR_RETURN, bin_bitmap_, col_file_, col_file_palette_, yaze::gfx::Bitmap::Create(), current_offset_, current_palette_, yaze::Rom::data(), yaze::gfx::lc_lz2::DecompressV2(), yaze::editor::Editor::game_data(), yaze::gfx::Arena::Get(), gfx_loaded_, import_data_, yaze::gfx::kTilesheetDepth, yaze::gfx::kTilesheetWidth, yaze::gfx::PaletteGroupMap::overworld_animated, yaze::zelda3::GameData::palette_groups, yaze::gfx::Arena::QueueTextureCommand(), rom(), yaze::gfx::Bitmap::SetPalette(), yaze::Rom::size(), yaze::gfx::SnesTo8bppSheet(), temp_rom_, yaze::gfx::Arena::UPDATE, and z3_rom_palette_.
Referenced by DrawClipboardImport(), and DrawFileImport().
|
private |
Definition at line 667 of file graphics_editor.cc.
References ASSIGN_OR_RETURN, col_file_, col_file_palette_group_, current_palette_, current_palette_index_, yaze::Rom::data(), yaze::gfx::lc_lz2::DecompressV2(), yaze::editor::Editor::game_data(), yaze::gfx::Arena::Get(), yaze::gfx::PaletteGroupMap::get_group(), gfx_sheets_, yaze::editor::kSuperDonkeySprites, yaze::editor::kSuperDonkeyTiles, yaze::gfx::kTilesheetDepth, yaze::gfx::kTilesheetHeight, yaze::gfx::kTilesheetWidth, num_sheets_to_load_, yaze::zelda3::GameData::palette_groups, yaze::gfx::Arena::QueueTextureCommand(), yaze::Rom::size(), yaze::gfx::SnesTo8bppSheet(), super_donkey_, temp_rom_, yaze::gfx::Arena::UPDATE, and z3_rom_palette_.
Referenced by DrawExperimentalFeatures().
|
private |
Definition at line 103 of file graphics_editor.h.
Referenced by HandleEditorShortcuts(), Initialize(), NextSheet(), PrevSheet(), and Save().
|
private |
Definition at line 104 of file graphics_editor.h.
Referenced by Initialize().
|
private |
Definition at line 105 of file graphics_editor.h.
Referenced by Initialize().
|
private |
Definition at line 106 of file graphics_editor.h.
Referenced by Initialize(), and SetGameData().
|
private |
Definition at line 107 of file graphics_editor.h.
Referenced by Initialize().
|
private |
Definition at line 108 of file graphics_editor.h.
Referenced by Initialize(), and Load().
|
private |
Definition at line 109 of file graphics_editor.h.
Referenced by Initialize().
|
private |
Definition at line 110 of file graphics_editor.h.
Referenced by Initialize().
|
private |
Definition at line 127 of file graphics_editor.h.
Referenced by DecompressImportData(), DecompressSuperDonkey(), and DrawPaletteControls().
|
private |
Definition at line 128 of file graphics_editor.h.
Referenced by DecompressImportData(), and DrawFileImport().
|
private |
Definition at line 129 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and DrawPaletteControls().
|
private |
Definition at line 130 of file graphics_editor.h.
Referenced by DrawCgxImport(), and DrawScrImport().
|
private |
Definition at line 131 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 132 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), DrawClipboardImport(), and DrawPrototypeViewer().
|
private |
Definition at line 133 of file graphics_editor.h.
Referenced by DrawFileImport().
|
private |
Definition at line 134 of file graphics_editor.h.
Referenced by DrawClipboardImport().
|
private |
Definition at line 135 of file graphics_editor.h.
Referenced by DrawClipboardImport().
|
private |
Definition at line 136 of file graphics_editor.h.
Referenced by DrawPaletteControls().
|
private |
Definition at line 137 of file graphics_editor.h.
Referenced by DrawClipboardImport(), and DrawPrototypeViewer().
|
private |
Definition at line 138 of file graphics_editor.h.
Referenced by DecompressImportData(), and DrawPrototypeViewer().
|
private |
Definition at line 139 of file graphics_editor.h.
Referenced by DrawCgxImport(), DrawClipboardImport(), DrawFileImport(), DrawMemoryEditor(), DrawObjImport(), DrawPaletteControls(), DrawScrImport(), and DrawTilemapImport().
|
private |
Definition at line 140 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and DrawPrototypeViewer().
|
private |
Definition at line 141 of file graphics_editor.h.
Referenced by DecompressImportData(), DecompressSuperDonkey(), DrawCgxImport(), DrawPaletteControls(), and DrawPrototypeViewer().
|
private |
Definition at line 142 of file graphics_editor.h.
Referenced by DrawCgxImport(), and DrawPrototypeViewer().
|
private |
Definition at line 143 of file graphics_editor.h.
Referenced by DrawPrototypeViewer(), and DrawScrImport().
|
private |
Definition at line 144 of file graphics_editor.h.
Referenced by DrawObjImport().
|
private |
Definition at line 145 of file graphics_editor.h.
Referenced by DrawTilemapImport().
|
private |
Definition at line 147 of file graphics_editor.h.
Referenced by DrawExperimentalFeatures(), and DrawFileImport().
|
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 DrawPaletteControls().
|
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 DrawCgxImport().
|
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 DrawScrImport().
|
private |
Definition at line 154 of file graphics_editor.h.
Referenced by DrawObjImport().
|
private |
Definition at line 155 of file graphics_editor.h.
Referenced by DrawTilemapImport().
|
private |
Definition at line 156 of file graphics_editor.h.
|
private |
Definition at line 158 of file graphics_editor.h.
Referenced by DecompressImportData(), DecompressSuperDonkey(), DrawClipboardImport(), DrawFileImport(), DrawMemoryEditor(), DrawObjImport(), and DrawPaletteControls().
|
private |
Definition at line 159 of file graphics_editor.h.
Referenced by DrawTilemapImport().
|
private |
Definition at line 160 of file graphics_editor.h.
Referenced by DecompressImportData().
|
private |
Definition at line 161 of file graphics_editor.h.
Referenced by DrawCgxImport(), and DrawScrImport().
|
private |
Definition at line 162 of file graphics_editor.h.
Referenced by DrawCgxImport().
|
private |
Definition at line 163 of file graphics_editor.h.
Referenced by DrawCgxImport().
|
private |
Definition at line 164 of file graphics_editor.h.
Referenced by DrawCgxImport(), DrawPaletteControls(), and DrawScrImport().
|
private |
Definition at line 165 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 166 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 167 of file graphics_editor.h.
Referenced by DrawCgxImport(), and DrawPrototypeViewer().
|
private |
Definition at line 168 of file graphics_editor.h.
Referenced by DrawPrototypeViewer(), and DrawScrImport().
|
private |
Definition at line 169 of file graphics_editor.h.
Referenced by DecompressImportData(), and DrawPrototypeViewer().
|
private |
Definition at line 170 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and DrawPrototypeViewer().
|
private |
Definition at line 171 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and DrawPaletteControls().
|
private |
Definition at line 172 of file graphics_editor.h.
Referenced by DecompressImportData(), and DecompressSuperDonkey().
|
private |
Definition at line 173 of file graphics_editor.h.
Referenced by DecompressImportData(), and DrawPaletteControls().
|
private |
Definition at line 174 of file graphics_editor.h.
Referenced by DrawPrototypeViewer().
|
private |
Definition at line 175 of file graphics_editor.h.
Referenced by DrawPrototypeViewer().
|
private |
Definition at line 176 of file graphics_editor.h.
|
private |
Definition at line 179 of file graphics_editor.h.
Referenced by DrawCgxImport(), DrawClipboardImport(), DrawFileImport(), DrawObjImport(), DrawPaletteControls(), DrawPrototypeViewer(), DrawScrImport(), DrawTilemapImport(), Initialize(), and Update().
|
private |
Definition at line 182 of file graphics_editor.h.
Referenced by Initialize(), Load(), rom(), Save(), and set_rom().
|
private |
Definition at line 183 of file graphics_editor.h.
Referenced by Initialize(), and SetGameData().