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

Undoable pixel edit on one graphics sheet. More...

#include <graphics_undo_actions.h>

Inheritance diagram for yaze::editor::GraphicsPixelEditAction:
Collaboration diagram for yaze::editor::GraphicsPixelEditAction:

Public Member Functions

 GraphicsPixelEditAction (GraphicsEditorState *state, SheetPixelDiff diff, std::string description)
 
absl::Status Undo () override
 
absl::Status Redo () override
 
std::string Description () const override
 Human-readable description (e.g., "Paint 12 tiles on map 5")
 
size_t MemoryUsage () const override
 Approximate memory footprint for budget enforcement.
 
bool CanMergeWith (const UndoAction &) const override
 
const SheetPixelDiff & diff () const
 
- Public Member Functions inherited from yaze::editor::UndoAction
virtual ~UndoAction ()=default
 
virtual void MergeWith (UndoAction &)
 

Private Attributes

GraphicsEditorState * state_
 
SheetPixelDiff diff_
 
std::string description_
 

Detailed Description

Undoable pixel edit on one graphics sheet.

Holds only the pixels the edit changed. Undo and Redo write them through the session's GraphicsSheetStore (graphics_sheet_sync.h), which refreshes the Arena copy and marks the sheet modified.

Definition at line 25 of file graphics_undo_actions.h.

Constructor & Destructor Documentation

◆ GraphicsPixelEditAction()

yaze::editor::GraphicsPixelEditAction::GraphicsPixelEditAction ( GraphicsEditorState * state,
SheetPixelDiff diff,
std::string description )
inline

Definition at line 27 of file graphics_undo_actions.h.

Member Function Documentation

◆ Undo()

absl::Status yaze::editor::GraphicsPixelEditAction::Undo ( )
inlineoverridevirtual

Implements yaze::editor::UndoAction.

Definition at line 33 of file graphics_undo_actions.h.

References yaze::editor::ApplySheetPixelDiff(), diff_, and state_.

Here is the call graph for this function:

◆ Redo()

absl::Status yaze::editor::GraphicsPixelEditAction::Redo ( )
inlineoverridevirtual

Implements yaze::editor::UndoAction.

Definition at line 36 of file graphics_undo_actions.h.

References yaze::editor::ApplySheetPixelDiff(), diff_, and state_.

Here is the call graph for this function:

◆ Description()

std::string yaze::editor::GraphicsPixelEditAction::Description ( ) const
inlineoverridevirtual

Human-readable description (e.g., "Paint 12 tiles on map 5")

Implements yaze::editor::UndoAction.

Definition at line 40 of file graphics_undo_actions.h.

References description_.

◆ MemoryUsage()

size_t yaze::editor::GraphicsPixelEditAction::MemoryUsage ( ) const
inlineoverridevirtual

Approximate memory footprint for budget enforcement.

Reimplemented from yaze::editor::UndoAction.

Definition at line 41 of file graphics_undo_actions.h.

References diff_, and yaze::editor::SheetPixelDiff::MemoryUsage().

Here is the call graph for this function:

◆ CanMergeWith()

bool yaze::editor::GraphicsPixelEditAction::CanMergeWith ( const UndoAction & ) const
inlineoverridevirtual

Whether this action can merge with the previous action on the stack. Called only when both actions have the same concrete type.

Reimplemented from yaze::editor::UndoAction.

Definition at line 43 of file graphics_undo_actions.h.

◆ diff()

const SheetPixelDiff & yaze::editor::GraphicsPixelEditAction::diff ( ) const
inline

Definition at line 48 of file graphics_undo_actions.h.

References diff_.

Member Data Documentation

◆ state_

GraphicsEditorState* yaze::editor::GraphicsPixelEditAction::state_
private

Definition at line 51 of file graphics_undo_actions.h.

Referenced by Redo(), and Undo().

◆ diff_

SheetPixelDiff yaze::editor::GraphicsPixelEditAction::diff_
private

Definition at line 52 of file graphics_undo_actions.h.

Referenced by diff(), MemoryUsage(), Redo(), and Undo().

◆ description_

std::string yaze::editor::GraphicsPixelEditAction::description_
private

Definition at line 53 of file graphics_undo_actions.h.

Referenced by Description().


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