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

Allows the user to view and edit in game palettes. More...

#include <palette_editor.h>

Inheritance diagram for yaze::editor::PaletteEditor:

Public Member Functions

 PaletteEditor (Rom *rom=nullptr)
 
void Initialize () override
 
absl::Status Load () 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
 
absl::Status Save () override
 
void DisplayCategoryTable ()
 
absl::Status EditColorInPalette (gfx::SnesPalette &palette, int index)
 
absl::Status ResetColorToOriginal (gfx::SnesPalette &palette, int index, const gfx::SnesPalette &originalPalette)
 
absl::Status DrawPaletteGroup (int category, bool right_side=false)
 
void DrawCustomPalette ()
 
void DrawModifiedColors ()
 
void set_rom (Rom *rom)
 
Romrom () const
 
- Public Member Functions inherited from yaze::editor::Editor
 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 Member Functions

absl::Status HandleColorPopup (gfx::SnesPalette &palette, int i, int j, int n)
 

Private Attributes

absl::Status status_
 
gfx::SnesColor current_color_
 
GfxGroupEditor gfx_group_editor_
 
std::vector< gfx::SnesColorcustom_palette_
 
ImVec4 saved_palette_ [256] = {}
 
palette_internal::PaletteEditorHistory history_
 
Romrom_
 

Additional Inherited Members

- Protected Attributes inherited from yaze::editor::Editor
bool active_ = false
 
EditorType type_
 
EditorContextcontext_ = nullptr
 

Detailed Description

Allows the user to view and edit in game palettes.

Definition at line 80 of file palette_editor.h.

Constructor & Destructor Documentation

◆ PaletteEditor()

yaze::editor::PaletteEditor::PaletteEditor ( Rom * rom = nullptr)
inlineexplicit

Definition at line 82 of file palette_editor.h.

References custom_palette_, yaze::editor::kPalette, rom(), rom_, and yaze::editor::Editor::type_.

Here is the call graph for this function:

Member Function Documentation

◆ Initialize()

void yaze::editor::PaletteEditor::Initialize ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 173 of file palette_editor.cc.

◆ Load()

absl::Status yaze::editor::PaletteEditor::Load ( )
overridevirtual

Implements yaze::editor::Editor.

Definition at line 175 of file palette_editor.cc.

References yaze::ResourceLabelManager::CreateOrGetLabel(), yaze::gfx::kNumPalettes, yaze::Rom::resource_label(), and rom().

Here is the call graph for this function:

◆ Update()

absl::Status yaze::editor::PaletteEditor::Update ( )
overridevirtual

◆ Cut()

absl::Status yaze::editor::PaletteEditor::Cut ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 90 of file palette_editor.h.

◆ Copy()

absl::Status yaze::editor::PaletteEditor::Copy ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 91 of file palette_editor.h.

◆ Paste()

absl::Status yaze::editor::PaletteEditor::Paste ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 92 of file palette_editor.h.

◆ Undo()

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

Implements yaze::editor::Editor.

Definition at line 93 of file palette_editor.h.

◆ Redo()

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

Implements yaze::editor::Editor.

Definition at line 94 of file palette_editor.h.

◆ Find()

absl::Status yaze::editor::PaletteEditor::Find ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 95 of file palette_editor.h.

◆ Save()

absl::Status yaze::editor::PaletteEditor::Save ( )
inlineoverridevirtual

Implements yaze::editor::Editor.

Definition at line 96 of file palette_editor.h.

◆ DisplayCategoryTable()

void yaze::editor::PaletteEditor::DisplayCategoryTable ( )

Definition at line 264 of file palette_editor.cc.

References yaze::gui::BeginChildWithScrollbar(), DrawPaletteGroup(), and status_.

Referenced by Update().

Here is the call graph for this function:

◆ EditColorInPalette()

absl::Status yaze::editor::PaletteEditor::EditColorInPalette ( gfx::SnesPalette & palette,
int index )

Definition at line 450 of file palette_editor.cc.

References ASSIGN_OR_RETURN, and yaze::gfx::SnesPalette::size().

Here is the call graph for this function:

◆ ResetColorToOriginal()

absl::Status yaze::editor::PaletteEditor::ResetColorToOriginal ( gfx::SnesPalette & palette,
int index,
const gfx::SnesPalette & originalPalette )

Definition at line 466 of file palette_editor.cc.

References ASSIGN_OR_RETURN, and yaze::gfx::SnesPalette::size().

Here is the call graph for this function:

◆ DrawPaletteGroup()

◆ DrawCustomPalette()

void yaze::editor::PaletteEditor::DrawCustomPalette ( )

Definition at line 227 of file palette_editor.cc.

References custom_palette_, and yaze::gui::SnesColorEdit4().

Referenced by Update().

Here is the call graph for this function:

◆ DrawModifiedColors()

void yaze::editor::PaletteEditor::DrawModifiedColors ( )

Definition at line 394 of file palette_editor.cc.

References history_, and yaze::gui::SnesColorEdit4().

Referenced by Update().

Here is the call graph for this function:

◆ set_rom()

void yaze::editor::PaletteEditor::set_rom ( Rom * rom)
inline

Definition at line 110 of file palette_editor.h.

References rom(), and rom_.

Here is the call graph for this function:

◆ rom()

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

Definition at line 113 of file palette_editor.h.

References rom_.

Referenced by DrawPaletteGroup(), Load(), PaletteEditor(), and set_rom().

◆ HandleColorPopup()

absl::Status yaze::editor::PaletteEditor::HandleColorPopup ( gfx::SnesPalette & palette,
int i,
int j,
int n )
private

Definition at line 410 of file palette_editor.cc.

References yaze::gfx::ConvertRgbToSnes(), F32_TO_INT8_SAT, history_, yaze::editor::kColorPopupFlags, yaze::gui::SnesColorEdit4(), and yaze::gfx::ToFloatArray().

Referenced by DrawPaletteGroup().

Here is the call graph for this function:

Member Data Documentation

◆ status_

absl::Status yaze::editor::PaletteEditor::status_
private

Definition at line 118 of file palette_editor.h.

Referenced by DisplayCategoryTable(), and Update().

◆ current_color_

gfx::SnesColor yaze::editor::PaletteEditor::current_color_
private

Definition at line 119 of file palette_editor.h.

Referenced by DrawPaletteGroup(), and Update().

◆ gfx_group_editor_

GfxGroupEditor yaze::editor::PaletteEditor::gfx_group_editor_
private

Definition at line 121 of file palette_editor.h.

Referenced by Update().

◆ custom_palette_

std::vector<gfx::SnesColor> yaze::editor::PaletteEditor::custom_palette_
private

Definition at line 123 of file palette_editor.h.

Referenced by DrawCustomPalette(), and PaletteEditor().

◆ saved_palette_

ImVec4 yaze::editor::PaletteEditor::saved_palette_[256] = {}
private

Definition at line 125 of file palette_editor.h.

◆ history_

palette_internal::PaletteEditorHistory yaze::editor::PaletteEditor::history_
private

Definition at line 127 of file palette_editor.h.

Referenced by DrawModifiedColors(), and HandleColorPopup().

◆ rom_

Rom* yaze::editor::PaletteEditor::rom_
private

Definition at line 129 of file palette_editor.h.

Referenced by PaletteEditor(), rom(), and set_rom().


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