Manage graphics group configurations in a Rom. More...
#include <gfx_group_editor.h>
Classes | |
| struct | AssignmentSession |
Public Types | |
| using | MainUsageCallback |
| using | RoomsetUsageCallback |
Public Member Functions | |
| ~GfxGroupEditor () | |
| absl::Status | Update () |
| void | DrawBlocksetViewer (bool sheet_only=false) |
| void | DrawRoomsetViewer () |
| void | DrawSpritesetViewer (bool sheet_only=false) |
| void | DrawPaletteControls () |
| void | SetSelectedBlockset (uint8_t blockset) |
| void | SetSelectedRoomset (uint8_t roomset) |
| void | SetSelectedSpriteset (uint8_t spriteset) |
| void | SetRom (Rom *rom) |
| void | SetUndoManager (UndoManager *undo) |
| void | SetMainUsageCallback (MainUsageCallback callback) |
| absl::Status | EditMainGraphicsSheet (int group, int slot, int sheet) |
| absl::Status | EditRoomsetGraphicsSheet (int group, int entry, int sheet) |
| void | SetRoomsetUsageCallback (RoomsetUsageCallback callback) |
| void | DetachRuntimeContext () |
| Rom * | rom () const |
| void | SetGameData (zelda3::GameData *data) |
| zelda3::GameData * | game_data () const |
| void | SetWorkspaceState (GfxGroupWorkspaceState *state) |
| void | SetHostSurfaceHint (std::string hint) |
| const GfxGroupWorkspaceState & | workspace_state () const |
Private Types | |
| enum class | GroupKind { kMain , kRoomset } |
Private Member Functions | |
| void | UpdateCurrentPalette () |
| absl::Status | EditGraphicsSheet (GroupKind kind, int group, int slot, int sheet) |
| void | DrawAssignmentControls (GroupKind kind) |
| void | DrawRoomsetUsage () |
| void | DrawMainUsage () |
| void | DrawSheetPicker () |
| void | ResetSheetPicker () |
| gfx::Bitmap * | PrepareSheetPreview (int sheet_id, gfx::SheetRole role, gfx::Bitmap &preview) |
| GfxGroupWorkspaceState & | Ws () |
| const GfxGroupWorkspaceState & | Ws () const |
| void | DrawSpritesetUsage (int id) |
Manage graphics group configurations in a Rom.
Provides a UI for viewing and editing:
Features palette preview controls for viewing sheets with different palettes.
When SetWorkspaceState is set (typically from EditorSet), selection and preview palette UI fields are shared with other GfxGroupEditor instances for the same ROM session. Canvases remain per-instance.
Definition at line 39 of file gfx_group_editor.h.
Definition at line 58 of file gfx_group_editor.h.
Definition at line 68 of file gfx_group_editor.h.
|
strongprivate |
| Enumerator | |
|---|---|
| kMain | |
| kRoomset | |
Definition at line 89 of file gfx_group_editor.h.
| yaze::editor::GfxGroupEditor::~GfxGroupEditor | ( | ) |
Definition at line 52 of file gfx_group_editor_main.cc.
References blockset_previews_, yaze::gfx::Arena::Get(), ResetSheetPicker(), yaze::gfx::Arena::RetireBitmap(), roomset_previews_, and spriteset_previews_.

| absl::Status yaze::editor::GfxGroupEditor::Update | ( | ) |
Definition at line 135 of file gfx_group_editor.cc.
References yaze::gui::BeginThemedTabBar(), DrawBlocksetViewer(), DrawPaletteControls(), DrawRoomsetViewer(), DrawSpritesetUsage(), DrawSpritesetViewer(), yaze::gui::EndThemedTabBar(), host_surface_hint_, yaze::gui::InputHexByte(), yaze::Rom::resource_label(), rom(), yaze::project::ResourceLabelManager::SelectableLabelWithNameEdit(), UpdateCurrentPalette(), and Ws().
Referenced by yaze::editor::OverworldEditor::UpdateGfxGroupEditor().
| void yaze::editor::GfxGroupEditor::DrawBlocksetViewer | ( | bool | sheet_only = false | ) |
Definition at line 229 of file gfx_group_editor.cc.
References blockset_canvases_, blockset_previews_, DrawAssignmentControls(), game_data(), kMain, yaze::zelda3::GameData::main_blockset_ids, PrepareSheetPreview(), yaze::gfx::RoleForBlocksetSlot(), and Ws().
Referenced by Update().
| void yaze::editor::GfxGroupEditor::DrawRoomsetViewer | ( | ) |
Definition at line 282 of file gfx_group_editor.cc.
References DrawAssignmentControls(), game_data(), kRoomset, PrepareSheetPreview(), yaze::gfx::RoleForRoomsetSlot(), yaze::zelda3::GameData::room_blockset_ids, roomset_canvases_, roomset_previews_, and Ws().
Referenced by Update().
| void yaze::editor::GfxGroupEditor::DrawSpritesetViewer | ( | bool | sheet_only = false | ) |
Definition at line 351 of file gfx_group_editor.cc.
References game_data(), yaze::gui::LayoutHelpers::GetSliderWidth(), yaze::gui::InputHexByte(), PrepareSheetPreview(), yaze::gfx::RoleForSpritesetSlot(), spriteset_canvases_, yaze::zelda3::GameData::spriteset_ids, spriteset_previews_, and Ws().
Referenced by Update().
| void yaze::editor::GfxGroupEditor::DrawPaletteControls | ( | ) |
Definition at line 429 of file gfx_group_editor.cc.
References current_palette_, yaze::gfx::SnesPalette::empty(), game_data(), yaze::gui::LayoutHelpers::GetComboWidth(), yaze::gui::LayoutHelpers::GetHexInputWidth(), yaze::gui::LayoutHelpers::GetSliderWidth(), ICON_MD_PALETTE, ICON_MD_ZOOM_IN, yaze::gui::InputHexByte(), UpdateCurrentPalette(), and Ws().
Referenced by Update().
|
inline |
Definition at line 49 of file gfx_group_editor.h.
References yaze::editor::GfxGroupWorkspaceState::selected_blockset, and Ws().

|
inline |
Definition at line 52 of file gfx_group_editor.h.
References yaze::editor::GfxGroupWorkspaceState::selected_roomset, and Ws().

|
inline |
Definition at line 53 of file gfx_group_editor.h.
References yaze::editor::GfxGroupWorkspaceState::selected_spriteset, and Ws().

| void yaze::editor::GfxGroupEditor::SetRom | ( | Rom * | rom | ) |
Definition at line 72 of file gfx_group_editor_main.cc.
References assignment_session_, current_palette_, ResetSheetPicker(), rom(), rom_, usage_areas_, and usage_rooms_.
Referenced by DetachRuntimeContext(), and yaze::editor::OverworldEditor::OverworldEditor().

|
inline |
Definition at line 57 of file gfx_group_editor.h.
References undo_.
Referenced by yaze::editor::OverworldEditor::OverworldEditor().
|
inline |
Definition at line 60 of file gfx_group_editor.h.
References main_usage_.
Referenced by yaze::editor::OverworldEditor::SetMainGraphicsUsageCallback().
| absl::Status yaze::editor::GfxGroupEditor::EditMainGraphicsSheet | ( | int | group, |
| int | slot, | ||
| int | sheet ) |
Definition at line 104 of file gfx_group_editor_main.cc.
References EditGraphicsSheet(), and kMain.

| absl::Status yaze::editor::GfxGroupEditor::EditRoomsetGraphicsSheet | ( | int | group, |
| int | entry, | ||
| int | sheet ) |
Definition at line 109 of file gfx_group_editor_main.cc.
References EditGraphicsSheet(), and kRoomset.

|
inline |
Definition at line 70 of file gfx_group_editor.h.
References roomset_usage_.
Referenced by yaze::editor::OverworldEditor::SetRoomsetGraphicsUsageCallback().
| void yaze::editor::GfxGroupEditor::DetachRuntimeContext | ( | ) |
Definition at line 95 of file gfx_group_editor_main.cc.
References main_usage_, roomset_usage_, SetGameData(), SetRom(), undo_, and workspace_.
Referenced by yaze::editor::OverworldEditor::PrepareForSessionTeardown().

|
inline |
Definition at line 74 of file gfx_group_editor.h.
References rom_.
| void yaze::editor::GfxGroupEditor::SetGameData | ( | zelda3::GameData * | data | ) |
Definition at line 84 of file gfx_group_editor_main.cc.
References assignment_session_, current_palette_, game_data_, and ResetSheetPicker().
Referenced by DetachRuntimeContext(), and yaze::editor::OverworldEditor::SetGameData().

|
inline |
Definition at line 76 of file gfx_group_editor.h.
References game_data_.
Referenced by DrawBlocksetViewer(), DrawPaletteControls(), DrawRoomsetViewer(), DrawSpritesetViewer(), and UpdateCurrentPalette().
|
inline |
Definition at line 78 of file gfx_group_editor.h.
References workspace_.
Referenced by yaze::editor::OverworldEditor::SetDependencies().
|
inline |
Subdued line at top of the panel (per-surface messaging).
Definition at line 81 of file gfx_group_editor.h.
References host_surface_hint_.
Referenced by yaze::editor::OverworldEditor::Initialize().
|
inline |
Definition at line 85 of file gfx_group_editor.h.
References Ws().

|
private |
Definition at line 491 of file gfx_group_editor.cc.
References current_palette_, game_data(), yaze::zelda3::GameData::palette_groups, and Ws().
Referenced by DrawPaletteControls(), PrepareSheetPreview(), and Update().

|
private |
Definition at line 114 of file gfx_group_editor_main.cc.
References assignment_session_, game_data_, yaze::zelda3::GetGfxSheetStorageKind(), yaze::zelda3::GameData::gfx_groups_loaded, yaze::zelda3::GraphicsSheetStore::HasSheet(), yaze::Rom::is_loaded(), yaze::zelda3::kCompressed2bpp, kRoomset, yaze::zelda3::GraphicsSheetStore::kSheetCount, yaze::zelda3::GameData::main_blockset_ids, yaze::editor::UndoManager::Push(), RETURN_IF_ERROR, rom_, yaze::zelda3::GameData::room_blockset_ids, yaze::zelda3::GraphicsSheetStoreHolder::sheet_store, and undo_.
Referenced by DrawSheetPicker(), EditMainGraphicsSheet(), and EditRoomsetGraphicsSheet().

|
private |
Definition at line 254 of file gfx_group_editor_main.cc.
References assignment_error_, yaze::gui::AutoRegisterLastItem(), DrawMainUsage(), DrawRoomsetUsage(), DrawSheetPicker(), game_data_, yaze::zelda3::GameData::gfx_groups_loaded, kRoomset, yaze::zelda3::GameData::main_blockset_ids, main_usage_, picker_expected_sheet_, picker_group_, picker_kind_, ResetSheetPicker(), yaze::zelda3::GameData::room_blockset_ids, roomset_usage_, yaze::editor::GfxGroupWorkspaceState::selected_blockset, selected_main_slot_, yaze::editor::GfxGroupWorkspaceState::selected_roomset, selected_roomset_entry_, show_sheet_picker_, undo_, and Ws().
Referenced by DrawBlocksetViewer(), and DrawRoomsetViewer().
|
private |
Definition at line 220 of file gfx_group_editor_main.cc.
References roomset_usage_, and Ws().
Referenced by DrawAssignmentControls().

|
private |
Definition at line 169 of file gfx_group_editor_main.cc.
References main_usage_, selected_main_slot_, and Ws().
Referenced by DrawAssignmentControls().

|
private |
Definition at line 300 of file gfx_group_editor_main.cc.
References assignment_error_, yaze::gui::AutoRegisterLastItem(), EditGraphicsSheet(), game_data_, yaze::zelda3::GetGfxSheetStorageKind(), yaze::zelda3::GraphicsSheetStore::HasSheet(), yaze::zelda3::kCompressed2bpp, kRoomset, yaze::zelda3::GraphicsSheetStore::kSheetCount, yaze::zelda3::GameData::main_blockset_ids, pending_sheet_, picker_expected_sheet_, picker_group_, picker_kind_, picker_previews_, PrepareSheetPreview(), yaze::gfx::RoleForBlocksetSlot(), yaze::gfx::RoleForRoomsetSlot(), yaze::zelda3::GameData::room_blockset_ids, selected_main_slot_, selected_roomset_entry_, yaze::zelda3::GraphicsSheetStoreHolder::sheet_store, and show_sheet_picker_.
Referenced by DrawAssignmentControls().
|
private |
Definition at line 62 of file gfx_group_editor_main.cc.
References assignment_error_, yaze::gfx::Arena::Get(), pending_sheet_, picker_group_, picker_previews_, yaze::gfx::Arena::RetireBitmap(), and show_sheet_picker_.
Referenced by DrawAssignmentControls(), SetGameData(), SetRom(), and ~GfxGroupEditor().

|
private |
Definition at line 103 of file gfx_group_editor.cc.
References yaze::gfx::Bitmap::Create(), current_palette_, yaze::editor::internal::EnsureSheetTextureQueued(), game_data_, yaze::zelda3::GraphicsSheetStore::HasSheet(), yaze::zelda3::GraphicsSheetStore::kSheetCount, yaze::editor::GfxGroupWorkspaceState::override_palette, yaze::gfx::Bitmap::palette(), yaze::zelda3::GameData::palette_groups, yaze::editor::internal::ResolveRoleDefaultPalette(), yaze::gfx::Bitmap::SetPalette(), yaze::zelda3::GraphicsSheetStore::Sheet(), yaze::zelda3::GraphicsSheetStoreHolder::sheet_store, yaze::gfx::Bitmap::surface(), yaze::gfx::Bitmap::texture(), UpdateCurrentPalette(), yaze::gfx::Bitmap::UpdateTexture(), yaze::gfx::Bitmap::vector(), and Ws().
Referenced by DrawBlocksetViewer(), DrawRoomsetViewer(), DrawSheetPicker(), and DrawSpritesetViewer().
|
inlineprivate |
Definition at line 119 of file gfx_group_editor.h.
References fallback_, and workspace_.
Referenced by DrawAssignmentControls(), DrawBlocksetViewer(), DrawMainUsage(), DrawPaletteControls(), DrawRoomsetUsage(), DrawRoomsetViewer(), DrawSpritesetViewer(), PrepareSheetPreview(), SetSelectedBlockset(), SetSelectedRoomset(), SetSelectedSpriteset(), Update(), UpdateCurrentPalette(), and workspace_state().
|
inlineprivate |
Definition at line 120 of file gfx_group_editor.h.
References fallback_, and workspace_.
|
private |
Definition at line 185 of file gfx_group_editor.cc.
References yaze::zelda3::CollectOverworldAreaGfx(), yaze::zelda3::CollectRoomGfx(), yaze::zelda3::FindSpritesetUsage(), game_data_, HOVER_HINT, ICON_MD_REFRESH, yaze::Rom::is_loaded(), yaze::zelda3::kDungeonSpritesetBase, rom_, usage_areas_, usage_rom_, and usage_rooms_.
Referenced by Update().

|
private |
Definition at line 102 of file gfx_group_editor.h.
Referenced by EditGraphicsSheet(), SetGameData(), and SetRom().
|
private |
Definition at line 104 of file gfx_group_editor.h.
Referenced by DetachRuntimeContext(), DrawAssignmentControls(), EditGraphicsSheet(), and SetUndoManager().
|
private |
Definition at line 105 of file gfx_group_editor.h.
Referenced by DetachRuntimeContext(), DrawAssignmentControls(), DrawMainUsage(), and SetMainUsageCallback().
|
private |
Definition at line 106 of file gfx_group_editor.h.
Referenced by DetachRuntimeContext(), DrawAssignmentControls(), DrawRoomsetUsage(), and SetRoomsetUsageCallback().
|
private |
Definition at line 107 of file gfx_group_editor.h.
Referenced by DrawAssignmentControls(), and DrawSheetPicker().
|
private |
Definition at line 108 of file gfx_group_editor.h.
Referenced by DrawAssignmentControls(), and DrawSheetPicker().
|
private |
Definition at line 109 of file gfx_group_editor.h.
Referenced by DrawAssignmentControls(), DrawMainUsage(), and DrawSheetPicker().
|
private |
Definition at line 110 of file gfx_group_editor.h.
Referenced by DrawAssignmentControls(), DrawSheetPicker(), and ResetSheetPicker().
|
private |
Definition at line 111 of file gfx_group_editor.h.
Referenced by DrawSheetPicker(), and ResetSheetPicker().
|
private |
Definition at line 112 of file gfx_group_editor.h.
Referenced by DrawAssignmentControls(), and DrawSheetPicker().
|
private |
Definition at line 113 of file gfx_group_editor.h.
Referenced by DrawAssignmentControls(), DrawSheetPicker(), and ResetSheetPicker().
|
private |
Definition at line 114 of file gfx_group_editor.h.
Referenced by DrawAssignmentControls(), DrawSheetPicker(), and ResetSheetPicker().
|
private |
Definition at line 115 of file gfx_group_editor.h.
Referenced by DrawSheetPicker(), and ResetSheetPicker().
|
private |
Definition at line 124 of file gfx_group_editor.h.
Referenced by DetachRuntimeContext(), SetWorkspaceState(), Ws(), and Ws().
|
private |
Definition at line 125 of file gfx_group_editor.h.
|
private |
Definition at line 128 of file gfx_group_editor.h.
Referenced by DrawBlocksetViewer().
|
private |
Definition at line 129 of file gfx_group_editor.h.
Referenced by DrawRoomsetViewer().
|
private |
Definition at line 130 of file gfx_group_editor.h.
Referenced by DrawSpritesetViewer().
|
private |
Definition at line 132 of file gfx_group_editor.h.
Referenced by DrawBlocksetViewer(), and ~GfxGroupEditor().
|
private |
Definition at line 133 of file gfx_group_editor.h.
Referenced by DrawRoomsetViewer(), and ~GfxGroupEditor().
|
private |
Definition at line 134 of file gfx_group_editor.h.
Referenced by DrawSpritesetViewer(), and ~GfxGroupEditor().
|
private |
Definition at line 136 of file gfx_group_editor.h.
Referenced by DrawSpritesetUsage(), EditGraphicsSheet(), rom(), and SetRom().
|
private |
Definition at line 137 of file gfx_group_editor.h.
Referenced by DrawAssignmentControls(), DrawSheetPicker(), DrawSpritesetUsage(), EditGraphicsSheet(), game_data(), PrepareSheetPreview(), and SetGameData().
|
private |
Definition at line 142 of file gfx_group_editor.h.
Referenced by DrawSpritesetUsage(), and SetRom().
|
private |
Definition at line 143 of file gfx_group_editor.h.
Referenced by DrawSpritesetUsage(), and SetRom().
|
private |
Definition at line 144 of file gfx_group_editor.h.
Referenced by DrawSpritesetUsage().
|
private |
Definition at line 145 of file gfx_group_editor.h.
Referenced by DrawPaletteControls(), PrepareSheetPreview(), SetGameData(), SetRom(), and UpdateCurrentPalette().
|
private |
Definition at line 146 of file gfx_group_editor.h.
Referenced by SetHostSurfaceHint(), and Update().