1#ifndef YAZE_APP_EDITOR_OVERWORLD_PAINTING_TILE_PAINTING_MANAGER_H
2#define YAZE_APP_EDITOR_OVERWORLD_PAINTING_TILE_PAINTING_MANAGER_H
13#include "imgui/imgui.h"
28 std::array<gfx::Bitmap, zelda3::kExpandedMapCount>*
maps_bmp =
nullptr;
41 std::function<void(
int map_id,
int world,
int x,
int y,
int old_tile_id)>
78 const std::vector<uint8_t>& tile_data);
104 std::vector<std::vector<uint16_t>>&
WorldTiles()
const;
109 bool mark_selection,
int alpha);
114 int height,
bool finalize =
true);
117 const std::vector<uint8_t>& tile_data);
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
ImGui façade for Tile16 editing; domain state lives in Tile16EditSession.
Manages tile painting, fill, selection, and eyedropper operations.
std::vector< uint8_t > Tile16PixelsForMap(int map_id, int tile_id) const
bool PaintTile(TilePosition position, int tile_id, ChangedMaps &changed_maps)
void CheckForSelectRectangle()
Draw and create the tile16 IDs that are currently selected.
TilePaintingCallbacks callbacks_
bool IsValidTile(TilePosition position) const
bool paint_gesture_owned_
std::array< gfx::Bitmap, zelda3::kNumOverworldMaps > map_brush_previews_
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.
const gfx::Bitmap & map_brush_preview(int map_id) const
bool selection_gesture_owned_
bool PickTile16FromHoveredCanvas()
Eyedropper: pick the tile16 under the hovered canvas position.
void RenderMapTile(int map_id, TilePosition position, const std::vector< uint8_t > &tile_data)
void ActivateFillTool()
Toggle FILL_TILE mode on/off.
absl::Status PasteBrush(const TileBrush &brush)
bool single_paint_pending_
const TileBrush * selection_brush() const
The captured selection, independent of its source or preview position.
void ToggleBrushTool()
Toggle between DRAW_TILE and MOUSE modes.
void DrawBrushPreview(const TileBrush &brush, TilePosition anchor, bool mark_selection, int alpha)
std::vector< std::vector< uint16_t > > & WorldTiles() const
std::array< bool, zelda3::kNumOverworldMaps > ChangedMaps
TilePaintingManager(const TilePaintingDependencies &deps, const TilePaintingCallbacks &callbacks)
TilePaintingDependencies deps_
TilePosition HoveredTile() const
void PaintPattern(const TileBrush &brush, TilePosition anchor, int width, int height, bool finalize=true)
Represents a bitmap image optimized for SNES ROM hacking.
Modern, robust canvas for drawing and manipulating graphics.
Callbacks for undo integration and map refresh.
std::function< void(int tile_id)> request_tile16_selection
When set, eyedropper routes here (guarded RequestTileSwitch path).
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)> select_map_for_editing
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.
Tile16Editor * tile16_editor
std::array< gfx::Bitmap, zelda3::kExpandedMapCount > * maps_bmp
gui::Canvas * ow_map_canvas
zelda3::Overworld * overworld
std::vector< int > * selected_tile16_ids
gfx::Tilemap * tile16_blockset
EditingMode * current_mode
Tilemap structure for SNES tile-based graphics management.