Add SaveAllPalettes, SaveWithChangeQueue exp flags

This commit is contained in:
scawful
2023-11-18 20:04:54 -05:00
parent fee9484a5d
commit 82952e2e73
2 changed files with 14 additions and 5 deletions

View File

@@ -25,6 +25,10 @@ class ExperimentFlags {
// handled manually by controller class but should be // handled manually by controller class but should be
// ported away from that eventually. // ported away from that eventually.
bool kUseNewImGuiInput = false; bool kUseNewImGuiInput = false;
bool kSaveAllPalettes = false;
bool kSaveWithChangeQueue = false;
}; };
ExperimentFlags() = default; ExperimentFlags() = default;

View File

@@ -405,12 +405,17 @@ absl::Status ROM::SaveToFile(bool backup, absl::string_view filename) {
} }
// Run the other save functions // Run the other save functions
// SaveAllPalettes(); if (flags()->kSaveAllPalettes) {
SaveAllPalettes();
}
if (flags()->kSaveWithChangeQueue) {
while (!changes_.empty()) { while (!changes_.empty()) {
auto change = changes_.top(); auto change = changes_.top();
change(); change();
changes_.pop(); changes_.pop();
} }
}
// Open the file that we know exists for writing // Open the file that we know exists for writing
std::ofstream file(filename.data(), std::ios::binary); std::ofstream file(filename.data(), std::ios::binary);