yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
overworld_canvas_renderer.cc
Go to the documentation of this file.
1// Related header
3
4#ifndef IM_PI
5#define IM_PI 3.14159265358979323846f
6#endif
7
8// C++ standard library headers
9#include <memory>
10#include <string>
11
12// Third-party library headers
13#include "absl/status/status.h"
14#include "absl/strings/str_format.h"
15#include "imgui/imgui.h"
16
17// Project headers
28#include "app/gfx/core/bitmap.h"
33#include "app/gui/core/icons.h"
34#include "app/gui/core/style.h"
37#include "rom/rom.h"
38#include "util/log.h"
40
41namespace yaze::editor {
42
45
46// =============================================================================
47// Main Canvas Drawing
48// =============================================================================
49
51 // Simplified map settings - compact row with popup panels for detailed
52 // editing
55 const EditingMode old_mode = editor_->current_mode;
56 bool has_selection = editor_->ow_map_canvas_.select_rect_active() &&
58
59 // Check if scratch space has data
60 bool scratch_has_data = editor_->scratch_space_.in_use;
61
62 // Pass WorkspaceWindowManager to toolbar for panel visibility management
63 editor_->toolbar_->Draw(
67 has_selection, scratch_has_data, editor_->rom_, &editor_->overworld_);
68
69 // Toolbar toggles don't currently update canvas usage mode.
70 if (old_mode != editor_->current_mode) {
74 } else {
76 }
77 }
78 }
79
80 // ==========================================================================
81 // PHASE 3: Modern BeginCanvas/EndCanvas Pattern
82 // ==========================================================================
83 // Context menu setup MUST happen BEFORE BeginCanvas (lesson from dungeon)
84 bool show_context_menu =
87 editor_->entity_renderer_->hovered_entity() == nullptr);
88
92 editor_->map_properties_system_->SetupCanvasContextMenu(
96 static_cast<int>(editor_->current_mode));
97 }
98
99 // Configure canvas frame options
100 gui::CanvasFrameOptions frame_opts;
102 frame_opts.draw_grid = true;
103 frame_opts.grid_step = 64.0f; // Map boundaries (512px / 8 maps)
104 frame_opts.draw_context_menu = show_context_menu;
105 frame_opts.draw_overlay = true;
106 frame_opts.render_popups = true;
107 frame_opts.use_child_window = false; // CRITICAL: Canvas has own pan logic
108
109 // Wrap in child window for scrollbars
112
113 // Keep canvas scroll at 0 - ImGui's child window handles all scrolling
114 // The scrollbars scroll the child window which moves the entire canvas
115 editor_->ow_map_canvas_.set_scrolling(ImVec2(0, 0));
116
117 // Begin canvas frame - this handles DrawBackground + DrawContextMenu
118 auto canvas_rt = gui::BeginCanvas(editor_->ow_map_canvas_, frame_opts);
120
121 // Handle pan via ImGui scrolling (instead of canvas internal scroll)
124
125 // Tile painting mode - handle tile edits and right-click tile picking
129 }
130
132 // Draw the 64 overworld map bitmaps
134
135 // Draw all entities using the new CanvasRuntime-based methods
137 editor_->entity_renderer_->DrawExits(canvas_rt, editor_->current_world_);
138 editor_->entity_renderer_->DrawEntrances(canvas_rt,
140 editor_->entity_renderer_->DrawItems(canvas_rt, editor_->current_world_);
141 editor_->entity_renderer_->DrawSprites(canvas_rt, editor_->current_world_,
143 }
144
145 // Draw overlay preview if enabled
147 editor_->map_properties_system_->DrawOverlayPreviewOnMap(
150 }
151
155 }
156
157 // Use canvas runtime hover state for map detection
158 if (canvas_rt.hovered) {
160 }
161
162 // --- BEGIN ENTITY DRAG/DROP LOGIC ---
165 auto hovered_entity = editor_->entity_renderer_->hovered_entity();
166
167 // 1. Initiate drag
168 if (!editor_->is_dragging_entity_ && hovered_entity &&
169 ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
170 editor_->dragged_entity_ = hovered_entity;
172 if (hovered_entity->entity_type_ ==
175 *static_cast<zelda3::OverworldItem*>(hovered_entity));
176 }
180 }
181 }
182
183 // 2. Update drag
185 ImGui::IsMouseDragging(ImGuiMouseButton_Left)) {
186 ImGui::SetMouseCursor(ImGuiMouseCursor_Hand);
187 ImVec2 mouse_delta = ImGui::GetIO().MouseDelta;
188 float scale = canvas_rt.scale;
189 if (scale > 0.0f) {
190 editor_->dragged_entity_->x_ += mouse_delta.x / scale;
191 editor_->dragged_entity_->y_ += mouse_delta.y / scale;
192 }
193 }
194
195 // 3. End drag
197 ImGui::IsMouseReleased(ImGuiMouseButton_Left)) {
199 float end_scale = canvas_rt.scale;
200 MoveEntityOnGrid(editor_->dragged_entity_, canvas_rt.canvas_p0,
201 canvas_rt.scrolling,
203 // Pass overworld context for proper area size detection
206 editor_->rom_->set_dirty(true);
207 }
209 editor_->dragged_entity_ = nullptr;
211 }
212 }
213 // --- END ENTITY DRAG/DROP LOGIC ---
214
215 // --- TILE DROP TARGET ---
216 // Accept tile drops from the blockset selector onto the map canvas.
217 gui::TileDragPayload tile_drop;
218 if (gui::AcceptTileDrop(&tile_drop)) {
223 }
224 }
225 }
226
227 // End canvas frame - draws grid/overlay based on frame_opts
228 gui::EndCanvas(editor_->ow_map_canvas_, canvas_rt, frame_opts);
229 ImGui::EndChild();
230}
231
232// =============================================================================
233// Internal Canvas Drawing Helpers
234// =============================================================================
235
237 // Get the current zoom scale for positioning and sizing
238 float scale = editor_->ow_map_canvas_.global_scale();
239 if (scale <= 0.0f)
240 scale = 1.0f;
241
242 int xx = 0;
243 int yy = 0;
244 for (int i = 0; i < 0x40; i++) {
245 int world_index = i + (editor_->current_world_ * 0x40);
246
247 // Bounds checking to prevent crashes
248 if (world_index < 0 ||
249 world_index >= static_cast<int>(editor_->maps_bmp_.size())) {
250 continue; // Skip invalid map index
251 }
252
253 // Apply scale to positions for proper zoom support
254 int map_x = static_cast<int>(xx * kOverworldMapSize * scale);
255 int map_y = static_cast<int>(yy * kOverworldMapSize * scale);
256
257 // Ensure visible maps are materialized on demand before drawing.
258 if (!editor_->maps_bmp_[world_index].is_active() ||
259 !editor_->maps_bmp_[world_index].texture()) {
260 editor_->EnsureMapTexture(world_index);
261 }
262
263 // Only draw if the map has a valid texture AND is active (has bitmap data)
264 // The current_map_ check was causing crashes when hovering over unbuilt maps
265 // because the bitmap would be drawn before EnsureMapBuilt() was called
266 bool can_draw = editor_->maps_bmp_[world_index].texture() &&
267 editor_->maps_bmp_[world_index].is_active();
268
269 if (can_draw) {
270 // Draw bitmap at scaled position with scale applied to size
271 editor_->ow_map_canvas_.DrawBitmap(editor_->maps_bmp_[world_index], map_x,
272 map_y, scale);
273 } else {
274 // Draw a placeholder for maps that haven't loaded yet
275 ImDrawList* draw_list = ImGui::GetWindowDrawList();
276 ImVec2 canvas_pos = editor_->ow_map_canvas_.zero_point();
277 ImVec2 scrolling = editor_->ow_map_canvas_.scrolling();
278 // Apply scrolling offset and use already-scaled map_x/map_y
279 ImVec2 placeholder_pos = ImVec2(canvas_pos.x + scrolling.x + map_x,
280 canvas_pos.y + scrolling.y + map_y);
281 // Scale the placeholder size to match zoomed maps
282 float scaled_size = kOverworldMapSize * scale;
283 ImVec2 placeholder_size = ImVec2(scaled_size, scaled_size);
284
285 // Modern loading indicator with theme colors
286 const auto& theme = AgentUI::GetTheme();
287 draw_list->AddRectFilled(
288 placeholder_pos,
289 ImVec2(placeholder_pos.x + placeholder_size.x,
290 placeholder_pos.y + placeholder_size.y),
291 ImGui::GetColorU32(
292 theme.editor_background)); // Theme-aware background
293
294 // Animated loading spinner - scale spinner radius with zoom
295 ImVec2 spinner_pos = ImVec2(placeholder_pos.x + placeholder_size.x / 2,
296 placeholder_pos.y + placeholder_size.y / 2);
297
298 const float spinner_radius = 8.0f * scale;
299 const float rotation = static_cast<float>(ImGui::GetTime()) * 3.0f;
300 const float start_angle = rotation;
301 const float end_angle = rotation + IM_PI * 1.5f;
302
303 draw_list->PathArcTo(spinner_pos, spinner_radius, start_angle, end_angle,
304 12);
305 draw_list->PathStroke(ImGui::GetColorU32(theme.status_active), 0,
306 2.5f * scale);
307 }
308
309 xx++;
310 if (xx >= 8) {
311 yy++;
312 xx = 0;
313 }
314 }
315}
316
317// =============================================================================
318// Panel Drawing Methods
319// =============================================================================
320
323 gui::TileSelectorWidget::Config selector_config;
324 const auto& theme = AgentUI::GetTheme();
325 selector_config.tile_size = 16;
326 selector_config.display_scale = 2.0f;
327 selector_config.tiles_per_row = 8;
329 selector_config.draw_offset = ImVec2(2.0f, 0.0f);
330 selector_config.highlight_color = theme.selection_primary;
331
332 selector_config.enable_drag = true;
333 selector_config.show_hover_tooltip = true;
334
335 editor_->blockset_selector_ = std::make_unique<gui::TileSelectorWidget>(
336 "OwBlocksetSelector", selector_config);
338 }
339
341
343 ImGui::BeginGroup();
345 "##Tile16SelectorScrollRegion",
346 ImVec2(editor_->blockset_selector_->GetPreferredViewportWidth(), 0.0f),
347 true);
349
350 // Tile ID search/jump bar
351 if (editor_->blockset_selector_->DrawFilterBar()) {
353 editor_->blockset_selector_->GetSelectedTileID());
354 }
355
357 bool atlas_ready = editor_->map_blockset_loaded_ && atlas.is_active();
358 auto result = editor_->blockset_selector_->Render(atlas, atlas_ready);
359
360 if (result.selection_changed) {
361 editor_->RequestTile16Selection(result.selected_tile);
362 // Note: We do NOT auto-scroll here because it breaks user interaction.
363 // The canvas should only scroll when explicitly requested (e.g., when
364 // selecting a tile from the overworld canvas via
365 // ScrollBlocksetCanvasToCurrentTile).
366 }
367
368 if (result.tile_double_clicked) {
372 }
373 }
374
375 ImGui::EndChild();
376 ImGui::EndGroup();
377 return absl::OkStatus();
378}
379
381 // Configure canvas frame options for graphics bin
382 gui::CanvasFrameOptions frame_opts;
384 frame_opts.draw_grid = true;
385 frame_opts.grid_step = 16.0f; // Tile8 grid
386 frame_opts.draw_context_menu = true;
387 frame_opts.draw_overlay = true;
388 frame_opts.render_popups = true;
389 frame_opts.use_child_window = false;
390
391 auto canvas_rt = gui::BeginCanvas(editor_->graphics_bin_canvas_, frame_opts);
392
394 int key = 0;
395 for (auto& value : gfx::Arena::Get().gfx_sheets()) {
396 int offset = 0x40 * (key + 1);
397 int top_left_y = canvas_rt.canvas_p0.y + 2;
398 if (key >= 1) {
399 top_left_y = canvas_rt.canvas_p0.y + 0x40 * key;
400 }
401 auto texture = value.texture();
402 canvas_rt.draw_list->AddImage(
403 (ImTextureID)(intptr_t)texture,
404 ImVec2(canvas_rt.canvas_p0.x + 2, top_left_y),
405 ImVec2(canvas_rt.canvas_p0.x + 0x100,
406 canvas_rt.canvas_p0.y + offset));
407 key++;
408 }
409 }
410
411 gui::EndCanvas(editor_->graphics_bin_canvas_, canvas_rt, frame_opts);
412}
413
416 // Always ensure current map graphics are loaded
420 auto bmp = std::make_unique<gfx::Bitmap>();
421 bmp->Create(0x80, kOverworldMapSize, 0x08,
423 bmp->SetPalette(editor_->palette_);
428 }
429 }
430
431 // Configure canvas frame options for area graphics
432 gui::CanvasFrameOptions frame_opts;
434 frame_opts.draw_grid = true;
435 frame_opts.grid_step = 32.0f; // Tile selector grid
436 frame_opts.draw_context_menu = true;
437 frame_opts.draw_overlay = true;
438 frame_opts.render_popups = true;
439 frame_opts.use_child_window = false;
440
442 ImGui::BeginGroup();
443 gui::BeginChildWithScrollbar("##AreaGraphicsScrollRegion");
444
445 auto canvas_rt = gui::BeginCanvas(editor_->current_gfx_canvas_, frame_opts);
447
452 }
454
455 gui::EndCanvas(editor_->current_gfx_canvas_, canvas_rt, frame_opts);
456 ImGui::EndChild();
457 ImGui::EndGroup();
458 return absl::OkStatus();
459}
460
462 // Lightweight v3 controls for map size and feature visibility.
463 ImGui::TextWrapped("ZSCustomOverworld v3 settings");
464 ImGui::Separator();
465
466 if (!editor_->rom_ || !editor_->rom_->is_loaded()) {
467 gui::CenterText("No ROM loaded");
468 return;
469 }
470
471 const uint8_t asm_version =
473 ImGui::Text("ASM Version: 0x%02X", asm_version);
474
475 if (asm_version == 0x00 || asm_version == 0xFF || asm_version < 0x03) {
476 ImGui::Spacing();
477 ImGui::TextColored(ImVec4(1.0f, 0.75f, 0.25f, 1.0f),
478 "v3 controls require ZSCustomOverworld v3+");
479 ImGui::TextDisabled("Apply the v3 patch to enable map-size editing.");
480 return;
481 }
482
484 if (!map) {
485 ImGui::TextDisabled("Current map is unavailable.");
486 return;
487 }
488
489 ImGui::Spacing();
490 ImGui::Text("Current map: 0x%02X", editor_->current_map_);
491 ImGui::Text("Parent map: 0x%02X", map->parent());
492
493 static int selected_area_size = 0;
494 selected_area_size = static_cast<int>(map->area_size());
495 const char* area_size_labels[] = {"Small", "Wide", "Tall", "Large"};
496 ImGui::SetNextItemWidth(220.0f);
497 ImGui::Combo("Area Size", &selected_area_size, area_size_labels,
498 IM_ARRAYSIZE(area_size_labels));
499
500 if (ImGui::Button(ICON_MD_SAVE " Apply Area Size")) {
502 map->parent(), static_cast<zelda3::AreaSizeEnum>(selected_area_size));
503 if (status.ok()) {
506 }
507 }
508
509 ImGui::Spacing();
510 ImGui::TextDisabled(
511 "Area-size changes update sibling map relationships for this parent "
512 "map.");
513}
514
516 // Area Configuration panel
517 static bool show_custom_bg_color_editor = false;
518 static bool show_overlay_editor = false;
519 static int game_state = 0; // 0=Beginning, 1=Zelda Saved, 2=Master Sword
520
521 if (editor_->sidebar_) {
523 editor_->current_map_lock_, game_state,
524 show_custom_bg_color_editor, show_overlay_editor);
525 }
526
527 // Draw popups if triggered from sidebar
528 if (show_custom_bg_color_editor) {
529 ImGui::OpenPopup("CustomBGColorEditor");
530 show_custom_bg_color_editor = false; // Reset after opening
531 }
532 if (show_overlay_editor) {
533 ImGui::OpenPopup("OverlayEditor");
534 show_overlay_editor = false; // Reset after opening
535 }
536
537 if (ImGui::BeginPopup("CustomBGColorEditor")) {
539 editor_->map_properties_system_->DrawCustomBackgroundColorEditor(
540 editor_->current_map_, show_custom_bg_color_editor);
541 }
542 ImGui::EndPopup();
543 }
544
545 if (ImGui::BeginPopup("OverlayEditor")) {
548 show_overlay_editor);
549 }
550 ImGui::EndPopup();
551 }
552}
553
555 static bool init_properties = false;
556
557 if (!init_properties) {
558 for (int i = 0; i < 0x40; i++) {
559 std::string area_graphics_str = absl::StrFormat(
560 "%02hX", editor_->overworld_.overworld_map(i)->area_graphics());
563 ->push_back(area_graphics_str);
564
565 area_graphics_str = absl::StrFormat(
566 "%02hX",
567 editor_->overworld_.overworld_map(i + 0x40)->area_graphics());
570 ->push_back(area_graphics_str);
571
572 std::string area_palette_str = absl::StrFormat(
573 "%02hX", editor_->overworld_.overworld_map(i)->area_palette());
576 ->push_back(area_palette_str);
577
578 area_palette_str = absl::StrFormat(
579 "%02hX", editor_->overworld_.overworld_map(i + 0x40)->area_palette());
582 ->push_back(area_palette_str);
583
584 std::string sprite_gfx_str = absl::StrFormat(
585 "%02hX", editor_->overworld_.overworld_map(i)->sprite_graphics(1));
588 ->push_back(sprite_gfx_str);
589
590 sprite_gfx_str = absl::StrFormat(
591 "%02hX", editor_->overworld_.overworld_map(i)->sprite_graphics(2));
594 ->push_back(sprite_gfx_str);
595
596 sprite_gfx_str = absl::StrFormat(
597 "%02hX",
598 editor_->overworld_.overworld_map(i + 0x40)->sprite_graphics(1));
601 ->push_back(sprite_gfx_str);
602
603 sprite_gfx_str = absl::StrFormat(
604 "%02hX",
605 editor_->overworld_.overworld_map(i + 0x40)->sprite_graphics(2));
608 ->push_back(sprite_gfx_str);
609
610 std::string sprite_palette_str = absl::StrFormat(
611 "%02hX", editor_->overworld_.overworld_map(i)->sprite_palette(1));
614 ->push_back(sprite_palette_str);
615
616 sprite_palette_str = absl::StrFormat(
617 "%02hX", editor_->overworld_.overworld_map(i)->sprite_palette(2));
620 ->push_back(sprite_palette_str);
621
622 sprite_palette_str = absl::StrFormat(
623 "%02hX",
624 editor_->overworld_.overworld_map(i + 0x40)->sprite_palette(1));
627 ->push_back(sprite_palette_str);
628
629 sprite_palette_str = absl::StrFormat(
630 "%02hX",
631 editor_->overworld_.overworld_map(i + 0x40)->sprite_palette(2));
634 ->push_back(sprite_palette_str);
635 }
636 init_properties = true;
637 }
638
639 ImGui::Text("Area Gfx LW/DW");
642 ImGui::SameLine();
645 ImGui::Separator();
646
647 ImGui::Text("Sprite Gfx LW/DW");
649 ImVec2(256, 256), 32,
651 ImGui::SameLine();
653 ImVec2(256, 256), 32,
655 ImGui::SameLine();
657 ImVec2(256, 256), 32,
659 ImGui::SameLine();
661 ImVec2(256, 256), 32,
663 ImGui::Separator();
664
665 ImGui::Text("Area Pal LW/DW");
668 ImGui::SameLine();
671
672 static bool show_gfx_group = false;
673 ImGui::Checkbox("Show Gfx Group Editor", &show_gfx_group);
674 if (show_gfx_group) {
675 gui::BeginWindowWithDisplaySettings("Gfx Group Editor", &show_gfx_group);
678 }
679}
680
681} // namespace yaze::editor
void set_dirty(bool dirty)
Definition rom.h:134
bool is_loaded() const
Definition rom.h:132
EditorDependencies dependencies_
Definition editor.h:316
absl::Status DrawTile16Selector()
Draw the tile16 selector panel.
absl::Status DrawAreaGraphics()
Draw the area graphics panel.
void DrawMapProperties()
Draw the map properties panel (sidebar-based)
void DrawOverworldProperties()
Draw the overworld properties grid (debug/info view)
OverworldEditor * editor_
Non-owning pointer to the parent editor.
void DrawOverworldCanvas()
Draw the main overworld canvas with toolbar, maps, and entities. This is the primary entry point call...
void DrawV3Settings()
Draw the v3 settings panel.
void DrawTile8Selector()
Draw the tile8 selector panel (graphics bin)
void DrawOverworldMaps()
Render the 64 overworld map bitmaps to the canvas.
Main UI class for editing overworld maps in A Link to the Past.
std::unique_ptr< MapPropertiesSystem > map_properties_system_
absl::Status CheckForCurrentMap()
Check for map changes and refresh if needed.
zelda3::GameEntity * dragged_entity_
std::array< gfx::Bitmap, zelda3::kNumOverworldMaps > maps_bmp_
void CheckForOverworldEdits()
Check for tile edits - delegates to TilePaintingManager.
void RefreshSiblingMapGraphics(int map_index, bool include_self=false)
std::unique_ptr< OverworldSidebar > sidebar_
std::unique_ptr< OverworldEntityRenderer > entity_renderer_
void EnsureMapTexture(int map_index)
Ensure a specific map has its texture created.
std::unique_ptr< OverworldToolbar > toolbar_
std::unique_ptr< gui::TileSelectorWidget > blockset_selector_
bool SelectItemByIdentity(const zelda3::OverworldItem &item_identity)
Select an overworld item using value identity matching.
bool OpenWindow(size_t session_id, const std::string &base_window_id)
void QueueTextureCommand(TextureCommandType type, Bitmap *bitmap)
Definition arena.cc:36
std::array< gfx::Bitmap, 223 > & gfx_sheets()
Get reference to all graphics sheets.
Definition arena.h:152
static Arena & Get()
Definition arena.cc:21
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:67
bool is_active() const
Definition bitmap.h:384
void set_scrolling(ImVec2 scroll)
Definition canvas.h:446
void DrawBitmap(Bitmap &bitmap, int border_offset, float scale)
Definition canvas.cc:1157
auto global_scale() const
Definition canvas.h:491
auto select_rect_active() const
Definition canvas.h:487
void SetUsageMode(CanvasUsage usage)
Definition canvas.cc:280
auto selected_tiles() const
Definition canvas.h:488
void UpdateInfoGrid(ImVec2 bg_size, float grid_size=64.0f, int label_id=0)
Definition canvas.cc:582
bool DrawTileSelector(int size, int size_y=0)
Definition canvas.cc:1093
void ClearContextMenuItems()
Definition canvas.cc:858
auto mutable_labels(int i)
Definition canvas.h:536
auto zero_point() const
Definition canvas.h:443
auto scrolling() const
Definition canvas.h:445
virtual void UpdateMapProperties(uint16_t map_id, const void *context=nullptr)=0
Update entity properties based on map position.
enum yaze::zelda3::GameEntity::EntityType entity_type_
const std::vector< uint8_t > & current_graphics() const
Definition overworld.h:558
const gfx::SnesPalette & current_area_palette() const
Definition overworld.h:574
auto is_loaded() const
Definition overworld.h:597
auto overworld_map(int i) const
Definition overworld.h:531
void set_current_map(int i)
Definition overworld.h:603
absl::Status ConfigureMultiAreaMap(int parent_index, AreaSizeEnum size)
Configure a multi-area map structure (Large/Wide/Tall)
Definition overworld.cc:309
#define ICON_MD_SAVE
Definition icons.h:1644
const AgentUITheme & GetTheme()
Editors are the view controllers for the application.
constexpr ImVec2 kOverworldCanvasSize(kOverworldMapSize *8, kOverworldMapSize *8)
constexpr unsigned int kOverworldMapSize
constexpr ImVec2 kCurrentGfxCanvasSize(0x100+1, 0x10 *0x40+1)
void MoveEntityOnGrid(zelda3::GameEntity *entity, ImVec2 canvas_p0, ImVec2 scrolling, bool free_movement, float scale)
Move entity to grid-aligned position based on mouse.
Definition entity.cc:65
constexpr ImVec2 kGraphicsBinCanvasSize(0x100+1, kNumSheetsToLoad *0x40+1)
void EndCanvas(Canvas &canvas)
Definition canvas.cc:1591
void BeginPadding(int i)
Definition style.cc:274
void BeginChildBothScrollbars(int id)
Definition style.cc:324
void BeginCanvas(Canvas &canvas, ImVec2 child_size)
Definition canvas.cc:1568
bool AcceptTileDrop(TileDragPayload *out)
Accept a tile16 drop. Returns true if a payload was accepted.
Definition drag_drop.h:106
void EndNoPadding()
Definition style.cc:286
void CenterText(const char *text)
void EndPadding()
Definition style.cc:278
void BeginNoPadding()
Definition style.cc:282
void EndWindowWithDisplaySettings()
Definition style.cc:269
void BeginWindowWithDisplaySettings(const char *id, bool *active, const ImVec2 &size, ImGuiWindowFlags flags)
Definition style.cc:249
void BeginChildWithScrollbar(const char *str_id)
Definition style.cc:290
constexpr int kNumTile16Individual
Definition overworld.h:239
AreaSizeEnum
Area size enumeration for v3+ ROMs.
constexpr int OverworldCustomASMHasBeenApplied
Definition common.h:89
#define IM_PI
WorkspaceWindowManager * window_manager
Definition editor.h:176
static constexpr const char * kTile16Editor
Bitmap atlas
Master bitmap containing all tiles.
Definition tilemap.h:119
std::optional< float > grid_step
Definition canvas.h:70