Allows the user to view and edit in game palettes. More...
#include <palette_editor.h>
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 | DrawQuickAccessTab () |
void | DrawCustomPalette () |
absl::Status | DrawPaletteGroup (int category, bool right_side=false) |
absl::Status | EditColorInPalette (gfx::SnesPalette &palette, int index) |
absl::Status | ResetColorToOriginal (gfx::SnesPalette &palette, int index, const gfx::SnesPalette &originalPalette) |
void | AddRecentlyUsedColor (const gfx::SnesColor &color) |
void | set_rom (Rom *rom) |
Rom * | rom () const |
![]() | |
Editor ()=default | |
virtual | ~Editor ()=default |
virtual absl::Status | Clear () |
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::SnesColor > | custom_palette_ |
std::vector< gfx::SnesColor > | recently_used_colors_ |
int | edit_palette_index_ = -1 |
ImVec4 | saved_palette_ [256] = {} |
palette_internal::PaletteEditorHistory | history_ |
Rom * | rom_ |
Additional Inherited Members | |
![]() | |
bool | active_ = false |
EditorType | type_ |
EditorContext * | context_ = nullptr |
Allows the user to view and edit in game palettes.
Definition at line 80 of file palette_editor.h.
|
inlineexplicit |
Definition at line 82 of file palette_editor.h.
References custom_palette_, yaze::editor::kPalette, rom(), rom_, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 171 of file palette_editor.cc.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 173 of file palette_editor.cc.
References yaze::ResourceLabelManager::CreateOrGetLabel(), yaze::gfx::kNumPalettes, yaze::Rom::resource_label(), and rom().
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 187 of file palette_editor.cc.
References DrawPaletteGroup(), DrawQuickAccessTab(), yaze::gfx::kNumPalettes, yaze::editor::kPaletteTableFlags, rom(), and status_.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 90 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 91 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 92 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 93 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 94 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 95 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 96 of file palette_editor.h.
void yaze::editor::PaletteEditor::DrawQuickAccessTab | ( | ) |
Definition at line 233 of file palette_editor.cc.
References yaze::gui::ConvertSnesColorToImVec4(), current_color_, DrawCustomPalette(), F32_TO_INT8_SAT, yaze::editor::kColorPopupFlags, recently_used_colors_, and yaze::gui::SnesColorEdit4().
Referenced by Update().
void yaze::editor::PaletteEditor::DrawCustomPalette | ( | ) |
Definition at line 284 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertSnesColorToImVec4(), current_color_, custom_palette_, edit_palette_index_, yaze::editor::kColorPopupFlags, and yaze::gui::SnesColorEdit4().
Referenced by DrawQuickAccessTab().
absl::Status yaze::editor::PaletteEditor::DrawPaletteGroup | ( | int | category, |
bool | right_side = false ) |
Definition at line 369 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertSnesColorToImVec4(), current_color_, HandleColorPopup(), yaze::gfx::PaletteGroup::mutable_palette(), yaze::Rom::mutable_palette_group(), yaze::Rom::resource_label(), RETURN_IF_ERROR, rom(), yaze::ResourceLabelManager::SelectableLabelWithNameEdit(), yaze::gfx::PaletteGroup::size(), and yaze::gfx::SnesPalette::size().
Referenced by Update().
absl::Status yaze::editor::PaletteEditor::EditColorInPalette | ( | gfx::SnesPalette & | palette, |
int | index ) |
Definition at line 495 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gui::ConvertImVec4ToSnesColor(), and yaze::gfx::SnesPalette::size().
absl::Status yaze::editor::PaletteEditor::ResetColorToOriginal | ( | gfx::SnesPalette & | palette, |
int | index, | ||
const gfx::SnesPalette & | originalPalette ) |
Definition at line 514 of file palette_editor.cc.
References yaze::gui::ConvertImVec4ToSnesColor(), and yaze::gfx::SnesPalette::size().
void yaze::editor::PaletteEditor::AddRecentlyUsedColor | ( | const gfx::SnesColor & | color | ) |
Definition at line 420 of file palette_editor.cc.
References recently_used_colors_.
Referenced by DrawCustomPalette(), DrawPaletteGroup(), EditColorInPalette(), and HandleColorPopup().
|
inline |
|
inline |
Definition at line 109 of file palette_editor.h.
References rom_.
Referenced by DrawPaletteGroup(), Load(), PaletteEditor(), set_rom(), and Update().
|
private |
Definition at line 440 of file palette_editor.cc.
References AddRecentlyUsedColor(), yaze::gfx::ConvertRgbToSnes(), custom_palette_, F32_TO_INT8_SAT, history_, yaze::editor::kColorPopupFlags, yaze::gui::SnesColorEdit4(), and yaze::gfx::ToFloatArray().
Referenced by DrawPaletteGroup().
|
private |
Definition at line 114 of file palette_editor.h.
Referenced by Update().
|
private |
Definition at line 115 of file palette_editor.h.
Referenced by DrawCustomPalette(), DrawPaletteGroup(), and DrawQuickAccessTab().
|
private |
Definition at line 117 of file palette_editor.h.
|
private |
Definition at line 119 of file palette_editor.h.
Referenced by DrawCustomPalette(), HandleColorPopup(), and PaletteEditor().
|
private |
Definition at line 120 of file palette_editor.h.
Referenced by AddRecentlyUsedColor(), and DrawQuickAccessTab().
|
private |
Definition at line 122 of file palette_editor.h.
Referenced by DrawCustomPalette().
|
private |
Definition at line 124 of file palette_editor.h.
|
private |
Definition at line 126 of file palette_editor.h.
Referenced by HandleColorPopup().
|
private |
Definition at line 128 of file palette_editor.h.
Referenced by PaletteEditor(), rom(), and set_rom().