update editors based on namespace changes
This commit is contained in:
@@ -118,30 +118,25 @@ absl::Status ScreenEditor::LoadDungeonMaps() {
|
||||
for (int d = 0; d < 14; d++) {
|
||||
current_floor_rooms_d.clear();
|
||||
current_floor_gfx_d.clear();
|
||||
ASSIGN_OR_RETURN(
|
||||
int ptr,
|
||||
rom()->ReadWord(zelda3::screen::kDungeonMapRoomsPtr + (d * 2)));
|
||||
ASSIGN_OR_RETURN(
|
||||
int ptr_gfx,
|
||||
rom()->ReadWord(zelda3::screen::kDungeonMapGfxPtr + (d * 2)));
|
||||
ASSIGN_OR_RETURN(int ptr,
|
||||
rom()->ReadWord(zelda3::kDungeonMapRoomsPtr + (d * 2)));
|
||||
ASSIGN_OR_RETURN(int ptr_gfx,
|
||||
rom()->ReadWord(zelda3::kDungeonMapGfxPtr + (d * 2)));
|
||||
ptr |= 0x0A0000; // Add bank to the short ptr
|
||||
ptr_gfx |= 0x0A0000; // Add bank to the short ptr
|
||||
int pc_ptr = core::SnesToPc(ptr); // Contains data for the next 25 rooms
|
||||
int pc_ptr_gfx =
|
||||
core::SnesToPc(ptr_gfx); // Contains data for the next 25 rooms
|
||||
|
||||
ASSIGN_OR_RETURN(
|
||||
ushort boss_room_d,
|
||||
rom()->ReadWord(zelda3::screen::kDungeonMapBossRooms + (d * 2)));
|
||||
ASSIGN_OR_RETURN(ushort boss_room_d,
|
||||
rom()->ReadWord(zelda3::kDungeonMapBossRooms + (d * 2)));
|
||||
|
||||
ASSIGN_OR_RETURN(
|
||||
nbr_basement_d,
|
||||
rom()->ReadByte(zelda3::screen::kDungeonMapFloors + (d * 2)));
|
||||
ASSIGN_OR_RETURN(nbr_basement_d,
|
||||
rom()->ReadByte(zelda3::kDungeonMapFloors + (d * 2)));
|
||||
nbr_basement_d &= 0x0F;
|
||||
|
||||
ASSIGN_OR_RETURN(
|
||||
nbr_floor_d,
|
||||
rom()->ReadByte(zelda3::screen::kDungeonMapFloors + (d * 2)));
|
||||
ASSIGN_OR_RETURN(nbr_floor_d,
|
||||
rom()->ReadByte(zelda3::kDungeonMapFloors + (d * 2)));
|
||||
nbr_floor_d &= 0xF0;
|
||||
nbr_floor_d = nbr_floor_d >> 4;
|
||||
|
||||
@@ -184,8 +179,8 @@ absl::Status ScreenEditor::LoadDungeonMaps() {
|
||||
|
||||
absl::Status ScreenEditor::SaveDungeonMaps() {
|
||||
for (int d = 0; d < 14; d++) {
|
||||
int ptr = zelda3::screen::kDungeonMapRoomsPtr + (d * 2);
|
||||
int ptr_gfx = zelda3::screen::kDungeonMapGfxPtr + (d * 2);
|
||||
int ptr = zelda3::kDungeonMapRoomsPtr + (d * 2);
|
||||
int ptr_gfx = zelda3::kDungeonMapGfxPtr + (d * 2);
|
||||
int pc_ptr = core::SnesToPc(ptr);
|
||||
int pc_ptr_gfx = core::SnesToPc(ptr_gfx);
|
||||
|
||||
@@ -210,9 +205,9 @@ absl::Status ScreenEditor::LoadDungeonMapTile16(
|
||||
tile16_sheet_.Init(256, 192, gfx::TileType::Tile16);
|
||||
|
||||
for (int i = 0; i < 186; i++) {
|
||||
int addr = zelda3::screen::kDungeonMapTile16;
|
||||
if (rom()->data()[zelda3::screen::kDungeonMapExpCheck] != 0xB9) {
|
||||
addr = zelda3::screen::kDungeonMapTile16Expanded;
|
||||
int addr = zelda3::kDungeonMapTile16;
|
||||
if (rom()->data()[zelda3::kDungeonMapExpCheck] != 0xB9) {
|
||||
addr = zelda3::kDungeonMapTile16Expanded;
|
||||
}
|
||||
|
||||
ASSIGN_OR_RETURN(auto tl, rom()->ReadWord(addr + (i * 8)));
|
||||
@@ -251,9 +246,9 @@ absl::Status ScreenEditor::LoadDungeonMapTile16(
|
||||
|
||||
absl::Status ScreenEditor::SaveDungeonMapTile16() {
|
||||
for (int i = 0; i < 186; i++) {
|
||||
int addr = zelda3::screen::kDungeonMapTile16;
|
||||
if (rom()->data()[zelda3::screen::kDungeonMapExpCheck] != 0xB9) {
|
||||
addr = zelda3::screen::kDungeonMapTile16Expanded;
|
||||
int addr = zelda3::kDungeonMapTile16;
|
||||
if (rom()->data()[zelda3::kDungeonMapExpCheck] != 0xB9) {
|
||||
addr = zelda3::kDungeonMapTile16Expanded;
|
||||
}
|
||||
|
||||
gfx::TileInfo t1 = tile16_sheet_.tile_info()[i].tiles[0];
|
||||
|
||||
@@ -90,7 +90,7 @@ class ScreenEditor : public SharedRom, public Editor {
|
||||
std::vector<gfx::Bitmap> tile8_individual_;
|
||||
std::vector<uint8_t> all_gfx_;
|
||||
std::vector<uint8_t> gfx_bin_data_;
|
||||
std::vector<zelda3::screen::DungeonMap> dungeon_maps_;
|
||||
std::vector<zelda3::DungeonMap> dungeon_maps_;
|
||||
std::vector<std::vector<std::array<std::string, 25>>> dungeon_map_labels_;
|
||||
|
||||
absl::Status status_;
|
||||
@@ -107,7 +107,7 @@ class ScreenEditor : public SharedRom, public Editor {
|
||||
gui::Canvas tilemap_canvas_{"##TilemapCanvas", ImVec2(128 + 2, (192) + 4),
|
||||
gui::CanvasGridSize::k8x8, 2.f};
|
||||
|
||||
zelda3::screen::Inventory inventory_;
|
||||
zelda3::Inventory inventory_;
|
||||
};
|
||||
|
||||
} // namespace editor
|
||||
|
||||
Reference in New Issue
Block a user