yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::Tile16Editor Class Reference

ImGui façade for Tile16 editing; domain state lives in Tile16EditSession. More...

#include <tile16_editor.h>

Inheritance diagram for yaze::editor::Tile16Editor:

Public Member Functions

 Tile16Editor (Rom *rom, gfx::Tilemap *tile16_blockset)
 
absl::Status Initialize (gfx::Bitmap &tile16_blockset_bmp, gfx::Bitmap &current_gfx_bmp, std::array< uint8_t, 0x200 > &all_tiles_types)
 
absl::Status Update ()
 
absl::Status UpdateAsPanel ()
 
void SetOpenGraphicsForQuadrant (std::function< absl::Status(int, int)> callback)
 
absl::Status OpenGraphicsForActiveQuadrant ()
 
void DrawContextMenu ()
 
void DrawTile16Editor ()
 
absl::Status UpdateBlockset ()
 
void DrawScratchSpace ()
 
absl::Status DrawToCurrentTile16 (ImVec2 pos, const gfx::Bitmap *source_tile=nullptr)
 
absl::Status HandleTile16CanvasClick (const ImVec2 &tile_position, bool left_click, bool right_click)
 
absl::Status UpdateTile16Edit ()
 
absl::Status LoadTile8 ()
 
absl::Status SetCurrentTile (int id)
 
void RequestTileSwitch (int target_tile_id)
 
absl::Status CopyTile16ToClipboard (int tile_id)
 
absl::Status PasteTile16FromClipboard ()
 
absl::Status SaveTile16ToScratchSpace (int slot)
 
absl::Status LoadTile16FromScratchSpace (int slot)
 
absl::Status ClearScratchSpace (int slot)
 
absl::Status FlipTile16Horizontal ()
 
absl::Status FlipTile16Vertical ()
 
absl::Status RotateTile16 ()
 
absl::Status FillTile16WithTile8 (int tile8_id)
 
absl::Status ClearTile16 ()
 
absl::Status CyclePalette (bool forward=true)
 
absl::Status ApplyPaletteToAll (uint8_t palette_id)
 
absl::Status ApplyPaletteToQuadrant (int quadrant, uint8_t palette_id)
 
absl::Status PreviewPaletteChange (uint8_t palette_id)
 
void BindDocument (std::vector< gfx::Tile16 > *definitions, UndoManager *history, std::function< void()> before_edit={})
 
absl::Status ReplaceCurrentTile (const gfx::Tile16 &data)
 
absl::Status Undo ()
 
absl::Status Redo ()
 
void EnableLivePreview (bool enable)
 
absl::Status UpdateLivePreview ()
 
absl::Status ValidateTile16Data ()
 
bool IsTile16Valid (int tile_id) const
 
absl::Status SaveTile16ToROM ()
 
absl::Status UpdateOverworldTilemap ()
 
absl::Status CommitChangesToBlockset ()
 
absl::Status CommitChangesToOverworld ()
 
absl::Status DiscardChanges ()
 
bool has_pending_changes () const
 
int pending_changes_count () const
 
bool is_tile_modified (int tile_id) const
 
const gfx::Bitmap * GetPendingTileBitmap (int tile_id) const
 
absl::Status CommitAllChanges ()
 
void DiscardAllChanges ()
 
void DiscardCurrentTileChanges ()
 
void MarkCurrentTileModified ()
 
absl::Status UpdateTile8Palette (int tile8_id)
 
absl::Status RefreshAllPalettes ()
 
void DrawPaletteSettings ()
 
int GetActualPaletteSlot (int palette_button, int sheet_index) const
 
int GetSheetIndexForTile8 (int tile8_id) const
 
int GetActualPaletteSlotForCurrentTile16 () const
 
gfx::SnesPalette CreateRemappedPaletteForViewing (const gfx::SnesPalette &source, int target_row) const
 
int GetEncodedPaletteRow (uint8_t pixel_value) const
 
absl::Status UpdateROMTile16Data ()
 
absl::Status RefreshTile16Blockset ()
 
gfx::Tile16 * GetCurrentTile16Data ()
 
absl::Status RegenerateTile16BitmapFromROM ()
 
absl::Status UpdateBlocksetBitmap ()
 
absl::Status PickTile8FromTile16 (const ImVec2 &position)
 
void DrawManualTile8Inputs ()
 
void SetRom (Rom *rom)
 
Rom * rom () const
 
void SetGameData (zelda3::GameData *game_data)
 
zelda3::GameData * game_data () const
 
void set_palette (const gfx::SnesPalette &palette)
 
void set_on_document_changed (std::function< void(const std::vector< Tile16Commit > &)> callback)
 
void set_on_changes_committed (std::function< absl::Status(const std::vector< Tile16Commit > &)> callback)
 
void set_on_current_tile_changed (std::function< void(int)> callback)
 
int current_palette () const
 
void set_current_palette (int palette)
 
const gfx::Bitmap & Tile8PreviewBitmapForTesting () const
 
int current_tile16 () const
 
int selected_tile16_for_testing () const
 
int current_tile8 () const
 
int active_quadrant () const
 
void set_active_quadrant (int quadrant)
 
Tile16EditMode edit_mode () const
 
void set_edit_mode (Tile16EditMode mode)
 
void AnalyzeTile8SourceData () const
 
absl::Status SaveLayoutToScratch (int slot)
 
absl::Status LoadLayoutFromScratch (int slot)
 

Static Public Member Functions

static ImVec2 Tile16PreviewDisplayPixelToTilePosition (const ImVec2 &display_position)
 

Private Member Functions

void DrawTile8UsageOverlay ()
 
void HandleKeyboardShortcuts ()
 
absl::Status DrawTile16NavigationHeader (int total_tiles)
 
absl::Status DrawTile16EditorWorkbenchColumn (bool show_debug_info, bool show_advanced_controls)
 
absl::Status DrawCompactActionStatusRow (bool *show_debug_info, bool *show_advanced_controls)
 
absl::Status DrawBrushAndTilePaletteControls (bool show_debug_info)
 
absl::Status DrawTile8SourcePanel (float preferred_height=0.0f)
 
absl::Status HandleTile8SourceSelection (bool right_clicked, float display_scale)
 
absl::Status DrawPrimaryActionControls ()
 

Private Attributes

Tile16EditSession session_
 
gfx::Bitmap stamp_preview_bitmap_
 
std::vector< int > selected_tiles_
 
int selection_start_tile_ = -1
 
bool multi_select_mode_ = false
 
util::NotifyValue< uint32_t > notify_tile16
 
util::NotifyValue< uint8_t > notify_palette
 
gui::Canvas blockset_canvas_
 
gui::TileSelectorWidget blockset_selector_
 
gui::Canvas tile16_edit_canvas_
 
gui::Canvas tile8_source_canvas_
 
gui::Table tile_edit_table_
 
PaletteEditor palette_editor_
 
absl::Status status_
 
absl::Status graphics_open_status_
 
std::function< absl::Status(int, int)> open_graphics_for_quadrant_
 

Additional Inherited Members

- Static Protected Attributes inherited from yaze::gfx::GfxContext
static std::unordered_map< uint8_t, gfx::Paletteset > palettesets_
 

Detailed Description

ImGui façade for Tile16 editing; domain state lives in Tile16EditSession.

Definition at line 31 of file tile16_editor.h.

Constructor & Destructor Documentation

◆ Tile16Editor()

yaze::editor::Tile16Editor::Tile16Editor ( Rom * rom,
gfx::Tilemap * tile16_blockset )
inline

Definition at line 33 of file tile16_editor.h.

Member Function Documentation

◆ Initialize()

◆ Update()

absl::Status yaze::editor::Tile16Editor::Update ( )

Definition at line 91 of file tile16_editor.cc.

References UpdateAsPanel().

Here is the call graph for this function:

◆ UpdateAsPanel()

◆ SetOpenGraphicsForQuadrant()

void yaze::editor::Tile16Editor::SetOpenGraphicsForQuadrant ( std::function< absl::Status(int, int)> callback)
inline

Definition at line 42 of file tile16_editor.h.

References open_graphics_for_quadrant_.

Referenced by yaze::editor::OverworldEditor::Load().

◆ OpenGraphicsForActiveQuadrant()

absl::Status yaze::editor::Tile16Editor::OpenGraphicsForActiveQuadrant ( )
inline

Definition at line 46 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::active_quadrant(), yaze::editor::Tile16EditSession::current_tile16(), open_graphics_for_quadrant_, and session_.

Referenced by UpdateAsPanel().

Here is the call graph for this function:

◆ DrawContextMenu()

◆ DrawTile16Editor()

void yaze::editor::Tile16Editor::DrawTile16Editor ( )

Definition at line 96 of file tile16_editor.cc.

References status_, and UpdateTile16Edit().

Referenced by UpdateAsPanel().

Here is the call graph for this function:

◆ UpdateBlockset()

◆ DrawScratchSpace()

void yaze::editor::Tile16Editor::DrawScratchSpace ( )

◆ DrawToCurrentTile16()

absl::Status yaze::editor::Tile16Editor::DrawToCurrentTile16 ( ImVec2 pos,
const gfx::Bitmap * source_tile = nullptr )

Definition at line 297 of file tile16_editor.cc.

References yaze::editor::Tile16EditSession::DrawToCurrentTile16(), and session_.

Here is the call graph for this function:

◆ HandleTile16CanvasClick()

absl::Status yaze::editor::Tile16Editor::HandleTile16CanvasClick ( const ImVec2 & tile_position,
bool left_click,
bool right_click )

Definition at line 302 of file tile16_editor.cc.

References yaze::editor::Tile16EditSession::HandleTile16CanvasClick(), and session_.

Referenced by DrawTile16EditorWorkbenchColumn().

Here is the call graph for this function:

◆ Tile16PreviewDisplayPixelToTilePosition()

ImVec2 yaze::editor::Tile16Editor::Tile16PreviewDisplayPixelToTilePosition ( const ImVec2 & display_position)
static

◆ UpdateTile16Edit()

◆ LoadTile8()

absl::Status yaze::editor::Tile16Editor::LoadTile8 ( )
inline

Definition at line 66 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::LoadTile8(), and session_.

Referenced by DrawPaletteSettings().

Here is the call graph for this function:

◆ SetCurrentTile()

absl::Status yaze::editor::Tile16Editor::SetCurrentTile ( int id)
inline

◆ RequestTileSwitch()

void yaze::editor::Tile16Editor::RequestTileSwitch ( int target_tile_id)
inline

◆ CopyTile16ToClipboard()

absl::Status yaze::editor::Tile16Editor::CopyTile16ToClipboard ( int tile_id)
inline

Definition at line 72 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::CopyTile16ToClipboard(), and session_.

Referenced by DrawContextMenu(), DrawPrimaryActionControls(), and HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ PasteTile16FromClipboard()

absl::Status yaze::editor::Tile16Editor::PasteTile16FromClipboard ( )
inline

Definition at line 75 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::PasteTile16FromClipboard(), and session_.

Referenced by DrawContextMenu(), DrawPrimaryActionControls(), and HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ SaveTile16ToScratchSpace()

absl::Status yaze::editor::Tile16Editor::SaveTile16ToScratchSpace ( int slot)
inline

Definition at line 78 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::SaveTile16ToScratchSpace(), and session_.

Referenced by DrawContextMenu().

Here is the call graph for this function:

◆ LoadTile16FromScratchSpace()

absl::Status yaze::editor::Tile16Editor::LoadTile16FromScratchSpace ( int slot)
inline

Definition at line 81 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::LoadTile16FromScratchSpace(), and session_.

Referenced by DrawContextMenu().

Here is the call graph for this function:

◆ ClearScratchSpace()

absl::Status yaze::editor::Tile16Editor::ClearScratchSpace ( int slot)
inline

Definition at line 84 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::ClearScratchSpace(), and session_.

Referenced by DrawContextMenu().

Here is the call graph for this function:

◆ FlipTile16Horizontal()

absl::Status yaze::editor::Tile16Editor::FlipTile16Horizontal ( )
inline

Definition at line 88 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::FlipTile16Horizontal(), and session_.

Referenced by DrawContextMenu(), and HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ FlipTile16Vertical()

absl::Status yaze::editor::Tile16Editor::FlipTile16Vertical ( )
inline

Definition at line 91 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::FlipTile16Vertical(), and session_.

Referenced by DrawContextMenu(), and HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ RotateTile16()

absl::Status yaze::editor::Tile16Editor::RotateTile16 ( )
inline

Definition at line 92 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::RotateTile16(), and session_.

Referenced by DrawContextMenu(), and HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ FillTile16WithTile8()

absl::Status yaze::editor::Tile16Editor::FillTile16WithTile8 ( int tile8_id)
inline

Definition at line 93 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::FillTile16WithTile8(), and session_.

Referenced by HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ ClearTile16()

absl::Status yaze::editor::Tile16Editor::ClearTile16 ( )
inline

Definition at line 96 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::ClearTile16(), and session_.

Referenced by DrawContextMenu(), DrawPrimaryActionControls(), and HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ CyclePalette()

absl::Status yaze::editor::Tile16Editor::CyclePalette ( bool forward = true)
inline

Definition at line 98 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::CyclePalette(), and session_.

Referenced by HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ ApplyPaletteToAll()

absl::Status yaze::editor::Tile16Editor::ApplyPaletteToAll ( uint8_t palette_id)
inline

Definition at line 101 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::ApplyPaletteToAll(), and session_.

Referenced by DrawBrushAndTilePaletteControls().

Here is the call graph for this function:

◆ ApplyPaletteToQuadrant()

absl::Status yaze::editor::Tile16Editor::ApplyPaletteToQuadrant ( int quadrant,
uint8_t palette_id )
inline

Definition at line 104 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::ApplyPaletteToQuadrant(), and session_.

Referenced by DrawBrushAndTilePaletteControls().

Here is the call graph for this function:

◆ PreviewPaletteChange()

absl::Status yaze::editor::Tile16Editor::PreviewPaletteChange ( uint8_t palette_id)
inline

Definition at line 107 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::PreviewPaletteChange(), and session_.

Here is the call graph for this function:

◆ BindDocument()

void yaze::editor::Tile16Editor::BindDocument ( std::vector< gfx::Tile16 > * definitions,
UndoManager * history,
std::function< void()> before_edit = {} )
inline

Definition at line 111 of file tile16_editor.h.

Referenced by yaze::editor::OverworldEditor::Load().

◆ ReplaceCurrentTile()

absl::Status yaze::editor::Tile16Editor::ReplaceCurrentTile ( const gfx::Tile16 & data)
inline

Definition at line 115 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::ReplaceCurrentTile(), and session_.

Referenced by DrawManualTile8Inputs().

Here is the call graph for this function:

◆ Undo()

absl::Status yaze::editor::Tile16Editor::Undo ( )
inline

Definition at line 118 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::Undo().

Referenced by DrawCompactActionStatusRow(), and HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ Redo()

absl::Status yaze::editor::Tile16Editor::Redo ( )
inline

Definition at line 119 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::Redo(), and session_.

Referenced by DrawCompactActionStatusRow(), and HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ EnableLivePreview()

void yaze::editor::Tile16Editor::EnableLivePreview ( bool enable)
inline

Definition at line 121 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::EnableLivePreview(), and session_.

Here is the call graph for this function:

◆ UpdateLivePreview()

absl::Status yaze::editor::Tile16Editor::UpdateLivePreview ( )
inline

Definition at line 122 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::UpdateLivePreview().

Referenced by UpdateAsPanel().

Here is the call graph for this function:

◆ ValidateTile16Data()

absl::Status yaze::editor::Tile16Editor::ValidateTile16Data ( )
inline

Definition at line 124 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::ValidateTile16Data().

Here is the call graph for this function:

◆ IsTile16Valid()

bool yaze::editor::Tile16Editor::IsTile16Valid ( int tile_id) const
inline

Definition at line 125 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::IsTile16Valid(), and session_.

Here is the call graph for this function:

◆ SaveTile16ToROM()

absl::Status yaze::editor::Tile16Editor::SaveTile16ToROM ( )
inline

Definition at line 129 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::SaveTile16ToROM(), and session_.

Here is the call graph for this function:

◆ UpdateOverworldTilemap()

absl::Status yaze::editor::Tile16Editor::UpdateOverworldTilemap ( )
inline

Definition at line 130 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::UpdateOverworldTilemap().

Here is the call graph for this function:

◆ CommitChangesToBlockset()

absl::Status yaze::editor::Tile16Editor::CommitChangesToBlockset ( )
inline

Definition at line 133 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::CommitChangesToBlockset(), and session_.

Here is the call graph for this function:

◆ CommitChangesToOverworld()

absl::Status yaze::editor::Tile16Editor::CommitChangesToOverworld ( )
inline

Definition at line 136 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::CommitChangesToOverworld(), and session_.

Here is the call graph for this function:

◆ DiscardChanges()

absl::Status yaze::editor::Tile16Editor::DiscardChanges ( )
inline

Definition at line 139 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::DiscardChanges(), and session_.

Here is the call graph for this function:

◆ has_pending_changes()

bool yaze::editor::Tile16Editor::has_pending_changes ( ) const
inline

Definition at line 141 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::has_pending_changes(), and session_.

Referenced by yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges().

Here is the call graph for this function:

◆ pending_changes_count()

int yaze::editor::Tile16Editor::pending_changes_count ( ) const
inline

Definition at line 142 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::pending_changes_count(), and session_.

Here is the call graph for this function:

◆ is_tile_modified()

bool yaze::editor::Tile16Editor::is_tile_modified ( int tile_id) const
inline

Definition at line 143 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::is_tile_modified(), and session_.

Referenced by yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges().

Here is the call graph for this function:

◆ GetPendingTileBitmap()

const gfx::Bitmap * yaze::editor::Tile16Editor::GetPendingTileBitmap ( int tile_id) const
inline

Definition at line 146 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::GetPendingTileBitmap(), and session_.

Referenced by yaze::editor::MapRefreshCoordinator::UpdateBlocksetWithPendingTileChanges().

Here is the call graph for this function:

◆ CommitAllChanges()

absl::Status yaze::editor::Tile16Editor::CommitAllChanges ( )
inline

Definition at line 150 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::CommitAllChanges(), and session_.

Here is the call graph for this function:

◆ DiscardAllChanges()

void yaze::editor::Tile16Editor::DiscardAllChanges ( )
inline

Definition at line 151 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::DiscardAllChanges(), and session_.

Here is the call graph for this function:

◆ DiscardCurrentTileChanges()

void yaze::editor::Tile16Editor::DiscardCurrentTileChanges ( )
inline

Definition at line 152 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::DiscardCurrentTileChanges(), and session_.

Here is the call graph for this function:

◆ MarkCurrentTileModified()

void yaze::editor::Tile16Editor::MarkCurrentTileModified ( )
inline

Definition at line 153 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::MarkCurrentTileModified(), and session_.

Here is the call graph for this function:

◆ UpdateTile8Palette()

absl::Status yaze::editor::Tile16Editor::UpdateTile8Palette ( int tile8_id)
inline

Definition at line 155 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::UpdateTile8Palette().

Referenced by HandleTile8SourceSelection().

Here is the call graph for this function:

◆ RefreshAllPalettes()

absl::Status yaze::editor::Tile16Editor::RefreshAllPalettes ( )
inline

Definition at line 158 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::RefreshAllPalettes(), and session_.

Referenced by DrawBrushAndTilePaletteControls(), and HandleKeyboardShortcuts().

Here is the call graph for this function:

◆ DrawPaletteSettings()

◆ GetActualPaletteSlot()

int yaze::editor::Tile16Editor::GetActualPaletteSlot ( int palette_button,
int sheet_index ) const
inline

Definition at line 161 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::GetActualPaletteSlot(), and session_.

Referenced by DrawBrushAndTilePaletteControls(), and DrawTile16EditorWorkbenchColumn().

Here is the call graph for this function:

◆ GetSheetIndexForTile8()

int yaze::editor::Tile16Editor::GetSheetIndexForTile8 ( int tile8_id) const
inline

Definition at line 164 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::GetSheetIndexForTile8(), and session_.

Referenced by DrawTile16EditorWorkbenchColumn().

Here is the call graph for this function:

◆ GetActualPaletteSlotForCurrentTile16()

int yaze::editor::Tile16Editor::GetActualPaletteSlotForCurrentTile16 ( ) const
inline

Definition at line 167 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::GetActualPaletteSlotForCurrentTile16(), and session_.

Referenced by DrawBrushAndTilePaletteControls(), and DrawTile16EditorWorkbenchColumn().

Here is the call graph for this function:

◆ CreateRemappedPaletteForViewing()

gfx::SnesPalette yaze::editor::Tile16Editor::CreateRemappedPaletteForViewing ( const gfx::SnesPalette & source,
int target_row ) const
inline

Definition at line 170 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::CreateRemappedPaletteForViewing(), and session_.

Referenced by DrawTile16EditorWorkbenchColumn().

Here is the call graph for this function:

◆ GetEncodedPaletteRow()

int yaze::editor::Tile16Editor::GetEncodedPaletteRow ( uint8_t pixel_value) const
inline

Definition at line 174 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::GetEncodedPaletteRow(), and session_.

Here is the call graph for this function:

◆ UpdateROMTile16Data()

absl::Status yaze::editor::Tile16Editor::UpdateROMTile16Data ( )
inline

Definition at line 178 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::UpdateROMTile16Data().

Here is the call graph for this function:

◆ RefreshTile16Blockset()

absl::Status yaze::editor::Tile16Editor::RefreshTile16Blockset ( )
inline

Definition at line 179 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::RefreshTile16Blockset(), and session_.

Referenced by DrawTile16EditorWorkbenchColumn().

Here is the call graph for this function:

◆ GetCurrentTile16Data()

gfx::Tile16 * yaze::editor::Tile16Editor::GetCurrentTile16Data ( )
inline

Definition at line 182 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::GetCurrentTile16Data(), and session_.

Referenced by DrawBrushAndTilePaletteControls().

Here is the call graph for this function:

◆ RegenerateTile16BitmapFromROM()

absl::Status yaze::editor::Tile16Editor::RegenerateTile16BitmapFromROM ( )
inline

Definition at line 185 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::RegenerateTile16BitmapFromROM(), and session_.

Here is the call graph for this function:

◆ UpdateBlocksetBitmap()

absl::Status yaze::editor::Tile16Editor::UpdateBlocksetBitmap ( )
inline

Definition at line 188 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::UpdateBlocksetBitmap().

Here is the call graph for this function:

◆ PickTile8FromTile16()

absl::Status yaze::editor::Tile16Editor::PickTile8FromTile16 ( const ImVec2 & position)

Definition at line 317 of file tile16_editor.cc.

References yaze::editor::Tile16EditSession::PickTile8FromTile16(), and session_.

Here is the call graph for this function:

◆ DrawManualTile8Inputs()

void yaze::editor::Tile16Editor::DrawManualTile8Inputs ( )

◆ SetRom()

void yaze::editor::Tile16Editor::SetRom ( Rom * rom)
inline

Definition at line 195 of file tile16_editor.h.

References rom(), session_, and yaze::editor::Tile16EditSession::SetRom().

Referenced by yaze::editor::OverworldEditor::Load().

Here is the call graph for this function:

◆ rom()

Rom * yaze::editor::Tile16Editor::rom ( ) const
inline

Definition at line 196 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::rom(), and session_.

Referenced by SetRom().

Here is the call graph for this function:

◆ SetGameData()

void yaze::editor::Tile16Editor::SetGameData ( zelda3::GameData * game_data)
inline

Definition at line 197 of file tile16_editor.h.

References game_data(), session_, and yaze::editor::Tile16EditSession::SetGameData().

Referenced by yaze::editor::OverworldEditor::SetGameData().

Here is the call graph for this function:

◆ game_data()

zelda3::GameData * yaze::editor::Tile16Editor::game_data ( ) const
inline

Definition at line 200 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::game_data(), and session_.

Referenced by SetGameData().

Here is the call graph for this function:

◆ set_palette()

void yaze::editor::Tile16Editor::set_palette ( const gfx::SnesPalette & palette)
inline

Definition at line 202 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::set_palette().

Referenced by yaze::editor::OverworldEditor::Load(), and yaze::editor::MapRefreshCoordinator::RefreshTile16Blockset().

Here is the call graph for this function:

◆ set_on_document_changed()

void yaze::editor::Tile16Editor::set_on_document_changed ( std::function< void(const std::vector< Tile16Commit > &)> callback)
inline

Definition at line 206 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::set_on_document_changed().

Referenced by yaze::editor::OverworldEditor::Load().

Here is the call graph for this function:

◆ set_on_changes_committed()

void yaze::editor::Tile16Editor::set_on_changes_committed ( std::function< absl::Status(const std::vector< Tile16Commit > &)> callback)
inline

Definition at line 210 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::set_on_changes_committed().

Here is the call graph for this function:

◆ set_on_current_tile_changed()

void yaze::editor::Tile16Editor::set_on_current_tile_changed ( std::function< void(int)> callback)
inline

Definition at line 214 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::set_on_current_tile_changed().

Referenced by yaze::editor::OverworldEditor::Load().

Here is the call graph for this function:

◆ current_palette()

int yaze::editor::Tile16Editor::current_palette ( ) const
inline

Definition at line 218 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::current_palette(), and session_.

Here is the call graph for this function:

◆ set_current_palette()

void yaze::editor::Tile16Editor::set_current_palette ( int palette)
inline

Definition at line 219 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::set_current_palette().

Here is the call graph for this function:

◆ Tile8PreviewBitmapForTesting()

const gfx::Bitmap & yaze::editor::Tile16Editor::Tile8PreviewBitmapForTesting ( ) const
inline

Definition at line 222 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::Tile8PreviewBitmap().

Here is the call graph for this function:

◆ current_tile16()

int yaze::editor::Tile16Editor::current_tile16 ( ) const
inline

Definition at line 225 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::current_tile16(), and session_.

Referenced by yaze::editor::OverworldEditor::RequestTile16Selection().

Here is the call graph for this function:

◆ selected_tile16_for_testing()

int yaze::editor::Tile16Editor::selected_tile16_for_testing ( ) const
inline

Definition at line 226 of file tile16_editor.h.

References blockset_selector_, and yaze::gui::TileSelectorWidget::GetSelectedTileID().

Here is the call graph for this function:

◆ current_tile8()

int yaze::editor::Tile16Editor::current_tile8 ( ) const
inline

Definition at line 229 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::current_tile8(), and session_.

Here is the call graph for this function:

◆ active_quadrant()

int yaze::editor::Tile16Editor::active_quadrant ( ) const
inline

Definition at line 230 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::active_quadrant(), and session_.

Here is the call graph for this function:

◆ set_active_quadrant()

void yaze::editor::Tile16Editor::set_active_quadrant ( int quadrant)
inline

Definition at line 231 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::set_active_quadrant().

Here is the call graph for this function:

◆ edit_mode()

Tile16EditMode yaze::editor::Tile16Editor::edit_mode ( ) const
inline

Definition at line 234 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::edit_mode(), and session_.

Here is the call graph for this function:

◆ set_edit_mode()

void yaze::editor::Tile16Editor::set_edit_mode ( Tile16EditMode mode)
inline

Definition at line 235 of file tile16_editor.h.

References session_, and yaze::editor::Tile16EditSession::set_edit_mode().

Here is the call graph for this function:

◆ AnalyzeTile8SourceData()

void yaze::editor::Tile16Editor::AnalyzeTile8SourceData ( ) const
inline

Definition at line 237 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::AnalyzeTile8SourceData(), and session_.

Referenced by DrawTile16EditorWorkbenchColumn().

Here is the call graph for this function:

◆ SaveLayoutToScratch()

absl::Status yaze::editor::Tile16Editor::SaveLayoutToScratch ( int slot)
inline

Definition at line 239 of file tile16_editor.h.

References yaze::editor::Tile16EditSession::SaveLayoutToScratch(), and session_.

Referenced by DrawScratchSpace().

Here is the call graph for this function:

◆ LoadLayoutFromScratch()

◆ DrawTile8UsageOverlay()

◆ HandleKeyboardShortcuts()

◆ DrawTile16NavigationHeader()

◆ DrawTile16EditorWorkbenchColumn()

absl::Status yaze::editor::Tile16Editor::DrawTile16EditorWorkbenchColumn ( bool show_debug_info,
bool show_advanced_controls )
private

Definition at line 339 of file tile16_workbench.cc.

References AnalyzeTile8SourceData(), yaze::gui::BeginCanvas(), blockset_canvas_, blockset_selector_, yaze::editor::Tile16EditSession::BuildStampPreview(), yaze::gui::CanvasFrameOptions::canvas_size, yaze::gfx::Bitmap::Create(), yaze::gfx::Arena::CREATE, CreateRemappedPaletteForViewing(), yaze::editor::Tile16EditSession::current_gfx_bmp(), yaze::editor::Tile16EditSession::current_palette(), yaze::editor::Tile16EditSession::current_tile16(), yaze::editor::Tile16EditSession::current_tile16_bmp(), yaze::editor::Tile16EditSession::current_tile8(), yaze::gui::CanvasFrameOptions::draw_context_menu, yaze::gui::CanvasFrameOptions::draw_grid, yaze::gui::CanvasFrameOptions::draw_overlay, yaze::gui::Canvas::DrawBitmap(), DrawBrushAndTilePaletteControls(), DrawManualTile8Inputs(), DrawPrimaryActionControls(), DrawScratchSpace(), DrawTile8UsageOverlay(), yaze::editor::Tile16EditSession::edit_mode(), yaze::gfx::SnesPalette::empty(), yaze::gui::EndCanvas(), yaze::gfx::Arena::Get(), GetActualPaletteSlot(), GetActualPaletteSlotForCurrentTile16(), yaze::gui::TileSelectorWidget::GetSelectedTileID(), GetSheetIndexForTile8(), yaze::gui::CanvasFrameOptions::grid_step, HandleTile16CanvasClick(), yaze::editor::Tile16EditSession::highlight_tile8_usage(), HOVER_HINT, yaze::gfx::Bitmap::is_active(), yaze::editor::kPaint, yaze::editor::kPick, yaze::editor::kTile8DisplayScale, yaze::editor::kTile8PixelCount, yaze::editor::kTile8Size, yaze::editor::kUsageProbe, yaze::util::logf(), yaze::editor::Tile16EditSession::mutable_current_gfx_individual(), yaze::gfx::Bitmap::mutable_data(), yaze::editor::Tile16EditSession::mutable_highlight_tile8_usage(), yaze::editor::Tile16EditSession::mutable_priority_tile(), yaze::editor::Tile16EditSession::mutable_show_palette_settings(), yaze::editor::Tile16EditSession::mutable_tile8_preview_bitmap(), yaze::editor::Tile16EditSession::mutable_x_flip(), yaze::editor::Tile16EditSession::mutable_y_flip(), yaze::editor::Tile16EditSession::overworld_palette(), yaze::editor::Tile16EditSession::palette(), yaze::gfx::Bitmap::palette(), yaze::gfx::Arena::QueueTextureCommand(), RefreshTile16Blockset(), yaze::gui::TileSelectorWidget::Render(), yaze::gui::CanvasFrameOptions::render_popups, RequestTileSwitch(), session_, yaze::editor::Tile16EditSession::set_edit_mode(), yaze::editor::Tile16EditSession::set_tile8_stamp_size(), yaze::gfx::Bitmap::SetPalette(), yaze::gui::TileSelectorWidget::SetSelectedTile(), yaze::editor::Tile16EditSession::show_palette_settings(), yaze::editor::Tile16EditSession::show_tile_grid(), yaze::gfx::SnesPalette::size(), stamp_preview_bitmap_, yaze::gfx::Bitmap::texture(), yaze::editor::Tile16EditSession::tile16_blockset_bmp(), tile16_edit_canvas_, Tile16PreviewDisplayPixelToTilePosition(), yaze::editor::Tile16EditSession::tile8_stamp_size(), yaze::gfx::Arena::UPDATE, yaze::gfx::Bitmap::UpdateSurfacePixels(), yaze::gui::CanvasFrameOptions::use_child_window, yaze::editor::Tile16EditSession::x_flip(), yaze::editor::Tile16EditSession::y_flip(), and yaze::gui::Canvas::zero_point().

Referenced by UpdateTile16Edit().

◆ DrawCompactActionStatusRow()

◆ DrawBrushAndTilePaletteControls()

◆ DrawTile8SourcePanel()

absl::Status yaze::editor::Tile16Editor::DrawTile8SourcePanel ( float preferred_height = 0.0f)
private

◆ HandleTile8SourceSelection()

◆ DrawPrimaryActionControls()

absl::Status yaze::editor::Tile16Editor::DrawPrimaryActionControls ( )
private

Member Data Documentation

◆ session_

Tile16EditSession yaze::editor::Tile16Editor::session_
private

Definition at line 259 of file tile16_editor.h.

Referenced by active_quadrant(), AnalyzeTile8SourceData(), ApplyPaletteToAll(), ApplyPaletteToQuadrant(), ClearScratchSpace(), ClearTile16(), CommitAllChanges(), CommitChangesToBlockset(), CommitChangesToOverworld(), CopyTile16ToClipboard(), CreateRemappedPaletteForViewing(), current_palette(), current_tile16(), current_tile8(), CyclePalette(), DiscardAllChanges(), DiscardChanges(), DiscardCurrentTileChanges(), DrawBrushAndTilePaletteControls(), DrawCompactActionStatusRow(), DrawContextMenu(), DrawManualTile8Inputs(), DrawPaletteSettings(), DrawPrimaryActionControls(), DrawScratchSpace(), DrawTile16EditorWorkbenchColumn(), DrawTile16NavigationHeader(), DrawTile8SourcePanel(), DrawTile8UsageOverlay(), DrawToCurrentTile16(), edit_mode(), EnableLivePreview(), FillTile16WithTile8(), FlipTile16Horizontal(), FlipTile16Vertical(), game_data(), GetActualPaletteSlot(), GetActualPaletteSlotForCurrentTile16(), GetCurrentTile16Data(), GetEncodedPaletteRow(), GetPendingTileBitmap(), GetSheetIndexForTile8(), HandleKeyboardShortcuts(), HandleTile16CanvasClick(), HandleTile8SourceSelection(), has_pending_changes(), Initialize(), is_tile_modified(), IsTile16Valid(), LoadLayoutFromScratch(), LoadTile16FromScratchSpace(), LoadTile8(), MarkCurrentTileModified(), OpenGraphicsForActiveQuadrant(), PasteTile16FromClipboard(), pending_changes_count(), PickTile8FromTile16(), PreviewPaletteChange(), Redo(), RefreshAllPalettes(), RefreshTile16Blockset(), RegenerateTile16BitmapFromROM(), ReplaceCurrentTile(), RequestTileSwitch(), rom(), RotateTile16(), SaveLayoutToScratch(), SaveTile16ToROM(), SaveTile16ToScratchSpace(), set_active_quadrant(), set_current_palette(), set_edit_mode(), set_on_changes_committed(), set_on_current_tile_changed(), set_on_document_changed(), set_palette(), SetCurrentTile(), SetGameData(), SetRom(), Tile8PreviewBitmapForTesting(), Undo(), UpdateAsPanel(), UpdateBlockset(), UpdateBlocksetBitmap(), UpdateLivePreview(), UpdateOverworldTilemap(), UpdateROMTile16Data(), UpdateTile16Edit(), UpdateTile8Palette(), and ValidateTile16Data().

◆ stamp_preview_bitmap_

gfx::Bitmap yaze::editor::Tile16Editor::stamp_preview_bitmap_
private

Definition at line 260 of file tile16_editor.h.

Referenced by DrawTile16EditorWorkbenchColumn().

◆ selected_tiles_

std::vector<int> yaze::editor::Tile16Editor::selected_tiles_
private

Definition at line 262 of file tile16_editor.h.

Referenced by LoadLayoutFromScratch().

◆ selection_start_tile_

int yaze::editor::Tile16Editor::selection_start_tile_ = -1
private

Definition at line 263 of file tile16_editor.h.

Referenced by LoadLayoutFromScratch().

◆ multi_select_mode_

bool yaze::editor::Tile16Editor::multi_select_mode_ = false
private

Definition at line 264 of file tile16_editor.h.

◆ notify_tile16

util::NotifyValue<uint32_t> yaze::editor::Tile16Editor::notify_tile16
private

Definition at line 266 of file tile16_editor.h.

◆ notify_palette

util::NotifyValue<uint8_t> yaze::editor::Tile16Editor::notify_palette
private

Definition at line 267 of file tile16_editor.h.

◆ blockset_canvas_

gui::Canvas yaze::editor::Tile16Editor::blockset_canvas_
private

◆ blockset_selector_

gui::TileSelectorWidget yaze::editor::Tile16Editor::blockset_selector_
private
Initial value:
{
"Tile16BlocksetSelector",
gui::TileSelectorWidget::Config{.show_hover_tooltip = true}}

Definition at line 272 of file tile16_editor.h.

Referenced by DrawTile16EditorWorkbenchColumn(), Initialize(), LoadLayoutFromScratch(), selected_tile16_for_testing(), and UpdateBlockset().

◆ tile16_edit_canvas_

gui::Canvas yaze::editor::Tile16Editor::tile16_edit_canvas_
private
Initial value:
{"Tile16EditCanvas", ImVec2(64, 64),

Definition at line 276 of file tile16_editor.h.

Referenced by DrawPaletteSettings(), DrawTile16EditorWorkbenchColumn(), Initialize(), and UpdateTile16Edit().

◆ tile8_source_canvas_

gui::Canvas yaze::editor::Tile16Editor::tile8_source_canvas_
private
Initial value:
{
"Tile8SourceCanvas",
constexpr int kTilesheetHeight
Definition snes_tile.h:17
constexpr int kTilesheetWidth
Definition snes_tile.h:16

Definition at line 278 of file tile16_editor.h.

Referenced by DrawContextMenu(), DrawPaletteSettings(), DrawTile8SourcePanel(), HandleTile8SourceSelection(), Initialize(), and UpdateTile16Edit().

◆ tile_edit_table_

gui::Table yaze::editor::Tile16Editor::tile_edit_table_
private
Initial value:
{"##TileEditTable", 3, ImGuiTableFlags_Borders,
ImVec2(0, 0)}

Definition at line 283 of file tile16_editor.h.

Referenced by Initialize().

◆ palette_editor_

PaletteEditor yaze::editor::Tile16Editor::palette_editor_
private

Definition at line 286 of file tile16_editor.h.

◆ status_

absl::Status yaze::editor::Tile16Editor::status_
private

◆ graphics_open_status_

absl::Status yaze::editor::Tile16Editor::graphics_open_status_
private

Definition at line 288 of file tile16_editor.h.

Referenced by UpdateAsPanel().

◆ open_graphics_for_quadrant_

std::function<absl::Status(int, int)> yaze::editor::Tile16Editor::open_graphics_for_quadrant_
private

Definition at line 289 of file tile16_editor.h.

Referenced by OpenGraphicsForActiveQuadrant(), and SetOpenGraphicsForQuadrant().


The documentation for this class was generated from the following files: