1#ifndef YAZE_APP_EDITOR_GRAPHICS_EDITOR_H
2#define YAZE_APP_EDITOR_GRAPHICS_EDITOR_H
13#include "absl/status/status.h"
37class GraphicsEditorSaveStoplossTestPeer;
41 "97C05",
"98219",
"9871E",
"98C00",
"99084",
"995AF",
"99DE0",
"9A27E",
42 "9A741",
"9AC31",
"9B07E",
"9B55C",
"9B963",
"9BB99",
"9C009",
"9C4B4",
43 "9C92B",
"9CDD6",
"9D2C2",
"9E037",
"9E527",
"9EA56",
"9EF65",
"9FCD1",
44 "A0193",
"A059E",
"A0B17",
"A0FB6",
"A14A5",
"A1988",
"A1E66",
"A232B",
45 "A27F0",
"A2B6E",
"A302C",
"A3453",
"A38CA",
"A42BB",
"A470C",
"A4BA9",
46 "A5089",
"A5385",
"A5742",
"A5BCC",
"A6017",
"A6361",
"A66F8"};
49 "A8E5D",
"A9435",
"A9934",
"A9D83",
"AA2F1",
"AA6D4",
"AABE4",
"AB127",
50 "AB65A",
"ABBDD",
"AC38D",
"AC797",
"ACCC8",
"AD0AE",
"AD245",
"AD554",
51 "ADAAC",
"ADECC",
"AE453",
"AE9D2",
"AEF40",
"AF3C9",
"AF92E",
"AFE9D",
52 "B03D2",
"B09AC",
"B0F0C",
"B1430",
"B1859",
"B1E01",
"B229A",
"B2854",
53 "B2D27",
"B31D7",
"B3B58",
"B40B5",
"B45A5",
"B4D64",
"B5031",
"B555F",
54 "B5F30",
"B6858",
"B70DD",
"B7526",
"B79EC",
"B7C83",
"B80F7",
"B85CC",
55 "B8A3F",
"B8F97",
"B94F2",
"B9A20",
"B9E9A",
"BA3A2",
"BA8F6",
"BACDC",
56 "BB1F9",
"BB781",
"BBCCA",
"BC26D",
"BC7D4",
"BCBB0",
"BD082",
"BD5FC",
57 "BE115",
"BE5C2",
"BEB63",
"BF0CB",
"BF607",
"BFA55",
"BFD71",
"C017D",
58 "C0567",
"C0981",
"C0BA7",
"C116D",
"C166A",
"C1FE0",
"C24CE",
"C2B19"};
119 absl::Status
Load()
override;
120 absl::Status
Save()
override;
123 absl::Status
Update()
override;
132 absl::Status
Cut()
override;
133 absl::Status
Copy()
override;
134 absl::Status
Paste()
override;
135 absl::Status
Undo()
override;
136 absl::Status
Redo()
override;
137 absl::Status
Find()
override {
return absl::UnimplementedError(
"Find"); }
153 return absl::FailedPreconditionError(
154 "Commit or cancel the floating paste in Graphics before saving "
155 "(Enter to commit, Esc to cancel)");
159 return absl::FailedPreconditionError(
160 "Finish the pixel stroke before saving");
163 return absl::OkStatus();
240 absl::Status
ImportScratchBin(
const std::string& path,
int bpp,
size_t offset,
245 const std::array<uint8_t, 8>& permutation);
247 const std::string& label =
"",
double duration_secs = 3.0);
263 std::function<absl::Status(
const Rom&, uint16_t,
const std::vector<uint8_t>&,
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Interface for editor classes.
EditorContext context() const
project::YazeProject * project() const
virtual void SetDependencies(const EditorDependencies &deps)
zelda3::GameData * game_data() const
std::function< absl::StatusOr< zelda3::RoomsetUsageReport >(int)> RoomsetUsageCallback
std::function< absl::StatusOr< zelda3::MainGroupUsageReport >(int, int)> MainUsageCallback
Shared state between GraphicsEditor panel components.
std::set< uint16_t > modified_sheets
bool HasUnsavedChanges() const
Check if any sheets have unsaved changes.
void ClearSourceContext()
void ClearPreviewPalettes()
Allows the user to edit graphics sheets from the game or view prototype graphics.
void FinishPixelGesture()
usage_preview::LiveRoomProvider room_usage_provider_
absl::Status SaveScratchAssets()
friend class GraphicsEditorSaveStoplossTestPeer
std::vector< uint8_t > scr_data_
void SetRoomsetGraphicsUsageCallback(GfxGroupEditor::RoomsetUsageCallback callback)
GraphicsEditorState state_
absl::Status Save() override
GraphicsEditor(Rom *rom=nullptr)
void HighlightTile(uint16_t sheet_id, uint16_t tile_index, const std::string &label="", double duration_secs=3.0)
uint64_t clipboard_offset_
absl::Status ReorderSourcePalette(const std::vector< size_t > &targets, const std::array< uint8_t, 8 > &permutation)
GfxGroupEditor::RoomsetUsageCallback roomset_graphics_usage_
void SetPixelTool(PixelTool tool)
void RollbackSaveTransaction() override
gfx::PaletteGroup col_file_palette_group_
gui::Canvas super_donkey_canvas_
std::string tilemap_file_name_
void SelectSheet(uint16_t sheet_id)
std::string col_file_path_
std::string cgx_file_path_
absl::Status DrawMemoryEditor()
absl::Status Load() override
std::unique_ptr< GfxGroupEditor > gfx_group_panel_
zelda3::GameData * game_data_
std::unique_ptr< PaletteControlsPanel > palette_controls_panel_
void Initialize() override
std::vector< uint8_t > decoded_cgx_
EditorContextSnapshot BuildContextSnapshot() const override
std::string scr_file_path_
friend class EditorManagerLayoutTestPeer
absl::Status Copy() override
absl::Status DecompressSuperDonkey()
std::unique_ptr< GraphicsScratchView > scratch_view_
GfxGroupEditor::MainUsageCallback main_graphics_usage_
absl::Status EditProject(const std::function< void(project::YazeProject &)> &edit)
gfx::SnesPalette col_file_palette_
std::string col_file_name_
absl::Status DrawCgxImport()
std::vector< uint8_t > cgx_data_
std::unique_ptr< PixelEditorPanel > pixel_editor_panel_
absl::Status Redo() override
std::unique_ptr< PolyhedralEditorPanel > polyhedral_panel_
std::unique_ptr< PalettesetEditorPanel > paletteset_panel_
friend class DungeonPaletteSourceTestPeer
std::function< absl::Status(const Rom &, uint16_t, const std::vector< uint8_t > &, const zelda3::GfxSheetPointerTables &) verify_written_sheet_)
absl::Status Cut() override
std::string obj_file_path_
void DrawPrototypeViewer()
absl::Status DrawFileImport()
std::vector< uint8_t > import_data_
uint64_t current_palette_index_
absl::Status Paste() override
absl::StatusOr< std::vector< GraphicsSavePlanEntry > > PlanGraphicsSave()
Graphics save preflight: every dirty sheet written to a scratch copy of the ROM (placement,...
std::vector< SDL_Color > decoded_col_
absl::Status BeginSaveTransaction() override
absl::Status Undo() override
absl::Status DrawTilemapImport()
absl::StatusOr< PreparedGraphicsSave > PrepareGraphicsSave()
gfx::SnesPalette z3_rom_palette_
absl::Status Update() override
bool HasPendingGraphicsChanges() const
absl::Status OpenInContext(GraphicsEditContext context)
absl::Status DrawScrImport()
void SetRoomUsageProvider(usage_preview::LiveRoomProvider provider)
void CommitSaveTransaction() override
absl::Status ImportScratchBin(const std::string &path, int bpp, size_t offset, const gfx::SnesPalette &palette={})
std::string tilemap_file_path_
absl::Status Find() override
usage_preview::LiveOverworldProvider overworld_usage_provider_
std::vector< uint8_t > extra_cgx_data_
void SetScratchPreview(std::string label, ScratchPreviewCallback callback)
std::optional< std::set< uint16_t > > save_transaction_modified_sheets_
std::array< gfx::Bitmap, zelda3::kNumGfxSheets > gfx_sheets_
friend class AuthoringSaveWorkflowTestPeer
void SetDependencies(const EditorDependencies &deps) override
std::unique_ptr< ImageImportView > image_import_view_
gui::Canvas import_canvas_
std::vector< uint8_t > decoded_scr_data_
std::string cgx_file_name_
void SetOverworldUsageProvider(usage_preview::LiveOverworldProvider provider)
void SetGameData(zelda3::GameData *game_data) override
std::unique_ptr< LinkSpritePanel > link_sprite_panel_
absl::Status DrawObjImport()
void SetMainGraphicsUsageCallback(GfxGroupEditor::MainUsageCallback callback)
std::string prototype_import_feedback_
absl::Status DrawClipboardImport()
uint64_t num_sheets_to_load_
void PrepareForSessionTeardown() override
absl::Status DecompressImportData(int size)
void ContributeStatus(StatusBar *status_bar) override
std::unique_ptr< UsagePreviewView > usage_preview_view_
absl::Status DrawExperimentalFeatures()
absl::Status DrawPaletteControls()
std::unique_ptr< SheetBrowserPanel > sheet_browser_panel_
std::string scr_file_name_
A session-aware status bar displayed at the bottom of the application.
Represents a bitmap image optimized for SNES ROM hacking.
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
Modern, robust canvas for drawing and manipulating graphics.
The Graphics editor's path for sheet pixel writes.
std::function< LiveRoomContexts()> LiveRoomProvider
std::function< zelda3::Overworld *()> LiveOverworldProvider
const std::string kSuperDonkeySprites[]
void AttachSheetStore(GraphicsEditorState &state, zelda3::GameData *game_data)
const std::string kSuperDonkeyTiles[]
absl::Status VerifyWrittenSheetPixels(const Rom &rom, uint16_t sheet_id, const std::vector< uint8_t > &expected_pixels, const zelda3::GfxSheetPointerTables &tables)
PixelTool
Pixel editing tool types for the graphics editor.
std::function< absl::StatusOr< usage_preview::PreviewImage >( const GraphicsScratchAsset &)> ScratchPreviewCallback
Unified dependency container for all editor types.
GfxGroupWorkspaceState * gfx_group_workspace
std::map< uint16_t, std::string > refusals
zelda3::GfxSheetPointerTables tables
std::vector< uint16_t > sheet_ids
zelda3::GfxSheetWritePolicy policy
Represents a group of palettes.
Modern project structure with comprehensive settings consolidation.
PC offsets of the bank, high and low byte pointer tables.
Rules a sheet write must follow.