yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
sprite_editor.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SPRITE_EDITOR_H
2#define YAZE_APP_EDITOR_SPRITE_EDITOR_H
3
4#include "absl/status/status.h"
6#include "app/editor/editor.h"
7#include "app/gui/canvas.h"
8#include "app/rom.h"
9
10namespace yaze {
11namespace app {
12namespace editor {
13
14constexpr ImGuiTabItemFlags kSpriteTabFlags =
15 ImGuiTabItemFlags_Trailing | ImGuiTabItemFlags_NoTooltip;
16
17constexpr ImGuiTabBarFlags kSpriteTabBarFlags =
18 ImGuiTabBarFlags_AutoSelectNewTabs | ImGuiTabBarFlags_Reorderable |
19 ImGuiTabBarFlags_FittingPolicyResizeDown |
20 ImGuiTabBarFlags_TabListPopupButton;
21
22constexpr ImGuiTableFlags kSpriteTableFlags =
23 ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable |
24 ImGuiTableFlags_Hideable | ImGuiTableFlags_BordersOuter |
25 ImGuiTableFlags_BordersV;
26
34class SpriteEditor : public SharedRom, public Editor {
35 public:
37
43 absl::Status Update() override;
44
45 absl::Status Undo() override { return absl::UnimplementedError("Undo"); }
46 absl::Status Redo() override { return absl::UnimplementedError("Redo"); }
47 absl::Status Cut() override { return absl::UnimplementedError("Cut"); }
48 absl::Status Copy() override { return absl::UnimplementedError("Copy"); }
49 absl::Status Paste() override { return absl::UnimplementedError("Paste"); }
50 absl::Status Find() override { return absl::UnimplementedError("Find"); }
51
52 private:
54
58 void DrawSpritesList();
59
63 void DrawSpriteCanvas();
64
68 void DrawCurrentSheets();
69
70 void DrawCustomSprites();
71
73
78
79 ImVector<int> active_sprites_;
82 uint8_t current_sheets_[8] = {0x00, 0x0A, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00};
84 false;
86 // OAM Configuration
87 struct OAMConfig {
88 uint16_t x;
89 uint16_t y;
90 uint8_t tile;
91 uint8_t palette;
92 uint8_t priority;
93 bool flip_x;
94 bool flip_y;
95 };
96
101 "SpriteCanvas", ImVec2(0x200, 0x200),
105 "GraphicsSheetCanvas", ImVec2(0x80 * 2 + 2, 0x40 * 8 + 2),
108 std::vector<zsprite::ZSprite> custom_sprites_;
110 absl::Status status_;
111};
112
113} // namespace editor
114} // namespace app
115} // namespace yaze
116
117#endif // YAZE_APP_EDITOR_SPRITE_EDITOR_H
A class to hold a shared pointer to a Rom object.
Definition rom.h:576
Interface for editor classes.
Definition editor.h:54
Allows the user to edit sprites.
absl::Status Find() override
void DrawSpritesList()
Draws the sprites list.
void DrawAnimationFrames()
Draws the animation frames manager.
absl::Status Paste() override
absl::Status Undo() override
void DrawSpriteCanvas()
Draws the sprite canvas.
absl::Status Copy() override
std::vector< zsprite::ZSprite > custom_sprites_
void DrawCurrentSheets()
Draws the current sheets.
absl::Status Update() override
Updates the sprite editor.
absl::Status Redo() override
absl::Status Cut() override
Represents a bitmap image.
Definition bitmap.h:67
Represents a canvas for drawing and manipulating graphics.
Definition canvas.h:34
constexpr ImGuiTabBarFlags kSpriteTabBarFlags
constexpr ImGuiTabItemFlags kSpriteTabFlags
constexpr ImGuiTableFlags kSpriteTableFlags
Definition common.cc:22