Allows the user to view and edit in game palettes. More...
#include <palette_editor.h>
Public Member Functions | |
PaletteEditor () | |
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 |
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 () |
Public Member Functions inherited from yaze::SharedRom | |
SharedRom ()=default | |
virtual | ~SharedRom ()=default |
std::shared_ptr< Rom > | shared_rom () |
auto | rom () |
Public Member Functions inherited from yaze::editor::Editor | |
Editor ()=default | |
virtual | ~Editor ()=default |
EditorType | type () const |
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_ |
ImVec4 | saved_palette_ [256] = {} |
palette_internal::PaletteEditorHistory | history_ |
Additional Inherited Members | |
Static Public Attributes inherited from yaze::SharedRom | |
static std::shared_ptr< Rom > | shared_rom_ = nullptr |
Protected Attributes inherited from yaze::editor::Editor | |
EditorType | type_ |
EditorContext | context_ |
Allows the user to view and edit in game palettes.
Definition at line 79 of file palette_editor.h.
|
inline |
Definition at line 81 of file palette_editor.h.
References custom_palette_, yaze::editor::kPalette, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 173 of file palette_editor.cc.
References CLEAR_AND_RETURN_STATUS, current_color_, DisplayCategoryTable(), DrawCustomPalette(), DrawModifiedColors(), gfx_group_editor_, yaze::gfx::kNumPalettes, yaze::editor::kPaletteTableFlags, yaze::SharedRom::rom(), yaze::gui::SnesColorEdit4(), and status_.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 88 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 89 of file palette_editor.h.
|
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.
void yaze::editor::PaletteEditor::DisplayCategoryTable | ( | ) |
Definition at line 259 of file palette_editor.cc.
References yaze::gui::BeginChildWithScrollbar(), DrawPaletteGroup(), and status_.
Referenced by Update().
absl::Status yaze::editor::PaletteEditor::EditColorInPalette | ( | gfx::SnesPalette & | palette, |
int | index ) |
Definition at line 445 of file palette_editor.cc.
References ASSIGN_OR_RETURN, yaze::gfx::SnesPalette::GetColor(), and yaze::gfx::SnesPalette::size().
absl::Status yaze::editor::PaletteEditor::ResetColorToOriginal | ( | gfx::SnesPalette & | palette, |
int | index, | ||
const gfx::SnesPalette & | originalPalette ) |
Definition at line 461 of file palette_editor.cc.
References ASSIGN_OR_RETURN, yaze::gfx::SnesPalette::GetColor(), and yaze::gfx::SnesPalette::size().
absl::Status yaze::editor::PaletteEditor::DrawPaletteGroup | ( | int | category, |
bool | right_side = false ) |
Definition at line 343 of file palette_editor.cc.
References ASSIGN_OR_RETURN, current_color_, yaze::gfx::SnesPalette::GetColor(), HandleColorPopup(), yaze::editor::kPalNoAlpha, yaze::gfx::SnesPalette::mutable_color(), yaze::gfx::PaletteGroup::mutable_palette(), RETURN_IF_ERROR, yaze::SharedRom::rom(), yaze::gfx::PaletteGroup::size(), yaze::gfx::SnesPalette::size(), and yaze::gui::SnesColorButton().
Referenced by DisplayCategoryTable().
void yaze::editor::PaletteEditor::DrawCustomPalette | ( | ) |
Definition at line 222 of file palette_editor.cc.
References custom_palette_, and yaze::gui::SnesColorEdit4().
Referenced by Update().
void yaze::editor::PaletteEditor::DrawModifiedColors | ( | ) |
Definition at line 389 of file palette_editor.cc.
References history_, and yaze::gui::SnesColorEdit4().
Referenced by Update().
|
private |
Definition at line 405 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().
|
private |
Definition at line 109 of file palette_editor.h.
Referenced by DisplayCategoryTable(), and Update().
|
private |
Definition at line 110 of file palette_editor.h.
Referenced by DrawPaletteGroup(), and Update().
|
private |
Definition at line 112 of file palette_editor.h.
Referenced by Update().
|
private |
Definition at line 114 of file palette_editor.h.
Referenced by DrawCustomPalette(), and PaletteEditor().
|
private |
Definition at line 116 of file palette_editor.h.
|
private |
Definition at line 118 of file palette_editor.h.
Referenced by DrawModifiedColors(), and HandleColorPopup().