yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
overworld_editor.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_OVERWORLDEDITOR_H
2#define YAZE_APP_EDITOR_OVERWORLDEDITOR_H
3
4#include <chrono>
5#include <memory>
6#include <optional>
7
8#include "absl/status/status.h"
9#include "app/editor/editor.h"
28#include "app/gfx/core/bitmap.h"
32#include "app/gui/core/input.h"
34#include "imgui/imgui.h"
35#include "rom/rom.h"
38
39// =============================================================================
40// Overworld Editor - UI Layer
41// =============================================================================
42//
43// ARCHITECTURE OVERVIEW:
44// ----------------------
45// The OverworldEditor is the main UI class for editing overworld maps.
46// It orchestrates several subsystems:
47//
48// 1. TILE EDITING SYSTEM
49// - Tile16Editor: Popup for editing individual 16x16 tiles
50// - Tile selection and painting on the main canvas
51// - Undo/Redo stack for paint operations
52//
53// 2. ENTITY SYSTEM
54// - OverworldEntityRenderer: Draws entities on the canvas
55// - entity_operations.cc: Insertion/deletion logic
56// - overworld_entity_interaction.cc: Drag/drop and click handling
57//
58// 3. MAP PROPERTIES SYSTEM
59// - MapPropertiesSystem: Toolbar and context menus
60// - OverworldSidebar: Property editing tabs
61// - Graphics, palettes, music per area
62//
63// 4. CANVAS SYSTEM
64// - ow_map_canvas_: Main overworld display (4096x4096)
65// - blockset_canvas_: Tile16 selector
66// - scratch_canvas_: Layout workspace
67//
68// EDITING MODES:
69// --------------
70// - DRAW_TILE: Left-click paints tiles, right-click opens tile16 editor
71// - MOUSE: Left-click selects entities, right-click opens context menus
72//
73// KEY WORKFLOWS:
74// --------------
75// See README.md in this directory for complete workflow documentation.
76//
77// SUBSYSTEM ORGANIZATION:
78// -----------------------
79// The class is organized into logical sections marked with comment blocks.
80// Each section groups related methods and state for a specific subsystem.
81// =============================================================================
82
83namespace yaze {
84namespace editor {
85
86struct OverworldItemsSnapshot;
87
88// =============================================================================
89// Constants
90// =============================================================================
91
92constexpr unsigned int k4BPP = 4;
93constexpr unsigned int kByteSize = 3;
94constexpr unsigned int kMessageIdSize = 5;
95constexpr unsigned int kNumSheetsToLoad = 223;
98constexpr ImVec2 kCurrentGfxCanvasSize(0x100 + 1, 0x10 * 0x40 + 1);
99constexpr ImVec2 kBlocksetCanvasSize(0x100 + 1, 0x4000 + 1);
100constexpr ImVec2 kGraphicsBinCanvasSize(0x100 + 1, kNumSheetsToLoad * 0x40 + 1);
101
102constexpr ImGuiTableFlags kOWMapFlags =
103 ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable |
104 ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingStretchProp;
105
106constexpr absl::string_view kWorldList =
107 "Light World\0Dark World\0Extra World\0";
108
109constexpr absl::string_view kGamePartComboString = "Part 0\0Part 1\0Part 2\0";
110
111constexpr absl::string_view kOWMapTable = "#MapSettingsTable";
112
131class OverworldEditor : public Editor, public gfx::GfxContext {
133
134 public:
135 // ===========================================================================
136 // Construction and Initialization
137 // ===========================================================================
138
142 // MapPropertiesSystem will be initialized after maps_bmp_ and canvas are
143 // ready
144 }
145
148 dependencies_ = deps;
149 }
150
155
162
163 // ===========================================================================
164 // Editor Interface Implementation
165 // ===========================================================================
166
167 void Initialize() override;
168 absl::Status Load() override;
169 absl::Status Update() final;
170 absl::Status Undo() override;
171 absl::Status Redo() override;
172 absl::Status Cut() override { return absl::UnimplementedError("Cut"); }
173 absl::Status Copy() override;
174 absl::Status Paste() override;
175 absl::Status Find() override { return absl::UnimplementedError("Find"); }
176 absl::Status Save() override;
177 absl::Status Clear() override;
178 void ContributeStatus(StatusBar* status_bar) override;
179
182
183 int jump_to_tab() { return jump_to_tab_; }
184 int jump_to_tab_ = -1;
185
186 // ===========================================================================
187 // ROM State
188 // ===========================================================================
189
190 bool IsRomLoaded() const override { return rom_ && rom_->is_loaded(); }
191 std::string GetRomStatus() const override {
192 if (!rom_)
193 return "No ROM loaded";
194 if (!rom_->is_loaded())
195 return "ROM failed to load";
196 return absl::StrFormat("ROM loaded: %s", rom_->title());
197 }
198
199 Rom* rom() const { return rom_; }
200
202 void set_current_map(int map_id) {
203 if (map_id >= 0 && map_id < zelda3::kNumOverworldMaps) {
204 // Finalize any pending paint operation before switching maps
206 current_map_ = map_id;
208 map_id / 0x40; // Calculate which world the map belongs to
211 }
212 }
213 void SetCurrentMap(int map_id) { set_current_map(map_id); }
214
215 void set_current_tile16(int tile_id) { current_tile16_ = tile_id; }
216 int current_map_id() const { return current_map_; }
217 int current_world_id() const { return current_world_; }
218
219 // ===========================================================================
220 // Graphics Loading
221 // ===========================================================================
222
230 absl::Status LoadGraphics();
231
232 // ===========================================================================
233 // Entity Interaction API
234 // ===========================================================================
235
239
243
245 void RequestJumpToRoom(int room_id) { jump_to_tab_ = room_id; }
246
248 void RequestJumpToEntrance(int entrance_id) { jump_to_tab_ = entrance_id; }
249
254
259
260 std::string& pending_insert_type() { return pending_insert_type_; }
262 std::string& insert_error() { return insert_error_; }
263
265 int game_state() const { return game_state_; }
266
267 // ===========================================================================
268 // Entity System - Insertion and Editing
269 // ===========================================================================
270 // Entity operations are delegated to entity_operations.cc helper functions.
271 // Entity rendering is handled by OverworldEntityRenderer.
272 // Entity interaction (drag/drop) is in overworld_entity_interaction.cc.
273
276 void HandleEntityInsertion(const std::string& entity_type);
277
282
285 void HandleTile16Edit();
286
288 bool SelectItemByIdentity(const zelda3::OverworldItem& item_identity);
289
291 void ClearSelectedItem();
292
294 std::optional<zelda3::OverworldItem> selected_item_identity() const {
296 }
297
301
303 bool DuplicateSelectedItem(int offset_x = 16, int offset_y = 0);
304
306 bool NudgeSelectedItem(int delta_x, int delta_y);
307
309 bool DeleteSelectedItem();
310 bool DeleteItemByIdentity(const zelda3::OverworldItem& item_identity);
311
312 // ===========================================================================
313 // Keyboard Shortcuts
314 // ===========================================================================
315
317 if (tile_painting_)
318 tile_painting_->ToggleBrushTool();
319 }
321 if (tile_painting_)
322 tile_painting_->ActivateFillTool();
323 }
324 void CycleTileSelection(int delta);
325
329 void RequestTile16Selection(int tile_id);
330
332 return tile_painting_ && tile_painting_->PickTile16FromHoveredCanvas();
333 }
334
335 // ===========================================================================
336 // WindowContent View Hooks
337 // ===========================================================================
338 // These are used by focused WindowContent wrappers around Overworld views.
339 // Drawing is delegated to OverworldCanvasRenderer.
340
341 absl::Status DrawAreaGraphics() {
342 if (!canvas_renderer_)
343 return absl::FailedPreconditionError("Renderer not initialized");
344 return canvas_renderer_->DrawAreaGraphics();
345 }
346 absl::Status DrawTile16Selector() {
347 if (!canvas_renderer_)
348 return absl::FailedPreconditionError("Renderer not initialized");
349 return canvas_renderer_->DrawTile16Selector();
350 }
353 canvas_renderer_->DrawMapProperties();
354 }
355
359 void InvalidateGraphicsCache(int map_id = -1) {
360 if (map_refresh_)
361 map_refresh_->InvalidateGraphicsCache(map_id);
362 }
363 absl::Status DrawScratchSpace();
366 canvas_renderer_->DrawTile8Selector();
367 }
368 absl::Status UpdateGfxGroupEditor();
371 canvas_renderer_->DrawV3Settings();
372 }
373
376
379
382
385
389 canvas_renderer_->DrawOverworldCanvas();
390 }
391
392 private:
393 // ===========================================================================
394 // Entity Interaction System
395 // ===========================================================================
396 // Handles mouse interactions with entities in MOUSE mode.
397
400
401 // ===========================================================================
402 // Map Refresh System (delegated to MapRefreshCoordinator)
403 // ===========================================================================
404
408
409 // Convenience delegation methods for internal use
410 void RefreshChildMap(int map_index) {
411 if (map_refresh_)
412 map_refresh_->RefreshChildMap(map_index);
413 }
415 if (map_refresh_)
416 map_refresh_->RefreshOverworldMap();
417 }
418 void RefreshOverworldMapOnDemand(int map_index) {
419 if (map_refresh_)
420 map_refresh_->RefreshOverworldMapOnDemand(map_index);
421 }
422 void RefreshChildMapOnDemand(int map_index) {
423 if (map_refresh_)
424 map_refresh_->RefreshChildMapOnDemand(map_index);
425 }
426 absl::Status RefreshMapPalette() {
427 if (map_refresh_)
428 return map_refresh_->RefreshMapPalette();
429 return absl::FailedPreconditionError(
430 "MapRefreshCoordinator not initialized");
431 }
433 if (map_refresh_)
434 map_refresh_->RefreshMapProperties();
435 }
436 absl::Status RefreshTile16Blockset() {
437 if (map_refresh_)
438 return map_refresh_->RefreshTile16Blockset();
439 return absl::FailedPreconditionError(
440 "MapRefreshCoordinator not initialized");
441 }
443 if (map_refresh_)
444 map_refresh_->UpdateBlocksetWithPendingTileChanges();
445 }
446 void ForceRefreshGraphics(int map_index) {
447 if (map_refresh_)
448 map_refresh_->ForceRefreshGraphics(map_index);
449 }
450 void RefreshSiblingMapGraphics(int map_index, bool include_self = false) {
451 if (map_refresh_)
452 map_refresh_->RefreshSiblingMapGraphics(map_index, include_self);
453 }
454
455 // ===========================================================================
456 // Tile Editing System
457 // ===========================================================================
458 // Handles tile painting and selection on the main canvas.
459
462
465
467 absl::Status CheckForCurrentMap();
468
471
474
477
478 // Canvas navigation (delegated to CanvasNavigationManager)
483 void HandleOverworldPan();
484 void HandleOverworldZoom();
485 void ZoomIn();
486 void ZoomOut();
488 void ResetOverworldView();
489 void CenterOverworldView();
490
491 // ===========================================================================
492 // Texture and Graphics Loading
493 // ===========================================================================
494
495 absl::Status LoadSpriteGraphics();
496
499
501 void EnsureMapTexture(int map_index);
502 void PrimeWorldMaps(int world, bool process_texture_queue = false);
503 void SwitchToWorld(int world);
504
505 // ===========================================================================
506 // Canvas Navigation (delegated to CanvasNavigationManager)
507 // ===========================================================================
508
509 // ===========================================================================
510 // Canvas Automation API
511 // ===========================================================================
512 // Integration with automation testing system.
513
516 bool AutomationSetTile(int x, int y, int tile_id);
517 int AutomationGetTile(int x, int y);
518
519 // ===========================================================================
520 // Scratch Space System
521 // ===========================================================================
522 // Workspace for planning tile layouts before placing them on the map.
523
524 absl::Status SaveCurrentSelectionToScratch();
525 absl::Status LoadScratchToSelection();
526 absl::Status ClearScratchSpace();
530 void UpdateScratchBitmapTile(int tile_x, int tile_y, int tile_id);
531
532 // ===========================================================================
533 // Undo/Redo System
534 // ===========================================================================
535 // Tracks tile paint operations for undo/redo functionality.
536 // Operations within 500ms are batched to reduce undo point count.
537
539 int map_id = 0;
540 int world = 0; // 0=Light, 1=Dark, 2=Special
541 std::vector<std::pair<std::pair<int, int>, int>>
542 tile_changes; // ((x,y), old_tile_id)
543 std::chrono::steady_clock::time_point timestamp;
544 };
545
546 void CreateUndoPoint(int map_id, int world, int x, int y, int old_tile_id);
548 auto& GetWorldTiles(int world);
552 std::string description);
553
554 // ===========================================================================
555 // Editing Mode State
556 // ===========================================================================
557
561
576
577 // ===========================================================================
578 // Current Selection State
579 // ===========================================================================
580
581 int current_world_ = 0; // 0=Light, 1=Dark, 2=Special
582 int current_map_ = 0; // Current map index (0-159)
583 int current_parent_ = 0; // Parent map for multi-area
585 int game_state_ = 1; // 0=Beginning, 1=Pendants, 2=Crystals
586 int current_tile16_ = 0; // Selected tile16 for painting
589
590 // Selected tile IDs for rectangle selection
591 std::vector<int> selected_tile16_ids_;
592
593 // ===========================================================================
594 // Loading State
595 // ===========================================================================
596
597 bool all_gfx_loaded_ = false;
599
603
604 // ===========================================================================
605 // Canvas Interaction State
606 // ===========================================================================
607
611 bool current_map_lock_ = false;
612
613 // ===========================================================================
614 // Property Windows (Standalone, Not PanelManager)
615 // ===========================================================================
616
621
622 // ===========================================================================
623 // UI Subsystem Components
624 // ===========================================================================
625
626 std::unique_ptr<OverworldCanvasRenderer> canvas_renderer_;
627 std::unique_ptr<CanvasNavigationManager> canvas_nav_;
628 std::unique_ptr<TilePaintingManager> tile_painting_;
629 std::unique_ptr<zelda3::OverworldUpgradeSystem> upgrade_system_;
630 std::unique_ptr<EntityMutationService> entity_mutation_service_;
631 std::unique_ptr<OverworldInteractionCoordinator> interaction_coordinator_;
632 std::unique_ptr<MapRefreshCoordinator> map_refresh_;
633 std::unique_ptr<MapPropertiesSystem> map_properties_system_;
634 std::unique_ptr<OverworldSidebar> sidebar_;
635 std::unique_ptr<OverworldEntityRenderer> entity_renderer_;
636 std::unique_ptr<OverworldToolbar> toolbar_;
637
638 // ===========================================================================
639 // Scratch Space System (Unified Single Workspace)
640 // ===========================================================================
641
644 std::array<std::array<int, 32>, 32> tile_data{};
645 bool in_use = false;
646 std::string name = "Scratch Space";
647 int width = 16;
648 int height = 16;
649 std::vector<ImVec2> selected_tiles;
650 std::vector<ImVec2> selected_points;
651 bool select_rect_active = false;
652 };
654
655 // ===========================================================================
656 // Core Data References
657 // ===========================================================================
658
660
664
665 // Sub-editors
669
670 // ===========================================================================
671 // Graphics Data
672 // ===========================================================================
673
679 std::array<gfx::Bitmap, zelda3::kNumOverworldMaps> maps_bmp_;
681 std::vector<gfx::Bitmap> sprite_previews_;
682
683 // ===========================================================================
684 // Overworld Data Layer
685 // ===========================================================================
686
689
690 // ===========================================================================
691 // Entity State
692 // ===========================================================================
693
695
698 std::optional<zelda3::OverworldItem> selected_item_identity_;
699 std::optional<OverworldEntityEditingTarget> editing_target_;
700
701 // Edit buffers for popups (session-specific)
706
707 // Deferred entity insertion (needed for popup flow from context menu)
709 ImVec2 pending_insert_pos_ = ImVec2(0.0f, 0.0f);
710 std::string insert_error_;
711
712 // ===========================================================================
713 // Canvas Components
714 // ===========================================================================
715
722 std::unique_ptr<gui::TileSelectorWidget> blockset_selector_;
726 gui::Canvas scratch_canvas_{"ScratchSpace", ImVec2(320, 480),
728
729 // ===========================================================================
730 // Panel Cards
731 // ===========================================================================
732
733 std::unique_ptr<UsageStatisticsCard> usage_stats_card_;
734 std::unique_ptr<DebugWindowCard> debug_window_card_;
735
736 absl::Status status_;
737
738 // ===========================================================================
739 // Undo/Redo State
740 // ===========================================================================
741
742 std::optional<OverworldUndoPoint> current_paint_operation_;
743 std::chrono::steady_clock::time_point last_paint_time_;
744 static constexpr auto kPaintBatchTimeout = std::chrono::milliseconds(500);
745
746 // ===========================================================================
747 // Event Listeners
748 // ===========================================================================
749
751};
752} // namespace editor
753} // namespace yaze
754
755#endif
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
bool is_loaded() const
Definition rom.h:132
auto title() const
Definition rom.h:137
Interface for editor classes.
Definition editor.h:240
virtual void SetDependencies(const EditorDependencies &deps)
Definition editor.h:245
zelda3::GameData * game_data() const
Definition editor.h:307
EditorDependencies dependencies_
Definition editor.h:316
EditorType type_
Definition editor.h:315
Editor-level service responsible for overworld entity mutations.
Manage graphics group configurations in a Rom.
void SetWorkspaceState(GfxGroupWorkspaceState *state)
void SetGameData(zelda3::GameData *data)
Handles all canvas drawing and panel rendering for the overworld editor.
Main UI class for editing overworld maps in A Link to the Past.
std::unique_ptr< UsageStatisticsCard > usage_stats_card_
absl::Status Clear() override
std::unique_ptr< MapPropertiesSystem > map_properties_system_
std::unique_ptr< OverworldCanvasRenderer > canvas_renderer_
OverworldEntityWorkbench * GetWorkbench()
Resolve the entity workbench window content (may be null).
zelda3::OverworldEntranceTileTypes entrance_tiletypes_
void OpenEntityContextMenu(zelda3::GameEntity *entity)
void HandleTile16Edit()
Handle tile16 editing from context menu (MOUSE mode) Gets the tile16 under the cursor and opens the T...
zelda3::OverworldExit & edit_exit()
std::optional< OverworldUndoPoint > current_paint_operation_
void PushItemUndoAction(OverworldItemsSnapshot before, std::string description)
absl::Status CheckForCurrentMap()
Check for map changes and refresh if needed.
void CreateUndoPoint(int map_id, int world, int x, int y, int old_tile_id)
absl::Status Cut() override
void ForceRefreshGraphics(int map_index)
zelda3::GameEntity * ResolveEditingEntity()
void RestoreItemUndoSnapshot(const OverworldItemsSnapshot &snapshot)
std::vector< int > selected_tile16_ids_
zelda3::OverworldEntrance edit_entrance_
void ProcessPendingEntityInsertion()
Process any pending entity insertion request Called from Update() - needed because ImGui::OpenPopup()...
Definition automation.cc:87
void InitCanvasNavigationManager()
Initialize the canvas navigation manager (called during Initialize)
void InitMapRefreshCoordinator()
Initialize the map refresh coordinator (called during Initialize)
std::optional< zelda3::OverworldItem > selected_item_identity_
zelda3::OverworldBlockset refresh_blockset_
zelda3::OverworldItem & edit_item()
std::unique_ptr< zelda3::OverworldUpgradeSystem > upgrade_system_
void RequestJumpToEntrance(int entrance_id)
Trigger a jump to a dungeon entrance.
void SetDependencies(const EditorDependencies &deps) override
bool DeleteItemByIdentity(const zelda3::OverworldItem &item_identity)
void NotifyEntityModified(zelda3::GameEntity *entity)
Notify that an entity has been modified, marking ROM as dirty.
void HandleEntityInsertion(const std::string &entity_type)
Handle entity insertion from context menu.
Definition automation.cc:75
zelda3::GameEntity * dragged_entity_
std::unique_ptr< MapRefreshCoordinator > map_refresh_
std::array< gfx::Bitmap, zelda3::kNumOverworldMaps > maps_bmp_
void CheckForOverworldEdits()
Check for tile edits - delegates to TilePaintingManager.
void UpdateScratchBitmapTile(int tile_x, int tile_y, int tile_id)
UsageStatisticsCard * usage_stats_card()
Access usage statistics card for panel.
void ContributeStatus(StatusBar *status_bar) override
EntityMutationService * entity_mutation_service()
Access the entity mutation service.
void SetGameData(zelda3::GameData *game_data) override
void RefreshSiblingMapGraphics(int map_index, bool include_self=false)
void PrimeWorldMaps(int world, bool process_texture_queue=false)
std::optional< zelda3::OverworldItem > selected_item_identity() const
Get current selected item identity snapshot.
void set_current_map(int map_id)
Set the current map for editing (also updates world)
void RefreshOverworldMapOnDemand(int map_index)
std::unique_ptr< OverworldSidebar > sidebar_
std::chrono::steady_clock::time_point last_paint_time_
void InvalidateGraphicsCache(int map_id=-1)
Invalidate cached graphics for a specific map or all maps.
DebugWindowCard * debug_window_card()
Access debug window card for panel.
std::optional< int > pending_tile16_selection_after_gfx_
absl::Status SaveCurrentSelectionToScratch()
zelda3::OverworldItem * GetSelectedItem()
Resolve selected item identity to the current live item pointer.
bool DuplicateSelectedItem(int offset_x=16, int offset_y=0)
Duplicate selected item with optional pixel offset.
bool AutomationSetTile(int x, int y, int tile_id)
Definition automation.cc:29
void DrawOverworldCanvas()
Draw the main overworld canvas.
void OpenEntityEditor(zelda3::GameEntity *entity)
zelda3::Overworld & overworld()
Access the underlying Overworld data.
void SetCurrentEntity(zelda3::GameEntity *entity)
Set the currently active entity for editing.
zelda3::OverworldItem edit_item_
void RefreshChildMap(int map_index)
std::unique_ptr< OverworldEntityRenderer > entity_renderer_
absl::Status Load() override
void EnsureMapTexture(int map_index)
Ensure a specific map has its texture created.
std::vector< gfx::Bitmap > sprite_previews_
std::unique_ptr< CanvasNavigationManager > canvas_nav_
OverworldEditor(Rom *rom, const EditorDependencies &deps)
absl::Status Copy() override
std::string GetRomStatus() const override
bool NudgeSelectedItem(int delta_x, int delta_y)
Move selected item by signed pixel deltas.
std::unique_ptr< OverworldToolbar > toolbar_
bool IsRomLoaded() const override
Tile16Editor & tile16_editor()
Access the Tile16 Editor for panel integration.
void ProcessDeferredTextures()
Create textures for deferred map bitmaps on demand.
zelda3::OverworldEntrance & edit_entrance()
std::unique_ptr< gui::TileSelectorWidget > blockset_selector_
std::optional< OverworldEntityEditingTarget > editing_target_
zelda3::GameEntity * current_entity() const
absl::Status Paste() override
void ScrollBlocksetCanvasToCurrentTile()
Scroll the blockset canvas to show the current selected tile16.
static constexpr auto kPaintBatchTimeout
bool DeleteSelectedItem()
Delete selected item and preserve nearest-item selection continuity.
std::unique_ptr< TilePaintingManager > tile_painting_
absl::Status LoadGraphics()
Load the Bitmap objects for each OverworldMap.
void RefreshChildMapOnDemand(int map_index)
absl::Status Find() override
OverworldItemsSnapshot CaptureItemUndoSnapshot() const
void RequestJumpToRoom(int room_id)
Trigger a jump to a dungeon room.
std::unique_ptr< DebugWindowCard > debug_window_card_
std::unique_ptr< OverworldInteractionCoordinator > interaction_coordinator_
zelda3::GameEntity * current_entity_
void HandleKeyboardShortcuts()
Handle overworld keyboard shortcuts and edit-mode hotkeys.
zelda3::OverworldExit edit_exit_
int AutomationGetTile(int x, int y)
Definition automation.cc:58
std::unique_ptr< EntityMutationService > entity_mutation_service_
void ClearSelectedItem()
Clear active item selection.
void InitTilePaintingManager()
Initialize the tile painting manager (called after graphics load)
bool SelectItemByIdentity(const zelda3::OverworldItem &item_identity)
Select an overworld item using value identity matching.
Authoritative component for entity editing state and UI.
Allows the user to view and edit in game palettes.
A session-aware status bar displayed at the bottom of the application.
Definition status_bar.h:54
Popup window to edit Tile16 data.
void SetGameData(zelda3::GameData *game_data)
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:67
Shared graphical context across editors.
Defines an abstract interface for all rendering operations.
Definition irenderer.h:60
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
Modern, robust canvas for drawing and manipulating graphics.
Definition canvas.h:150
Base class for all overworld and dungeon entities.
Definition common.h:31
Represents an overworld exit that transitions from dungeon to overworld.
Represents the full Overworld data, light and dark world.
Definition overworld.h:261
void set_current_world(int world)
Definition overworld.h:604
void SetGameData(GameData *game_data)
Definition overworld.h:266
void set_current_map(int i)
Definition overworld.h:603
A class for managing sprites in the overworld and underworld.
Definition sprite.h:35
constexpr ImVec2 kOverworldCanvasSize(kOverworldMapSize *8, kOverworldMapSize *8)
constexpr absl::string_view kOWMapTable
constexpr ImGuiTableFlags kOWMapFlags
constexpr unsigned int kOverworldMapSize
constexpr absl::string_view kWorldList
constexpr absl::string_view kGamePartComboString
constexpr unsigned int kNumSheetsToLoad
constexpr ImVec2 kCurrentGfxCanvasSize(0x100+1, 0x10 *0x40+1)
constexpr ImVec2 kBlocksetCanvasSize(0x100+1, 0x4000+1)
constexpr ImVec2 kGraphicsBinCanvasSize(0x100+1, kNumSheetsToLoad *0x40+1)
constexpr unsigned int kByteSize
constexpr unsigned int k4BPP
constexpr unsigned int kMessageIdSize
std::unordered_map< int, std::unique_ptr< gfx::Bitmap > > BitmapTable
Definition bitmap.h:497
constexpr int kNumOverworldMaps
Definition common.h:85
std::vector< std::vector< uint16_t > > OverworldBlockset
Represents tile32 data for the overworld.
Unified dependency container for all editor types.
Definition editor.h:164
GfxGroupWorkspaceState * gfx_group_workspace
Definition editor.h:173
std::vector< std::pair< std::pair< int, int >, int > > tile_changes
std::chrono::steady_clock::time_point timestamp
std::array< std::array< int, 32 >, 32 > tile_data
Snapshot of overworld item list + current item selection.
Tilemap structure for SNES tile-based graphics management.
Definition tilemap.h:118