yaze 0.2.2
Link to the Past ROM Editor
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 RETURN_IF_ERROR(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;
264 tile16_individual_[i].SetPalette(*rom()->mutable_dungeon_palette(3)));
266 }
267
268 return absl::OkStatus();
269}
270
272 for (int i = 0; i < 186; i++) {
273 int addr = zelda3::kDungeonMapTile16;
274 if (rom()->data()[zelda3::kDungeonMapExpCheck] != 0xB9) {
276 }
277
278 gfx::TileInfo t1 = tile16_sheet_.tile_info()[i].tiles[0];
279 gfx::TileInfo t2 = tile16_sheet_.tile_info()[i].tiles[1];
280 gfx::TileInfo t3 = tile16_sheet_.tile_info()[i].tiles[2];
281 gfx::TileInfo t4 = tile16_sheet_.tile_info()[i].tiles[3];
282
283 auto tl = gfx::TileInfoToWord(t1);
284 RETURN_IF_ERROR(rom()->WriteWord(addr + (i * 8), tl));
285
286 auto tr = gfx::TileInfoToWord(t2);
287 RETURN_IF_ERROR(rom()->WriteWord(addr + 2 + (i * 8), tr));
288
289 auto bl = gfx::TileInfoToWord(t3);
290 RETURN_IF_ERROR(rom()->WriteWord(addr + 4 + (i * 8), bl));
291
292 auto br = gfx::TileInfoToWord(t4);
293 RETURN_IF_ERROR(rom()->WriteWord(addr + 6 + (i * 8), br));
294 }
295 return absl::OkStatus();
296}
297
299 auto &current_dungeon = dungeon_maps_[selected_dungeon];
300 if (ImGui::BeginTabBar("##DungeonMapTabs")) {
301 auto nbr_floors =
302 current_dungeon.nbr_of_floor + current_dungeon.nbr_of_basement;
303 for (int i = 0; i < nbr_floors; i++) {
304 int basement_num = current_dungeon.nbr_of_basement - i;
305 std::string tab_name = absl::StrFormat("Basement %d", basement_num);
306 if (i >= current_dungeon.nbr_of_basement) {
307 tab_name = absl::StrFormat("Floor %d",
308 i - current_dungeon.nbr_of_basement + 1);
309 }
310
311 if (ImGui::BeginTabItem(tab_name.c_str())) {
312 floor_number = i;
313 screen_canvas_.DrawBackground(ImVec2(325, 325));
314 screen_canvas_.DrawTileSelector(64.f);
315
316 auto boss_room = current_dungeon.boss_room;
317 for (int j = 0; j < 25; j++) {
318 if (current_dungeon.floor_rooms[floor_number][j] != 0x0F) {
319 int tile16_id = current_dungeon.floor_gfx[floor_number][j];
320 int posX = ((j % 5) * 32);
321 int posY = ((j / 5) * 32);
322
323 if (tile16_individual_.count(tile16_id) == 0) {
324 tile16_individual_[tile16_id] =
325 tile16_sheet_.GetTile16(tile16_id);
327 &tile16_individual_[tile16_id]);
328 }
329 screen_canvas_.DrawBitmap(tile16_individual_[tile16_id], (posX * 2),
330 (posY * 2), 4.0f);
331
332 if (current_dungeon.floor_rooms[floor_number][j] == boss_room) {
333 screen_canvas_.DrawOutlineWithColor((posX * 2), (posY * 2), 64,
334 64, kRedPen);
335 }
336
337 std::string label =
339 screen_canvas_.DrawText(label, (posX * 2), (posY * 2));
340 std::string gfx_id = util::HexByte(tile16_id);
341 screen_canvas_.DrawText(gfx_id, (posX * 2), (posY * 2) + 16);
342 }
343 }
344
345 screen_canvas_.DrawGrid(64.f, 5);
346 screen_canvas_.DrawOverlay();
347
348 if (!screen_canvas_.points().empty()) {
349 int x = screen_canvas_.points().front().x / 64;
350 int y = screen_canvas_.points().front().y / 64;
351 selected_room = x + (y * 5);
352 }
353 ImGui::EndTabItem();
354 }
355 }
356 ImGui::EndTabBar();
357 }
358
360 "Selected Room",
361 &current_dungeon.floor_rooms[floor_number].at(selected_room));
362
363 gui::InputHexWord("Boss Room", &current_dungeon.boss_room);
364
365 const ImVec2 button_size = ImVec2(130, 0);
366
367 // Add Floor Button
368 if (ImGui::Button("Add Floor", button_size) &&
369 current_dungeon.nbr_of_floor < 8) {
370 current_dungeon.nbr_of_floor++;
372 }
373 ImGui::SameLine();
374 if (ImGui::Button("Remove Floor", button_size) &&
375 current_dungeon.nbr_of_floor > 0) {
376 current_dungeon.nbr_of_floor--;
378 }
379
380 // Add Basement Button
381 if (ImGui::Button("Add Basement", button_size) &&
382 current_dungeon.nbr_of_basement < 8) {
383 current_dungeon.nbr_of_basement++;
385 }
386 ImGui::SameLine();
387 if (ImGui::Button("Remove Basement", button_size) &&
388 current_dungeon.nbr_of_basement > 0) {
389 current_dungeon.nbr_of_basement--;
391 }
392
393 if (ImGui::Button("Copy Floor", button_size)) {
394 copy_button_pressed = true;
395 }
396 ImGui::SameLine();
397 if (ImGui::Button("Paste Floor", button_size)) {
399 }
400}
401
403 if (ImGui::BeginChild("##DungeonMapTiles", ImVec2(0, 0), true)) {
404 tilesheet_canvas_.DrawBackground(ImVec2((256 * 2) + 2, (192 * 2) + 4));
405 tilesheet_canvas_.DrawContextMenu();
406 tilesheet_canvas_.DrawTileSelector(32.f);
407 tilesheet_canvas_.DrawBitmap(*tile16_sheet_.bitmap(), 2, true);
408 tilesheet_canvas_.DrawGrid(32.f);
409 tilesheet_canvas_.DrawOverlay();
410
411 if (!tilesheet_canvas_.points().empty()) {
412 selected_tile16_ = tilesheet_canvas_.points().front().x / 32 +
413 (tilesheet_canvas_.points().front().y / 32) * 16;
415
416 // Draw the selected tile
417 if (!screen_canvas_.points().empty()) {
420 tilesheet_canvas_.mutable_points()->clear();
421 }
422 }
423
424 ImGui::Separator();
425 current_tile_canvas_.DrawBackground(); // ImVec2(64 * 2 + 2, 64 * 2 + 4));
426 current_tile_canvas_.DrawContextMenu();
428 16)) {
429 // Modify the tile16 based on the selected tile and current_tile16_info
430 }
432 4.0f);
433 current_tile_canvas_.DrawGrid(16.f);
434 current_tile_canvas_.DrawOverlay();
435
437 ImGui::SameLine();
440 ImGui::SameLine();
442
443 if (ImGui::Button("Modify Tile16")) {
444 tile16_sheet_.ModifyTile16(
445 rom()->graphics_buffer(), current_tile16_info.tiles[0],
446 current_tile16_info.tiles[1], current_tile16_info.tiles[2],
451 *rom()->mutable_dungeon_palette(3)));
454 }
455 }
456 ImGui::EndChild();
457}
458
461 if (!LoadDungeonMaps().ok()) {
462 ImGui::Text("Failed to load dungeon maps");
463 }
464
465 if (LoadDungeonMapTile16(rom()->graphics_buffer()).ok()) {
466 // TODO: Load roomset gfx based on dungeon ID
467 sheets_.emplace(0, GraphicsSheetManager::GetInstance().gfx_sheets()[212]);
468 sheets_.emplace(1, GraphicsSheetManager::GetInstance().gfx_sheets()[213]);
469 sheets_.emplace(2, GraphicsSheetManager::GetInstance().gfx_sheets()[214]);
470 sheets_.emplace(3, GraphicsSheetManager::GetInstance().gfx_sheets()[215]);
471 int current_tile8 = 0;
472 int tile_data_offset = 0;
473 for (int i = 0; i < 4; ++i) {
474 for (int j = 0; j < 32; j++) {
475 std::vector<uint8_t> tile_data(64, 0); // 8x8 tile (64 bytes
476 int tile_index = current_tile8 + j;
477 int x = (j % 8) * 8;
478 int y = (j / 8) * 8;
479 sheets_[i].Get8x8Tile(tile_index, 0, 0, tile_data, tile_data_offset);
480 tile8_individual_.emplace_back(gfx::Bitmap(8, 8, 4, tile_data));
481 RETURN_VOID_IF_ERROR(tile8_individual_.back().SetPalette(
482 *rom()->mutable_dungeon_palette(3)));
484 }
485 tile_data_offset = 0;
486 }
488 } else {
489 ImGui::Text("Failed to load dungeon map tile16");
490 }
491 }
492
493 if (ImGui::BeginTable("##DungeonMapToolset", 2,
494 ImGuiTableFlags_SizingFixedFit)) {
495 ImGui::TableSetupColumn("Draw Mode");
496 ImGui::TableSetupColumn("Edit Mode");
497
498 ImGui::TableNextColumn();
499 if (ImGui::Button(ICON_MD_DRAW)) {
501 }
502
503 ImGui::TableNextColumn();
504 if (ImGui::Button(ICON_MD_EDIT)) {
506 }
507
508 ImGui::EndTable();
509 }
510
511 static std::vector<std::string> dungeon_names = {
512 "Sewers/Sanctuary", "Hyrule Castle", "Eastern Palace",
513 "Desert Palace", "Tower of Hera", "Agahnim's Tower",
514 "Palace of Darkness", "Swamp Palace", "Skull Woods",
515 "Thieves' Town", "Ice Palace", "Misery Mire",
516 "Turtle Rock", "Ganon's Tower"};
517
518 if (ImGui::BeginTable("DungeonMapsTable", 4,
519 ImGuiTableFlags_Resizable |
520 ImGuiTableFlags_Reorderable |
521 ImGuiTableFlags_Hideable)) {
522 ImGui::TableSetupColumn("Dungeon");
523 ImGui::TableSetupColumn("Map");
524 ImGui::TableSetupColumn("Rooms Gfx");
525 ImGui::TableSetupColumn("Tiles Gfx");
526 ImGui::TableHeadersRow();
527
528 ImGui::TableNextColumn();
529 for (int i = 0; i < dungeon_names.size(); i++) {
530 rom()->resource_label()->SelectableLabelWithNameEdit(
531 selected_dungeon == i, "Dungeon Names", absl::StrFormat("%d", i),
532 dungeon_names[i]);
533 if (ImGui::IsItemClicked()) {
535 }
536 }
537
538 ImGui::TableNextColumn();
540
541 ImGui::TableNextColumn();
543
544 ImGui::TableNextColumn();
545 tilemap_canvas_.DrawBackground();
546 tilemap_canvas_.DrawContextMenu();
547 if (tilemap_canvas_.DrawTileSelector(16.f)) {
548 // Get the tile8 ID to use for the tile16 drawing above
549 selected_tile8_ = tilemap_canvas_.GetTileIdFromMousePos();
550 }
551 tilemap_canvas_.DrawBitmapTable(sheets_);
552 tilemap_canvas_.DrawGrid();
553 tilemap_canvas_.DrawOverlay();
554
555 ImGui::Text("Selected tile8: %d", selected_tile8_);
556 ImGui::Separator();
557 ImGui::Text("For use with custom inserted graphics assembly patches.");
558 if (ImGui::Button("Load GFX from BIN file")) LoadBinaryGfx();
559
560 ImGui::EndTable();
561 }
562}
563
565 std::string bin_file = core::FileDialogWrapper::ShowOpenFileDialog();
566 if (!bin_file.empty()) {
567 std::ifstream file(bin_file, std::ios::binary);
568 if (file.is_open()) {
569 // Read the gfx data into a buffer
570 std::vector<uint8_t> bin_data((std::istreambuf_iterator<char>(file)),
571 std::istreambuf_iterator<char>());
572 auto converted_bin = gfx::SnesTo8bppSheet(bin_data, 4, 4);
573 gfx_bin_data_ = converted_bin;
574 tile16_sheet_.clear();
575 if (LoadDungeonMapTile16(converted_bin, true).ok()) {
576 sheets_.clear();
577 std::vector<std::vector<uint8_t>> gfx_sheets;
578 for (int i = 0; i < 4; i++) {
579 gfx_sheets.emplace_back(converted_bin.begin() + (i * 0x1000),
580 converted_bin.begin() + ((i + 1) * 0x1000));
581 sheets_.emplace(i, gfx::Bitmap(128, 32, 8, gfx_sheets[i]));
582 status_ = sheets_[i].SetPalette(*rom()->mutable_dungeon_palette(3));
583 if (status_.ok()) {
585 }
586 }
587 binary_gfx_loaded_ = true;
588 } else {
589 status_ = absl::InternalError("Failed to load dungeon map tile16");
590 }
591 file.close();
592 }
593 }
594}
595
597 if (ImGui::BeginTabItem("Title Screen")) {
598 ImGui::EndTabItem();
599 }
600}
601
603 if (ImGui::BeginTabItem("Naming Screen")) {
604 ImGui::EndTabItem();
605 }
606}
607
609 if (ImGui::BeginTabItem("Overworld Map")) {
610 ImGui::EndTabItem();
611 }
612}
613
615 static bool show_bg1 = true;
616 static bool show_bg2 = true;
617 static bool show_bg3 = true;
618
619 static bool drawing_bg1 = true;
620 static bool drawing_bg2 = false;
621 static bool drawing_bg3 = false;
622
623 ImGui::Checkbox("Show BG1", &show_bg1);
624 ImGui::SameLine();
625 ImGui::Checkbox("Show BG2", &show_bg2);
626
627 ImGui::Checkbox("Draw BG1", &drawing_bg1);
628 ImGui::SameLine();
629 ImGui::Checkbox("Draw BG2", &drawing_bg2);
630 ImGui::SameLine();
631 ImGui::Checkbox("Draw BG3", &drawing_bg3);
632}
633
634} // namespace editor
635} // namespace yaze
static GraphicsSheetManager & GetInstance()
Definition rom.h:270
auto rom()
Definition rom.h:382
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:67
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
#define RETURN_VOID_IF_ERROR(expression)
Definition macro.h:42
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:153
bool InputTileInfo(const char *label, gfx::TileInfo *tile_info)
Definition input.cc:258
absl::Status DisplayPalette(gfx::SnesPalette &palette, bool loaded)
Definition color.cc:50
bool InputHexByte(const char *label, uint8_t *data, float input_width, bool no_step)
Definition input.cc:167
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:327