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) |
Rom * | rom () const |
![]() | |
Editor ()=default | |
virtual | ~Editor ()=default |
virtual absl::Status | Clear () |
virtual void | CleanupUnusedTextures (uint64_t current_time, uint64_t timeout) |
EditorType | type () const |
void | set_context (EditorContext *context) |
bool * | active () |
void | set_active (bool active) |
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 | |
![]() | |
bool | active_ = false |
EditorType | type_ |
EditorContext * | context_ = nullptr |
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 57 of file graphics_editor.h.
|
strongprivate |
Enumerator | |
---|---|
kSelect | |
kPencil | |
kFill |
Definition at line 81 of file graphics_editor.h.
|
inlineexplicit |
Definition at line 59 of file graphics_editor.h.
References yaze::editor::kGraphics, rom(), rom_, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 44 of file graphics_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 46 of file graphics_editor.cc.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 65 of file graphics_editor.h.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 48 of file graphics_editor.cc.
References asset_browser_, CLEAR_AND_RETURN_STATUS, END_TAB_ITEM, yaze::GraphicsSheetManager::GetInstance(), status_, TAB_ITEM, UpdateGfxEdit(), UpdateLinkGfxView(), and UpdateScadView().
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 67 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 68 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 69 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 70 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 71 of file graphics_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 72 of file graphics_editor.h.
|
inline |
|
inline |
Definition at line 78 of file graphics_editor.h.
References rom_.
Referenced by DecompressImportData(), DecompressSuperDonkey(), DrawPaletteControls(), GraphicsEditor(), set_rom(), UpdateGfxEdit(), UpdateLinkGfxView(), and UpdatePaletteColumn().
|
private |
Definition at line 66 of file graphics_editor.cc.
References DrawGfxEditToolset(), yaze::editor::kGfxEditTableFlags, NEXT_COLUMN, rom(), status_, UpdateGfxSheetList(), UpdateGfxTabView(), and UpdatePaletteColumn().
Referenced by Update().
|
private |
Definition at line 185 of file graphics_editor.cc.
References current_sheet_, yaze::GraphicsSheetManager::GetInstance(), graphics_bin_canvas_, yaze::kNumGfxSheets, open_sheets_, and sheet_scale_.
Referenced by UpdateGfxEdit().
|
private |
Definition at line 258 of file graphics_editor.cc.
References yaze::editor::Editor::active(), child_window_sheets_, current_color_, current_scale_, current_sheet_, current_sheet_canvas_, yaze::editor::Renderer::GetInstance(), yaze::GraphicsSheetManager::GetInstance(), ICON_MD_ADD, yaze::GraphicsSheetManager::mutable_gfx_sheets(), open_sheets_, release_queue_, tile_size_, and yaze::core::Renderer::UpdateBitmap().
Referenced by UpdateGfxEdit().
|
private |
Definition at line 358 of file graphics_editor.cc.
References current_sheet_, edit_palette_group_name_index_, edit_palette_index_, edit_palette_sub_index_, yaze::editor::Renderer::GetInstance(), yaze::GraphicsSheetManager::GetInstance(), yaze::gui::InputHex(), yaze::gfx::kPaletteGroupAddressesKeys, yaze::GraphicsSheetManager::mutable_gfx_sheets(), open_sheets_, yaze::Rom::palette_group(), refresh_graphics_, rom(), yaze::gui::SelectablePalettePipeline(), yaze::gui::TextWithSeparators(), and yaze::core::Renderer::UpdateBitmap().
Referenced by UpdateGfxEdit().
|
private |
Definition at line 97 of file graphics_editor.cc.
References yaze::core::CopyImageToClipboard(), current_color_, current_scale_, current_sheet_, yaze::core::GetImageFromClipboard(), yaze::editor::Renderer::GetInstance(), yaze::GraphicsSheetManager::GetInstance(), gfx_edit_mode_, yaze::GraphicsSheetManager::gfx_sheets(), 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::gui::InputHexByte(), kFill, kPencil, kSelect, yaze::GraphicsSheetManager::mutable_gfx_sheets(), tile_size_, and yaze::core::Renderer::UpdateBitmap().
Referenced by UpdateGfxEdit().
|
private |
Definition at line 388 of file graphics_editor.cc.
References ASSIGN_OR_RETURN, END_TAB_ITEM, yaze::editor::kGfxEditTableFlags, yaze::gfx::kTilesheetHeight, link_canvas_, link_sheets_, yaze::LoadLinkGraphics(), NEXT_COLUMN, rom(), and TAB_ITEM.
Referenced by Update().
|
private |
Definition at line 436 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(), 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 525 of file graphics_editor.cc.
References cgx_bitmap_, cgx_data_, cgx_file_name_, cgx_file_path_, cgx_loaded_, col_file_, current_bpp_, decoded_cgx_, decoded_col_, extra_cgx_data_, yaze::editor::Renderer::GetInstance(), is_open_, yaze::gfx::LoadCgx(), yaze::core::Renderer::RenderBitmap(), yaze::core::FileDialogWrapper::ShowOpenFileDialog(), status_, and yaze::gui::TextWithSeparators().
Referenced by UpdateScadView().
|
private |
Definition at line 558 of file graphics_editor.cc.
References current_bpp_, decoded_cgx_, decoded_col_, decoded_scr_data_, yaze::gfx::DrawScrWithCgx(), yaze::editor::Renderer::GetInstance(), is_open_, yaze::gfx::LoadScr(), yaze::core::Renderer::RenderBitmap(), scr_bitmap_, scr_data_, scr_file_name_, scr_file_path_, scr_loaded_, scr_mod_value_, yaze::core::FileDialogWrapper::ShowOpenFileDialog(), and status_.
Referenced by UpdateScadView().
|
private |
Definition at line 677 of file graphics_editor.cc.
References bin_size_, current_offset_, DecompressImportData(), file_path_, HOVER_HINT, yaze::gui::InputHex(), is_open_, RETURN_IF_ERROR, yaze::core::FileDialogWrapper::ShowOpenFileDialog(), status_, temp_rom_, and yaze::gui::TextWithSeparators().
Referenced by UpdateScadView().
|
private |
Definition at line 636 of file graphics_editor.cc.
References HOVER_HINT, is_open_, obj_file_path_, obj_loaded_, yaze::core::FileDialogWrapper::ShowOpenFileDialog(), status_, temp_rom_, and yaze::gui::TextWithSeparators().
|
private |
Definition at line 654 of file graphics_editor.cc.
References yaze::gfx::lc_lz2::DecompressV2(), HOVER_HINT, is_open_, yaze::gfx::lc_lz2::kNintendoMode1, yaze::core::FileDialogWrapper::ShowOpenFileDialog(), status_, yaze::gui::TextWithSeparators(), tilemap_file_path_, tilemap_loaded_, and tilemap_rom_.
|
private |
Definition at line 501 of file graphics_editor.cc.
References ICON_MD_MEMORY, and open_memory_editor_.
Referenced by UpdateScadView().
|
private |
Definition at line 588 of file graphics_editor.cc.
References 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::gfx::kPaletteGroupAddressesKeys, refresh_graphics_, rom(), yaze::gui::SelectablePalettePipeline(), yaze::core::FileDialogWrapper::ShowOpenFileDialog(), status_, temp_rom_, and yaze::gui::TextWithSeparators().
Referenced by UpdateScadView().
|
private |
Definition at line 709 of file graphics_editor.cc.
References clipboard_offset_, clipboard_size_, DecompressImportData(), yaze::gui::InputHex(), is_open_, num_sheets_to_load_, open_memory_editor_, status_, temp_rom_, and yaze::gui::TextWithSeparators().
Referenced by UpdateScadView().
|
private |
Definition at line 739 of file graphics_editor.cc.
References DecompressSuperDonkey(), file_path_, RETURN_IF_ERROR, and yaze::gui::TextWithSeparators().
Referenced by UpdateScadView().
|
private |
Definition at line 755 of file graphics_editor.cc.
References is_open_, and temp_rom_.
Referenced by UpdateScadView().
|
private |
Definition at line 765 of file graphics_editor.cc.
References ASSIGN_OR_RETURN, bin_bitmap_, col_file_, col_file_palette_, current_offset_, current_palette_, yaze::gfx::lc_lz2::DecompressV2(), yaze::editor::Renderer::GetInstance(), gfx_loaded_, import_data_, yaze::gfx::kTilesheetDepth, yaze::gfx::kTilesheetWidth, yaze::Rom::palette_group(), yaze::core::Renderer::RenderBitmap(), rom(), yaze::gfx::SnesTo8bppSheet(), temp_rom_, and z3_rom_palette_.
Referenced by DrawClipboardImport(), and DrawFileImport().
|
private |
Definition at line 789 of file graphics_editor.cc.
References ASSIGN_OR_RETURN, col_file_, col_file_palette_group_, current_palette_, current_palette_index_, yaze::gfx::lc_lz2::DecompressV2(), yaze::editor::Renderer::GetInstance(), gfx_sheets_, yaze::gfx::kPaletteGroupAddressesKeys, yaze::editor::kSuperDonkeySprites, yaze::editor::kSuperDonkeyTiles, yaze::gfx::kTilesheetDepth, yaze::gfx::kTilesheetHeight, yaze::gfx::kTilesheetWidth, num_sheets_to_load_, yaze::Rom::palette_group(), yaze::core::Renderer::RenderBitmap(), rom(), yaze::gfx::SnesTo8bppSheet(), super_donkey_, temp_rom_, and z3_rom_palette_.
Referenced by DrawExperimentalFeatures().
|
private |
Definition at line 118 of file graphics_editor.h.
Referenced by DrawGfxEditToolset(), and UpdateGfxTabView().
|
private |
Definition at line 119 of file graphics_editor.h.
Referenced by DrawGfxEditToolset(), UpdateGfxSheetList(), UpdateGfxTabView(), and UpdatePaletteColumn().
|
private |
Definition at line 120 of file graphics_editor.h.
Referenced by DrawGfxEditToolset(), and UpdateGfxTabView().
|
private |
Definition at line 121 of file graphics_editor.h.
Referenced by UpdateGfxSheetList(), UpdateGfxTabView(), and UpdatePaletteColumn().
|
private |
Definition at line 122 of file graphics_editor.h.
Referenced by UpdateGfxTabView().
|
private |
Definition at line 123 of file graphics_editor.h.
Referenced by UpdateGfxTabView().
|
private |
Definition at line 124 of file graphics_editor.h.
Referenced by UpdatePaletteColumn().
|
private |
Definition at line 125 of file graphics_editor.h.
|
private |
Definition at line 126 of file graphics_editor.h.
Referenced by UpdatePaletteColumn().
|
private |
Definition at line 127 of file graphics_editor.h.
Referenced by UpdatePaletteColumn().
|
private |
Definition at line 128 of file graphics_editor.h.
Referenced by UpdateGfxSheetList().
|
private |
Definition at line 129 of file graphics_editor.h.
Referenced by DrawGfxEditToolset(), and UpdateGfxTabView().
|
private |
Definition at line 132 of file graphics_editor.h.
Referenced by DecompressImportData(), DecompressSuperDonkey(), and DrawPaletteControls().
|
private |
Definition at line 133 of file graphics_editor.h.
Referenced by DecompressImportData(), and DrawFileImport().
|
private |
Definition at line 134 of file graphics_editor.h.
|
private |
Definition at line 135 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and DrawPaletteControls().
|
private |
Definition at line 136 of file graphics_editor.h.
Referenced by DrawCgxImport(), and DrawScrImport().
|
private |
Definition at line 137 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 139 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and DrawClipboardImport().
|
private |
Definition at line 140 of file graphics_editor.h.
Referenced by DrawFileImport().
|
private |
Definition at line 141 of file graphics_editor.h.
Referenced by DrawClipboardImport().
|
private |
Definition at line 142 of file graphics_editor.h.
Referenced by DrawClipboardImport().
|
private |
Definition at line 144 of file graphics_editor.h.
Referenced by DrawPaletteControls(), and UpdatePaletteColumn().
|
private |
Definition at line 145 of file graphics_editor.h.
Referenced by DrawClipboardImport(), DrawToolset(), and UpdateScadView().
|
private |
Definition at line 146 of file graphics_editor.h.
Referenced by DecompressImportData(), and UpdateScadView().
|
private |
Definition at line 147 of file graphics_editor.h.
Referenced by DrawCgxImport(), DrawClipboardImport(), DrawFileImport(), DrawMemoryEditor(), DrawObjImport(), DrawPaletteControls(), DrawScrImport(), and DrawTilemapImport().
|
private |
Definition at line 148 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and UpdateScadView().
|
private |
Definition at line 149 of file graphics_editor.h.
Referenced by DecompressImportData(), DecompressSuperDonkey(), DrawCgxImport(), DrawPaletteControls(), and UpdateScadView().
|
private |
Definition at line 150 of file graphics_editor.h.
Referenced by DrawCgxImport(), and UpdateScadView().
|
private |
Definition at line 151 of file graphics_editor.h.
Referenced by DrawScrImport(), and UpdateScadView().
|
private |
Definition at line 152 of file graphics_editor.h.
Referenced by DrawObjImport().
|
private |
Definition at line 153 of file graphics_editor.h.
Referenced by DrawTilemapImport().
|
private |
Definition at line 155 of file graphics_editor.h.
Referenced by DrawExperimentalFeatures(), and DrawFileImport().
|
private |
Definition at line 156 of file graphics_editor.h.
Referenced by DrawPaletteControls().
|
private |
Definition at line 157 of file graphics_editor.h.
Referenced by DrawPaletteControls().
|
private |
Definition at line 158 of file graphics_editor.h.
Referenced by DrawCgxImport().
|
private |
Definition at line 159 of file graphics_editor.h.
Referenced by DrawCgxImport().
|
private |
Definition at line 160 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 161 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 162 of file graphics_editor.h.
Referenced by DrawObjImport().
|
private |
Definition at line 163 of file graphics_editor.h.
Referenced by DrawTilemapImport().
|
private |
Definition at line 164 of file graphics_editor.h.
|
private |
Definition at line 166 of file graphics_editor.h.
Referenced by Update().
|
private |
Definition at line 168 of file graphics_editor.h.
Referenced by DrawGfxEditToolset().
|
private |
Definition at line 170 of file graphics_editor.h.
Referenced by DecompressImportData(), DecompressSuperDonkey(), DrawClipboardImport(), DrawFileImport(), DrawMemoryEditor(), DrawObjImport(), and DrawPaletteControls().
|
private |
Definition at line 171 of file graphics_editor.h.
Referenced by DrawTilemapImport().
|
private |
Definition at line 172 of file graphics_editor.h.
|
private |
Definition at line 173 of file graphics_editor.h.
|
private |
Definition at line 174 of file graphics_editor.h.
|
private |
Definition at line 175 of file graphics_editor.h.
|
private |
Definition at line 176 of file graphics_editor.h.
Referenced by DecompressImportData().
|
private |
Definition at line 177 of file graphics_editor.h.
|
private |
Definition at line 178 of file graphics_editor.h.
Referenced by DrawCgxImport(), and DrawScrImport().
|
private |
Definition at line 179 of file graphics_editor.h.
Referenced by DrawCgxImport().
|
private |
Definition at line 180 of file graphics_editor.h.
Referenced by DrawCgxImport().
|
private |
Definition at line 181 of file graphics_editor.h.
Referenced by DrawCgxImport(), DrawPaletteControls(), and DrawScrImport().
|
private |
Definition at line 182 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 183 of file graphics_editor.h.
Referenced by DrawScrImport().
|
private |
Definition at line 184 of file graphics_editor.h.
Referenced by DrawCgxImport(), and UpdateScadView().
|
private |
Definition at line 185 of file graphics_editor.h.
Referenced by DrawScrImport(), and UpdateScadView().
|
private |
Definition at line 186 of file graphics_editor.h.
Referenced by DecompressImportData(), and UpdateScadView().
|
private |
Definition at line 187 of file graphics_editor.h.
|
private |
Definition at line 188 of file graphics_editor.h.
Referenced by DecompressSuperDonkey().
|
private |
Definition at line 189 of file graphics_editor.h.
Referenced by UpdateLinkGfxView().
|
private |
Definition at line 191 of file graphics_editor.h.
Referenced by DecompressSuperDonkey(), and DrawPaletteControls().
|
private |
Definition at line 192 of file graphics_editor.h.
Referenced by DecompressImportData(), and DecompressSuperDonkey().
|
private |
Definition at line 193 of file graphics_editor.h.
Referenced by DecompressImportData(), and DrawPaletteControls().
|
private |
Definition at line 194 of file graphics_editor.h.
|
private |
Definition at line 195 of file graphics_editor.h.
Referenced by UpdateScadView().
|
private |
Definition at line 196 of file graphics_editor.h.
Referenced by UpdateScadView().
|
private |
Definition at line 197 of file graphics_editor.h.
|
private |
Definition at line 198 of file graphics_editor.h.
Referenced by UpdateGfxSheetList().
|
private |
Definition at line 199 of file graphics_editor.h.
Referenced by UpdateGfxTabView().
|
private |
Definition at line 201 of file graphics_editor.h.
Referenced by UpdateLinkGfxView().
|
private |
Definition at line 205 of file graphics_editor.h.
Referenced by DrawCgxImport(), DrawClipboardImport(), DrawFileImport(), DrawObjImport(), DrawPaletteControls(), DrawScrImport(), DrawTilemapImport(), Update(), UpdateGfxEdit(), and UpdateScadView().
|
private |
Definition at line 207 of file graphics_editor.h.
Referenced by GraphicsEditor(), rom(), and set_rom().