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::app::SharedRom | |
SharedRom ()=default | |
virtual | ~SharedRom ()=default |
std::shared_ptr< Rom > | shared_rom () |
auto | rom () |
Public Member Functions inherited from yaze::app::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::app::SharedRom | |
static std::shared_ptr< Rom > | shared_rom_ = nullptr |
Protected Attributes inherited from yaze::app::editor::Editor | |
EditorType | type_ |
EditorContext | context_ |
Allows the user to view and edit in game palettes.
Definition at line 80 of file palette_editor.h.
|
inline |
Definition at line 82 of file palette_editor.h.
References custom_palette_, yaze::app::editor::kPalette, and yaze::app::editor::Editor::type_.
|
overridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 174 of file palette_editor.cc.
References CLEAR_AND_RETURN_STATUS, current_color_, DisplayCategoryTable(), DrawCustomPalette(), DrawModifiedColors(), yaze::app::editor::GfxGroupEditor::DrawPaletteViewer(), gfx_group_editor_, yaze::app::gfx::kNumPalettes, yaze::app::editor::kPaletteTableFlags, yaze::app::SharedRom::rom(), yaze::app::gui::SnesColorEdit4(), and status_.
Referenced by yaze::app::editor::EditorManager::DrawYazeMenuBar(), and yaze::app::editor::EditorManager::ManageActiveEditors().
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 89 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 90 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 91 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 92 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 93 of file palette_editor.h.
|
inlineoverridevirtual |
Implements yaze::app::editor::Editor.
Definition at line 94 of file palette_editor.h.
void yaze::app::editor::PaletteEditor::DisplayCategoryTable | ( | ) |
Definition at line 260 of file palette_editor.cc.
References yaze::app::gui::BeginChildWithScrollbar(), DrawPaletteGroup(), yaze::app::gfx::kAreaColors, yaze::app::gfx::kClothes, yaze::app::gfx::kCrystal, yaze::app::gfx::kDungeonMap, yaze::app::gfx::kDungeons, yaze::app::gfx::kGlobalSprites, yaze::app::gfx::kShield, yaze::app::gfx::kSpritesAux1, yaze::app::gfx::kSpritesAux2, yaze::app::gfx::kSpritesAux3, yaze::app::gfx::kSword, yaze::app::gfx::kTriforce, yaze::app::gfx::kWorldColors, yaze::app::gfx::kWorldMap, and status_.
Referenced by Update().
absl::Status yaze::app::editor::PaletteEditor::EditColorInPalette | ( | gfx::SnesPalette & | palette, |
int | index ) |
Definition at line 446 of file palette_editor.cc.
References ASSIGN_OR_RETURN, yaze::app::gfx::SnesPalette::GetColor(), and yaze::app::gfx::SnesPalette::size().
absl::Status yaze::app::editor::PaletteEditor::ResetColorToOriginal | ( | gfx::SnesPalette & | palette, |
int | index, | ||
const gfx::SnesPalette & | originalPalette ) |
Definition at line 462 of file palette_editor.cc.
References ASSIGN_OR_RETURN, yaze::app::gfx::SnesPalette::GetColor(), and yaze::app::gfx::SnesPalette::size().
absl::Status yaze::app::editor::PaletteEditor::DrawPaletteGroup | ( | int | category, |
bool | right_side = false ) |
Definition at line 344 of file palette_editor.cc.
References ASSIGN_OR_RETURN, current_color_, yaze::app::gfx::SnesPalette::GetColor(), HandleColorPopup(), yaze::app::editor::kPalNoAlpha, yaze::app::gfx::SnesPalette::mutable_color(), yaze::app::gfx::PaletteGroup::mutable_palette(), RETURN_IF_ERROR, yaze::app::SharedRom::rom(), yaze::app::gfx::PaletteGroup::size(), yaze::app::gfx::SnesPalette::size(), and yaze::app::gui::SnesColorButton().
Referenced by DisplayCategoryTable().
void yaze::app::editor::PaletteEditor::DrawCustomPalette | ( | ) |
Definition at line 223 of file palette_editor.cc.
References custom_palette_, and yaze::app::gui::SnesColorEdit4().
Referenced by Update().
void yaze::app::editor::PaletteEditor::DrawModifiedColors | ( | ) |
Definition at line 390 of file palette_editor.cc.
References yaze::app::editor::palette_internal::PaletteEditorHistory::GetModifiedColor(), yaze::app::editor::palette_internal::PaletteEditorHistory::GetOriginalColor(), history_, yaze::app::editor::palette_internal::PaletteEditorHistory::size(), and yaze::app::gui::SnesColorEdit4().
Referenced by Update().
|
private |
Definition at line 406 of file palette_editor.cc.
References yaze::app::gfx::ConvertRgbToSnes(), F32_TO_INT8_SAT, history_, yaze::app::editor::kColorPopupFlags, yaze::app::editor::palette_internal::PaletteEditorHistory::RecordChange(), yaze::app::gui::SnesColorEdit4(), and yaze::app::gfx::ToFloatArray().
Referenced by DrawPaletteGroup().
|
private |
Definition at line 110 of file palette_editor.h.
Referenced by DisplayCategoryTable(), and Update().
|
private |
Definition at line 111 of file palette_editor.h.
Referenced by DrawPaletteGroup(), and Update().
|
private |
Definition at line 113 of file palette_editor.h.
Referenced by Update().
|
private |
Definition at line 115 of file palette_editor.h.
Referenced by DrawCustomPalette(), and PaletteEditor().
|
private |
Definition at line 117 of file palette_editor.h.
|
private |
Definition at line 119 of file palette_editor.h.
Referenced by DrawModifiedColors(), and HandleColorPopup().