yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
screen_editor.cc
Go to the documentation of this file.
1#include "screen_editor.h"
2
3#include <fstream>
4#include <iostream>
5#include <string>
6
7#include "absl/strings/str_format.h"
8#include "absl/strings/string_view.h"
11#include "app/gfx/bitmap.h"
12#include "app/gfx/snes_tile.h"
13#include "app/gfx/tilesheet.h"
14#include "app/gui/canvas.h"
15#include "app/gui/color.h"
16#include "app/gui/icons.h"
17#include "app/gui/input.h"
18#include "imgui/imgui.h"
19#include "util/hex.h"
20#include "util/macro.h"
21
22namespace yaze {
23namespace editor {
24
25using core::Renderer;
26
27constexpr uint32_t kRedPen = 0xFF0000FF;
28
30
31absl::Status ScreenEditor::Load() { return absl::OkStatus(); }
32
33absl::Status ScreenEditor::Update() {
34 if (ImGui::BeginTabBar("##ScreenEditorTabBar")) {
35 if (ImGui::BeginTabItem("Dungeon Maps")) {
36 if (rom()->is_loaded()) {
38 }
39 ImGui::EndTabItem();
40 }
45 ImGui::EndTabBar();
46 }
47 return status_;
48}
49
51 TAB_ITEM("Inventory Menu")
52
53 static bool create = false;
54 if (!create && rom()->is_loaded()) {
55 status_ = inventory_.Create();
56 palette_ = inventory_.palette();
57 create = true;
58 }
59
61
62 if (ImGui::BeginTable("InventoryScreen", 3, ImGuiTableFlags_Resizable)) {
63 ImGui::TableSetupColumn("Canvas");
64 ImGui::TableSetupColumn("Tiles");
65 ImGui::TableSetupColumn("Palette");
66 ImGui::TableHeadersRow();
67
68 ImGui::TableNextColumn();
69 screen_canvas_.DrawBackground();
70 screen_canvas_.DrawContextMenu();
71 screen_canvas_.DrawBitmap(inventory_.bitmap(), 2, create);
72 screen_canvas_.DrawGrid(32.0f);
73 screen_canvas_.DrawOverlay();
74
75 ImGui::TableNextColumn();
76 tilesheet_canvas_.DrawBackground(ImVec2(128 * 2 + 2, (192 * 2) + 4));
77 tilesheet_canvas_.DrawContextMenu();
78 tilesheet_canvas_.DrawBitmap(inventory_.tilesheet(), 2, create);
79 tilesheet_canvas_.DrawGrid(16.0f);
80 tilesheet_canvas_.DrawOverlay();
81
82 ImGui::TableNextColumn();
84
85 ImGui::EndTable();
86 }
87 ImGui::Separator();
89}
90
92 if (ImGui::BeginTable("InventoryToolset", 8, ImGuiTableFlags_SizingFixedFit,
93 ImVec2(0, 0))) {
94 ImGui::TableSetupColumn("#drawTool");
95 ImGui::TableSetupColumn("#sep1");
96 ImGui::TableSetupColumn("#zoomOut");
97 ImGui::TableSetupColumn("#zoomIN");
98 ImGui::TableSetupColumn("#sep2");
99 ImGui::TableSetupColumn("#bg2Tool");
100 ImGui::TableSetupColumn("#bg3Tool");
101 ImGui::TableSetupColumn("#itemTool");
102
103 ImGui::TableNextColumn();
104 if (ImGui::Button(ICON_MD_UNDO)) {
105 // status_ = inventory_.Undo();
106 }
107 ImGui::TableNextColumn();
108 if (ImGui::Button(ICON_MD_REDO)) {
109 // status_ = inventory_.Redo();
110 }
111 ImGui::TableNextColumn();
112 ImGui::Text(ICON_MD_MORE_VERT);
113 ImGui::TableNextColumn();
114 if (ImGui::Button(ICON_MD_ZOOM_OUT)) {
115 screen_canvas_.ZoomOut();
116 }
117 ImGui::TableNextColumn();
118 if (ImGui::Button(ICON_MD_ZOOM_IN)) {
119 screen_canvas_.ZoomIn();
120 }
121 ImGui::TableNextColumn();
122 ImGui::Text(ICON_MD_MORE_VERT);
123 ImGui::TableNextColumn();
124 if (ImGui::Button(ICON_MD_DRAW)) {
126 }
127 ImGui::TableNextColumn();
128 if (ImGui::Button(ICON_MD_BUILD)) {
129 // current_mode_ = EditingMode::BUILD;
130 }
131
132 ImGui::EndTable();
133 }
134}
135
137 std::vector<std::array<uint8_t, 25>> current_floor_rooms_d;
138 std::vector<std::array<uint8_t, 25>> current_floor_gfx_d;
139 int total_floors_d;
140 uint8_t nbr_floor_d;
141 uint8_t nbr_basement_d;
142
143 for (int d = 0; d < 14; d++) {
144 current_floor_rooms_d.clear();
145 current_floor_gfx_d.clear();
146 ASSIGN_OR_RETURN(int ptr,
147 rom()->ReadWord(zelda3::kDungeonMapRoomsPtr + (d * 2)));
148 ASSIGN_OR_RETURN(int ptr_gfx,
149 rom()->ReadWord(zelda3::kDungeonMapGfxPtr + (d * 2)));
150 ptr |= 0x0A0000; // Add bank to the short ptr
151 ptr_gfx |= 0x0A0000; // Add bank to the short ptr
152 int pc_ptr = SnesToPc(ptr); // Contains data for the next 25 rooms
153 int pc_ptr_gfx = SnesToPc(ptr_gfx); // Contains data for the next 25 rooms
154
155 ASSIGN_OR_RETURN(uint16_t boss_room_d,
156 rom()->ReadWord(zelda3::kDungeonMapBossRooms + (d * 2)));
157
158 ASSIGN_OR_RETURN(nbr_basement_d,
159 rom()->ReadByte(zelda3::kDungeonMapFloors + (d * 2)));
160 nbr_basement_d &= 0x0F;
161
162 ASSIGN_OR_RETURN(nbr_floor_d,
163 rom()->ReadByte(zelda3::kDungeonMapFloors + (d * 2)));
164 nbr_floor_d &= 0xF0;
165 nbr_floor_d = nbr_floor_d >> 4;
166
167 total_floors_d = nbr_basement_d + nbr_floor_d;
168
169 dungeon_map_labels_.emplace_back();
170
171 // for each floor in the dungeon
172 for (int i = 0; i < total_floors_d; i++) {
173 dungeon_map_labels_[d].emplace_back();
174
175 std::array<uint8_t, 25> rdata;
176 std::array<uint8_t, 25> gdata;
177
178 // for each room on the floor
179 for (int j = 0; j < 25; j++) {
180 gdata[j] = 0xFF;
181 rdata[j] = rom()->data()[pc_ptr + j + (i * 25)]; // Set the rooms
182
183 if (rdata[j] == 0x0F) {
184 gdata[j] = 0xFF;
185 } else {
186 gdata[j] = rom()->data()[pc_ptr_gfx++];
187 }
188
189 std::string label = util::HexByte(rdata[j]);
190 dungeon_map_labels_[d][i][j] = label;
191 }
192
193 current_floor_gfx_d.push_back(gdata); // Add new floor gfx data
194 current_floor_rooms_d.push_back(rdata); // Add new floor data
195 }
196
197 dungeon_maps_.emplace_back(boss_room_d, nbr_floor_d, nbr_basement_d,
198 current_floor_rooms_d, current_floor_gfx_d);
199 }
200
201 return absl::OkStatus();
202}
203
205 for (int d = 0; d < 14; d++) {
206 int ptr = zelda3::kDungeonMapRoomsPtr + (d * 2);
207 int ptr_gfx = zelda3::kDungeonMapGfxPtr + (d * 2);
208 int pc_ptr = SnesToPc(ptr);
209 int pc_ptr_gfx = SnesToPc(ptr_gfx);
210
211 const int nbr_floors = dungeon_maps_[d].nbr_of_floor;
212 const int nbr_basements = dungeon_maps_[d].nbr_of_basement;
213 for (int i = 0; i < nbr_floors + nbr_basements; i++) {
214 for (int j = 0; j < 25; j++) {
215 RETURN_IF_ERROR(rom()->WriteByte(pc_ptr + j + (i * 25),
216 dungeon_maps_[d].floor_rooms[i][j]));
217 RETURN_IF_ERROR(rom()->WriteByte(pc_ptr_gfx + j + (i * 25),
218 dungeon_maps_[d].floor_gfx[i][j]));
219 pc_ptr_gfx++;
220 }
221 }
222 }
223
224 return absl::OkStatus();
225}
226
228 const std::vector<uint8_t> &gfx_data, bool bin_mode) {
229 tile16_sheet_.Init(256, 192, gfx::TileType::Tile16);
230
231 for (int i = 0; i < 186; i++) {
232 int addr = zelda3::kDungeonMapTile16;
233 if (rom()->data()[zelda3::kDungeonMapExpCheck] != 0xB9) {
235 }
236
237 ASSIGN_OR_RETURN(auto tl, rom()->ReadWord(addr + (i * 8)));
238 gfx::TileInfo t1 = gfx::WordToTileInfo(tl); // Top left
239
240 ASSIGN_OR_RETURN(auto tr, rom()->ReadWord(addr + 2 + (i * 8)));
241 gfx::TileInfo t2 = gfx::WordToTileInfo(tr); // Top right
242
243 ASSIGN_OR_RETURN(auto bl, rom()->ReadWord(addr + 4 + (i * 8)));
244 gfx::TileInfo t3 = gfx::WordToTileInfo(bl); // Bottom left
245
246 ASSIGN_OR_RETURN(auto br, rom()->ReadWord(addr + 6 + (i * 8)));
247 gfx::TileInfo t4 = gfx::WordToTileInfo(br); // Bottom right
248
249 int sheet_offset = 212;
250 if (bin_mode) {
251 sheet_offset = 0;
252 }
253 tile16_sheet_.ComposeTile16(gfx_data, t1, t2, t3, t4, sheet_offset);
254 }
255
256 tile16_sheet_.mutable_bitmap()->SetPalette(
257 *rom()->mutable_dungeon_palette(3));
258 Renderer::GetInstance().RenderBitmap(&*tile16_sheet_.mutable_bitmap().get());
259
260 for (int i = 0; i < tile16_sheet_.num_tiles(); ++i) {
261 auto tile = tile16_sheet_.GetTile16(i);
262 tile16_individual_[i] = tile;
263 tile16_individual_[i].SetPalette(*rom()->mutable_dungeon_palette(3));
265 }
266
267 return absl::OkStatus();
268}
269
271 for (int i = 0; i < 186; i++) {
272 int addr = zelda3::kDungeonMapTile16;
273 if (rom()->data()[zelda3::kDungeonMapExpCheck] != 0xB9) {
275 }
276
277 gfx::TileInfo t1 = tile16_sheet_.tile_info()[i].tiles[0];
278 gfx::TileInfo t2 = tile16_sheet_.tile_info()[i].tiles[1];
279 gfx::TileInfo t3 = tile16_sheet_.tile_info()[i].tiles[2];
280 gfx::TileInfo t4 = tile16_sheet_.tile_info()[i].tiles[3];
281
282 auto tl = gfx::TileInfoToWord(t1);
283 RETURN_IF_ERROR(rom()->WriteWord(addr + (i * 8), tl));
284
285 auto tr = gfx::TileInfoToWord(t2);
286 RETURN_IF_ERROR(rom()->WriteWord(addr + 2 + (i * 8), tr));
287
288 auto bl = gfx::TileInfoToWord(t3);
289 RETURN_IF_ERROR(rom()->WriteWord(addr + 4 + (i * 8), bl));
290
291 auto br = gfx::TileInfoToWord(t4);
292 RETURN_IF_ERROR(rom()->WriteWord(addr + 6 + (i * 8), br));
293 }
294 return absl::OkStatus();
295}
296
298 auto &current_dungeon = dungeon_maps_[selected_dungeon];
299 if (ImGui::BeginTabBar("##DungeonMapTabs")) {
300 auto nbr_floors =
301 current_dungeon.nbr_of_floor + current_dungeon.nbr_of_basement;
302 for (int i = 0; i < nbr_floors; i++) {
303 int basement_num = current_dungeon.nbr_of_basement - i;
304 std::string tab_name = absl::StrFormat("Basement %d", basement_num);
305 if (i >= current_dungeon.nbr_of_basement) {
306 tab_name = absl::StrFormat("Floor %d",
307 i - current_dungeon.nbr_of_basement + 1);
308 }
309
310 if (ImGui::BeginTabItem(tab_name.c_str())) {
311 floor_number = i;
312 screen_canvas_.DrawBackground(ImVec2(325, 325));
313 screen_canvas_.DrawTileSelector(64.f);
314
315 auto boss_room = current_dungeon.boss_room;
316 for (int j = 0; j < 25; j++) {
317 if (current_dungeon.floor_rooms[floor_number][j] != 0x0F) {
318 int tile16_id = current_dungeon.floor_gfx[floor_number][j];
319 int posX = ((j % 5) * 32);
320 int posY = ((j / 5) * 32);
321
322 if (tile16_individual_.count(tile16_id) == 0) {
323 tile16_individual_[tile16_id] =
324 tile16_sheet_.GetTile16(tile16_id);
326 &tile16_individual_[tile16_id]);
327 }
328 screen_canvas_.DrawBitmap(tile16_individual_[tile16_id], (posX * 2),
329 (posY * 2), 4.0f);
330
331 if (current_dungeon.floor_rooms[floor_number][j] == boss_room) {
332 screen_canvas_.DrawOutlineWithColor((posX * 2), (posY * 2), 64,
333 64, kRedPen);
334 }
335
336 std::string label =
338 screen_canvas_.DrawText(label, (posX * 2), (posY * 2));
339 std::string gfx_id = util::HexByte(tile16_id);
340 screen_canvas_.DrawText(gfx_id, (posX * 2), (posY * 2) + 16);
341 }
342 }
343
344 screen_canvas_.DrawGrid(64.f, 5);
345 screen_canvas_.DrawOverlay();
346
347 if (!screen_canvas_.points().empty()) {
348 int x = screen_canvas_.points().front().x / 64;
349 int y = screen_canvas_.points().front().y / 64;
350 selected_room = x + (y * 5);
351 }
352 ImGui::EndTabItem();
353 }
354 }
355 ImGui::EndTabBar();
356 }
357
359 "Selected Room",
360 &current_dungeon.floor_rooms[floor_number].at(selected_room));
361
362 gui::InputHexWord("Boss Room", &current_dungeon.boss_room);
363
364 const ImVec2 button_size = ImVec2(130, 0);
365
366 // Add Floor Button
367 if (ImGui::Button("Add Floor", button_size) &&
368 current_dungeon.nbr_of_floor < 8) {
369 current_dungeon.nbr_of_floor++;
371 }
372 ImGui::SameLine();
373 if (ImGui::Button("Remove Floor", button_size) &&
374 current_dungeon.nbr_of_floor > 0) {
375 current_dungeon.nbr_of_floor--;
377 }
378
379 // Add Basement Button
380 if (ImGui::Button("Add Basement", button_size) &&
381 current_dungeon.nbr_of_basement < 8) {
382 current_dungeon.nbr_of_basement++;
384 }
385 ImGui::SameLine();
386 if (ImGui::Button("Remove Basement", button_size) &&
387 current_dungeon.nbr_of_basement > 0) {
388 current_dungeon.nbr_of_basement--;
390 }
391
392 if (ImGui::Button("Copy Floor", button_size)) {
393 copy_button_pressed = true;
394 }
395 ImGui::SameLine();
396 if (ImGui::Button("Paste Floor", button_size)) {
398 }
399}
400
402 if (ImGui::BeginChild("##DungeonMapTiles", ImVec2(0, 0), true)) {
403 tilesheet_canvas_.DrawBackground(ImVec2((256 * 2) + 2, (192 * 2) + 4));
404 tilesheet_canvas_.DrawContextMenu();
405 tilesheet_canvas_.DrawTileSelector(32.f);
406 tilesheet_canvas_.DrawBitmap(*tile16_sheet_.bitmap(), 2, true);
407 tilesheet_canvas_.DrawGrid(32.f);
408 tilesheet_canvas_.DrawOverlay();
409
410 if (!tilesheet_canvas_.points().empty()) {
411 selected_tile16_ = tilesheet_canvas_.points().front().x / 32 +
412 (tilesheet_canvas_.points().front().y / 32) * 16;
414
415 // Draw the selected tile
416 if (!screen_canvas_.points().empty()) {
419 tilesheet_canvas_.mutable_points()->clear();
420 }
421 }
422
423 ImGui::Separator();
424 current_tile_canvas_.DrawBackground(); // ImVec2(64 * 2 + 2, 64 * 2 + 4));
425 current_tile_canvas_.DrawContextMenu();
427 16)) {
428 // Modify the tile16 based on the selected tile and current_tile16_info
429 }
431 4.0f);
432 current_tile_canvas_.DrawGrid(16.f);
433 current_tile_canvas_.DrawOverlay();
434
436 ImGui::SameLine();
439 ImGui::SameLine();
441
442 if (ImGui::Button("Modify Tile16")) {
443 tile16_sheet_.ModifyTile16(
444 rom()->graphics_buffer(), current_tile16_info.tiles[0],
445 current_tile16_info.tiles[1], current_tile16_info.tiles[2],
450 *rom()->mutable_dungeon_palette(3));
453 }
454 }
455 ImGui::EndChild();
456}
457
460 if (!LoadDungeonMaps().ok()) {
461 ImGui::Text("Failed to load dungeon maps");
462 }
463
464 if (LoadDungeonMapTile16(rom()->graphics_buffer()).ok()) {
465 // TODO: Load roomset gfx based on dungeon ID
466 sheets_.emplace(0, GraphicsSheetManager::GetInstance().gfx_sheets()[212]);
467 sheets_.emplace(1, GraphicsSheetManager::GetInstance().gfx_sheets()[213]);
468 sheets_.emplace(2, GraphicsSheetManager::GetInstance().gfx_sheets()[214]);
469 sheets_.emplace(3, GraphicsSheetManager::GetInstance().gfx_sheets()[215]);
470 int current_tile8 = 0;
471 int tile_data_offset = 0;
472 for (int i = 0; i < 4; ++i) {
473 for (int j = 0; j < 32; j++) {
474 std::vector<uint8_t> tile_data(64, 0); // 8x8 tile (64 bytes
475 int tile_index = current_tile8 + j;
476 int x = (j % 8) * 8;
477 int y = (j / 8) * 8;
478 sheets_[i].Get8x8Tile(tile_index, 0, 0, tile_data, tile_data_offset);
479 tile8_individual_.emplace_back(gfx::Bitmap(8, 8, 4, tile_data));
480 tile8_individual_.back().SetPalette(
481 *rom()->mutable_dungeon_palette(3));
483 }
484 tile_data_offset = 0;
485 }
487 } else {
488 ImGui::Text("Failed to load dungeon map tile16");
489 }
490 }
491
492 if (ImGui::BeginTable("##DungeonMapToolset", 2,
493 ImGuiTableFlags_SizingFixedFit)) {
494 ImGui::TableSetupColumn("Draw Mode");
495 ImGui::TableSetupColumn("Edit Mode");
496
497 ImGui::TableNextColumn();
498 if (ImGui::Button(ICON_MD_DRAW)) {
500 }
501
502 ImGui::TableNextColumn();
503 if (ImGui::Button(ICON_MD_EDIT)) {
505 }
506
507 ImGui::EndTable();
508 }
509
510 static std::vector<std::string> dungeon_names = {
511 "Sewers/Sanctuary", "Hyrule Castle", "Eastern Palace",
512 "Desert Palace", "Tower of Hera", "Agahnim's Tower",
513 "Palace of Darkness", "Swamp Palace", "Skull Woods",
514 "Thieves' Town", "Ice Palace", "Misery Mire",
515 "Turtle Rock", "Ganon's Tower"};
516
517 if (ImGui::BeginTable("DungeonMapsTable", 4,
518 ImGuiTableFlags_Resizable |
519 ImGuiTableFlags_Reorderable |
520 ImGuiTableFlags_Hideable)) {
521 ImGui::TableSetupColumn("Dungeon");
522 ImGui::TableSetupColumn("Map");
523 ImGui::TableSetupColumn("Rooms Gfx");
524 ImGui::TableSetupColumn("Tiles Gfx");
525 ImGui::TableHeadersRow();
526
527 ImGui::TableNextColumn();
528 for (int i = 0; i < dungeon_names.size(); i++) {
530 selected_dungeon == i, "Dungeon Names", absl::StrFormat("%d", i),
531 dungeon_names[i]);
532 if (ImGui::IsItemClicked()) {
534 }
535 }
536
537 ImGui::TableNextColumn();
539
540 ImGui::TableNextColumn();
542
543 ImGui::TableNextColumn();
544 tilemap_canvas_.DrawBackground();
545 tilemap_canvas_.DrawContextMenu();
546 if (tilemap_canvas_.DrawTileSelector(16.f)) {
547 // Get the tile8 ID to use for the tile16 drawing above
548 selected_tile8_ = tilemap_canvas_.GetTileIdFromMousePos();
549 }
550 tilemap_canvas_.DrawBitmapTable(sheets_);
551 tilemap_canvas_.DrawGrid();
552 tilemap_canvas_.DrawOverlay();
553
554 ImGui::Text("Selected tile8: %d", selected_tile8_);
555 ImGui::Separator();
556 ImGui::Text("For use with custom inserted graphics assembly patches.");
557 if (ImGui::Button("Load GFX from BIN file")) LoadBinaryGfx();
558
559 ImGui::EndTable();
560 }
561}
562
564 std::string bin_file = core::FileDialogWrapper::ShowOpenFileDialog();
565 if (!bin_file.empty()) {
566 std::ifstream file(bin_file, std::ios::binary);
567 if (file.is_open()) {
568 // Read the gfx data into a buffer
569 std::vector<uint8_t> bin_data((std::istreambuf_iterator<char>(file)),
570 std::istreambuf_iterator<char>());
571 auto converted_bin = gfx::SnesTo8bppSheet(bin_data, 4, 4);
572 gfx_bin_data_ = converted_bin;
573 tile16_sheet_.clear();
574 if (LoadDungeonMapTile16(converted_bin, true).ok()) {
575 sheets_.clear();
576 std::vector<std::vector<uint8_t>> gfx_sheets;
577 for (int i = 0; i < 4; i++) {
578 gfx_sheets.emplace_back(converted_bin.begin() + (i * 0x1000),
579 converted_bin.begin() + ((i + 1) * 0x1000));
580 sheets_.emplace(i, gfx::Bitmap(128, 32, 8, gfx_sheets[i]));
581 sheets_[i].SetPalette(*rom()->mutable_dungeon_palette(3));
583 }
584 binary_gfx_loaded_ = true;
585 } else {
586 status_ = absl::InternalError("Failed to load dungeon map tile16");
587 }
588 file.close();
589 }
590 }
591}
592
594 if (ImGui::BeginTabItem("Title Screen")) {
595 ImGui::EndTabItem();
596 }
597}
598
600 if (ImGui::BeginTabItem("Naming Screen")) {
601 ImGui::EndTabItem();
602 }
603}
604
606 if (ImGui::BeginTabItem("Overworld Map")) {
607 ImGui::EndTabItem();
608 }
609}
610
612 static bool show_bg1 = true;
613 static bool show_bg2 = true;
614 static bool show_bg3 = true;
615
616 static bool drawing_bg1 = true;
617 static bool drawing_bg2 = false;
618 static bool drawing_bg3 = false;
619
620 ImGui::Checkbox("Show BG1", &show_bg1);
621 ImGui::SameLine();
622 ImGui::Checkbox("Show BG2", &show_bg2);
623
624 ImGui::Checkbox("Draw BG1", &drawing_bg1);
625 ImGui::SameLine();
626 ImGui::Checkbox("Draw BG2", &drawing_bg2);
627 ImGui::SameLine();
628 ImGui::Checkbox("Draw BG3", &drawing_bg3);
629}
630
631} // namespace editor
632} // namespace yaze
static GraphicsSheetManager & GetInstance()
Definition rom.h:272
ResourceLabelManager * resource_label()
Definition rom.h:181
auto data() const
Definition rom.h:163
static std::string ShowOpenFileDialog()
ShowOpenFileDialog opens a file dialog and returns the selected filepath.
void RenderBitmap(gfx::Bitmap *bitmap)
Used to render a bitmap to the screen.
Definition renderer.h:48
static Renderer & GetInstance()
Definition renderer.h:26
absl::Status LoadDungeonMapTile16(const std::vector< uint8_t > &gfx_data, bool bin_mode=false)
std::vector< gfx::Bitmap > tile8_individual_
absl::Status SaveDungeonMapTile16()
absl::Status Load() override
absl::Status Update() override
std::vector< uint8_t > gfx_bin_data_
std::vector< std::vector< std::array< std::string, 25 > > > dungeon_map_labels_
zelda3::Inventory inventory_
std::vector< zelda3::DungeonMap > dungeon_maps_
std::unordered_map< int, gfx::Bitmap > tile16_individual_
gfx::InternalTile16 current_tile16_info
Represents a bitmap image.
Definition bitmap.h:66
SNES 16-bit tile metadata container.
Definition snes_tile.h:49
#define ICON_MD_MORE_VERT
Definition icons.h:1241
#define ICON_MD_DRAW
Definition icons.h:623
#define ICON_MD_ZOOM_OUT
Definition icons.h:2191
#define ICON_MD_REDO
Definition icons.h:1568
#define ICON_MD_EDIT
Definition icons.h:643
#define ICON_MD_BUILD
Definition icons.h:326
#define ICON_MD_ZOOM_IN
Definition icons.h:2189
#define ICON_MD_UNDO
Definition icons.h:2034
#define RETURN_IF_ERROR(expression)
Definition macro.h:51
#define END_TAB_ITEM()
Definition macro.h:5
#define ASSIGN_OR_RETURN(type_variable_name, expression)
Definition macro.h:59
#define TAB_ITEM(w)
Definition macro.h:4
Editors are the view controllers for the application.
constexpr uint32_t kRedPen
uint16_t TileInfoToWord(TileInfo tile_info)
Definition snes_tile.cc:301
TileInfo WordToTileInfo(uint16_t word)
Definition snes_tile.cc:318
std::vector< uint8_t > SnesTo8bppSheet(const std::vector< uint8_t > &sheet, int bpp, int num_sheets)
Definition snes_tile.cc:139
bool InputHexWord(const char *label, uint16_t *data, float input_width, bool no_step)
Definition input.cc:161
bool InputTileInfo(const char *label, gfx::TileInfo *tile_info)
Definition input.cc:291
absl::Status DisplayPalette(gfx::SnesPalette &palette, bool loaded)
Definition color.cc:54
bool InputHexByte(const char *label, uint8_t *data, float input_width, bool no_step)
Definition input.cc:175
std::string HexByte(uint8_t byte, HexStringParams params)
Definition hex.cc:33
constexpr int kDungeonMapExpCheck
Definition dungeon_map.h:23
constexpr int kDungeonMapFloors
Definition dungeon_map.h:15
constexpr int kDungeonMapTile16
Definition dungeon_map.h:24
constexpr int kDungeonMapTile16Expanded
Definition dungeon_map.h:25
constexpr int kDungeonMapBossRooms
Definition dungeon_map.h:28
constexpr int kDungeonMapRoomsPtr
Definition dungeon_map.h:14
constexpr int kDungeonMapGfxPtr
Definition dungeon_map.h:17
Main namespace for the application.
Definition controller.cc:18
uint32_t SnesToPc(uint32_t addr) noexcept
Definition rom.h:329
void SelectableLabelWithNameEdit(bool selected, const std::string &type, const std::string &key, const std::string &defaultValue)
Definition project.cc:146