yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
tile16_editor.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_TILE16EDITOR_H
2#define YAZE_APP_EDITOR_TILE16EDITOR_H
3
4#include "absl/status/status.h"
5#include "app/core/common.h"
7#include "app/gfx/bitmap.h"
9#include "app/gfx/snes_tile.h"
10#include "app/gui/canvas.h"
11#include "app/rom.h"
13#include "imgui/imgui.h"
14
15namespace yaze {
16namespace app {
17namespace editor {
18
22class Tile16Editor : public GfxContext, public SharedRom {
23 public:
24 absl::Status InitBlockset(const gfx::Bitmap& tile16_blockset_bmp,
25 const gfx::Bitmap& current_gfx_bmp,
26 const std::vector<gfx::Bitmap>& tile16_individual,
27 uint8_t all_tiles_types[0x200]);
28
29 absl::Status Update();
30 absl::Status DrawMenu();
31
32 void DrawTile16Editor();
33 absl::Status UpdateTile16Transfer();
34 absl::Status UpdateBlockset();
35
36 absl::Status DrawToCurrentTile16(ImVec2 pos);
37
38 absl::Status UpdateTile16Edit();
39
40 absl::Status DrawTileEditControls();
41
42 absl::Status UpdateTransferTileCanvas();
43
44 absl::Status LoadTile8();
45
46 absl::Status SetCurrentTile(int id);
47
48 private:
50 bool transfer_started_ = false;
52
55 uint8_t current_palette_ = 0;
56
59
60 // Various options for the Tile16 Editor
61 bool x_flip;
62 bool y_flip;
65
67
68 // Tile16 blockset for selecting the tile to edit
69 gui::Canvas blockset_canvas_{"blocksetCanvas", ImVec2(0x100, 0x4000),
72
73 // Canvas for editing the selected tile
74 gui::Canvas tile16_edit_canvas_{"Tile16EditCanvas", ImVec2(0x40, 0x40),
77
78 // Tile8 canvas to get the tile to drawing in the tile16_edit_canvas_
84
87
88 std::vector<gfx::Bitmap> tile16_individual_;
89 std::vector<gfx::Bitmap> current_gfx_individual_;
90
92
95
96 absl::Status status_;
97
99 absl::Status transfer_status_;
100};
101
102} // namespace editor
103} // namespace app
104} // namespace yaze
105#endif // YAZE_APP_EDITOR_TILE16EDITOR_H
Shared graphical context across editors.
The Rom class is used to load, save, and modify Rom data.
Definition rom.h:136
A class to hold a shared pointer to a Rom object.
Definition rom.h:576
A class to manage a value that can be modified and notify when it changes.
Definition common.h:163
Allows the user to view and edit in game palettes.
Popup window to edit Tile16 data.
core::NotifyValue< uint8_t > notify_palette
std::vector< gfx::Bitmap > current_gfx_individual_
absl::Status DrawToCurrentTile16(ImVec2 pos)
absl::Status SetCurrentTile(int id)
absl::Status InitBlockset(const gfx::Bitmap &tile16_blockset_bmp, const gfx::Bitmap &current_gfx_bmp, const std::vector< gfx::Bitmap > &tile16_individual, uint8_t all_tiles_types[0x200])
std::vector< gfx::Bitmap > tile16_individual_
zelda3::overworld::Overworld transfer_overworld_
core::NotifyValue< uint32_t > notify_tile16
Represents a bitmap image.
Definition bitmap.h:67
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
Represents a canvas for drawing and manipulating graphics.
Definition canvas.h:34
Represents the full Overworld data, light and dark world.
Definition overworld.h:461
constexpr int kTilesheetWidth
Definition snes_tile.h:16
constexpr int kTilesheetHeight
Definition snes_tile.h:17
Definition common.cc:22