yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
tile_painting_manager.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_OVERWORLD_TILE_PAINTING_MANAGER_H
2#define YAZE_APP_EDITOR_OVERWORLD_TILE_PAINTING_MANAGER_H
3
4#include <array>
5#include <functional>
6#include <vector>
7
12#include "imgui/imgui.h"
13#include "rom/rom.h"
15
16namespace yaze {
17namespace editor {
18
19class Tile16Editor;
20
27 std::array<gfx::Bitmap, zelda3::kNumOverworldMaps>* maps_bmp = nullptr;
29 int* current_tile16 = nullptr;
30 std::vector<int>* selected_tile16_ids = nullptr;
31 int* current_map = nullptr;
32 int* current_world = nullptr;
33 int* current_parent = nullptr;
35 int* game_state = nullptr;
36 Rom* rom = nullptr;
38};
39
42 std::function<void(int map_id, int world, int x, int y, int old_tile_id)>
44 std::function<void()> finalize_paint_operation;
45 std::function<void()> refresh_overworld_map;
46 std::function<void(int map_index)> refresh_overworld_map_on_demand;
47 std::function<void()> scroll_blockset_to_current_tile;
48};
49
56 public:
58 const TilePaintingCallbacks& callbacks);
59
62
65
67 void RenderUpdatedMapBitmap(const ImVec2& click_position,
68 const std::vector<uint8_t>& tile_data);
69
72
74 void ToggleBrushTool();
75
77 void ActivateFillTool();
78
79 private:
82 void DrawOverworldEdits();
83
86};
87
88} // namespace editor
89} // namespace yaze
90
91#endif // YAZE_APP_EDITOR_OVERWORLD_TILE_PAINTING_MANAGER_H
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
Popup window to edit Tile16 data.
Manages tile painting, fill, selection, and eyedropper operations.
void CheckForSelectRectangle()
Draw and create the tile16 IDs that are currently selected.
void DrawOverworldEdits()
Handle the actual drawing of a single tile (called by CheckForOverworldEdits when DrawTilemapPainter ...
void CheckForOverworldEdits()
Main entry point: check for tile edits (paint, fill, stamp).
void RenderUpdatedMapBitmap(const ImVec2 &click_position, const std::vector< uint8_t > &tile_data)
Update bitmap pixels after a single tile paint.
bool PickTile16FromHoveredCanvas()
Eyedropper: pick the tile16 under the hovered canvas position.
void ActivateFillTool()
Toggle FILL_TILE mode on/off.
void ToggleBrushTool()
Toggle between DRAW_TILE and MOUSE modes.
TilePaintingManager(const TilePaintingDependencies &deps, const TilePaintingCallbacks &callbacks)
Modern, robust canvas for drawing and manipulating graphics.
Definition canvas.h:150
Represents the full Overworld data, light and dark world.
Definition overworld.h:261
Callbacks for undo integration and map refresh.
std::function< void(int map_index)> refresh_overworld_map_on_demand
std::function< void()> scroll_blockset_to_current_tile
std::function< void()> finalize_paint_operation
std::function< void(int map_id, int world, int x, int y, int old_tile_id)> create_undo_point
Shared state for the tile painting system.
std::array< gfx::Bitmap, zelda3::kNumOverworldMaps > * maps_bmp
Tilemap structure for SNES tile-based graphics management.
Definition tilemap.h:118