Add Changes stack to ROM for saving

This commit is contained in:
Justin Scofield
2023-08-27 10:20:10 -04:00
parent 168030ee31
commit 190917ff6f
4 changed files with 33 additions and 13 deletions

View File

@@ -245,13 +245,15 @@ void OverworldEditor::RenderUpdatedMapBitmap(const ImVec2 &click_position,
void OverworldEditor::QueueROMChanges(int index, ushort new_tile16) {
// Store the changes made by the user to the ROM (or project file)
overworld_.SaveOverworldMaps();
if (!overworld_.CreateTile32Tilemap()) {
// overworld_.SaveMap16Tiles();
overworld_.SaveMap32Tiles();
} else {
std::cout << "Failed to create tile32 tilemap" << std::endl;
}
rom()->QueueChanges([&]() {
overworld_.SaveOverworldMaps();
if (!overworld_.CreateTile32Tilemap()) {
// overworld_.SaveMap16Tiles();
overworld_.SaveMap32Tiles();
} else {
std::cout << "Failed to create tile32 tilemap" << std::endl;
}
});
}
void OverworldEditor::DetermineActiveMap(const ImVec2 &mouse_position) {